diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc index e2f3b8544..2e365f2b7 100644 --- a/lix/libexpr/eval.cc +++ b/lix/libexpr/eval.cc @@ -629,7 +629,7 @@ void printStaticEnvBindings(const SymbolTable & st, const StaticEnv & se) // just for the current level of Env, not the whole chain. void printWithBindings(const SymbolTable & st, const Env & env) { - if (!env.values[0]->isThunk()) { + if (env.values[0]->type() == nAttrs) { std::set bindings; for (const auto & attr : *env.values[0]->attrs) bindings.emplace(st[attr.name]); @@ -686,7 +686,7 @@ void mapStaticEnvBindings(const SymbolTable & st, const StaticEnv & se, const En if (env.up && se.up) { mapStaticEnvBindings(st, *se.up, *env.up, vm); - if (se.isWith && !env.values[0]->isThunk()) { + if (se.isWith && env.values[0]->type() == nAttrs) { // add 'with' bindings. Bindings::iterator j = env.values[0]->attrs->begin(); while (j != env.values[0]->attrs->end()) { diff --git a/tests/functional/repl_characterization/data/regression_l592.nix b/tests/functional/repl_characterization/data/regression_l592.nix new file mode 100644 index 000000000..0962725b8 --- /dev/null +++ b/tests/functional/repl_characterization/data/regression_l592.nix @@ -0,0 +1 @@ +let x = 4; in __seq x (with x; (x: builtins.break x) 1) diff --git a/tests/functional/repl_characterization/data/regression_l592.test b/tests/functional/repl_characterization/data/regression_l592.test new file mode 100644 index 000000000..b0ba331ae --- /dev/null +++ b/tests/functional/repl_characterization/data/regression_l592.test @@ -0,0 +1,21 @@ +@args --debugger + + breakpoint reached + + nix-repl> :quit + error: + … while evaluating the file '$TEST_DATA/regression_l592.nix': + + … while calling the 'seq' builtin + at $TEST_DATA/regression_l592.nix:1:15: + 1| let x = 4; in __seq x (with x; (x: builtins.break x) 1) + | ^ + 2| + + … while calling the 'break' builtin + at $TEST_DATA/regression_l592.nix:1:36: + 1| let x = 4; in __seq x (with x; (x: builtins.break x) 1) + | ^ + 2| + + error: breakpoint reached diff --git a/tests/functional/repl_characterization/repl_characterization.cc b/tests/functional/repl_characterization/repl_characterization.cc index eccaeaf8e..8fde93c4a 100644 --- a/tests/functional/repl_characterization/repl_characterization.cc +++ b/tests/functional/repl_characterization/repl_characterization.cc @@ -177,6 +177,7 @@ REPL_TEST(no_nested_debuggers); REPL_TEST(regression_9917); REPL_TEST(regression_9918); REPL_TEST(regression_l145); +REPL_TEST(regression_l592); REPL_TEST(repl_overlays); REPL_TEST(repl_overlays_compose); REPL_TEST(repl_overlays_destructure_without_dotdotdot_errors);