Replies: 2 comments 2 replies
-
This is working as intended. Pattern expressions do evaluate to a |
Beta Was this translation helpful? Give feedback.
2 replies
-
There is no bug here. The expression does evaluate to a bool, and the var pattern always matches the input value. The pattern you want is |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently I can write code like this to see if a string exists within another string
However, I was surprised to see that if I change the code to:
It compiles and has the effect of meaning that the if expression is always true. i.e. it is treated as:
This strikes be as a bug. The compiler should raise an error saying that the expression does not evaluate to a boolean.
Beta Was this translation helpful? Give feedback.
All reactions