Add annotation for parameter name in signatures

This commit is contained in:
e5l
2017-08-11 16:45:48 +03:00
committed by Leonid Stashevsky
parent 8201ff3006
commit 62e87c873c
37 changed files with 766 additions and 18 deletions
@@ -0,0 +1,31 @@
// TARGET_BACKEND: JVM
// FILE: A.java
// ANDROID_ANNOTATIONS
import kotlin.annotations.jvm.internal.*;
public class A {
public int connect(@ParameterName("host") int host, @ParameterName("port") int port) {
return host;
}
}
// FILE: test.kt
fun box(): String {
val test = A()
if (test.connect(host = 42, port = 8080) != 42) {
return "FAIL 1"
}
if (test.connect(port = 1234, host = 5678) != 5678) {
return "FAIL 2"
}
if (test.connect(9876, 4321) != 9876) {
return "FAIL 3"
}
return "OK"
}