FIR: support private-in-file effective visibility
This commit is contained in:
+2
-2
@@ -1,13 +1,13 @@
|
||||
compiler/testData/cli/jvm/firError.kt:5:13: error: x must be initialized before access
|
||||
println(x)
|
||||
^
|
||||
compiler/testData/cli/jvm/firError.kt:10:16: error: public subclass exposes its private supertype 'Private'
|
||||
compiler/testData/cli/jvm/firError.kt:10:16: error: public subclass exposes its private-in-file supertype 'Private'
|
||||
class Public : Private() {
|
||||
^
|
||||
compiler/testData/cli/jvm/firError.kt:11:5: error: property must be initialized or be abstract
|
||||
val x: Private
|
||||
^
|
||||
compiler/testData/cli/jvm/firError.kt:11:9: error: public property exposes its private type 'Private'
|
||||
compiler/testData/cli/jvm/firError.kt:11:9: error: public property exposes its private-in-file type 'Private'
|
||||
val x: Private
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
|
||||
@@ -13,17 +13,17 @@ class Public {
|
||||
private class PrivateInFileClass {
|
||||
private open class NestedPrivate
|
||||
|
||||
fun test1() = NestedPrivate()
|
||||
fun test2(p: NestedPrivate) {}
|
||||
fun NestedPrivate.test3() {}
|
||||
val test4 = NestedPrivate()
|
||||
class Test5 : NestedPrivate()
|
||||
fun <!EXPOSED_FUNCTION_RETURN_TYPE!>test1<!>() = NestedPrivate()
|
||||
fun test2(<!EXPOSED_PARAMETER_TYPE!>p: NestedPrivate<!>) {}
|
||||
fun <!EXPOSED_RECEIVER_TYPE!>NestedPrivate<!>.test3() {}
|
||||
val <!EXPOSED_PROPERTY_TYPE!>test4<!> = NestedPrivate()
|
||||
class Test5 : <!EXPOSED_SUPER_CLASS!>NestedPrivate<!>()
|
||||
}
|
||||
|
||||
private interface PrivateInFile {
|
||||
private class Private
|
||||
|
||||
fun expose() = Private()
|
||||
fun <!EXPOSED_FUNCTION_RETURN_TYPE!>expose<!>() = Private()
|
||||
}
|
||||
|
||||
// Exposes 'PrivateInFile$Private' via 'expose'
|
||||
|
||||
@@ -13,17 +13,17 @@ class Public {
|
||||
private class PrivateInFileClass {
|
||||
private open class NestedPrivate
|
||||
|
||||
fun test1() = NestedPrivate()
|
||||
fun test2(p: NestedPrivate) {}
|
||||
fun NestedPrivate.test3() {}
|
||||
val test4 = NestedPrivate()
|
||||
class Test5 : NestedPrivate()
|
||||
fun <!EXPOSED_FUNCTION_RETURN_TYPE!>test1<!>() = NestedPrivate()
|
||||
fun test2(<!EXPOSED_PARAMETER_TYPE!>p: NestedPrivate<!>) {}
|
||||
fun <!EXPOSED_RECEIVER_TYPE!>NestedPrivate<!>.test3() {}
|
||||
val <!EXPOSED_PROPERTY_TYPE!>test4<!> = NestedPrivate()
|
||||
class Test5 : <!EXPOSED_SUPER_CLASS!>NestedPrivate<!>()
|
||||
}
|
||||
|
||||
private interface PrivateInFile {
|
||||
private class Private
|
||||
|
||||
fun expose() = Private()
|
||||
fun <!EXPOSED_FUNCTION_RETURN_TYPE!>expose<!>() = Private()
|
||||
}
|
||||
|
||||
// Exposes 'PrivateInFile$Private' via 'expose'
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ package a
|
||||
|
||||
import pack1.SomeClass.*
|
||||
|
||||
private class X : <!HIDDEN!>N<!>()
|
||||
private class X : <!EXPOSED_SUPER_CLASS, HIDDEN!>N<!>()
|
||||
|
||||
Reference in New Issue
Block a user