Skip to content

[Diagnostics] Port last remaining closure expression diagnostics #28573

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 4 commits into from
Dec 5, 2019

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Dec 4, 2019

  • Diagnose errors related to missing argument(s) in closure expressions used in return statements
  • Detect that member lookup is about to being attempted on a "hole".
  • Remove obsolete diagnoseClosureExpr from CSDiag

xedin added 4 commits December 4, 2019 14:22
…e returns

If return type is a function, it's possible to return a closure
which can have some of its arguments unused in the body e.g.

`let _: () -> ((Int) -> Void) = { return { } }`

In this case resulting closure has to use its only parameter or
explictly ignore it by declaring `_ in`.
Member lookup on a "hole" is not going to produce any results
and it makes sense to detect early and short-circuit the constraint.
@xedin xedin requested a review from hborla December 4, 2019 22:28
@xedin
Copy link
Contributor Author

xedin commented Dec 4, 2019

@swift-ci please smoke test

@xedin xedin merged commit d8997c6 into swiftlang:master Dec 5, 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