Branded type does not work anymore
mohaalak opened this issue · comments
Mohammad Hadi Aliakbar commented
Describe the bug
In the previous version of ts-pattern (prior to v5), the Branded Types feature was working correctly and as intended. However, after updating to v5.0.1, it seems that the Branded Types are no longer functioning as expected.
in (4.0.6) it's working correctly and will narrow type to primitive type when matching but after this version it needs PatternMatcher .
Code Sandbox with a minimal reproduction case
https://codesandbox.io/p/sandbox/modern-tdd-xly9tj
Versions
- TypeScript version: 5.1.6
- ts-pattern version: 5.0.3
- environment: node 18
Gabriel Vergnaud commented
Closing, is this is a duplicate of #167. Thanks for providing this sandbox link, will take a look at this shortly.