Skip to content

Instantly share code, notes, and snippets.

@evgzakharov
Last active August 7, 2017 07:26
Show Gist options
  • Save evgzakharov/2a6226ac676a53190cbf7f058c8c0ebb to your computer and use it in GitHub Desktop.
Save evgzakharov/2a6226ac676a53190cbf7f058c8c0ebb to your computer and use it in GitHub Desktop.
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