overriddenDescriptors is empty for java static property and function declarations

Fake overrides are still created for java static with non-empty overriddenDescriptors

Add tests for inheriting visibility for java static members
Add test: check that java static declarations that shadow deprecated declarations should not be deprecated
Add test for corner case where "overriding" java static constant led to incorrect type in inheritor

Fix test data for existing tests
This commit is contained in:
Pavel V. Talanov
2016-02-08 19:04:18 +03:00
parent 7e78e8d8ab
commit 7d98103c0c
30 changed files with 249 additions and 39 deletions
@@ -0,0 +1,53 @@
// FILE: A.java
public class A {
@Deprecated
public static final String D = "d";
@Deprecated
public void f() {
return text;
}
@Deprecated
public static void bar() {
}
}
// FILE: B.java
public class B extends A {
public static final String D = "d";
@Override
public void f() {
return text;
}
public static void bar() {
}
}
// FILE: C.java
public class C extends A {
}
// FILE: use.kt
fun use(a: A, b: B, c: C) {
a.<!DEPRECATION!>f<!>()
b.<!DEPRECATION!>f<!>()
c.<!DEPRECATION!>f<!>()
A.<!DEPRECATION!>D<!>
B.D
C.<!DEPRECATION!>D<!>
A.<!DEPRECATION!>bar<!>()
B.bar()
C.<!DEPRECATION!>bar<!>()
}
@@ -0,0 +1,39 @@
package
public fun use(/*0*/ a: A, /*1*/ b: B, /*2*/ c: C): kotlin.Unit
public open class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@kotlin.Deprecated(message = "Deprecated in Java") public open fun f(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
// Static members
@kotlin.Deprecated(message = "Deprecated in Java") public const final val D: kotlin.String = "d"
@kotlin.Deprecated(message = "Deprecated in Java") public open fun bar(): kotlin.Unit
}
public open class B : A {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@java.lang.Override() public open override /*1*/ fun f(): kotlin.Unit
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 D: kotlin.String = "d"
public open fun bar(): kotlin.Unit
}
public open class C : A {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@kotlin.Deprecated(message = "Deprecated in Java") public open override /*1*/ /*fake_override*/ fun f(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
// Static members
@kotlin.Deprecated(message = "Deprecated in Java") public const final override /*1*/ /*fake_override*/ val D: kotlin.String
@kotlin.Deprecated(message = "Deprecated in Java") public open override /*1*/ /*fake_override*/ fun bar(): kotlin.Unit
}