https://kotlinlang.org logo
#language-proposals
Title
# language-proposals
e

elect

07/04/2022, 9:29 AM
automatic parameter assignment with matching variable name. Imagine you have
Copy code
class Entity(val fields: Fields = ..,
             val inner: Inner = ..,
             val owner: Owner? = null)
right now if I want to pass
owner
, I have to use named parameters
Entity(owner = owner)
, which is redundant if the variable naming matches, imho
m

Mikhail

07/04/2022, 3:30 PM
what if you rename the variable to
inner
while refactoring?
1
e

elect

07/04/2022, 5:25 PM
then the refactoring should fall back to something working, like named parameters
3 Views