Uploaded image for project: 'Swift'
  1. Swift
  2. SR-1386

Can't reference a type inside a module that has a type whose name is the same as the module

    XMLWordPrintable

    Details

      Description

      In Framework Something

      public struct A { ... }
      public class Something { ... }
      

      In Framework OtherFramework

      public struct A { ... }
      

      Then on the main project import both modules:

      import Something
      import OtherFramework
      
      let myA = A() // 'A' is ambiguous for type lookup in this context
      

      or

      import Something
      import OtherFramework
      
      let myA = Something.A() // 'A' is not a member type of 'Something'
      

      There is no way to reference `A` in module `Something`. Except for a couple workarounds, see http://stackoverflow.com/questions/36991735/how-to-reference-a-type-in-a-module-that-has-a-type-with-the-same-name-as-the-mo

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              aleph Alejandro Isaza
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: