diff -r 37085099e415 -r bd5f6cee8001 src/Pure/ML/ml_context.ML --- a/src/Pure/ML/ml_context.ML Thu May 11 14:17:24 2023 +0200 +++ b/src/Pure/ML/ml_context.ML Thu May 11 21:32:22 2023 +0200 @@ -228,7 +228,9 @@ SOME context' => context' | NONE => error "Missing context after execution"); -fun expression pos ants = exec (fn () => eval ML_Compiler.flags pos ants); +fun expression pos ants = + Local_Theory.touch_ml_env #> + exec (fn () => eval ML_Compiler.flags pos ants); end;