Skip to content

Commit 5ab264a

Browse files
[test] Add regression test for nil literal in pattern binding
1 parent a0b9032 commit 5ab264a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/Constraints/optional.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,6 @@ func rdar85166519() {
509509
v?.addingReportingOverflow(0) // expected-error {{cannot convert value of type '(partialValue: Int, overflow: Bool)?' to expected dictionary key type 'Int'}}
510510
]
511511
}
512+
513+
// https://github.com/apple/swift/issues/58539
514+
if let x = nil {} // expected-error{{'nil' requires a contextual type}}

0 commit comments

Comments
 (0)