Closed guillaumebrunerie closed 11 months ago
This pull request fixes five instances of valid code not being parsed correctly (mostly due to new or somewhat advanced features):
unique symbol
const sym: unique symbol = Symbol();
as const
const
const str = "foobar" as const;
asserts
declare const f: (x: any) => asserts x;
const f = <const T extends string>(x: T) => x;
extends
infer
type StringAsNumber<T> = T extends `${infer N extends number}` ? N : never;
Checklist:
Thanks for your work!
This pull request fixes five instances of valid code not being parsed correctly (mostly due to new or somewhat advanced features):
unique symbol
type (see here):as const
(it is currently being parsed as ifconst
were a type, but it is a keyword):asserts
in type declarations (see also longer description at #250):const
type parameters (see here):extends
clauses ininfer
(see here):Checklist: