Skip to content

Commit 6219abb

Browse files
committed
Fix bug
1 parent f728352 commit 6219abb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/finitestatemachines/macro.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ macro stateful(expr::Expr)
3737
$((:($arg) for arg in new_expr.args)...)
3838
end
3939
)
40-
expr.args[1].head == Symbol("::") && func_expr.args[1] = Expr(Symbol("::"), func_expr.args[1], expr.args[1].args[2])
40+
if expr.args[1].head == Symbol("::")
41+
func_expr.args[1] = Expr(Symbol("::"), func_expr.args[1], expr.args[1].args[2])
42+
end
4143
call_expr = deepcopy(expr)
42-
call_expr.args[1].head == Symbol("::") && call_expr.args[1] = call_expr.args[1].args[1]
44+
if call_expr.args[1].head == Symbol("::")
45+
call_expr.args[1] = call_expr.args[1].args[1]
46+
end
4347
call_expr.head = Symbol("=")
4448
call_expr.args[2] = :($type_name($((:($arg) for arg in args)...)))
4549
esc(quote

0 commit comments

Comments
 (0)