Describe the bug
as and satisfies have a strange precedence rule that implicitly introduces operator regrouping. Simply erasing the operator may result in wrong grouping.
To Reproduce
Transpilers print 1 for the following code, while type erasers print 1.5.
console.log(1 + 1 as number / 2);
Expected behavior
As there is no guaranteed room for (, type erasers should reject this kind of AsExpressions and SatisfiesExpressions.
Environment (please complete the following information):
- Operating System and Version: confirmed on Windows 11
Additional context
I found this while writing up an unofficial spec documentation and the example above is merely synthetic. I am raising an issue here first because ts-blank-space seems rather strict about such hazards. I will ask other tool authors about the same hazard.
Describe the bug
asandsatisfieshave a strange precedence rule that implicitly introduces operator regrouping. Simply erasing the operator may result in wrong grouping.To Reproduce
Transpilers print 1 for the following code, while type erasers print 1.5.
Expected behavior
As there is no guaranteed room for
(, type erasers should reject this kind of AsExpressions and SatisfiesExpressions.Environment (please complete the following information):
Additional context
I found this while writing up an unofficial spec documentation and the example above is merely synthetic. I am raising an issue here first because ts-blank-space seems rather strict about such hazards. I will ask other tool authors about the same hazard.