Is there any rationale behind Kotlin not being abl...
# announcements
r
Is there any rationale behind Kotlin not being able to infer the type from the default value:
Copy code
data class Foo(
        val bar = true
)
a
I think there are more rational than you can imagine. It’s better to ask “why”.
c
I think the word he was looking for is rationale and that should not be offensive..
👍 3
j
I’ve been wondering about that as well, the rule as far as I know is that all params needs to be explicitly typed, not sure how easy it would be to relax that in the event that default values are given to a param.
👍 2