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
{{ message }}
Repository navigation
Parsing issue for call expression with type arguments following left-shift #37760
Actual behavior: Syntax highlighting breaks, even with ts-ignore.
Code
functionalignof<T>(): number{return1;}// worksfunctionfoo<T>(): number{return1>>alignof<T[]>();}// breaksfunctionbar<T>(): number{return1<<alignof<T[]>();}// still breaks, does not ignorefunctionbaz<T>(): number{// @ts-ignorereturn1<<alignof<T[]>();}
Looks like a rescan issue on potentially ambiguous < tokens, attempting to interpret as 1 < <type>.
changed the title [-]Syntax highlighting issue on less-than token[/-][+]Parsing issue for call expression with type arguments following left-shift[/+]on Apr 2, 2020
Activity
[-]Syntax highlighting issue on less-than token[/-][+]Parsing issue for call expression with type arguments following left-shift[/+]RyanCavanaugh commentedon Apr 3, 2020
At an asbolute bare minimum, parenthesizing the right operand ought to work around the problem.
FYI
ts-ignoreisn't capable of causing syntax errors to not happen