swift - Inhereted protocols conformance -


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 } 
  1. protocol c requires variable of type a.
  2. protocol b inherited a.
  3. class testclass implements c protocol defining variable of type b (what should ok in order of 2)

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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -