Repository navigation
typescript: a structural pair needs matching arity and a class that can reach the interface - #1796
Merged
swapnilpaliwal-sd merged 3 commits intoSep 30, 2026
Conversation
…an reach the interface A class was counted as implementing an interface whenever it declared a member of each required name. Now a covered method that needs more arguments than the target passes rejects the pair, and outside one tsconfig program the class's module (or a module that uses the class as a value) must import the interface's module. impact never promotes a structural pair to 'must change', and a via-the-interface row reached only structurally is at most one of a set. Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
…e member The compiler rejects assigning a class whose only member of a required name is private, protected or #private, so the structural rule no longer counts such a class as a conformer. The structural-satisfaction case gains a same-arity class with a private method, built in the interface's module, that must not become a dispatch candidate. Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
… lets its class meet it The reachability gate walks imports from the class's modules to the interface's module. A workspace package whose manifest points at absent build output, or a compiled .d.ts, binds no client module, so the walk stopped there and dropped true conformers (a class declaring implements through such a package, or one built by a factory module that imports the interface that way). An import in a reached module that names the interface now counts as the meeting. Control Declared in 03-structural-satisfaction: without the rule it loses Relay.run -> Declared.publish; Stranger and Bus stay absent. Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
September 29, 2026 23:28
swapnilpaliwal-sd
deleted the
apps/typescript/structural-satisfaction-by-name-only
branch
September 30, 2026 02:00
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.
TypeScript structural satisfaction paired a class with an interface whenever it had a member of each required name. Pairs across unrelated services became dispatch edges, came back as "verified" one-hop paths, and
impactreported them as "must change - it implements this"..d.ts), an import that names the interface counts as reaching it.03-structural-satisfactiongains Bus (arity), Stranger (unreachable), a private-member case and Declared (opaque import). Controls keep their edges: Duck assigned to aPubslot, the nominalReal, and Declared. Each rule was checked by disabling it, which makes the case fail.