Support named arguments for Java constructors annotated with KotlinSignature
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package test;
|
||||
|
||||
public class genericConstructor<T extends Number> {
|
||||
public genericConstructor(T number) {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import test.genericConstructor
|
||||
|
||||
class Subclass : genericConstructor<Int>(42) {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Subclass()
|
||||
return "OK"
|
||||
}
|
||||
@@ -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")
|
||||
+12
@@ -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")
|
||||
Reference in New Issue
Block a user