diff options
Diffstat (limited to 'tests/ui/expr/if/if-branch-types.rs')
-rw-r--r-- | tests/ui/expr/if/if-branch-types.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/ui/expr/if/if-branch-types.rs b/tests/ui/expr/if/if-branch-types.rs new file mode 100644 index 000000000..c125ba306 --- /dev/null +++ b/tests/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` +} |