strict checking for internal visibility

This commit is contained in:
Michael Nedzelsky
2015-09-08 05:12:41 +03:00
parent ae36981a0f
commit ea11133142
11 changed files with 53 additions and 51 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import shared.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: test">t
private fun privateInM1() {
}
fun internalInM1() {
internal fun internalInM1() {
}
public fun publicInM1() {
}
@@ -4,7 +4,7 @@ import shared.*
private fun privateInM1Test() {
}
fun internalInM1Test() {
internal fun internalInM1Test() {
}
public fun publicInM1Test() {
}
+2 -2
View File
@@ -4,14 +4,14 @@ import shared.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: test">t
private fun privateInM2() {
}
fun internalInM2() {
internal fun internalInM2() {
}
public fun publicInM2() {
}
fun access() {
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM1': it is 'private' in 'shared'">privateInM1</error>()
internalInM1()
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalInM1': it is 'internal' in 'shared'">internalInM1</error>()
publicInM1()
<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: privateInM1Test">privateInM1Test</error>()
@@ -4,18 +4,18 @@ import shared.*
private fun privateInM2Test() {
}
fun internalInM2Test() {
internal fun internalInM2Test() {
}
public fun publicInM2Test() {
}
fun access() {
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM1': it is 'private' in 'shared'">privateInM1</error>()
internalInM1()
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalInM1': it is 'internal' in 'shared'">internalInM1</error>()
publicInM1()
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM1Test': it is 'private' in 'test'">privateInM1Test</error>()
internalInM1Test()
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalInM1Test': it is 'internal' in 'test'">internalInM1Test</error>()
publicInM1Test()
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM2': it is 'private' in 'shared'">privateInM2</error>()
+1 -1
View File
@@ -4,7 +4,7 @@ import shared.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: test">t
private fun privateInM3() {
}
fun internalInM3() {
internal fun internalInM3() {
}
public fun publicInM3() {
}
@@ -4,26 +4,26 @@ import shared.*
private fun privateInM3Test() {
}
fun internalInM3Test() {
internal fun internalInM3Test() {
}
public fun publicInM3Test() {
}
fun access() {
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM1': it is 'private' in 'shared'">privateInM1</error>()
internalInM1()
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalInM1': it is 'internal' in 'shared'">internalInM1</error>()
publicInM1()
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM1Test': it is 'private' in 'test'">privateInM1Test</error>()
internalInM1Test()
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalInM1Test': it is 'internal' in 'test'">internalInM1Test</error>()
publicInM1Test()
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM2': it is 'private' in 'shared'">privateInM2</error>()
internalInM2()
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalInM2': it is 'internal' in 'shared'">internalInM2</error>()
publicInM2()
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM2Test': it is 'private' in 'test'">privateInM2Test</error>()
internalInM2Test()
<error descr="[INVISIBLE_MEMBER] Cannot access 'internalInM2Test': it is 'internal' in 'test'">internalInM2Test</error>()
publicInM2Test()
<error descr="[INVISIBLE_MEMBER] Cannot access 'privateInM3': it is 'private' in 'shared'">privateInM3</error>()
+3 -3
View File
@@ -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 -5
View File
@@ -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>()
}
}