Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun startHere() {
- doSomething("Akexorcist", { name ->
- if (!name.contains("Ake")) {
- return // Error : return is not allowed herer
- }
- ...
- })
- }
- inline fun doSomething(name: String,
- crossinline block: (name: String) -> Unit) {
- System.out.println("Do something")
- block(name)
- System.out.println("Hello, $name")
- }
Add Comment
Please, Sign In to add comment