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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -