[swift-users] Package module name collisions

zhaoxin肇鑫 owenzx at gmail.com
Mon Feb 1 19:54:47 CST 2016


Have you tried typealias? typealias NewTypeName =
Module.TypeInsideModuleName

zhaoxin

On Tue, Feb 2, 2016 at 9:41 AM, Jason Lee via swift-users <
swift-users at swift.org> wrote:

> Today I introduced a dependency on another project's package with brought
> over a module name that conflicted with one he modules in my project.
>
> Currently my project has multiple modules (and executables) in the package
> and everything is working well for me. However, when I got this conflict
> today, I was thinking this will be a problem going forward. I'm sure it's
> been solved already by the package manager team, but I haven't figured out
> how to do this from the docs yet.
>
> An example:
> Package 'A' has a module named 'Base'
> My package also has a module named 'Base'
>
> When I build, I get a circular ref error now. One way I was thinking I cld
> fix this on my end is to prefix all my module names with my package name
> (seems redundant, of course). Something like 'Base' becomes 'MyAppBase'.
> And my imports could look like so:
>
> import Foundation
> import Base
> import MyAppBase
>
> Any thoughts on this? Thx.
>
> - jason
>
> Sent from my iPhone
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160202/98f4598d/attachment.html>


More information about the swift-users mailing list