Skip to content

Commit ea41caf

Browse files
committed
[Test] Add a regression test for SR-13258
1 parent 909e22f commit ea41caf

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)