Add annotation for default parameter value

This commit is contained in:
Leonid Stashevsky
2017-10-04 14:03:23 +03:00
parent 62e87c873c
commit 0348561cd2
48 changed files with 1827 additions and 39 deletions
@@ -0,0 +1,26 @@
// TARGET_BACKEND: JVM
// FILE: A.java
// ANDROID_ANNOTATIONS
import kotlin.annotations.jvm.internal.*;
public class A {
public int x(@DefaultValue("42") int x) {
return x;
}
}
// FILE: B.kt
class B : A() {
override fun x(x: Int): Int = x + 1
}
// FILE: box.kt
fun box(): String {
if (B().x() != 43) {
return "FAIL"
}
return "OK"
}