-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] Detect and diagnose conversion failures related to… #24791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ConstraintSystem] Detect and diagnose conversion failures related to… #24791
Conversation
Related to #24754 |
… collection element types Detect and diagnose a contextual mismatch between expected collection element type and the one provided (e.g. source of the assignment or argument to a call) e.g.: ```swift let _: [Int] = ["hello"] func foo(_: [Int]) {} foo(["hello"]) ```
c1da131
to
b9a0ca6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
@@ -26,7 +26,7 @@ func arraySameType() { | |||
|
|||
let _: SameType = [works] | |||
let _: SameType = [fails] | |||
// expected-error@-1 {{value of type '[Fails]' does not conform to specified type 'SameType'}} | |||
// expected-error@-1 {{cannot convert value of type 'Fails' to expected element type 'Works'}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much nicer!
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test macOS platform |
@swift-ci please test source compatibility |
Build failed |
@swift-ci please test macOS platform |
… collection element types
Detect and diagnose a contextual mismatch between expected
collection element type and the one provided (e.g. source
of the assignment or argument to a call) e.g.:
Resolves: rdar://problem/33914447