|
|
Previous ID |
SR-11183 |
Radar |
rdar://problem/17275821 |
Original Reporter |
broadway_lamb (JIRA User) |
Type |
Bug |
Additional Detail from JIRA
|
|
Votes |
2 |
Component/s |
Compiler |
Labels |
Bug |
Assignee |
None |
Priority |
Medium |
md5: 88bc464882feb2ff1ad6082004a35c49
relates to:
- SR-1842 Introduce syntax for explicitly invoking extension methods.
Issue Description:
Right now if two modules extend a type with a method/property with the same name, there's no way to refer to any of them in a client module:
// Module A
extension Int {
public struct Nested {
public init() {}
}
public func whatModuleIsThis() -> String { "A" }
}
// Module B
extension Int {
public struct Nested {
public init() {}
}
public func whatModuleIsThis() -> String { "B" }
}
// Module C
import A
import B
func ambiguous(_ n: Int) -> String {
// error: Ambiguous type name 'Nested' in 'Int'
return n.whatModuleIsThis() + String(describing: Int.Nested())
}
I couldn't find a bug for this, so I figured I should create one.
I'd like to work on supporting this in the compiler, and then pitch a syntax for disambiguation, with a working implementation.