-
-
Notifications
You must be signed in to change notification settings - Fork 82
Type inference problem: expected {integer}, found i64 #354
Copy link
Copy link
Closed
Description
The following piece of code doesn't compile because of a type inference error:
fn value() -> i64 { 6 }
pub fn main() {
let t = 2;
t = loop { break value(); };
}The error message:
error: expected `{integer}`, found `i64`
--> mod.mun:5:9
|
5 | t = loop { break value(); };
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `{integer}`, found `i64`
|
Expected behavior: the code compiles without error. i64 is an integer type so the compiler should be able to infer that t is of type i64.
Edit: I'm using mun v0.3.0 (the pre-built binaries)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels