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
classA{privatesomething: string;publicgetid(): string|null{returnnull;}publicdoSomethingUseful(){if(this.id){this.something=this.id;// Error can be null}}}
The text was updated successfully, but these errors were encountered:
I'm inclined to agree this is a bug, but obviously there's no guarantee that an accessor will return the same value the next time it is invoked. It's sort of akin to saying that if a function call foo() returns a truthy value, then we should assume it will also return a truthy value the next time it is called.
this is a bit too pedantic. For an interface property, there is no guarantee it was implemented as an accessor, so not sure why this would be any different.
The text was updated successfully, but these errors were encountered: