Can you give an example of a problematic name collision? Does fully qualifying 
names not help?

Slava

> On May 31, 2017, at 4:01 PM, Steven Brunwasser via swift-users 
> <swift-users@swift.org> wrote:
> 
> Hi,
> 
> I have a library which uses a few generic protocols with identically named 
> associated types that may not always be specified identically by implementors.
> 
>       protocol Foo {
>               associatedtype Container
>               associatedtype Element
>       }
> 
>       protocol Bar {
>               associatedtype Container
>               associatedtype Element
>       }
> 
>       struct Baz: Foo, Bar {
>               // Implement using two different Container/Element types.
>       }
> 
> Is there a consensus on some naming convention for associatedtypes to 
> mitigate name collisions?
> Would it be acceptable to add namespace prefixes to these types?
> 
>       protocol Foo {
>               associatedtype FooContainer
>               associatedtype FooElement
>       }
> 
> I’m using the dictionary and thesaurus to find some alternative names I could 
> use, but the ones already used are so the most sensical semantically.
> 
> Do you have any suggestions?
> 
> Thanks, 
> - Steve Brunwasser
> _______________________________________________
> swift-users mailing list
> swift-users@swift.org <mailto:swift-users@swift.org>
> https://lists.swift.org/mailman/listinfo/swift-users 
> <https://lists.swift.org/mailman/listinfo/swift-users>
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to