Imminent namespace conflict

Consider:

  • A Swift structure called FrameworkAthat defines the type Thing.
  • A Swift structure called FrameworkB, which also defines type Thingand type FrameworkA.
  • An application that imports both structures in a single Swift file.

How to reference FrameworkA.Thingin the specified file? The next line does not work with Thing is not a member of FrameworkA.

let t : FrameworkA.Thing? = nil
+4
source share
1 answer

This seems to be a Swift bug. As a workaround, you can create a new Swift file in the application, which only imports FrameworkAand defines typealiasfor Thing:

import FrameworkA

typealias ThingA = Thing

, , ThingA FrameworkA.Thing.

+5

All Articles