Slackbot
04/12/2022, 6:47 PMPaul Griffith
04/12/2022, 6:51 PMYoussef Shoaib [MOD]
04/12/2022, 6:52 PMephemient
04/12/2022, 6:52 PMsealed class A {
val a = "..."
companion object : A()
}
sealed class B : A() {
val b = "..."
companion object : B()
}
sealed class C : B() {
val c = "..."
companion object : C()
}
but I agree with above, this does not seem like a great patternYoussef Shoaib [MOD]
04/12/2022, 6:57 PMYoussef Shoaib [MOD]
04/12/2022, 7:01 PMMyExtra and I add the methods I want as extensions on MyExtra but while requiring a context of the normal DSL class. Then simply whenever I want to give the user access to those methods, I put them in a context(DslClass, MyExtra) and let the magic happenephemient
04/12/2022, 7:02 PMobject, and even plain old receivers may work if you have a simple setup, e.g.
interface A { companion object }
val A.a get() = ...
interface B : A { companion object }
val B.b get() = ...
interface C : B { companion object }
val C.c get() = ...Youssef Shoaib [MOD]
04/14/2022, 3:54 PM