kotlin

Is there a way to have structured data in data classes with anonymous classes?


I'd like to be able to do the below (minimal example, not real use-case):

data class Customer(
  name: String,
  address: object {
    street: String,
    city: String
  }
)

Is this currently possible via some syntax?


Solution

  • Seems like the current answer is unfortunately "you can't". Maybe in the future...