Rob Elliot
08/24/2020, 3:42 PMdata class A(
val b: B
) {
data class B(
val c: C
) {
data class C(
val foo: String,
val bar: Int
)
}
}
I find myself hankering after a more concise way of doing the same thing; something like:
data class A(
val b: data class B(
val c: data class C(
val foo: String,
val bar: Int
)
)
)
I imagine those as being completely interchangeable - so the type of A.b.c
is A.B.C
.
What do you think?tddmonkey
08/24/2020, 3:53 PMNir
08/24/2020, 4:09 PMNir
08/24/2020, 4:10 PMNir
08/24/2020, 4:12 PMRob Elliot
08/24/2020, 4:25 PMNir
08/24/2020, 4:28 PMNir
08/24/2020, 4:29 PMNir
08/24/2020, 4:29 PM:
to be either a type or a declaration of a typeNir
08/24/2020, 4:30 PMRob Elliot
08/24/2020, 4:35 PM<a>
<b>
<c>
<foo>"hello"</foo>
<bar>45</bar>
</c>
</b>
</a>
Rob Elliot
08/24/2020, 4:36 PMNir
08/24/2020, 4:45 PM