[swift-evolution] [Draft] Mixins

Thorsten Seitz tseitz42 at icloud.com
Tue Mar 1 23:37:53 CST 2016


> Am 02.03.2016 um 02:00 schrieb Brian Pratt <brian at pratt.io>:
> 
> If something *is* both an A and a B, it needs to act like (and speak the same language of) an A or a B *all* of the time.

Yes, that is exactly the point of Eiffel-style-multiple inheritance.

> Beyond this, I think it's going to be extremely complex managing compile-time type constraints with renames in place. Let's say I have a class C that inherits from bases A and B, which implement protocol P and Q respectively, and there's a naming collision. Functions that expect Ps or Qs will have to know about the renaming of conflicts from the combination of A+B?

No, functions that expect Ps or Qs will talk the language of P and Q. They don't have to know about renaming (that's the whole point which is only possible in statically typed languages). 
Functions that expect C will have to know about renaming. They will talk the language of C.

-Thorsten 


More information about the swift-evolution mailing list