You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do not consider the proposed solution in SO as a workaround, since it doesn't solve the problem. This problem stems from the fact, that Swift doesn't let us use qualified names. But many problems arise due to those name conflicts and could be solved easily using qualified names. Of course, Swift would need to refer to names with their fully qualified names internally, across its implementation.
Note that some very used libraries tend to not have paid attention to this problem.
Eg: RxSwift where the two core protocols ObserverType and ObservableType both use "E" (like Event) as an associate type.
Meaning you can't observe one type and emit another.
Seeing that that the general trend is to use single letter names for associated types, this looks like a critical limitation to me.
Additional Detail from JIRA
md5: 85eaf1679db0a25d3d656686bf1b62fe
Issue Description:
This does currently not compile:
Having two protocols with the same name for associatedtype declaration:
A class or struct conforming to this two protocols:
Expected:
The compiler should be able to resolve the types.
Actual:
The compiler issues nonsensical errors.
Further improvements:
In order to resolve naming conflicts, a developer should be able to use qualified names. For example:
The code above does not compile.
Compiler:
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)
The text was updated successfully, but these errors were encountered: