Skip to content

Commit f1c9145

Browse files
committed
fixup! Add support for default values to TYPEDSIGNATURES
1 parent 7fed390 commit f1c9145

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/parsing.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ function parse_arg_with_type(arg_expr::Expr)
1919
elseif n_expr_args == 2
2020
# 'x::Int'
2121
ASTArg(; name=arg_expr.args[1], type=arg_expr.args[2])
22+
else
23+
Meta.dump(arg_expr)
24+
error("Couldn't parse typed argument (printed above)")
2225
end
2326
end
2427

@@ -85,7 +88,7 @@ function find_call_expr(obj)
8588
if Meta.isexpr(obj, :call)
8689
# Base case: we've found the :call expression
8790
return obj
88-
elseif obj isa Symbol || (obj isa Expr && isempty(obj.args))
91+
elseif !(obj isa Expr) || isempty(obj.args)
8992
# Base case: this is the end of a branch in the expression tree
9093
return nothing
9194
end

0 commit comments

Comments
 (0)