previously, `builtins.break` didn't force its argument, resulting in a value wrapped with `break` being opaque to most builtins if not also wrapped with `seq`. see [lix-project/lix#1165] for more details on what this can break. this tiny fix just adds a call to `forceValue` inside `prim_break`, but unfortunately this "breaks" a few existing tests because it changes the call stack; those tests' golden outputs have been adjusted without modifying their intended purpose. Fixes #1165 [lix-project/lix#1165]: https://git.lix.systems/lix-project/lix/issues/1165 Change-Id: I5fe4ee3ff28b38aaf924125b8978130812e58fef
15 lines
531 B
Markdown
15 lines
531 B
Markdown
---
|
|
synopsis: "builtins.break doesn't break expression anymore"
|
|
issues: [1165]
|
|
cls: [5422]
|
|
category: "Fixes"
|
|
credits: [blokyk]
|
|
---
|
|
|
|
Wrapping an expression in `builtins.break` used to break some builtins like
|
|
`map` and the `is*` functions, which could modify the execution path of code
|
|
inadvertently, made debugging nix harder than it already is, and in some cases
|
|
even crashed the interpreter. Now, using `break` should be completely
|
|
transparent to whatever function receives it as an input, preventing the
|
|
above-mentioned issues.
|