Dotty または Scala の既存のオブジェクトに特性を混在させる方法はありますか?
class SomeClass
trait SomeTrait
// This works, but it's not what I'm looking for:
new SomeClass with SomeTrait
// This is what I'm looking for, but it breaks:
val someClass = new SomeClass
someClass with SomeTrait
この答えはマクロな解決策を提供しますが、それは7歳で、もっと簡単なものを望んでいます(指が交差しました!)。