Hello everyone,
I think I have found (by chance) an undocumented Swift feature today. It seems Protocol can require conforming types to be of a certain class type, like in this example:
class A { }
protocol P: A { }
class B: A, P { } // Ok
class C: P { } // Error: 'P' requires that 'C' inherit from 'A'
The official documentation here only mentions "inherited protocols". It might be worth adding a small paragraph to talk about this cool but little known Swift feature.
Hey tiam, that seems like it could be a reasonable thing to add. The best way to get these sorts of things tracked is to send them in via Feedback Assistant.
After you send something in Feedback Assistant, can you post the issue number here? I'm the writer currently maintaining the documentation, so I'll pull the bug into my queue.