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
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 results in different runtime behaviour than tsc for constructor(readonly x) {}. This is not related to #7435.
Input code
Config
swc --config jsc.target=es2022
Playground link
https://play.swc.rs/?version=1.3.61&code=H4sIAAAAAAAAA0vOSSwuVnDLz1eo5uJMzs8rLikqTS7JL9IoSk1Myc%2FLqVRIT8xNtVIAimfmpWsqVNdycXFWKNgqlGRkFuuB5PRK8kMLClKLnBOLUzU0rblquQCXZn2sVAAAAA%3D%3D&config=H4sIAAAAAAAAA1VPOw7DIAzdOQXy3KFi6NA79BCIOhERAYQdqSjK3QsJpM1mv4%2Ff8yqkhIkMPOVaxrJEnQjTuReEsmf9KQhwjkgm2chw6yxTpQbtCHdoOxhgnUbk6kJSd6WaA1wIhN3RsNl6O%2BT%2FTBPmmJDoKqxS7UeH10TRUmEO72Un2y%2B179HgAT9RDzsPg6VXd3JaUGxfBMLf3xcBAAA%3D
Expected behavior
tsc outputs the following:
this code is broken because the this.game assignment happens after the x assignment.
Actual behavior
this code works because the assignment of x is moved into the constructor by swc.
Version
1.3.66
Additional context
No response
The text was updated successfully, but these errors were encountered: