-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 featureIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 3.7.0-dev.20190831
Search Terms: class, constructor, static, computed, quoted
Code
class A { static constructor() {} }
class B { static "constructor"() {} }
class C { static ["constructor"]() {} }Expected behavior:
Even though it may be confused with non-standard extensions like #265, I think treating all cases equally would be less confusing, because unlike non-static ["constructor"] there is no difference at runtime.
Actual behavior:
A and B (with #31949) get a 'static' modifier cannot appear on a constructor declaration. diagnostic.
Playground Link:
http://www.typescriptlang.org/play/#code/MYGwhgzhAECC0G9oQC5hQS2NYB7AdqgE4CuwKuRAFAJSIC+09AUKJDAEKLJqbYBEeQilLlK-WgyatwUaAGFuqdFmgBtQQWJkKRfgF1JCRiyA
Related Issues: #31020, eslint/eslint#12110
Reactions are currently unavailable
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 featureIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript