Last active
June 21, 2021 20:07
-
-
Save GabrielBrasileiro/e13b67efc935fa7c2ad60c5c410936da to your computer and use it in GitHub Desktop.
HighOrderFunctionCrossinline.kt
This file contains hidden or 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
fun main() { | |
val descricao = "Inline te dando poderes mágicos" | |
executarOperacao { | |
print(descricao) | |
return // Retorno não permitido | |
} | |
} | |
inline fun executarOperacao(crossinline operacaoDois: () -> Unit) { | |
operacaoUm { | |
operacaoDois() | |
} | |
} | |
fun operacaoUm(bloco: () -> Unit) { | |
bloco() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment