tests: #806 — systematic harness for class-extends-factory / mixin patterns#822
Open
proggeramlug wants to merge 2 commits into
Open
tests: #806 — systematic harness for class-extends-factory / mixin patterns#822proggeramlug wants to merge 2 commits into
proggeramlug wants to merge 2 commits into
Conversation
…tterns
`class X extends Fn(...)<...>` had zero systematic coverage. This harness
covers eight independent sub-cases, each printing a stable `section:
result` line so parity diffs pin exactly which sub-case regressed:
1. Bare factory — `class X extends makeBare()`.
2. Parameterized factory — `class X extends tagged("name", schema)`.
3. Captured-factory generic — `class X extends makeNamed<T>("...")`.
4. Chained mixins — `class X extends WithA(WithB(WithC(Base)))`.
5. Mixin with super-arg forwarding.
6. Factory with static method.
7. Effect-shape double-call — `class X extends TaggedError<X>()("tag", schema)`.
8. Parameterized mixin factory — `ParamMixin<T>(seed)(Base)`.
Verified against `node --experimental-strip-types` on macOS; baseline
prints 22 stable lines. Perry currently passes sub-cases 2, 3, and the
captured Effect shape (post-#740) but surfaces two real gaps:
- **Bare factory** — `bare.kind: undefined` instead of `bare.kind: bare`.
The base class's field initializer is dropped when the parent is a
factory-returned class expression.
- **Chained mixins** — `TypeError: value is not a function` thrown
before construction; the layered `WithA(WithB(WithC(...)))` shape
doesn't resolve through the mixin chain.
Both are linked to the #321 Effect umbrella and added to
`known_failures.json` so this PR doesn't break the parity gate. Each
sub-case flips to PASS independently as the underlying lowering work
lands.
This was referenced May 16, 2026
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
New
test-files/test_harness_class_mixins.tscovers eight independent sub-cases ofclass X extends Fn(...)<...>, each emitting a stablesection: resultline so parity diffs pin exactly which sub-case regressed:class X extends makeBare()class X extends tagged(\"name\", schema)class X extends makeNamed<T>(\"...\")class X extends WithA(WithB(WithC(Base)))class X extends TaggedError<X>()(\"tag\", schema)What the harness surfaces today
Verified against
node --experimental-strip-typeson macOS (baseline prints 22 stable lines). Perry passes the parameterized-factory, captured-factory generic, and Effect double-call (post-#740) sub-cases — but the harness exposes two real gaps:bare.kind: undefinedvs Node'sbare.kind: bare. Base class's field initializer dropped when the parent is a factory-returned class expression.TypeError: value is not a functionat construction; the layeredWithA(WithB(WithC(Base)))shape doesn't resolve.Both are linked to the #321 Effect umbrella. The harness is added to
known_failures.jsonso this PR doesn't trip the parity gate; each sub-case flips to PASS independently as the underlying work lands.Test plan
node --experimental-strip-types test-files/test_harness_class_mixins.tsprints 22 lines, all sub-cases../target/release/perry test-files/test_harness_class_mixins.ts -o /tmp/harness && /tmp/harnessexits non-zero on the chained-mixin TypeError — diff vs Node pins the two gap locations cleanly.known_failures.jsonentry references tests: harness for dynamic class extension / mixins #806 + Tracking: Effect framework end-to-end compat (post-#309 / #310) #321 so the parity gate stays green.Closes #806.