Repository navigation
Properly emit super not root statement errors with class fields - #54475
Closed
Joshua Chen (Josh-Cena) wants to merge 7 commits into
Closed
Joshua Chen (Josh-Cena) wants to merge 7 commits into
Joshua Chen (Josh-Cena) wants to merge 7 commits into
Conversation
Joshua Chen (Josh-Cena)
force-pushed
the
fix-super-not-statement
branch
2 times, most recently
from
June 1, 2023 03:37
d716d8f to
a3f8645
Compare
Joshua Chen (Josh-Cena)
force-pushed
the
fix-super-not-statement
branch
from
June 2, 2023 17:59
a3f8645 to
3ccc950
Compare
Ron Buckton (rbuckton)
suggested changes
Jun 12, 2023
| ~~~~~~~~~~~~ | ||
| } | ||
| ~~~ | ||
| !!! error TS2376: A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers. |
Contributor
There was a problem hiding this comment.
Is this an intended consequence of this change?
Contributor
Author
There was a problem hiding this comment.
Yes, because it's a duplicate report. Specifically, all test cases where this or super is referenced before super() remain a TS17009/TS17011 error, while TS2376 is now emitted strictly when the downlevel emission is going to cause this to be implicitly referenced.
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #54445
I've: