Load Java static members from parents
This commit is contained in:
+15
@@ -67,4 +67,19 @@ public class JetDiagnosticsWithJava8TestGenerated extends AbstractJetDiagnostics
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithJava8/statics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Statics extends AbstractJetDiagnosticsWithFullJdkTest {
|
||||
public void testAllFilesPresentInStatics() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJava8/statics"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("inheritanceStaticMethodFromInterface.kt")
|
||||
public void testInheritanceStaticMethodFromInterface() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJava8/statics/inheritanceStaticMethodFromInterface.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class Child extends Parent {
|
||||
public static int b = 3;
|
||||
public static int c = 4;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
class Parent {
|
||||
public static int a = 1;
|
||||
public static int b = 2;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
if (Parent.a != 1) return "expected Parent.a == 1"
|
||||
if (Parent.b != 2) return "expected Parent.b == 2"
|
||||
if (Child.a != 1) return "expected Child.a == 1"
|
||||
if (Child.b != 3) return "expected Child.b == 3"
|
||||
if (Child.c != 4) return "expected Child.c == 4"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Child extends Parent {
|
||||
public static String bar() {
|
||||
return "Child.bar";
|
||||
}
|
||||
public static String baz() {
|
||||
return "Child.baz";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Parent {
|
||||
public static String foo() {
|
||||
return "Parent.foo";
|
||||
}
|
||||
public static String baz() {
|
||||
return "Parent.baz";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
if (Parent.foo() != "Parent.foo") return "expected: Parent.foo"
|
||||
if (Parent.baz() != "Parent.baz") return "expected: Parent.baz"
|
||||
if (Child.foo() != "Parent.foo") return "expected: Child.foo() != Parent.foo"
|
||||
if (Child.baz() != "Child.baz") return "expected: Child.baz"
|
||||
if (Child.bar() != "Child.bar") return "expected: Child.bar"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class Child extends Parent {
|
||||
public static String a = "2";
|
||||
public static String foo() {
|
||||
return "Child.foo()";
|
||||
}
|
||||
public static String foo(int i) {
|
||||
return "Child.foo(int)";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Parent {
|
||||
private static int a = 1;
|
||||
private static String foo() {
|
||||
return "Parent.foo";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
if (Child.a != "2") return "Fail #1"
|
||||
if (Child.foo() != "Child.foo()") return "Fail #2"
|
||||
if (Child.foo(1) != "Child.foo(int)") return "Fail #3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -19,5 +19,5 @@ public open class Bbb : Aaa {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final val i: kotlin.String = "s"
|
||||
public const final override /*1*/ val i: kotlin.String = "s"
|
||||
}
|
||||
|
||||
@@ -45,6 +45,13 @@ public abstract class A : java.util.ArrayList<kotlin.String!> {
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun trimToSize(): kotlin.Unit
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun writeObject(/*0*/ p0: java.io.ObjectOutputStream!): kotlin.Unit
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val MAX_ARRAY_SIZE: kotlin.Int
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val serialVersionUID: kotlin.Long
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> finishToArray(/*0*/ p0: kotlin.Array<(out) T!>!, /*1*/ p1: kotlin.(Mutable)Iterator<*>!): kotlin.Array<(out) T!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun hugeCapacity(/*0*/ p0: kotlin.Int): kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun subListRangeCheck(/*0*/ p0: kotlin.Int, /*1*/ p1: kotlin.Int, /*2*/ p2: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
|
||||
public final class B : A {
|
||||
|
||||
Vendored
+3
@@ -22,6 +22,9 @@ public/*package*/ open class MyMap</*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!>
|
||||
public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.Any?): V?
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun values(): kotlin.MutableCollection<V!>
|
||||
|
||||
// Static members
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun eq(/*0*/ p0: kotlin.Any!, /*1*/ p1: kotlin.Any!): kotlin.Boolean
|
||||
}
|
||||
|
||||
public interface ResolverForProject</*0*/ M1> {
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
// FILE: A.java
|
||||
|
||||
class A {
|
||||
private static int a = 1;
|
||||
private static void foo() {}
|
||||
|
||||
protected static int b = 1;
|
||||
protected static void bar() {}
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
|
||||
class B extends A {
|
||||
public static int a = 1;
|
||||
public static void foo() {}
|
||||
public static void foo(int i) {}
|
||||
|
||||
public static int b = 1;
|
||||
public static void bar() {}
|
||||
public static void bar(int i) {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun test() {
|
||||
A.<!INVISIBLE_MEMBER!>a<!>
|
||||
A.<!INVISIBLE_MEMBER!>foo<!>()
|
||||
A.b
|
||||
A.bar()
|
||||
B.a
|
||||
B.foo()
|
||||
B.foo(1)
|
||||
B.b
|
||||
B.bar()
|
||||
B.bar(1)
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public/*package*/ open class A {
|
||||
public/*package*/ constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
private final var a: kotlin.Int
|
||||
protected/*protected static*/ final var b: kotlin.Int
|
||||
protected/*protected static*/ open fun bar(): kotlin.Unit
|
||||
private open fun foo(): kotlin.Unit
|
||||
}
|
||||
|
||||
public/*package*/ open class B : A {
|
||||
public/*package*/ constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final var a: kotlin.Int
|
||||
public final override /*1*/ var b: kotlin.Int
|
||||
public open override /*1*/ fun bar(): kotlin.Unit
|
||||
public open fun bar(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
public open fun foo(): kotlin.Unit
|
||||
public open fun foo(/*0*/ i: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// FILE: I.java
|
||||
|
||||
public interface I {
|
||||
int a = 1;
|
||||
}
|
||||
|
||||
// FILE: C.java
|
||||
|
||||
public class C implements I {
|
||||
static int b = 1;
|
||||
static void bar() {}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
open class K : C()
|
||||
|
||||
// FILE: D.java
|
||||
|
||||
public class D extends K {
|
||||
static int c = 1;
|
||||
static void baz() {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun test() {
|
||||
I.a
|
||||
|
||||
C.a
|
||||
C.b
|
||||
C.bar()
|
||||
|
||||
K.<!UNRESOLVED_REFERENCE!>a<!>
|
||||
K.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
K.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
|
||||
D.a
|
||||
D.b
|
||||
D.c
|
||||
D.bar()
|
||||
D.baz()
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class C : I {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final override /*1*/ /*fake_override*/ val a: kotlin.Int
|
||||
public/*package*/ final var b: kotlin.Int
|
||||
public/*package*/ open fun bar(): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class D : K {
|
||||
public constructor D()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final override /*1*/ /*fake_override*/ val a: kotlin.Int
|
||||
public/*package*/ final override /*1*/ /*fake_override*/ var b: kotlin.Int
|
||||
public/*package*/ final var c: kotlin.Int
|
||||
public/*package*/ open override /*1*/ /*fake_override*/ fun bar(): kotlin.Unit
|
||||
public/*package*/ open fun baz(): kotlin.Unit
|
||||
}
|
||||
|
||||
public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final val a: kotlin.Int = 1
|
||||
}
|
||||
|
||||
public open class K : C {
|
||||
public constructor K()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// FILE: K.kt
|
||||
|
||||
open class K {
|
||||
companion object {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: D.java
|
||||
|
||||
class D extends K {
|
||||
static int b = 1;
|
||||
static void bar() {}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
class K2 {
|
||||
companion object {
|
||||
fun baz() {}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun test() {
|
||||
K.foo()
|
||||
|
||||
D.b
|
||||
D.bar()
|
||||
D.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
|
||||
K2.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
K2.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
K2.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
K2.baz()
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public/*package*/ open class D : K {
|
||||
public/*package*/ constructor D()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public/*package*/ final var b: kotlin.Int
|
||||
public/*package*/ open fun bar(): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class K {
|
||||
public constructor K()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class K2 {
|
||||
public constructor K2()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public final fun baz(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
// FILE: I.java
|
||||
|
||||
public interface I {
|
||||
int a = 1;
|
||||
}
|
||||
|
||||
// FILE: C.java
|
||||
|
||||
public class C implements I {
|
||||
static int b = 1;
|
||||
static void bar() {}
|
||||
}
|
||||
|
||||
// FILE: K.kt
|
||||
|
||||
open class K : C(), I
|
||||
|
||||
// FILE: D.java
|
||||
|
||||
public class D extends K, I {
|
||||
static int c = 1;
|
||||
static void baz() {}
|
||||
}
|
||||
|
||||
// FILE: E.java
|
||||
|
||||
public class E extends D, I {
|
||||
static int a = 1;
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun test() {
|
||||
I.a
|
||||
|
||||
C.a
|
||||
C.b
|
||||
C.bar()
|
||||
|
||||
K.<!UNRESOLVED_REFERENCE!>a<!>
|
||||
K.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
K.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
|
||||
D.a
|
||||
D.b
|
||||
D.c
|
||||
D.bar()
|
||||
D.baz()
|
||||
|
||||
E.a
|
||||
E.b
|
||||
E.c
|
||||
E.bar()
|
||||
E.baz()
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class C : I {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final override /*1*/ /*fake_override*/ val a: kotlin.Int
|
||||
public/*package*/ final var b: kotlin.Int
|
||||
public/*package*/ open fun bar(): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class D : K, I {
|
||||
public constructor D()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final override /*2*/ /*fake_override*/ val a: kotlin.Int
|
||||
public/*package*/ final override /*1*/ /*fake_override*/ var b: kotlin.Int
|
||||
public/*package*/ final var c: kotlin.Int
|
||||
public/*package*/ open override /*1*/ /*fake_override*/ fun bar(): kotlin.Unit
|
||||
public/*package*/ open fun baz(): kotlin.Unit
|
||||
}
|
||||
|
||||
public open class E : D, I {
|
||||
public constructor E()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public/*package*/ final override /*2*/ var a: kotlin.Int
|
||||
public/*package*/ final override /*1*/ /*fake_override*/ var b: kotlin.Int
|
||||
public/*package*/ final override /*1*/ /*fake_override*/ var c: kotlin.Int
|
||||
public/*package*/ open override /*1*/ /*fake_override*/ fun bar(): kotlin.Unit
|
||||
public/*package*/ open override /*1*/ /*fake_override*/ fun baz(): kotlin.Unit
|
||||
}
|
||||
|
||||
public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final val a: kotlin.Int = 1
|
||||
}
|
||||
|
||||
public open class K : C, I {
|
||||
public constructor K()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// FILE: I.java
|
||||
|
||||
public interface I {
|
||||
int a = 1;
|
||||
static void foo() {}
|
||||
}
|
||||
|
||||
// FILE: C.java
|
||||
|
||||
public class C implements I {
|
||||
static int b = 1;
|
||||
static void bar() {}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
class K : C()
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
I.a
|
||||
I.foo()
|
||||
|
||||
C.a
|
||||
C.b
|
||||
C.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
C.bar()
|
||||
|
||||
K.<!UNRESOLVED_REFERENCE!>a<!>
|
||||
K.<!UNRESOLVED_REFERENCE!>b<!>
|
||||
K.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
K.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||
|
||||
public open class C : I {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final override /*1*/ /*fake_override*/ val a: kotlin.Int
|
||||
public/*package*/ final var b: kotlin.Int
|
||||
public/*package*/ open fun bar(): kotlin.Unit
|
||||
}
|
||||
|
||||
public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public const final val a: kotlin.Int = 1
|
||||
public open fun foo(): kotlin.Unit
|
||||
}
|
||||
|
||||
public final class K : C {
|
||||
public constructor K()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+5
@@ -21,4 +21,9 @@ public fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>!
|
||||
public open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> toArray(/*0*/ p0: kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>!
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val MAX_ARRAY_SIZE: kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> finishToArray(/*0*/ p0: kotlin.Array<(out) T!>!, /*1*/ p1: kotlin.(Mutable)Iterator<*>!): kotlin.Array<(out) T!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun hugeCapacity(/*0*/ p0: kotlin.Int): kotlin.Int
|
||||
}
|
||||
|
||||
compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/customClassMutableList.txt
Vendored
+5
@@ -35,4 +35,9 @@ public fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>!
|
||||
public open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> toArray(/*0*/ p0: kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>!
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val MAX_ARRAY_SIZE: kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> finishToArray(/*0*/ p0: kotlin.Array<(out) T!>!, /*1*/ p1: kotlin.(Mutable)Iterator<*>!): kotlin.Array<(out) T!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun hugeCapacity(/*0*/ p0: kotlin.Int): kotlin.Int
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -35,6 +35,11 @@ public val y: B<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>!
|
||||
public open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> toArray(/*0*/ p0: kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>!
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val MAX_ARRAY_SIZE: kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> finishToArray(/*0*/ p0: kotlin.Array<(out) T!>!, /*1*/ p1: kotlin.(Mutable)Iterator<*>!): kotlin.Array<(out) T!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun hugeCapacity(/*0*/ p0: kotlin.Int): kotlin.Int
|
||||
}
|
||||
|
||||
@kotlin.jvm.PurelyImplements(value = "[INVALID]") public open class B</*0*/ T : kotlin.Any!> : java.util.AbstractList<T!> {
|
||||
@@ -69,4 +74,9 @@ public val y: B<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>!
|
||||
public open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> toArray(/*0*/ p0: kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>!
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val MAX_ARRAY_SIZE: kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> finishToArray(/*0*/ p0: kotlin.Array<(out) T!>!, /*1*/ p1: kotlin.(Mutable)Iterator<*>!): kotlin.Array<(out) T!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun hugeCapacity(/*0*/ p0: kotlin.Int): kotlin.Int
|
||||
}
|
||||
|
||||
+5
@@ -35,4 +35,9 @@ public fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>!
|
||||
public open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> toArray(/*0*/ p0: kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>!
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val MAX_ARRAY_SIZE: kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> finishToArray(/*0*/ p0: kotlin.Array<(out) T!>!, /*1*/ p1: kotlin.(Mutable)Iterator<*>!): kotlin.Array<(out) T!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun hugeCapacity(/*0*/ p0: kotlin.Int): kotlin.Int
|
||||
}
|
||||
|
||||
@@ -32,4 +32,20 @@ public abstract class ClassDoesNotOverrideMethod : java.util.Date {
|
||||
@kotlin.Deprecated(message = "Deprecated in Java") public open override /*1*/ /*fake_override*/ fun toGMTString(): kotlin.String!
|
||||
@kotlin.Deprecated(message = "Deprecated in Java") public open override /*1*/ /*fake_override*/ fun toLocaleString(): kotlin.String!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun writeObject(/*0*/ p0: java.io.ObjectOutputStream!): kotlin.Unit
|
||||
|
||||
// Static members
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var defaultCenturyStart: kotlin.Int
|
||||
invisible_fake final override /*1*/ /*fake_override*/ val gcal: sun.util.calendar.BaseCalendar!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var jcal: sun.util.calendar.BaseCalendar!
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val serialVersionUID: kotlin.Long
|
||||
invisible_fake final override /*1*/ /*fake_override*/ val ttb: kotlin.IntArray!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ val wtb: kotlin.Array<(out) kotlin.String!>!
|
||||
@kotlin.Deprecated(value = "Deprecated in Java") public open override /*1*/ /*fake_override*/ fun UTC(/*0*/ p0: kotlin.Int, /*1*/ p1: kotlin.Int, /*2*/ p2: kotlin.Int, /*3*/ p3: kotlin.Int, /*4*/ p4: kotlin.Int, /*5*/ p5: kotlin.Int): kotlin.Long
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun convertToAbbr(/*0*/ p0: java.lang.StringBuilder!, /*1*/ p1: kotlin.String!): java.lang.StringBuilder!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun getCalendarSystem(/*0*/ p0: kotlin.Int): sun.util.calendar.BaseCalendar!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun getCalendarSystem(/*0*/ p0: kotlin.Long): sun.util.calendar.BaseCalendar!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun getCalendarSystem(/*0*/ p0: sun.util.calendar.BaseCalendar.Date!): sun.util.calendar.BaseCalendar!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun getJulianCalendar(): sun.util.calendar.BaseCalendar!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun getMillisOf(/*0*/ p0: java.util.Date!): kotlin.Long
|
||||
@kotlin.Deprecated(value = "Deprecated in Java") public open override /*1*/ /*fake_override*/ fun parse(/*0*/ p0: kotlin.String!): kotlin.Long
|
||||
}
|
||||
|
||||
@@ -29,4 +29,9 @@ public open class ModalityOfFakeOverrides : java.util.AbstractList<kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.MutableList<kotlin.String!>
|
||||
public open override /*1*/ /*fake_override*/ fun toArray(): kotlin.Array<(out) kotlin.Any!>!
|
||||
public open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> toArray(/*0*/ p0: kotlin.Array<(out) T!>!): kotlin.Array<(out) T!>!
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val MAX_ARRAY_SIZE: kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun </*0*/ T : kotlin.Any!> finishToArray(/*0*/ p0: kotlin.Array<(out) T!>!, /*1*/ p1: kotlin.(Mutable)Iterator<*>!): kotlin.Array<(out) T!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun hugeCapacity(/*0*/ p0: kotlin.Int): kotlin.Int
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test;
|
||||
|
||||
class Parent {
|
||||
public static int a = 1;
|
||||
public static int b = 2;
|
||||
public static void foo() {}
|
||||
public static void baz() {}
|
||||
}
|
||||
|
||||
class Child extends Parent {
|
||||
public static String b = "3";
|
||||
public static int c = 4;
|
||||
public static void foo(int i) {}
|
||||
public static void bar() {}
|
||||
public static void bar(int i) {}
|
||||
public static void baz() {}
|
||||
public static void baz(int i) {}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package test
|
||||
|
||||
public/*package*/ open class Child : test.Parent {
|
||||
public/*package*/ constructor Child()
|
||||
|
||||
// Static members
|
||||
public final override /*1*/ /*fake_override*/ var a: kotlin.Int
|
||||
public final override /*1*/ var b: kotlin.String
|
||||
public final var c: kotlin.Int
|
||||
public open fun bar(): kotlin.Unit
|
||||
public open fun bar(/*0*/ p0: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ fun baz(): kotlin.Unit
|
||||
public open fun baz(/*0*/ p0: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit
|
||||
public open fun foo(/*0*/ p0: kotlin.Int): kotlin.Unit
|
||||
}
|
||||
|
||||
public/*package*/ open class Parent {
|
||||
public/*package*/ constructor Parent()
|
||||
|
||||
// Static members
|
||||
public final var a: kotlin.Int
|
||||
public final var b: kotlin.Int
|
||||
public open fun baz(): kotlin.Unit
|
||||
public open fun foo(): kotlin.Unit
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test;
|
||||
|
||||
interface Parent1 {
|
||||
public static int a = 1;
|
||||
public static int b = 2;
|
||||
}
|
||||
|
||||
interface Parent2 {
|
||||
public static int d = 1;
|
||||
public static int e = 2;
|
||||
}
|
||||
|
||||
class Child implements Parent1, Parent2 {
|
||||
public static String b = "3";
|
||||
public static int c = 4;
|
||||
public static String d = "4";
|
||||
public static void bar() {}
|
||||
public static void baz() {}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package test
|
||||
|
||||
public/*package*/ open class Child : test.Parent1, test.Parent2 {
|
||||
public/*package*/ constructor Child()
|
||||
|
||||
// Static members
|
||||
public const final override /*1*/ /*fake_override*/ val a: kotlin.Int
|
||||
public final override /*1*/ var b: kotlin.String
|
||||
public final var c: kotlin.Int
|
||||
public final override /*1*/ var d: kotlin.String
|
||||
public const final override /*1*/ /*fake_override*/ val e: kotlin.Int
|
||||
public open fun bar(): kotlin.Unit
|
||||
public open fun baz(): kotlin.Unit
|
||||
}
|
||||
|
||||
public/*package*/ interface Parent1 {
|
||||
|
||||
// Static members
|
||||
public const final val a: kotlin.Int = 1
|
||||
public const final val b: kotlin.Int = 2
|
||||
}
|
||||
|
||||
public/*package*/ interface Parent2 {
|
||||
|
||||
// Static members
|
||||
public const final val d: kotlin.Int = 1
|
||||
public const final val e: kotlin.Int = 2
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
interface Parent1 {
|
||||
public static int a = 1;
|
||||
public static int b = 2;
|
||||
}
|
||||
|
||||
interface Parent2 {
|
||||
public static int d = 1;
|
||||
public static int e = 2;
|
||||
}
|
||||
|
||||
enum StaticMembersInEnum implements Parent1, Parent2 {
|
||||
ENTRY;
|
||||
|
||||
public static int b = 3;
|
||||
public static int c = 4;
|
||||
public static int d = 4;
|
||||
|
||||
public static void foo() { }
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package test
|
||||
|
||||
public/*package*/ interface Parent1 {
|
||||
|
||||
// Static members
|
||||
public const final val a: kotlin.Int = 1
|
||||
public const final val b: kotlin.Int = 2
|
||||
}
|
||||
|
||||
public/*package*/ interface Parent2 {
|
||||
|
||||
// Static members
|
||||
public const final val d: kotlin.Int = 1
|
||||
public const final val e: kotlin.Int = 2
|
||||
}
|
||||
|
||||
public/*package*/ final enum class StaticMembersInEnum : kotlin.Enum<test.StaticMembersInEnum!>, test.Parent1, test.Parent2 {
|
||||
enum entry ENTRY
|
||||
|
||||
private constructor StaticMembersInEnum()
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.StaticMembersInEnum!): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun name(): kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int
|
||||
|
||||
// Static members
|
||||
public const final override /*1*/ /*fake_override*/ val a: kotlin.Int
|
||||
public final override /*1*/ var b: kotlin.Int
|
||||
public final var c: kotlin.Int
|
||||
public final override /*1*/ var d: kotlin.Int
|
||||
public const final override /*1*/ /*fake_override*/ val e: kotlin.Int
|
||||
public open fun foo(): kotlin.Unit
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.StaticMembersInEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<test.StaticMembersInEnum>
|
||||
}
|
||||
@@ -12899,6 +12899,48 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/VisibilityInheritModifier.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/scopes/inheritance")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Inheritance extends AbstractJetDiagnosticsTest {
|
||||
public void testAllFilesPresentInInheritance() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/scopes/inheritance"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/scopes/inheritance/statics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Statics extends AbstractJetDiagnosticsTest {
|
||||
public void testAllFilesPresentInStatics() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/scopes/inheritance/statics"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("hidePrivateByPublic.kt")
|
||||
public void testHidePrivateByPublic() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/inheritance/statics/hidePrivateByPublic.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("jjkj.kt")
|
||||
public void testJjkj() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kjk.kt")
|
||||
public void testKjk() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("oneInterfaceManyTimes.kt")
|
||||
public void testOneInterfaceManyTimes() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/sealed")
|
||||
|
||||
+28
@@ -512,4 +512,32 @@ public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodege
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/boxWithJava/statics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Statics extends AbstractBlackBoxCodegenTest {
|
||||
public void testAllFilesPresentInStatics() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithJava/statics"), Pattern.compile("^([^\\.]+)$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("fields")
|
||||
public void testFields() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/statics/fields/");
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("functions")
|
||||
public void testFunctions() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/statics/functions/");
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("hidePrivateByPublic")
|
||||
public void testHidePrivateByPublic() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithJava/statics/hidePrivateByPublic/");
|
||||
doTestWithJava(fileName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1848,11 +1848,29 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
doTestCompiledJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersFromParentClass.java")
|
||||
public void testStaticMembersFromParentClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersFromParentClass.java");
|
||||
doTestCompiledJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersFromParentInterface.java")
|
||||
public void testStaticMembersFromParentInterface() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersFromParentInterface.java");
|
||||
doTestCompiledJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersInEnum.java")
|
||||
public void testStaticMembersInEnum() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersInEnum.java");
|
||||
doTestCompiledJava(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersInEnumFromParents.java")
|
||||
public void testStaticMembersInEnumFromParents() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersInEnumFromParents.java");
|
||||
doTestCompiledJava(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/compiledJava/vararg")
|
||||
|
||||
+18
@@ -4203,11 +4203,29 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersFromParentClass.java")
|
||||
public void testStaticMembersFromParentClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersFromParentClass.java");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersFromParentInterface.java")
|
||||
public void testStaticMembersFromParentInterface() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersFromParentInterface.java");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersInEnum.java")
|
||||
public void testStaticMembersInEnum() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersInEnum.java");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StaticMembersInEnumFromParents.java")
|
||||
public void testStaticMembersInEnumFromParents() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersInEnumFromParents.java");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/compiledJava/vararg")
|
||||
|
||||
+40
-1
@@ -16,8 +16,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.load.java.lazy.descriptors
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.load.java.components.DescriptorResolverUtils
|
||||
import org.jetbrains.kotlin.load.java.lazy.LazyJavaResolverContext
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaClass
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
@@ -25,8 +30,9 @@ import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.DescriptorFactory.createEnumValueOfMethod
|
||||
import org.jetbrains.kotlin.resolve.DescriptorFactory.createEnumValuesMethod
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny
|
||||
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.types.JetType
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
|
||||
public class LazyJavaStaticClassScope(
|
||||
@@ -66,6 +72,9 @@ public class LazyJavaStaticClassScope(
|
||||
val nestedClassesScope = getContainingDeclaration().getUnsubstitutedInnerClassesScope()
|
||||
result.addIfNotNull(c.components.samConversionResolver.resolveSamConstructor(name, nestedClassesScope))
|
||||
|
||||
val functionsFromSupertypes = getStaticFunctionsFromJavaSuperClasses(name, getContainingDeclaration())
|
||||
result.addAll(DescriptorResolverUtils.resolveOverrides(name, functionsFromSupertypes, result, getContainingDeclaration(), c.components.errorReporter))
|
||||
|
||||
if (jClass.isEnum()) {
|
||||
when (name) {
|
||||
DescriptorUtils.ENUM_VALUE_OF -> result.add(createEnumValueOfMethod(getContainingDeclaration()))
|
||||
@@ -74,5 +83,35 @@ public class LazyJavaStaticClassScope(
|
||||
}
|
||||
}
|
||||
|
||||
override fun computeNonDeclaredProperties(name: Name, result: MutableCollection<PropertyDescriptor>) {
|
||||
val propertiesFromSupertypes = getStaticPropertiesFromJavaSupertypes(name, getContainingDeclaration())
|
||||
result.addAll(DescriptorResolverUtils.resolveOverrides(name, propertiesFromSupertypes, result, getContainingDeclaration(), c.components.errorReporter))
|
||||
}
|
||||
|
||||
override fun getContainingDeclaration() = super.getContainingDeclaration() as LazyJavaClassDescriptor
|
||||
|
||||
private fun getStaticFunctionsFromJavaSuperClasses(name: Name, descriptor: ClassDescriptor): Set<SimpleFunctionDescriptor> {
|
||||
val superClassDescriptor = descriptor.getSuperClassNotAny() ?: return emptySet()
|
||||
|
||||
val staticScope = superClassDescriptor.staticScope
|
||||
|
||||
if (staticScope !is LazyJavaStaticClassScope) return getStaticFunctionsFromJavaSuperClasses(name, superClassDescriptor)
|
||||
|
||||
return staticScope.getFunctions(name, NoLookupLocation.WHEN_GET_SUPER_MEMBERS).map { it as SimpleFunctionDescriptor }.toSet()
|
||||
}
|
||||
|
||||
private fun getStaticPropertiesFromJavaSupertypes(name: Name, descriptor: ClassDescriptor): Set<PropertyDescriptor> {
|
||||
|
||||
fun getStaticProperties(supertype: JetType): Iterable<PropertyDescriptor> {
|
||||
val superTypeDescriptor = supertype.constructor.declarationDescriptor as? ClassDescriptor ?: return emptyList()
|
||||
|
||||
val staticScope = superTypeDescriptor.staticScope
|
||||
|
||||
if (staticScope !is LazyJavaStaticClassScope) return getStaticPropertiesFromJavaSupertypes(name, superTypeDescriptor)
|
||||
|
||||
return staticScope.getProperties(name, NoLookupLocation.WHEN_GET_SUPER_MEMBERS).map { it as PropertyDescriptor }
|
||||
}
|
||||
|
||||
return descriptor.typeConstructor.supertypes.flatMap(::getStaticProperties).toSet()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user