Normally in Swift you can resolve naming collisions using the syntax ModuleName.ObjectName. For example, if you have two packages, Foo and Bar, both with a class Snafu, you can specify Foo.Snafu and Bar.Snafu.
However, if the package shares a name with one of the data types declared in the package, this breaks down. So, for example, in the attached test case, there is a package Sample with a struct named Sample. If you import that package into other code and then attempt to access the struct as follows
var s = Sample.Sample()
you get a compiler error: type 'Sample' has no member 'Sample'
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
Problem originally spotted:
Xcode Version 8.2.1 (8C1002)
Attached test case:
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1) on macOS 10.12.4
Additional Detail from JIRA
md5: a802a68cf6c5643d16a8a3ed1138dc4d
duplicates:
is duplicated by:
Issue Description:
Normally in Swift you can resolve naming collisions using the syntax ModuleName.ObjectName. For example, if you have two packages, Foo and Bar, both with a class Snafu, you can specify Foo.Snafu and Bar.Snafu.
However, if the package shares a name with one of the data types declared in the package, this breaks down. So, for example, in the attached test case, there is a package Sample with a struct named Sample. If you import that package into other code and then attempt to access the struct as follows
var s = Sample.Sample()
you get a compiler error: type 'Sample' has no member 'Sample'
The text was updated successfully, but these errors were encountered: