decoupling? Do you mean destructuring?
# announcements
s
decoupling? Do you mean destructuring?
a
sorry, destructing declaration
s
I’m not sure what you mean by it working only with functions
Copy code
class Test {
  val list = listOf("foo", "bar")

  fun frobnicate() {
    val (foo, bar) = list
    println("$foo $bar")
  }
}
this works just fine
a
hmm odd it didn't show up as an option before in IntelliJ
probably was just being dumb
s
computers are hard ¯\_(ツ)_/¯
a
ohhh
was doing
get() = {}
and not
get() {}
s
oof
at least you caught it now rather than later 😅
d
Destructuring only requires that
component1()
,
component2()
, etc. are present, extensions or not, with the rhs expression type as receiver.