why where traits removed? is there something similar (ie mixins)?
m
why where traits removed? is there something similar (ie mixins)?
d
Interfaces?
m
๐Ÿ˜•
d
Why the sadface?
m
i like mixins from dart for small methods that you want to add to classes while being able to extend another class. i guess the class hierarchy is just more strict in kotlin? only interfaces and abstract classes.
g
There are extension functions
๐Ÿ‘ 1
a
And you can have interfaces with default implementations of methods
g
Actually Kotlin traits were just groups of extension functions. So they been replaced by extension functions
o
Thatโ€™s incorrect. Traits were interfaces with default implementations. Or, if you wish, abstract classes without a state. Since interfaces in Java got default impls too, there were no reason to keep a distinct name.
g
Oh, of course ๐Ÿคฆโ€โ™‚๏ธ It's completely messed up in my mind ๐Ÿ™ƒ