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
Tests completionListInTypeParameterOfTypeAlias1 and 2 were failing before
this commit. The completions.ts changes are self-explanatory but the
parser.ts change is that I added semicolon as a terminator for type
parameter lists. The reason is the code in the failing test looks like:
```ts
type List1<
type List2<T> = T[];
type List4<T> = T[];
type List3<T1> = ;
```
When type parameters were not allowed to have their own type parameters
that code parsed as type `List1` with type parameters `type` and
`List2`, with a missing comma between `type` and `List2`, and then the
unexpected `<` from `List2<T>` was parsed as the list terminator for the
assumed `List1` type parameter list.
However now that type parameters are allowed to declare their own type
parameter lists, the `<` from `List2<T>` is no longer unexpected so
`List2<T> = T[]` is parsed as a syntactically correct definition of a
type parameter `List2` that has its own type parameter `T` and a default
of `T[]`. Then it ignored the unexpected semicolon and parsed the third
line in exactly the same way as the second line, as additional type
parameters of `List1`, with `List4<T>` defining its own child type
parameter `T`.
So adding semicolon as a type parameter list terminator stops the
assumed `List1` type parameter list at the end of line 2.
0 commit comments