Created
February 11, 2019 20:49
-
-
Save jangalinski/106f08caa8c5a4bf3da13b7734c50b31 to your computer and use it in GitHub Desktop.
kotlin property delegate
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
class Foo { | |
private var count = 0 | |
private fun count(): Int = ++count | |
val eager get() = count() | |
val lazy by lazy { count() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment