strict checking for internal visibility
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package m1
|
||||
|
||||
public class PublicClassInM1
|
||||
class InternalClassInM1
|
||||
internal class InternalClassInM1
|
||||
private class PrivateClassInM1
|
||||
|
||||
public fun publicFunInM1() {
|
||||
}
|
||||
fun internalFunInM1() {
|
||||
internal fun internalFunInM1() {
|
||||
}
|
||||
private fun privateFunInM1() {
|
||||
}
|
||||
@@ -18,7 +18,7 @@ fun testVisibility() {
|
||||
public open class A internal constructor() {
|
||||
private fun pri() {
|
||||
}
|
||||
fun int() {
|
||||
internal fun int() {
|
||||
}
|
||||
protected fun pro() {
|
||||
}
|
||||
|
||||
@@ -5,22 +5,22 @@ import m1.*
|
||||
fun testVisibility() {
|
||||
PublicClassInM1()
|
||||
|
||||
InternalClassInM1()
|
||||
<error descr="[INVISIBLE_MEMBER] Cannot access 'InternalClassInM1': it is 'internal' in 'm1'">InternalClassInM1</error>()
|
||||
|
||||
<error descr="[INVISIBLE_MEMBER] Cannot access 'PrivateClassInM1': it is 'private' in 'm1'">PrivateClassInM1</error>()
|
||||
|
||||
publicFunInM1()
|
||||
|
||||
internalFunInM1()
|
||||
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalFunInM1': it is 'internal' in 'm1'">internalFunInM1</error>()
|
||||
|
||||
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateFunInM1': it is 'private' in 'm1'">privateFunInM1</error>()
|
||||
}
|
||||
|
||||
public class ClassInM2
|
||||
|
||||
public class B: A() {
|
||||
public class B: <error descr="[INVISIBLE_MEMBER] Cannot access '<init>': it is 'internal' in 'A'">A</error>() {
|
||||
|
||||
fun accessA(<warning>a</warning>: A) {}
|
||||
fun accessA(<warning descr="[UNUSED_PARAMETER] Parameter 'a' is never used">a</warning>: A) {}
|
||||
|
||||
fun f() {
|
||||
<error descr="[INVISIBLE_MEMBER] Cannot access 'pri': it is 'invisible_fake' in 'B'">pri</error>()
|
||||
@@ -29,6 +29,6 @@ public class B: A() {
|
||||
|
||||
pub()
|
||||
|
||||
int()
|
||||
<error descr="[INVISIBLE_MEMBER] Cannot access 'int': it is 'invisible_fake' in 'B'">int</error>()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user