Johan Alkstål
09/11/2019, 7:43 PMFoo
, when making a List<Foo>
should be possible without casting the classes to their interface type?
When I do
fun listOfFoos(): List<Foo> {
return listOf(
FooA(),
FooB(),
FooC()
)
}
it complains that each class is not a Foo
but a FooA
FooB
and FooC
.
I would have thought that since they all implement the interface Foo
it would just work?Ruckus
09/11/2019, 7:49 PMJohan Alkstål
09/11/2019, 8:37 PM