Skip to content

Commit ca10039

Browse files
oxinaboxStefanKarpinski
authored andcommitted
Changed @generated body purity error (#32627)
* Changed @generated body purity error * change error message in tests for nonpure generated function
1 parent 140b70c commit ca10039

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/method.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ JL_DLLEXPORT jl_code_info_t *jl_code_for_staged(jl_method_instance_t *linfo)
413413
ptls->in_pure_callback = 0;
414414
jl_toplevel_eval(def->module, (jl_value_t*)func);
415415
}
416-
jl_error("generated function body is not pure. this likely means it contains a closure or comprehension.");
416+
jl_error("The function body AST defined by this @generated function is not pure. This likely means it contains a closure or comprehension.");
417417
}
418418

419419
jl_array_t *stmts = (jl_array_t*)func->code;

test/core.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4942,7 +4942,7 @@ gVararg(a::fVararg(Int)) = length(a)
49424942
false
49434943
catch e
49444944
(e::ErrorException).msg
4945-
end == "generated function body is not pure. this likely means it contains a closure or comprehension."
4945+
end == "The function body AST defined by this @generated function is not pure. This likely means it contains a closure or comprehension."
49464946

49474947
let x = 1
49484948
global g18444

0 commit comments

Comments
 (0)