Type inference for constructor parameters with default values


#1

Hi guys,

We have type inference for variable declarations but why don’t we have it for primary constructor parameters with default values?

fun f() {
    val f = 1 // SUCCESS
}

but

class A(
    val a = 1 // ERROR
)

#2

But there is an issue on Youtrack for what you want:

https://youtrack.jetbrains.com/issue/KT-19046


#3

Thanks! I missed that topic.