-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JS EmitThe issue relates to the emission of JavaScriptThe issue relates to the emission of JavaScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
🔎 Search Terms
override, property, esnext
🕗 Version & Regression Information
Bug in new feature of version 4.3
💻 Code
class Base {
state?: string;
}
export default class TestClass extends Base {
override state = "string";
}🙁 Actual behavior
Compiling this code for target esnext the override keyword on properties is preserved:
tsc -t esnext TestClass.ts
class Base {
state;
}
export default class TestClass extends Base {
override state = "string";
}🙂 Expected behavior
The override keyword should be removed from the javascript output, as it is already done correctly for methods.
(Compiling for other targets (e.g. es2021) works correctly as the property is transformed to a constructor initialization.)
Maybe related to #43535
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JS EmitThe issue relates to the emission of JavaScriptThe issue relates to the emission of JavaScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this