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
enumSomeEnum{k1=1,k2=2,k3=3}classSomeClass{state: SomeEnum=SomeEnum.k1method(){if(this.state===SomeEnum.k1){maybeUpdate();//error - [ts] Operator '===' cannot be applied to types 'SomeEnum.k1' and 'SomeEnum.k2'.if(this.state===SomeEnum.k2){this.state=SomeEnum.k3}}}}constobj=newSomeClass();obj.method();functionmaybeUpdate(){if(Math.random()<0.5){obj.state=SomeEnum.k2;}}
Expected behavior:
No error Actual behavior:
wtf error