mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
It's common for a requirement in a protocol and an implementation of that requirement in a protocol extension to have the same signature. Overload resolution prefers the requirement (which dispatches dynamically), but that was being subverted by the shadowing rules when the protocol came from an imported module and the extension was in the current module. Fixes rdar://problem/21739333. Swift SVN r30598
17 lines
304 B
Swift
17 lines
304 B
Swift
public var something : Int = 1
|
|
|
|
public var ambiguousWithVar : Int = 2
|
|
public var scopedVar : Int = 3
|
|
public var localVar : Int = 4
|
|
public var scopedFunction : Int = 5
|
|
|
|
public var typeNameWins : Int = 6
|
|
|
|
public protocol HasFoo {
|
|
var foo: Int { get }
|
|
}
|
|
|
|
public protocol HasBar {
|
|
var bar: Int { get }
|
|
}
|