New Feature: Smart initialization of arguments

I would love a language feature where I didn’t have to type the name of a data class when constructing it for an function argument.

This could look something like this in Kotlin:

data class Configuration(
  val option1: String = "Default",
  val option2: Boolean = false,
  val option3: Int = 25

fun run(config: Configuration) {

main() {
  run((option2 = true))

Looks similar to

1 Like