Protocol init not found if generic class requires subclass

Viewed 101

I've created a small example with generics logic and I don't understand what this error means. I think there is some problem with designated initializer.

Hope someone has already handled it and can explain it to me.

protocol Test {
    init(value: Int)
}

class ClassTest<T: Test> where T: UIView {
    var t: T

    init() {
        t = T(value: 2) //error:
    }
}

gives the following compiler error:

Argument labels '(value:)' do not match any available overloads

2 Answers
Related