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
Compiling playground v0.0.1 (file:///playground)
error[E0308]: mismatched types
--> src/main.rs:2:15
|
2 | let x = { match 2 { _ => 1 } - 2 };
| ^^^^^^^^^^^^^^^^^^ expected (), found integral variable
|
= note: expected type `()`
found type `{integer}`
error: aborting due to previous error
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
I would have expected it to be equivalent to the following code, which does work (evaluating x to -1 as expected):
let x = match2{ _ => 1} - 2;
The text was updated successfully, but these errors were encountered:
Just ran across this issue and wondered, whether this is some kind of syntax limitation or a parser bug:
The following code does not compile:
(playground)
The error message is somewhat confusing:
I would have expected it to be equivalent to the following code, which does work (evaluating
x
to-1
as expected):The text was updated successfully, but these errors were encountered: