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
According to Playground demo, swc breaks the definition order of class fields: all the undecorated fields go first, and the decorated ones go last. This behavior leads to some problems if the undecorated field depends on the decorated field value in its class constructor.
TSC compiler doesn't change the order of fields in a constructor.
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
According to Playground demo, swc breaks the definition order of class fields: all the undecorated fields go first, and the decorated ones go last. This behavior leads to some problems if the undecorated field depends on the decorated field value in its class constructor.
TSC compiler doesn't change the order of fields in a constructor.
Input code
No response
Config
Playground link
https://play.swc.rs/?version=1.3.35&code=H4sIAAAAAAAAA0vOSSwuVnBUqOZSUHDITypOLSpLTMpJVUhUsFUoKSpNteYCSiQBOWmJOcUQXnJ%2BXjFQKrkkv0hDE6yxlquWCwBWMAoXSQAAAA%3D%3D&config=H4sIAAAAAAAAA02Ouw6DMAxF%2F8Uzazswd%2BUjrGBQqiSObCM1Qvx7Ex6lm%2BV77mOFtzroV8goStIuLcnwAz1YyaROfDbowLS%2BJgxKHYzkWNBYFHqThbYqo8xk1UT6qHRgVvrx0Sc%2FlZbtOGYh1VvCNIeLbDmCSSeW2OhAM7ryutqOsr%2F6gQxHNDxXVHvkcWlx6z5%2Bn%2FOE7V5wtnodTnA3fgHD3DNVBQEAAA%3D%3D
Expected behavior
Fields are translated in an order they were declared.
Actual behavior
Order of fields is changed.
Version
1.3.35
Additional context
No response
The text was updated successfully, but these errors were encountered: