FIR: Refine visibility check for class members
This commit is contained in:
committed by
TeamCityServer
parent
d702365632
commit
fba44759c0
+20
@@ -0,0 +1,20 @@
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_TXT
|
||||
// FILE: test/JavaBase.java
|
||||
package test;
|
||||
|
||||
abstract /* package-private */ class JavaBase {
|
||||
public void foo() {}
|
||||
}
|
||||
|
||||
// FILE: test/JavaBase2.java
|
||||
package test;
|
||||
public class JavaBase2 extends JavaBase {}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
import test.*
|
||||
|
||||
class KotlinClass : JavaBase2() {
|
||||
override fun foo() {}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// SKIP_TXT
|
||||
open class BaseWithPrivate {
|
||||
private companion object {
|
||||
val X: Int = 1
|
||||
val Y: Int = 1
|
||||
}
|
||||
}
|
||||
|
||||
open class Base {
|
||||
companion object {
|
||||
val X: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun foo() {
|
||||
object : BaseWithPrivate() {
|
||||
fun bar() {
|
||||
X.length
|
||||
<!INVISIBLE_REFERENCE!>Y<!>.hashCode()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// SKIP_TXT
|
||||
open class BaseWithPrivate {
|
||||
private companion object {
|
||||
val X: Int = 1
|
||||
val Y: Int = 1
|
||||
}
|
||||
}
|
||||
|
||||
open class Base {
|
||||
companion object {
|
||||
val X: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun foo() {
|
||||
object : BaseWithPrivate() {
|
||||
fun bar() {
|
||||
X.length
|
||||
<!INVISIBLE_MEMBER!>Y<!>.hashCode()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user