Skip to content

Commit

Permalink
allow strings in args
Browse files Browse the repository at this point in the history
  • Loading branch information
ba2tro committed Nov 28, 2023
1 parent 7085f72 commit 0ba2120
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/QSymbolicsBase/QSymbolicsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function withmetadata(strct) # TODO this should really use MacroTools instead of
end
end
struct_args = strct.args[end].args
if all(x->x isa Symbol || x isa LineNumberNode || x.head==:(::), struct_args)
if all(x->x isa Symbol || x isa LineNumberNode || x isa String || x.head==:(::), struct_args)
# add constructor
args = [x for x in struct_args if x isa Symbol || x isa Expr] # the arguments required for the constructor
args = [a isa Symbol ? a : (a.head==:(::) ? a.args[1] : a) for a in args] # drop typeasserts
Expand Down

0 comments on commit 0ba2120

Please sign in to comment.