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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -