You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SWC's interpretation of type arguments in TypeScript code is different than the TypeScript compiler, which can cause SWC to generate incorrect JavaScript.
This is a follow-up to #7387, which was not fixed correctly.
And if that line is commented out, SWC still incorrectly transforms fn(x < y, x >>>= y) into fn(x >>= y) and fn(x < y, x < y, x >>>= y) into fn(x < y, x >>= y).
Version
1.3.58
Additional context
No response
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
SWC's interpretation of type arguments in TypeScript code is different than the TypeScript compiler, which can cause SWC to generate incorrect JavaScript.
This is a follow-up to #7387, which was not fixed correctly.
Input code
Config
(I only ran SWC via the playground)
Playground link
https://play.swc.rs/?version=1.3.58&code=H4sIAAAAAAAAA0tJTc5JLEpVyEktUUjLs1JIzKvUUaiA0pVgmisFqiatNC%2B5JDM%2FT6HKxlFHwclOIx4srwlRlZanUaVgo%2BBXmpuUWqSj4J%2BUlZpcomCnoFGpqYlT0lahEixZAZQEWQwUQhfAVIKpBpsiTDHcqhGacMuANQEAPpF21y8BAAA%3D&config=H4sIAAAAAAAAA1VPOw7DIAzdOQXy3CHK0KF36CEQdSIqfsKOVBTl7oUE0maz38fveRVSwps0PORaxrJElQjTuReEsmf1KQhwjkg6mchw6yxTpSZlCXdoOxhglWbk6kIah3FoDrAhEHZHw5zxZsr%2FmTq4mJDoKqxS5WeL10TRUsGF17KT7Zfa92hwh5%2Boh52HwdCzOzktKLYvIO%2B2AhcBAAA%3D
Expected behavior
SWC should generate the same output as the TypeScript compiler does:
Actual behavior
Starting with version 1.3.58, SWC fails to parse this code with a syntax error (due to the incorrect fix for #7387):
This syntax error is a regression from 1.3.57.
And if that line is commented out, SWC still incorrectly transforms
fn(x < y, x >>>= y)
intofn(x >>= y)
andfn(x < y, x < y, x >>>= y)
intofn(x < y, x >>= y)
.Version
1.3.58
Additional context
No response
The text was updated successfully, but these errors were encountered: