Skip to content

Commit 1459974

Browse files
committed
[TypeChecker] NFC: Add a test-case for SR-11104
1 parent b793415 commit 1459974

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/Constraints/optional.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,11 @@ func sr8411() {
394394
_ = S.foo(&foo) // Ok
395395
_ = S.bar(&foo, 42) // Ok
396396
}
397+
398+
// SR-11104 - Slightly misleading diagnostics for contextual failures with multiple fixes
399+
func sr_11104() {
400+
func bar(_: Int) {}
401+
402+
bar(["hello"].first)
403+
// expected-error@-1 {{cannot convert value of type 'String?' to expected argument type 'Int'}}
404+
}

0 commit comments

Comments
 (0)