Swift generic superclass' init not accessible when constructing its subclass

前端 未结 4 2078
春和景丽
春和景丽 2021-01-01 18:48

I have the following codes:

class ILProperty {
    var value: T?
    init(_ value: T) {
        self.value = value
    }
}

typealias ILStringProper         


        
4条回答
  •  粉色の甜心
    2021-01-01 19:42

    The last line in your code sample no longer gives a compile error, (since Swift 3). There is no mention of this in the Swift 3 Language Changes, so I can only assume that this was a bug.

提交回复
热议问题