Skip to content

Commit

Permalink
Fix constrained parametrization for sum_structs macro (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Feb 10, 2024
1 parent 65a7f67 commit 603cafd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "MixedStructTypes"
uuid = "3d69f371-6fa5-5add-b11c-3293622cad62"
version = "0.2.4"
version = "0.2.5"

[deps]
ExprTools = "e2ba6199-217a-4e67-a87a-7c52f15ade04"
Expand Down
3 changes: 2 additions & 1 deletion src/SumStructs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ macro sum_structs(type, struct_defs)
a_spec_n_d = [d != "#328723329" ? Expr(:kw, n, d) : (:($n))
for (n, d) in zip(f_params_args, fd)]
f_params_kwargs = Expr(:parameters, a_spec_n_d...)
@capture(type, new_type_n_{new_type_p__})
new_typ = type isa Expr && type.head == :(<:) ? type.args[1] : type
@capture(new_typ, new_type_n_{new_type_p__})
if new_type_p === nothing
new_type_n, new_type_p = type, []
end
Expand Down

0 comments on commit 603cafd

Please sign in to comment.