Skip to content

Commit

Permalink
Fix multiple types handling with same variants in :on_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Jun 22, 2024
1 parent c6dcde5 commit e2e0f52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SumStructsOnFields.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


struct Uninitialized end
const uninit = Uninitialized()

Expand Down Expand Up @@ -83,7 +82,8 @@ function _compact_structs(new_type, struct_defs, vtc, vtwpc)
field_type = is_mutable ? Expr(:const, :($(gensym_type)::Symbol)) : (:($(gensym_type)::Symbol))

types_each_vis = types_each
types_each = [t isa Symbol ? Symbol("##", t, "##") : :($(Symbol("##", t.args[1], "##")){$(t.args[2:end]...)})
types_each = [t isa Symbol ? Symbol("###", namify(new_type), "###", t) :
:($(Symbol("###", namify(new_type), "###", t.args[1])){$(t.args[2:end]...)})
for t in types_each]

expr_comp_types = [Expr(:struct, false, t, :(begin sdfnsdfsdfak() = 1 end)) for t in types_each]
Expand Down

0 comments on commit e2e0f52

Please sign in to comment.