mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In Swift 3, unqualified lookup would skip static methods when performing a lookup from instance context. In Swift 4 mode, if a module method is shadowed by a static method, you will need to qualify the module method with the module name. It would have been nice to isolate the quirk in Sema and not AST, but unfortunately UnqualifiedLookup only proceeds to lookup in the module if scope-based lookup failed to find anything, and I don't want to change that since it risks introducing performance regressions. Fixes <rdar://problem/29961715>.
12 lines
241 B
Swift
12 lines
241 B
Swift
// RUN: %target-typecheck-verify-swift -swift-version 3
|
|
|
|
struct X {
|
|
func f1(_ i: Int) { }
|
|
mutating func f1(_ f: Float) { }
|
|
}
|
|
|
|
func g0(_: (inout X) -> (Float) -> ()) {}
|
|
|
|
// This becomes an error in Swift 4 mode -- probably a bug
|
|
g0(X.f1)
|