From e2e0f521a5681ad06a6b145cc36d25b870119c56 Mon Sep 17 00:00:00 2001 From: Tortar <68152031+Tortar@users.noreply.github.com> Date: Sat, 22 Jun 2024 23:10:57 +0200 Subject: [PATCH] Fix multiple types handling with same variants in :on_fields --- src/SumStructsOnFields.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SumStructsOnFields.jl b/src/SumStructsOnFields.jl index b4edd58..2d80488 100644 --- a/src/SumStructsOnFields.jl +++ b/src/SumStructsOnFields.jl @@ -1,5 +1,4 @@ - struct Uninitialized end const uninit = Uninitialized() @@ -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]