Reputation: 31959
I'm a bit rusty with protocol composition in Kotlin, I'd just like to combine multiple interfaces by declaring a custom typealias
:
// This doesn't work
typealias MyType = (ReadableInterface && WritableInterface)
Any ideas?
In Swift, I would do it this way:
typealias MyType = ReadableInterface & WritableInterface
In Objective C, I would do it this way:
typedef <ReadableInterface, WritableInterface> MyType;
Upvotes: 13
Views: 3818
Reputation: 3079
Why not just create new interface?
interface MyType : ReadableInterface, WritableInterface
Upvotes: 9