-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 2.0.3
Code
enum SomeEnum {
V1,
V2
}
class SomeClass {
protected state:SomeEnum
method() {
// "Operator '===' cannot be applied to types 'SomeEnum.V1' and 'SomeEnum.V2'." error here
this.state = SomeEnum.V1
if (this.state === SomeEnum.V2) {
}
// and the same error here
if (SomeEnum.V1 === SomeEnum.V2) {
}
// but no error here
let state2 = SomeEnum.V1
if (state2 === SomeEnum.V2) {
}
}
}Expected behavior:
I didn't expect that error in these cases
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug