diff --git a/src/codegen.cpp b/src/codegen.cpp index 359438894951c..33c30b55b2248 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -3123,8 +3123,11 @@ static Value *emit_expr(jl_value_t *expr, jl_codectx_t *ctx, bool isboxed, jl_errorf("macro definition not allowed inside a local scope"); } else { - jl_errorf("unsupported or misplaced expression \"%s\" in function %s", - head->name, ctx->linfo->name->name); + std::ostringstream err; + err << "unsupported or misplaced expression '" << head->name + << "' in function '" << ctx->linfo->name->name << "'"; + emit_error(err.str(), ctx); + return V_null; } } }