Files
kotlin/compiler/testData/codegen/script/topLevelFunction.kts
Ilya Ryzhenkov 98c54f39bb Unify script file extensions to "kts" so that IDEA, compiler and tests agree when to parse as SCRIPT.
Include kt* files into formatter test generation, to test scripting formatting
2014-03-24 18:17:50 +04:00

12 lines
160 B
Kotlin
Vendored

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