Skip to content

Commit a05558f

Browse files
committed
Fix macro
1 parent 36d762c commit a05558f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/systems/abstractsystem.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,14 @@ function _named(name, call, runtime = false)
847847

848848
is_sys_construction = Symbol("###__is_system_construction###")
849849
kws = call.args[2].args
850-
for kw in kws
851-
kw.args[2] = :($is_sys_construction ? $(kw.args[2]) :
852-
$default_to_parentscope($(kw.args[2])))
850+
for (i, kw) in enumerate(kws)
851+
if Meta.isexpr(kw, (:(=), :kw))
852+
kw.args[2] = :($is_sys_construction ? $(kw.args[2]) :
853+
$default_to_parentscope($(kw.args[2])))
854+
elseif kw isa Symbol
855+
rhs = :($is_sys_construction ? $(kw) : $default_to_parentscope($(kw)))
856+
kws[i] = Expr(:kw, kw, rhs)
857+
end
853858
end
854859

855860
if !any(kw -> (kw isa Symbol ? kw : kw.args[1]) == :name, kws) # don't overwrite `name` kwarg

0 commit comments

Comments
 (0)