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
interfaceA{id?: number;}consta:A={id: 5};consttestA: boolean=(a===1);//works, but why?interfaceB{id: number;}constb:B={id: 5};consttestB: boolean=(b===1);//compiler error -> expected that also on A
This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow.
Code
Expected behavior:
An error on the compare line.
Actual behavior:
No error
Playground Link:
https://www.typescriptlang.org/play/?ssl=1&ssc=1&pln=18&pc=1#code/JYOwLgpgTgZghgYwgAgILIN4Chm+cAEwH4AuZEAVwFsAjaAbiwF8sEB7EAZzGThPQC8mHHkJkArM0bsuPSN1RkabNgBsIcEMiEAKONoFCAjAEp6yAPQWA7mygBrTgBpkNCj2sALAJ5Es-0EhYRBQAIWE8fAIySloGZlYOblcScKFsSLFkSSZpJLkIblClFXVNbWQdGgNjM0sLdioAB2B1KGRoKDtkAFoAPg6ADyaIBEgCZDBPOB44VU42ZA40fyA
Related Issues:
The text was updated successfully, but these errors were encountered: