benleggiero
02/10/2018, 9:26 PMclass Foo<out Bar>(val bar: Bar)
class Baz(bar: String): Foo(bar)
In this case, Baz
should be implied to be a subclass of Foo<String>
. Today, the compiler requires an explicit <String>
. This is inconsistent with creating a variable. Today, this is fine:
val x = Foo("b.ar") // implied type: Foo<String>