tests: pin inline-lambda type-variable params across engines#326
Merged
Conversation
Nlp-engineer rerun6 reported `rsrt (r:L a>n;at r 0) rows` failed with cascading ILO-T002 / ILO-P001 against v0.11.5 — the lifter looked like it was treating type-var `a` as a top-level fn name. Cannot reproduce on f6b3271: every variant of the reported shape now parses, verifies, and runs identically on tree, VM, and Cranelift. Most likely the bug was closed in passing by one of the v0.11.4 to v0.11.5 parser/lambda fixes (hof-error-parity, bare-bang-nil, listlit-fnref-greedy). Pins 12 cross-engine cases of the shape so it can't regress silently: identity `(x:a>a;x)`, polymorphic param with concrete return, the exact `(r:L a>n;at r 0)` from the report, two same-named-type-var lambdas in one fn, lifted from a non-main top-level fn, other single-letter names (z, k), reserved-letter `n` to confirm the type-var fast-path doesn't over-trigger, fld accumulator with type-var, nested `L (L a)`. Adds examples/inline-lambda-typevar.ilo so the examples harness exercises the shape on every engine and gives agents an in-context learning sample.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
danieljohnmorris
added a commit
that referenced
this pull request
May 17, 2026
fifteen fixes since 0.11.5, all from rerun5/rerun6 personas plus standing asks: ListView foundation (#334), window-text-perf reshape via ListView (#336), inner-flt predicate inlining (#340), double-minus trap ILO-P021 (#331), bare-ident bang silent-nil regression (#324), Cranelift JIT span plumbing (#335), bool-prefix ternary (#330), wh prefix-cond reparse (#332), --run-engine auto-pick main (#329), subcommand helper hyphens+non-ident (#328), runtime error spans (#335), persona-diagnostic batch 3 (#327), rgxall1+ct (#333), single-line body diagnostic (#322 carry), lambda type-var defensive test (#326), N-deep prefix arity error (#339), prefix-minus span column drift (#338), doc-sync (#337).
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nlp-engineer rerun6 reported
rsrt (r:L a>n;at r 0) rowsfailed with cascadingILO-T002 duplicate function definition 'a'andILO-P001 expected declaration, got RParenagainst v0.11.5, inferring the lambda-lifter was treating type-varaas a top-level fn name.I couldn't reproduce against f6b3271. Every variant of the reported shape now parses, verifies, and runs identically across tree, VM, and Cranelift.
src/verify.rs:170-182already treats unaliased single lowercase letters (other thann/t/b) as type variables that lower toTy::Unknown, and the lifter insrc/parser/mod.rsalways names synthetic decls__lit_N. Most likely the bug was closed in passing by one of the v0.11.4 to v0.11.5 parser/lambda fixes (#321 hof-error-parity, #324 bare-bang-nil, listlit-fnref-greedy, etc.).Rather than just close the entry, this is a defensive regression-test-only PR pinning every variant of the reported shape so it can't regress silently in the future.
Repro (current state — no error)
Runs clean on tree, VM, and Cranelift. Same for every variant the persona could plausibly have meant.
What's in the diff
tests/regression_inline_lambda_typevar.rs(12 cross-engine cases):(x:a>a;x)over map(x:a>n;0)over srt(r:L a>n;at r 0)over rsrt and srta)(r:L a>n; ...)lambdas threaded through rsrtmaintop-level fnz,k) to pin the spec rule, not a hard-codedanstill parses as the concrete number type (the type-var fast-path doesn't over-trigger)(acc:a x:a>n;...))L (L a)so the type walker handles depthexamples/inline-lambda-typevar.iloso the examples harness exercises the shape on every engine and agents get an in-context working sample.Test plan
cargo test --release --features cranelift --test regression_inline_lambda_typevar— 12/12 passcargo test --release --features cranelift --test examples_engines— passescargo test --release --features cranelift(full suite) — all greencargo fmt --check— cleancargo clippy --release --features cranelift --tests -- -D warnings— cleanFollow-ups
None. The originating entry in
ilo_assessment_feedback.mdwill be moved to the Addressed section with a link to this PR.