I have a class Person
:
class Person(val name: String, val age: Int)
I want to use Destructuring declaration with Parent
like this:
val (name, age) = Person("name", 22)
but I get this error:
Destructuring declaration initializer of type Person must have a 'component1()' function Destructuring declaration initializer of type Person must have a 'component2()' function