Comparison operator behaves differently for same inputs #347
Replies: 2 comments 2 replies
-
Hi @anakrish 👋 No, I think the first line should be a type error too. In general, the compiler will fail when it sees impossible equality comparisons performed, which is probably what you want it to do. As you've noticed, there are probably some cases that are not yet accounted for. |
Beta Was this translation helpful? Give feedback.
-
Hi @anderseknert, I wonder if it would be more appropriate for the second line to not error instead of the first line to error. Also, other comparison operators e.g
|
Beta Was this translation helpful? Give feedback.
-
It seems that when a statement is a comparison expression then additional type-checks are performed causing the comparison to become invalid.
Is this behavior expected?
Beta Was this translation helpful? Give feedback.
All reactions