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
Confusing error message: Operator '===' cannot be applied to types '1' and '0'. #25245
The new error is misleading. You can't compare unrelated interfaces, but it's still possible and reasonable that one object could implement both of them:
Daniel Rosenwasser (@DanielRosenwasser) - jeffreymorlan makes a good point here, I was expecting that we'd implement the "when both operands are literal types (or unions of literal types)" constraint for this message.
Activity
RyanCavanaugh commentedon Jun 26, 2018
We should have a sub-elaboration when both operands are literal types (or unions of literal types) that says something like
and is
in the general case
RyanCavanaugh commentedon Jun 26, 2018
Daniel Rosenwasser (@DanielRosenwasser) let's workshop it for a few hours 🎈
jeffreymorlan commentedon Jun 28, 2018
The new error is misleading. You can't compare unrelated interfaces, but it's still possible and reasonable that one object could implement both of them:
but now it claims that "The types of these values indicate that this condition will always be 'false'."
RyanCavanaugh commentedon Jun 28, 2018
Daniel Rosenwasser (@DanielRosenwasser) - jeffreymorlan makes a good point here, I was expecting that we'd implement the "when both operands are literal types (or unions of literal types)" constraint for this message.
GenweiWu commentedon Dec 24, 2018
great, saved my time
mjbvz commentedon Oct 13, 2021
The current error message is:
Still a bit confusing if you aren't used to literal types and where
1comes from, but I think we can close this now