https://kotlinlang.org logo
Title
g

gildor

11/01/2018, 10:46 AM
I remember someone already proposed this some time ago as part of the language
e

elizarov

11/01/2018, 11:18 AM
That is called “type classes” :)
g

gildor

11/01/2018, 12:15 PM
No, I mean extend each data class implicitly from interface with component1..N method and have Component1, Component2 interfaces
c

ckchen

11/02/2018, 2:27 AM
As I know the return type of componentN() for each data class is depending on the type of its corresponding property. How can we have a common interface of that?
g

gildor

11/02/2018, 2:34 AM
interface Component1<A>
,
interface Component2<A, B> : Component<A>
etc