You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[finding] symbol-anchors cannot resolve an override member — a true symbol anchor to one is reported unresolved-symbol, and the remedy is a weaker anchor #16821
Filed unassigned and unlabelled, as an observation for triage, by the #16711 implementer. Grade deliberately not asserted.
Found while writing #16711's gate header: scripts/check-scripts-symbol-anchors.mjs refused the anchor packages/drivers/driver-turso/src/turso-driver.ts#initObjects, which names a real, live declaration in that file.
Measured, with a firing control
scripts/symbol-anchors.mjs#symbolResolutionClass is the shared resolver every anchor corpus registers against. Driven directly on synthetic sources, 56faa7b9c4:
declaration plain method — initObjects(o) {}
declaration async method — async initObjects(o) {}
declaration protected async — protected async initObjects(o) {}
declaration public async — public async initObjects(o) {}
declaration private plain — private initObjects(o) {}
UNRESOLVED override async — override async initObjects(o) {}
UNRESOLVED override plain — override initObjects(o) {}
UNRESOLVED protected override async
UNRESOLVED CONTROL: a name that is NOT there
The last row is the negative control and the five declaration rows are the positive ones, so the four UNRESOLVED readings are a real refusal and not a silent instrument. ⇒ the matcher accepts async, public, protected and private before a method name and does not accept override.
Why this is worth a card rather than a shrug
It fails loudly, which is the good half — nothing goes silently green. The cost is in what an author does next.
Every override member in the tree is unreachable by a symbol anchor. The remedy the gate's own failure text offers is "name the real symbol, or drop to a file-level anchor" — and the real symbol IS named, so the only route left is a weaker anchor.
The consequence is quiet even though the failure is loud: check-scripts-symbol-anchors currently reports 34 symbol (34 declaration, 0 literal) anchors, and that census cannot contain an override member. A reader takes the number as coverage.
Shape of a fix, not asserted as the decision
Adding override to the modifier set the matcher already accepts looks like a one-token change, but it belongs to whoever owns that resolver: the same matcher serves docs/adr/** and scripts/** corpora, so a widened accept set moves both censuses at once, and the maintainer ruling behind the shared resolver is explicit that a corpus joins by registration and there is to be no second implementation. Whether the accept set should instead be derived rather than enumerated is the question this card cannot answer for the owner.
⛔ Not folded into #16711's PR — that card is fenced to the driver packages plus its own new gate script, and #16711's PR works around this by anchoring the class instead. ⛔ Also unrelated to #16713, which is a different regex in a different script.
Repro, no build needed:
node -e "const m = await import('./scripts/symbol-anchors.mjs');
console.log(m.symbolResolutionClass('class A {\n override async f(o) {}\n}', 'x.ts', 'f'));
console.log(m.symbolResolutionClass('class A {\n async f(o) {}\n}', 'x.ts', 'f'));"
Filed unassigned and unlabelled, as an observation for triage, by the #16711 implementer. Grade deliberately not asserted.
Found while writing #16711's gate header:
scripts/check-scripts-symbol-anchors.mjsrefused the anchorpackages/drivers/driver-turso/src/turso-driver.ts#initObjects, which names a real, live declaration in that file.Measured, with a firing control
scripts/symbol-anchors.mjs#symbolResolutionClassis the shared resolver every anchor corpus registers against. Driven directly on synthetic sources,56faa7b9c4:The last row is the negative control and the five
declarationrows are the positive ones, so the four UNRESOLVED readings are a real refusal and not a silent instrument. ⇒ the matcher acceptsasync,public,protectedandprivatebefore a method name and does not acceptoverride.Why this is worth a card rather than a shrug
It fails loudly, which is the good half — nothing goes silently green. The cost is in what an author does next.
overridemember in the tree is unreachable by a symbol anchor. The remedy the gate's own failure text offers is "name the real symbol, or drop to a file-level anchor" — and the real symbol IS named, so the only route left is a weaker anchor.SqlDriverreads keys off caller objects through(obj as any)at 7 sites while 3 parameter types declare none of them — a class, not a third coincidence (after #4311tenancy, #16570indexes) #16711's gate header ended up doing: it now anchors#TursoDriver, the class, because#initObjects, the member the header is actually about, cannot resolve.overridemembers are where a subclass restates a base's contract, which is where a citation most needs to be checkable — and [finding]SqlDriverreads keys off caller objects through(obj as any)at 7 sites while 3 parameter types declare none of them — a class, not a third coincidence (after #4311tenancy, #16570indexes) #16711 exists precisely because aTursoDriveroverride shadowed a base declaration for five weeks with nobody reading it.check-scripts-symbol-anchorscurrently reports34 symbol (34 declaration, 0 literal)anchors, and that census cannot contain anoverridemember. A reader takes the number as coverage.Shape of a fix, not asserted as the decision
Adding
overrideto the modifier set the matcher already accepts looks like a one-token change, but it belongs to whoever owns that resolver: the same matcher servesdocs/adr/**andscripts/**corpora, so a widened accept set moves both censuses at once, and the maintainer ruling behind the shared resolver is explicit that a corpus joins by registration and there is to be no second implementation. Whether the accept set should instead be derived rather than enumerated is the question this card cannot answer for the owner.⛔ Not folded into #16711's PR — that card is fenced to the driver packages plus its own new gate script, and #16711's PR works around this by anchoring the class instead. ⛔ Also unrelated to #16713, which is a different regex in a different script.
Repro, no build needed: