-
Notifications
You must be signed in to change notification settings - Fork 32
/
if-else-type-mismatch.rs
51 lines (48 loc) · 1.07 KB
/
if-else-type-mismatch.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
fn main() {
let _ = if true {
1i32
} else {
2u32
};
//~^^ ERROR `if` and `else` have incompatible types
let _ = if true { 42i32 } else { 42u32 };
//~^ ERROR `if` and `else` have incompatible types
let _ = if true {
3u32;
} else {
4u32
};
//~^^ ERROR `if` and `else` have incompatible types
let _ = if true {
5u32
} else {
6u32;
};
//~^^ ERROR `if` and `else` have incompatible types
let _ = if true {
7i32;
} else {
8u32
};
//~^^ ERROR `if` and `else` have incompatible types
let _ = if true {
9i32
} else {
10u32;
};
//~^^ ERROR `if` and `else` have incompatible types
let _ = if true {
} else {
11u32
};
//~^^ ERROR `if` and `else` have incompatible types
let _ = if true {
12i32
} else {
};
//~^^^ ERROR `if` and `else` have incompatible types
}
// ferrocene-annotations: fls_exe4zodlwfez
// Type Unification
// ferrocene-annotations: fls_mkut7gut49gi
// If Expressions