Skip to content

[5.7][CSSimplify] Disfavor choices that have injected callAsFunction #59106

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 1 commit into from
May 27, 2022

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 26, 2022

Cherry-pick of #58953


Ambiguities like:

struct S {
  init(v: Int) {}
  init(v: Int, _: () -> Void) {}

  func callAsFunction(_: () -> Void) {}
}

S(v: 42) {
}

Should always be resolved in favor of choice that doesn't require
injection of .callAsFunction, so let's try to avoid solving if
such an overload has already been found.

(cherry picked from commit 7898b5a)

Ambiguities like:

```
struct S {
  init(v: Int) {}
  init(v: Int, _: () -> Void) {}

  func callAsFunction(_: () -> Void) {}
}

S(v: 42) {
}
```

Should always be resolved in favor of choice that doesn't require
injection of `.callAsFunction`, so let's try to avoid solving if
such an overload has already been found.

(cherry picked from commit 7898b5a)
@xedin xedin added the r5.7 label May 26, 2022
@xedin xedin requested a review from a team as a code owner May 26, 2022 16:54
@xedin xedin requested a review from hborla May 26, 2022 16:54
@xedin
Copy link
Contributor Author

xedin commented May 26, 2022

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented May 26, 2022

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented May 26, 2022

@swift-ci please test Linux platform

@xedin
Copy link
Contributor Author

xedin commented May 26, 2022

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented May 26, 2022

@swift-ci please test Linux platform

@xedin
Copy link
Contributor Author

xedin commented May 27, 2022

@swift-ci please test macOS platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented May 27, 2022

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented May 27, 2022

@swift-ci please test Linux platform

@xedin
Copy link
Contributor Author

xedin commented May 27, 2022

@swift-ci please test macOS platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants