Skip to content

Commit 4a6a684

Browse files
authored
Merge pull request #33000 from theblixguy/chore/add-regression-test-sr-13258
[Test] Add a regression test for SR-13258
2 parents 7b14c1d + ea41caf commit 4a6a684

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/stmt/if_while_var.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,9 @@ class UsesPayload {
238238
}
239239
}
240240
}
241+
242+
func sr_13258() {
243+
let a = 1
244+
let b = Int?.none
245+
if let c = b ?? a { _ = c } // expected-error {{initializer for conditional binding must have Optional type, not 'Int'}}
246+
}

0 commit comments

Comments
 (0)