mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
12 lines
290 B
Swift
12 lines
290 B
Swift
// RUN: %target-typecheck-verify-swift -import-objc-header %S/Inputs/overload.h
|
|
// REQUIRES: objc_interop
|
|
protocol rdar29374163Proto {}
|
|
|
|
class rdar29374163 {
|
|
init(_ itf: Rdar29374163Itf) { self.itf = itf }
|
|
var itf: Rdar29374163Itf
|
|
func bar() -> Int {
|
|
return itf.foo as! Int
|
|
}
|
|
}
|