1. Let's declare three protocols Human, HasParent and CanCook:
2. Let's say we want to add a default implementation of the method cook() to every Human who also has a parent (conforming to HasParent protocol), but only if the parent can cook (Parent conforming to CanCook protocol).
3. Lastly, let's have two classes that implement these protocols, one of them who implements the method cook() and another that has a parent, that we want to delegate the call to:
Expected result would be that when calling cook() on the Toddler class, the parent.cook() would get called.
Actual result is compile error:
Note that if we change the type of parent in Toddler to Father, it works as expected. As well as changing the type of parent in Toddler to CanCook and changing the extension definition so that the conformance states Self.Parent == CanCook instead of Self.Parent: CanCook.