Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve hygiene of sum_type macro #79

Merged
merged 4 commits into from
May 21, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sum_type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function _sum_type(T, hidden, blk)
i = findfirst(x -> x == p, T_params)
T_params_constrained[i] isa Symbol && continue
T_p_args = T_params_constrained[i].args
T_p_args[2] = :(Union{Uninit, $(T_p_args[2])})
T_p_args[2] = :(Union{$(SumTypes.Uninit), $(T_p_args[2])})
MasonProtter marked this conversation as resolved.
Show resolved Hide resolved
end

if !allunique(map(x -> x.name, constructors))
Expand Down
Loading