You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enumMode{A,B}classC{m: Mode=Mode.A;test(){if(this.m!==Mode.B){this.m=Mode.B}letn:Mode=Mode.A;if(n!==Mode.B){// error Operator '!==' cannot be applied to types 'Mode.A' and 'Mode.B'.n=Mode.A;}letl=Mode.A;if(l!==Mode.B){// okl=Mode.A;}console.log(this.m)}}functiontest(){letm: Mode=Mode.A;if(m!==Mode.B){// error Operator '!==' cannot be applied to types 'Mode.A' and 'Mode.B'.m=Mode.B}}
Expected behavior:
Local enum variable with type annotations can not be compared. Actual behavior:
Local enum variable with type annotations can be compared.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.x
Code
Expected behavior:
Local enum variable with type annotations can not be compared.
Actual behavior:
Local enum variable with type annotations can be compared.
The text was updated successfully, but these errors were encountered: