why where traits removed? is there something simil...
# announcements
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 🙃