Commit e632ff8
committed
Reject property access on a bare instantiation expression (TS1477)
`Foo<T>.Bar()` — a bare type-argument instantiation followed by property access —
is a TS error (TS1477), but our access LEDs chained `.Bar` straight onto the
instantiation. Same family as the prior 'postfix closes the access tail' fix.
Grammar: split Expr's instantiation LED into a call/tag arm (an ordinary access
tail — `f<T>().x` still chains) and a separate bare-instantiation arm ending in
the negative lookahead `not(Expr)`.
Engine (still language-agnostic): a LED whose last item is a zero-width negative
lookahead is a 'tail-closing' LED — once it binds, it sets tailClosed, so the
access-tail LEDs (`.`/`?.`/`[`/call/`<T>`/tagged-template) can't chain off it.
Keyed purely on the structural shape '`led` ends in a not assertion', no TS
knowledge; there is exactly one such LED in the grammar.
Verified: rejects `Foo<T>.Bar()`/`Foo<T>.Bar<T>()`; still parses `Foo<T>()`,
`Foo.Bar<T>()`, `Foo<T>`x`` (tagged), `Foo<T>().x`, `Foo<T> as Bar`, `Foo<T>[0]`.
FP 95->93, FN stays 0 (3376/3376), TP unchanged. agnostic 5/5, refactor-guard
112/112, highlighter 99.3% unchanged, smoke pass. Artifacts regenerated.1 parent 2fe4d54 commit e632ff8
4 files changed
Lines changed: 29 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
| |||
249 | 258 | | |
250 | 259 | | |
251 | 260 | | |
| 261 | + | |
252 | 262 | | |
253 | 263 | | |
254 | 264 | | |
| |||
673 | 683 | | |
674 | 684 | | |
675 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
676 | 689 | | |
677 | 690 | | |
678 | 691 | | |
| |||
0 commit comments