type check the 'else' body of a let/else.

Swift SVN r26989
This commit is contained in:
Chris Lattner
2015-04-04 21:30:52 +00:00
parent a3c4a8cd50
commit eb922cd0c2
4 changed files with 14 additions and 1 deletions

View File

@@ -84,3 +84,8 @@ func tuplePatternDestructuring(x : Int, y : Int) {
let (x: g1, a: h1) = (b: x, a: y) // expected-error {{'(b: Int, a: Int)' is not convertible to '(x: (b: Int, a: Int), a: (b: Int, a: Int))'}}
}
let optUnwrap? = Optional(1) else {
optUnwrap = 42 // expected-error {{cannot assign to 'let' value 'optUnwrap'}}
}