Skip to content

Conversation

@rudkx
Copy link
Contributor

@rudkx rudkx commented Dec 15, 2016

We currently have an element in the solution score related to whether we
had a binding or equality constraint involving Any.

Doing this yields some strange results, e.g. if overload resolution
results in a property declared as Any we end up discarding that solution
in favor of solutions that involve other overloads that are not declared
as Any but are also not actually better solutions (e.g. overloads that
are declared as function types).

We really want to retain both solutions in this case and allow the
ranking step of the solver to decide on the better choice.

@rudkx rudkx self-assigned this Dec 15, 2016
@rudkx
Copy link
Contributor Author

rudkx commented Dec 15, 2016

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - b74cda3abcf18474885138631acad5453be0e5b3
Test requested by - @rudkx

@slavapestov
Copy link
Contributor

Interesting:

Foundation/NSCFSet.swift:44:16: error: ambiguous use of 'fetch'
22:52:21         return _SwiftValue.fetch(unsafeBitCast(value, to: AnyObject.self))
22:52:21                ^
22:52:21 Foundation/Bridging.swift:78:17: note: found this candidate
22:52:21     static func fetch(_ object: AnyObject?) -> Any? {
22:52:21                 ^
22:52:21 Foundation/Bridging.swift:85:17: note: found this candidate
22:52:21     static func fetch(_ object: AnyObject) -> Any {

@rudkx
Copy link
Contributor Author

rudkx commented Dec 15, 2016

Uh, yay for tests...?!

@rudkx
Copy link
Contributor Author

rudkx commented Dec 16, 2016

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - b74cda3abcf18474885138631acad5453be0e5b3
Test requested by - @rudkx

@rudkx
Copy link
Contributor Author

rudkx commented Dec 16, 2016

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 9e585ea0d1d2b8154a64d92d41a9bad0dd7d4260
Test requested by - @rudkx

@rudkx
Copy link
Contributor Author

rudkx commented Dec 17, 2016

@swift-ci Please test Linux platform

@rudkx
Copy link
Contributor Author

rudkx commented Dec 17, 2016

@swift-ci Please test

@rudkx rudkx changed the title WIP-DO-NOT-MERGE: Do not penalize binding or equality constraints involving Any. Do not penalize binding or equality constraints involving Any. Dec 20, 2016
@rudkx
Copy link
Contributor Author

rudkx commented Dec 20, 2016

@swift-ci Please smoke test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 2b2c8c1371ab1179f10049c73973a6c19f4a5f70
Test requested by - @rudkx

We currently have an element in the solution score related to whether we
had a binding or equality constraint involving Any.

Doing this yields some strange results, e.g. if overload resolution
results in a property declared as Any we end up discarding that solution
in favor of solutions that involve other overloads that are not declared
as Any but are also not actually better solutions (e.g. overloads that
are declared as function types).

We really want to retain both solutions in this case and allow the
ranking step of the solver to decide on the better choice.

Fixes rdar://problem/29374163, rdar://problem/29691909.
@rudkx
Copy link
Contributor Author

rudkx commented Dec 20, 2016

@swift-ci Please smoke test and merge

@rudkx
Copy link
Contributor Author

rudkx commented Dec 20, 2016

@swift-ci Please smoke test

@rudkx rudkx merged commit d2f1de7 into swiftlang:master Dec 20, 2016
@rudkx rudkx deleted the disable-any-penalty branch December 20, 2016 22:27
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.

3 participants