-
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 featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Is there some clever reason why TSC can't check this (maybe... related to semantics of JS inheritance?)?
TypeScript Version: 3.2.0-dev.20181011
Search Terms: strictPropertyInitialization, static, initialized, uninitialized, assigned, property
Code
class A {
static s: number
a() {
A.s * 3 // Should be a compile error
}
}
A.s * 7 // Should be an compile error
Expected behavior: Both lines should produce compile errors.
Actual behavior: Both lines result in runtime exceptions.
Related Issues:
jeanlauliac, yseymour, jcalz, SlurpTheo, Yogu and 15 more
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 featureSuggestionAn idea for TypeScriptAn idea for TypeScript