Commit 92ba668
Fix evalLowLevelLambda to handle non-closure layouts from polymorphic contexts
When evaluating a low-level lambda (like List.append) in a polymorphic context
where the type is constrained but not yet fully resolved, getRuntimeLayout
could return a non-closure layout (like Dec for an unresolved flex var).
This caused the closure header to be written to memory allocated with the
wrong layout, leading to type confusion when the value was later used.
The fix applies the same guard that evalLambda already has: check if the
layout is not a closure and create an empty captures closure layout if needed.
Fixes #9054
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 37054ba commit 92ba668
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13676 | 13676 | | |
13677 | 13677 | | |
13678 | 13678 | | |
13679 | | - | |
| 13679 | + | |
| 13680 | + | |
| 13681 | + | |
| 13682 | + | |
| 13683 | + | |
| 13684 | + | |
| 13685 | + | |
| 13686 | + | |
13680 | 13687 | | |
13681 | 13688 | | |
13682 | 13689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments