summaryrefslogtreecommitdiffstats
path: root/src/test/ui/expr/if/if-let-arm-types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/expr/if/if-let-arm-types.rs')
-rw-r--r--src/test/ui/expr/if/if-let-arm-types.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/expr/if/if-let-arm-types.rs b/src/test/ui/expr/if/if-let-arm-types.rs
new file mode 100644
index 000000000..1e8260a01
--- /dev/null
+++ b/src/test/ui/expr/if/if-let-arm-types.rs
@@ -0,0 +1,11 @@
+fn main() {
+ if let Some(b) = None {
+ //~^ NOTE `if` and `else` have incompatible types
+ ()
+ //~^ NOTE expected because of this
+ } else {
+ 1
+ };
+ //~^^ ERROR: `if` and `else` have incompatible types
+ //~| NOTE expected `()`, found integer
+}