-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
The following is an error:
function factory() {
return class {
static x = 1;
static y = this.x * 2;
}
}
I can see some potential for confusion here, though I'm not sure what that confusion might be. On the flip side, it seems useful to be able to refer to an anonymous class in a static initializer. It is also easy to teach that "this in instance initializers = the instance, this in static initializers = the class, same as methods vs. static methods."
iby, aluanhaddad, mantou132 and tonivj5
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)SuggestionAn idea for TypeScriptAn idea for TypeScript