Compiler Errors TS1110 and TS2345 with integer type pattern #27178
Open
Description
opened on Sep 18, 2018
TypeScript Version: 3.0.3
Explicitly marked positive integers are not recognized in a type pattern:
foo(direction: -1 | 1 | -2 | +2) { }
Likewise, calling it using a perfectly legit integer fails with TS2345:
Expected behavior:
As everywhere else, the unary operator + should be allowed in a type pattern.
This is not urgent, just for completeness.
Activity