Error on static class members named 'constructor' should be consistent #33198
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
TypeScript Version: 3.7.0-dev.20190831
Search Terms: class, constructor, static, computed, quoted
Code
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
andB
(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
The text was updated successfully, but these errors were encountered: