Files
kotlin/compiler/testData/codegen/script/topLevelFunction.ktscript
Stepan Koltsov f4051f45ab generate bytecode for script
It is just prototype

* does not make top level symbols visible as class members yet
* does not take parameters
* Script class name is hardcoded now
2012-05-23 02:52:29 +04:00

12 lines
156 B
Plaintext

// expected: 3628800
fun factorial(n: Int): Int {
var product = 1
for (i in 1..n) {
product *= i
}
return product
}
factorial(10)