Skip to content

[CSSimplify] Disfavor choices that have injected callAsFunction #58953

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 26, 2022

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 18, 2022

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.

@xedin xedin requested a review from hborla May 18, 2022 01:01
@xedin
Copy link
Contributor Author

xedin commented May 26, 2022

@swift-ci please test

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.
@xedin xedin force-pushed the fix-callAsFunction-perf branch from bdf57fa to 7898b5a Compare May 26, 2022 07:47
@xedin
Copy link
Contributor Author

xedin commented May 26, 2022

@swift-ci please test

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