[swift-evolution] Name disambiguation of computed property/function with same type defined in extensions
brent at architechies.com
Tue Jun 7 06:24:52 CDT 2016
> I want to discuss the problem of name ambiguity when a computed property or function is defined with the same name and type in different modules. Currently there’s no way to disambiguate the implementation in use cases similar to the one contained in the gist below.
> The gist also contains some informal proposals. The idea is to create a formal proposal based on the discussion that shall follow.
We already have the concept of prefixing a type name with a module to disambiguate when two modules have the same type. I wonder if we could do the same thing to disambiguate between conflicting extensions?
("hello world" as ModuleA.String).capitalized() // Swift.String, with only APIs known to ModuleA
("hello world" as ModuleB.String).capitalized() // Swift.String, with only APIs known to ModuleB
"hello world".capitalized() // Still causes a compile-time error for ambiguity
More information about the swift-evolution