Swift - Compile error when constraining associated type -


so don't have write code replicate error - might should using generics in case, feels solution should work. following block of code gives me "type dcserviceclient not conform protocol dmserviceclient":

protocol dmserviceendpoint { } protocol dcserviceendpoint: dmserviceendpoint { }  protocol dmserviceclient {     typealias endpoint: dmserviceendpoint }  class dcserviceclient: dmserviceclient {     typealias endpoint = dcserviceendpoint } 

however, if remove constraint on associated type (endpoint), compiles without issues. because dcserviceendpoint conforms constraint (dmserviceendpoint) seems should compile. ideas i'm missing here? guys!

protocol dmserviceendpoint { } protocol dcserviceendpoint: dmserviceendpoint { }  protocol dmserviceclient {     typealias endpoint: dmserviceendpoint } class dcserviceclient: dmserviceclient {     typealias endpoint = newclass // implementation class conforms  endpoint } // add new class conforms dmserviceendpoint class newclass: dcserviceendpoint {} 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -