Можно ли в котлине сделать что-то подобное ?
// original
class ModMe
{
void Say()
{
Print("Hello original");
}
};
// First mod
modded class ModMe // this class automatically inherits from original class ModMe
{
override void Say()
{
Print("Hello modded One");
super.Say();
}
};
// Second mod
modded class ModMe // this class automatically inherits from first mod's ModMe
{
override void Say()
{
Print("Hello modded Two");
super.Say();
}
};
void Test()
{
ModMe a = new ModMe(); // modded class ModMe is instanced
a.Say(); // prints 'Hello modded Two' , 'Hello modded One' and 'Hello original'
}