Last active
May 15, 2020 04:38
-
-
Save amatkivskiy/1484980e22d6428e812a41753281058f to your computer and use it in GitHub Desktop.
For medium article: https://medium.com/@amatkivskiy/legacy-code-pitfalls-35feda5acb71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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