Skip to content

Instantly share code, notes, and snippets.

@paulocoutinhox
Created December 8, 2020 23:38
Show Gist options
  • Save paulocoutinhox/0d379efc41d409bfa9829bc2042f453d to your computer and use it in GitHub Desktop.
Save paulocoutinhox/0d379efc41d409bfa9829bc2042f453d to your computer and use it in GitHub Desktop.
fun test1(callback: (() -> Unit)? = null) {
callback?.let {
it()
}
}
fun test2(callback: () -> Unit?) {
callback()
}
fun main() {
println(test1())
println(test2({
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment