Add dependency from annotation extraction mechanisms to the prototype, with tests

This commit is contained in:
Ilya Chernikov
2016-06-06 12:25:52 +02:00
committed by Pavel V. Talanov
parent 3f5a2c2781
commit 402e8c1e3e
7 changed files with 149 additions and 16 deletions
+16
View File
@@ -0,0 +1,16 @@
// this script expected parameter num : Int
@file:org.jetbrains.kotlin.scripts.depends("@{runtime}")
fun fib(n: Int): Int {
val v = if(n < 2) 1 else fib(n-1) + fib(n-2)
System.out.println("fib($n)=$v")
return v
}
val hdr = "Num".decapitalize()
System.out.println("$hdr: $num")
val result = fib(num)