First of all, thank you for visiting. I'm currently playing with Swift 3.1 Nested Generics and I've encountered an error with initialization.
class NestedProduct<T> {
enum Gadget {
case smartphone
case laptop
case fridge
case others(T)
}
enum Company {
case Samsung
case Apple
case Sony
case others(T)
}
let company: Company
let gadget: Gadget
let reviews: [T]
init(enterCompany: Company, enterGadget: Gadget, enterReView: [T]) {
company = enterCompany
gadget = enterGadget
reviews = enterReView
}
}
Now, I attempt to initialize
let product = NestedProduct<String>(enterCompany: NestedProduct.Company.Apple,
enterGadget: NestedProduct.Gadget.laptop,
enterReView: ["Good"])
However, I receive an error message,
GenericCache(0x11102a518): cyclic metadata dependency detected, aborting
I have no idea why this occurs. Could you guys please help? Thank you!
case others(T)
for eachGadget
andCompany
. – Alcock