* show test summary without --verbose flag (#8554)
* remove outdated comments
* shorten passed msg
---------
Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
The eval snapshot test is faster and more appropriate since the bug
is in the canonicalization phase. The test verifies both that the
code canonicalizes correctly (no incorrect captures) and that it
evaluates correctly at runtime.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The fix correctly identifies that variables bound inside nominal
patterns (like `s` in `Container.Box(s)`) are bound in the pattern
scope and don't need to be captured. This results in cleaner
canonical IR where functions that use nominal pattern matching
are now represented as pure lambdas instead of closures with
unnecessary captures.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
collectBoundVarsToScratch was not recursing into the backing pattern
for nominal and nominal_external patterns. This caused variables
bound in nominal patterns (e.g., Wrapper.Simple(s)) to not be tracked
as bound variables, leading to them incorrectly being included in the
free variables of match expression bodies.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Grow arrays exponentially
This leads to a speedup for AoC code from ~19s to ~300ms
* Grow ArrayListMap the same was as std.ArrayList
* Let ArrayList do the growing for var_to_layout_slot
---------
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
The layout computation's addTypeVar function was clearing work fields
(pending_record_fields, pending_tuple_fields, pending_tags, etc.) at
the start of every call via clearRetainingCapacity(). This caused
corruption when processing nested types that trigger recursive calls.
Example problem case:
{ tag: Str, attrs: List([StringAttr(Str, Str), BoolAttr(Str, Bool)]) }
When processing this record:
1. Record handling pushes fields to pending_record_fields
2. Processing the List element triggers tag union handling
3. Tag union handling makes recursive addTypeVar calls for variant payloads
4. These recursive calls cleared pending_record_fields
5. When returning to finalize the outer record, pop() found empty stack
The fix removes clearRetainingCapacity entirely. All work fields now
persist across recursive calls and are cleaned up individually:
- pending_containers: pop() when container layout is finalized
- in_progress_vars: swapRemove() when type is cached
- pending_record_fields: pop() when field is resolved
- pending_tags: shrinkRetainingCapacity() via defer
This fixes the unreachable panic in roc-dom when rendering elements
with complex nested types like List([String(Str,Str), Bool(Str,Bool)]).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two related issues were preventing methods with nominal patterns like
`|Widget.Content(s)|` from working:
1. In the canonicalizer, `collectBoundVarsToScratch` wasn't recursing
into `.nominal` and `.nominal_external` patterns, causing variables
bound inside them (like `s`) to be incorrectly treated as captures
instead of pattern-bound variables.
2. In the interpreter, no-args method dispatch was directly appending
bindings without using `patternMatchesBind`, which meant nested
patterns weren't properly bound. The body's `e_lookup_local` would
look for a `p-assign` pattern_idx but only find the outer `p-nominal`.
The fix makes both cases properly recurse into nominal patterns to find
and bind all nested pattern variables.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>