test: Add a test for mismatched types of if branches
This commit is contained in:
parent
e24d7ae967
commit
4bcdf57d78
9
src/test/compile-fail/if-branch-types.rs
Normal file
9
src/test/compile-fail/if-branch-types.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// error-pattern:mismatched types
|
||||
|
||||
fn main() {
|
||||
auto x = if (true) {
|
||||
10
|
||||
} else {
|
||||
10u
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user