通用结构中的Swift分段错误

时间:2017-02-19 19:05:15

标签: ios swift

我一直试图实施这件事:

public struct Relationship<P,K> where P:Persistable, P:Hashable, K:Persistable {
    let key: String
    var value: [P]
    var parentEntity: K?

    init(key: String) {
        self.key = key
        self.value = []
    }
}

然后在某些结构中使用它,如变量

public struct Test {
    var test: Relationship<Event, Test>?
}

我得到了enter image description here

别担心Test struct会在扩展中实现Persistable。 我不知道如何解决这个问题。你呢? 谢谢

0 个答案:

没有答案
相关问题