Files
swift-mirror/test/Constraints/imported-overload.swift
Mark Lacey 170dc8acd7 Do not penalize binding or equality constraints involving Any.
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.
2016-12-20 13:38:14 -08:00

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
}
}