Parenthesized extends expression seems to confuse the parser
Closed this issue · 3 comments
bmeurer commented
bmeurer commented
This is parsing with {typescript:true}
.
marijnh commented
At some point, typescript only allowed types after extends
, which makes sense because it needs to parse things like SomeClass<TypeParam>
, which isn't an expression.
However, it seems like modern TS somehow allows both expressions and types there. From microsoft/TypeScript#3516, it seems like they just parse an expression followed by an optional type argument list. Attached patch switches the grammar to do something similar.
bmeurer commented
Thanks, this seems reasonable!