test: Add a test for mismatched types of if branches
This commit is contained in:
parent
e24d7ae967
commit
4bcdf57d78
1 changed files with 9 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue