rust/tests/ui/expr/if/if-branch-types.rs

6 lines
152 B
Rust

fn main() {
let x = if true { 10i32 } else { 10u32 };
//~^ ERROR `if` and `else` have incompatible types
//~| expected `i32`, found `u32`
}