diff options
Diffstat (limited to 'src/test/ui/expr/if/if-branch-types.rs')
-rw-r--r-- | src/test/ui/expr/if/if-branch-types.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/ui/expr/if/if-branch-types.rs b/src/test/ui/expr/if/if-branch-types.rs new file mode 100644 index 000000000..c125ba306 --- /dev/null +++ b/src/test/ui/expr/if/if-branch-types.rs @@ -0,0 +1,5 @@ +fn main() { + let x = if true { 10i32 } else { 10u32 }; + //~^ ERROR `if` and `else` have incompatible types + //~| expected `i32`, found `u32` +} |