Merge pull request #9991 from eugenp/revert-9934-KTLN-8

Revert "KTLN-8: Non-Local Returns"
This commit is contained in:
Loredana Crusoveanu 2020-10-08 16:17:10 +03:00 committed by GitHub
commit 002c5ab712
1 changed files with 0 additions and 24 deletions

View File

@ -22,30 +22,6 @@ fun main() {
numbers.each { println(random * it) } // capturing the random variable
}
fun namedFunction(): Int {
return 42
}
fun anonymous(): () -> Int {
return fun(): Int {
return 42
}
}
inline fun <T> List<T>.eachIndexed(f: (Int, T) -> Unit) {
for (i in indices) {
f(i, this[i])
}
}
fun <T> List<T>.indexOf(x: T): Int {
eachIndexed { index, value ->
if (value == x) return index
}
return -1
}
/**
* Generates a random number.
*/