Scott Christopher
11/16/2021, 11:27 AMsealed class Foo<T> {
object FooBool : Foo<Boolean>()
object FooInt : Foo<Int>()
}
fun <T> match(x: Foo<T>): T = when (x) {
is Foo.FooBool -> true
is Foo.FooInt -> 42
}
raulraja
11/16/2021, 12:07 PMraulraja
11/16/2021, 12:08 PMminor
problem. To me is major as impacts pretty much every program involving adts and generics which is a very popular programming style.Scott Christopher
11/16/2021, 12:10 PMScott Christopher
11/16/2021, 12:12 PM