Skip to content

allow output type assertion - #31

Merged
ameligrana merged 4 commits into
ameligrana:mainfrom
matthijscox:assert-output-type
Mar 23, 2026
Merged

ameligrana merged 4 commits into
ameligrana:mainfrom
matthijscox:assert-output-type

Conversation

@matthijscox

Copy link
Copy Markdown
Contributor

This solves my issue: #30

The macro now takes the output type assertion into consideration, which is basically all I needed:

julia> @macroexpand f(x::X) = @unionsplit f(x)
:(f(x::X) = begin
          (WrappedUnions).unionsplit(f, (x,), (;))
      end)

julia> @macroexpand f(x::X) = @unionsplit f(x)::Real
:(f(x::X) = begin
          (WrappedUnions).unionsplit(f, (x,), (;))::Real
      end)

@ameligrana

ameligrana commented Mar 23, 2026 •

Copy link
Copy Markdown
Owner

Hi @matthijscox, thanks for the contribution, seems totally reasonable, I like also the way this feature is introduced, so, I will merge (and release a new version) as soon as you can fix the 1.10 failure!

Added a new wrapped struct 'In' for union types and updated test sets.
@ameligrana

Copy link
Copy Markdown
Owner

Actually fixed it myself!

@ameligrana
ameligrana merged commit cb57667 into ameligrana:main Mar 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants