Support named arguments for Java constructors annotated with KotlinSignature

This commit is contained in:
Alexander Udalov
2014-03-19 23:08:56 +04:00
parent d2dc54c14f
commit 7d311cdfa0
14 changed files with 189 additions and 43 deletions
@@ -0,0 +1,12 @@
// FILE: A.java
public @interface A {
int x();
String y();
}
// FILE: 1.kt
A(x = 1, y = "2")
fun test() {}
@@ -0,0 +1,9 @@
// FILE: A.java
public class A {
public A(int x, String y) {}
}
// FILE: 1.kt
val test = A(<!NAMED_ARGUMENTS_NOT_ALLOWED!>x<!> = 1, <!NAMED_ARGUMENTS_NOT_ALLOWED!>y<!> = "2")
@@ -0,0 +1,12 @@
// FILE: A.java
import kotlin.jvm.KotlinSignature;
public class A {
@KotlinSignature("fun A(x: Int, y: String)")
public A(int x, String y) {}
}
// FILE: 1.kt
val test = A(x = 1, y = "2")