Last active
August 7, 2017 07:26
-
-
Save evgzakharov/2a6226ac676a53190cbf7f058c8c0ebb to your computer and use it in GitHub Desktop.
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 GlobalCase { | |
fun someFun(): Unit {} | |
fun String.stringFun() { | |
} | |
} | |
fun main(args: Array<String>) { | |
val test: String = File("sadfasd").readText() | |
"asdfasdf".clousereFun { | |
someFun() | |
"some string".stringFun() | |
} | |
} | |
fun String.clousereFun(testFun: GlobalCase.() -> Unit): Unit { | |
val object1 = GlobalCase() | |
object1.testFun() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment