tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
361 stars 108 forks source link

Support 'unknown' on 'catch' clause bindings #142

Closed mjambon closed 3 years ago

mjambon commented 3 years ago

The following should be supported:

try {}
catch (e: unknown) {}

unknown and any are the only types that are allowed here according to the error message we're getting in the typescript playground when trying something else. Any type alias that resolves to unknown or any is also accepted:

type thing = unknown
try {}
catch (e: thing) {}