swift - Inhereted protocols conformance -
this question has answer here:
i want implement next code structure:
// base hierarchy definition protocol {} protocol c { var a: { set } } // specific definition protocol b: {} struct testclass: c { var a: b } - protocol
crequires variable of typea. - protocol
binheriteda. - class
testclassimplementscprotocol defining variable of typeb(what should ok in order of2)
but swift compiler complains testclass doesn't conform protocol c because candidate has non-matching type 'b'.
why swift compiler takes type b non-matching type a?
Comments
Post a Comment