Exposed visibility checking, a set of exposed visibility tests, some test fixes
Effective visibility mechanism introduced. Local is considered as public, java protected as Kotlin protected, java package private as Kotlin private.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
fa32aa2950
commit
0cc861f00b
@@ -0,0 +1,25 @@
|
||||
internal open class My
|
||||
|
||||
// valid, internal from internal
|
||||
internal open class Your: My() {
|
||||
// valid, effectively internal
|
||||
fun foo() = My()
|
||||
}
|
||||
|
||||
// error, public from internal
|
||||
open class His: <!EXPOSED_SUPER_CLASS!>Your()<!> {
|
||||
protected open class Nested
|
||||
// error, public from internal
|
||||
<!EXPOSED_PROPERTY_TYPE!>val x = My()<!>
|
||||
// valid, private from internal
|
||||
private fun bar() = My()
|
||||
// valid, internal from internal
|
||||
internal var y: My? = null
|
||||
// error, protected from internal
|
||||
protected fun <!EXPOSED_FUNCTION_RETURN_TYPE!>baz<!>() = Your()
|
||||
}
|
||||
|
||||
internal class Their: His() {
|
||||
// error, effectively internal from protected
|
||||
class InnerDerived: <!EXPOSED_SUPER_CLASS!>His.Nested()<!>
|
||||
}
|
||||
Reference in New Issue
Block a user