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
{{ message }}
Repository navigation
Error is not showing on comparing when interface has optional variables #36602
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.
Activity
jcalz commentedon Feb 4, 2020
Context: relevant SO question
Search terms: weak type detection, comparison operators
Related issues:
#16047 - weak type detection PR
#17215 - comparability spec PR that I think never made it anywhere.
Looks like this behavior is intentional, at least if I can take #17215 for its word:
typescript-bot commentedon Feb 11, 2020
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.