Deprecate visibility of static members inherited from Java
Now they are not visible by short name through companion objects, just like classifiers in KT-21515 ^KT-25333 In progress
This commit is contained in:
committed by
Dmitry Savvinov
parent
63202fe560
commit
76c651421b
@@ -0,0 +1,4 @@
|
||||
public class Java {
|
||||
public static int field = 42;
|
||||
public static void method() { }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import Java.field;
|
||||
import Java.method;
|
||||
|
||||
open class Base {
|
||||
companion object : Java()
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test() {
|
||||
val x = field;
|
||||
val y = method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import Java.field;
|
||||
import Java.method;
|
||||
|
||||
open class Base {
|
||||
companion object : Java()
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test() {
|
||||
val x = field;
|
||||
val y = method();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// LANGUAGE_VERSION: 1.3
|
||||
// FILE: first.before.kt
|
||||
// "Import" "true"
|
||||
// ERROR: Unresolved reference: foobar
|
||||
import foo.Bar
|
||||
|
||||
open class Base {
|
||||
companion object : Bar() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test() {
|
||||
val x = foobar<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: foo/Bar.java
|
||||
package foo;
|
||||
|
||||
public class Bar {
|
||||
public static final String foobar = "foobar";
|
||||
}
|
||||
|
||||
// FILE: first.after.kt
|
||||
// "Import" "true"
|
||||
// ERROR: Unresolved reference: foobar
|
||||
import foo.Bar
|
||||
import foo.Bar.foobar
|
||||
|
||||
open class Base {
|
||||
companion object : Bar() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test() {
|
||||
val x = foobar<caret>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
public class Java {
|
||||
public static int field = 42;
|
||||
public static void method() { }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
open class Base {
|
||||
companion object : Java()
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test() {
|
||||
val x = <selection>Java.field</selection>;
|
||||
val y = <selection>Java.method()</selection>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
open class Base {
|
||||
companion object : Java()
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test() {
|
||||
val x = Java.field;
|
||||
val y = Java.method();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user