Generic type parameters should be implied when sub...
# language-proposals
b
Generic type parameters should be implied when subclassing a generic class with a non-generic one:
Copy code
class 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:
Copy code
val x = Foo("b.ar") // implied type: Foo<String>
youtrack 1