Skip to content

Instantly share code, notes, and snippets.

@amatkivskiy
Last active May 15, 2020 04:38
Show Gist options
  • Save amatkivskiy/1484980e22d6428e812a41753281058f to your computer and use it in GitHub Desktop.
Save amatkivskiy/1484980e22d6428e812a41753281058f to your computer and use it in GitHub Desktop.
fun parentFunction() {
val parentObj = Parent(Child())
childFunction(parentObj)
}
fun childFunction(parentObj: Parent) {
// Do whatever needed with child obj
println("child = ${parentObj.child}")
}
data class Parent(val child: Child)
class Child
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment