diff --git a/base/interactiveutil.jl b/base/interactiveutil.jl index 8a9ec7f13e0be..bee7db3be6ebf 100644 --- a/base/interactiveutil.jl +++ b/base/interactiveutil.jl @@ -243,6 +243,7 @@ function gen_call_with_extracted_types(fcn, ex0) return Expr(:call, fcn, esc(args[1]), Expr(:call, typesof, map(esc, args[2:end])...)) end + exret = Expr(:none) ex = expand(ex0) if !isa(ex, Expr) exret = Expr(:call, :error, "expression is not a function call or symbol") @@ -266,7 +267,8 @@ function gen_call_with_extracted_types(fcn, ex0) Expr(:call, typesof, map(esc, a1.args[2:end])...)) end end - elseif ex.head == :thunk + end + if ex.head == :thunk || exret.head == :none exret = Expr(:call, :error, "expression is not a function call, " * "or is too complex for @$fcn to analyze; " * "break it down to simpler parts if possible")