Sto provando a fare riferimento a un tipo all'interno di un framework che ha un tipo il cui nome è lo stesso del framework. Più facile spiegare in codice:Come fare riferimento a un tipo in un modulo che ha un tipo con lo stesso nome del modulo in cui si trova?
Nel quadro Something
public struct A { ... }
public class Something { ... }
Nel quadro OtherFramework
public struct A { ... }
Poi sul progetto principale importare entrambi i moduli:
import Something
import OtherFramework
let myA = A() // 'A' is ambiguous for type lookup in this context
e se io do
import Something
import OtherFramework
let myA = Something.A() // 'A' is not a member type of 'Something'
Esiste un modo per fare riferimento a A
in Something
oltre a modificare il framework?
Questa è una domanda fantastica! Non ho ancora trovato una soluzione, ho pensato che fosse un bug. – HAS
È una soluzione, ma probabilmente potresti dividere la tua classe in estensioni che riguardano solo uno dei framework. – PeejWeej
@ Aleph7 Sono appena andato avanti e ho creato un problema per questo: https://bugs.swift.org/browse/SR-1389 Spero che tu stia bene con quello – HAS