Skip to content

[ConstraintSystem] Diagnose missing explicit calls in assignment #24407

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

Merged
merged 2 commits into from
May 1, 2019

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 1, 2019

If the source of the assignment is a function type which has
a result that could be converted to expected destination type,
let's diagnose that as missing call if such function doesn't
have any parameters.

xedin added 2 commits April 30, 2019 16:40
…aintSystem

That makes it much easier to use various facilities provided by
`ConstraintSystem`.
If the source of the assignment is a function type which has
a result that could be converted to expected destination type,
let's diagnose that as missing call if such function doesn't
have any parameters.
@xedin
Copy link
Contributor Author

xedin commented May 1, 2019

@swift-ci please test

@@ -37,7 +37,7 @@ func forgotCall() {
f6(f4, f2) // expected-error{{function produces expected type 'B'; did you mean to call it with '()'?}}{{8-8=()}}

// With overloading: only one succeeds.
a = createB // expected-error{{ambiguous reference to member 'createB()'}}
a = createB // expected-error{{function produces expected type 'B'; did you mean to call it with '()'?}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@xedin xedin merged commit e0f81a8 into swiftlang:master May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants