Skip to content

Commit

Permalink
Improve hygiene of sum_type macro (#79)
Browse files Browse the repository at this point in the history
* Improve hygiene of sum_type macro

* Update sum_type.jl

* Update sum_type.jl

* Update src/sum_type.jl

---------

Co-authored-by: Mason Protter <[email protected]>
  • Loading branch information
Tortar and MasonProtter committed May 21, 2024
1 parent 002b241 commit ffd1a54
Showing 1 changed file with 1 addition and 1 deletion.
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{$Uninit, $(T_p_args[2])})
end

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

0 comments on commit ffd1a54

Please sign in to comment.