> 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?
> 
>       import ModuleA
>       import ModuleB
>       
>       ("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

This only introduces a new kind of ambiguity since you can have both ModuleA 
and ModuleB declare something like

class String {
        /// ...
}

And now you have no idea if ModuleA.String refers to Swift.String extension in 
ModuleA or class String in ModuleA.



> 
> -- 
> Brent Royal-Gordon
> Architechies
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to