Skip to content

[5.0][CSSolver] Increment score when performing certain function conversions #14463

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
Feb 7, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 7, 2018

Increase solution score when performing function conversions where only
one side has @autoclosure. That is going to help pick the best overload
when only difference lays in presence of such attribute.

e.g.

func foo(_: @autoclosure () -> Int) {}
func foo(_: () -> Int) {}

If the argument is itself @autoclosure it's preferable to use overload
with @autoclosure attribute, otherwise () -> Int should be used.

Resolves: rdar://problem/37160679
(cherry picked from commit 8316353)

@xedin
Copy link
Contributor Author

xedin commented Feb 7, 2018

@swift-ci please smoke test and merge

Increase solution score when performing function conversions where only
one side has `@autoclosure`. That is going to help pick the best overload
when only difference lays in presence of such attribute.

e.g.

```swift
func foo(_: @autoclosure () -> Int) {}
func foo(_: () -> Int) {}
```

If the argument is itself `@autoclosure` it's preferable to use overload
with `@autoclosure` attribute, otherwise `() -> Int` should be used.

Resolves: rdar://problem/37160679
(cherry picked from commit 8316353)
@xedin xedin force-pushed the rdar-37160679-5.0 branch from 474e032 to a1f6243 Compare February 7, 2018 22:34
@xedin
Copy link
Contributor Author

xedin commented Feb 7, 2018

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit a839a9d into swiftlang:swift-5.0-branch Feb 7, 2018
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