Files
kotlin-fork/compiler/testData/diagnostics/tests/scopes/VisibilityInClassObject.kt
T
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00

34 lines
825 B
Kotlin
Vendored

fun devNull(<!UNUSED_PARAMETER!>obj<!>: Any?) {}
open class A {
companion object {
val internal_val = 1
public val public_val: Int = 2
private val private_val = 3
protected val protected_val: Int = 5
}
fun fromClass() {
devNull(internal_val)
devNull(public_val)
devNull(private_val)
devNull(protected_val)
}
}
fun fromOutside() {
devNull(A.internal_val)
devNull(A.public_val)
devNull(A.<!INVISIBLE_MEMBER!>private_val<!>)
devNull(A.<!INVISIBLE_MEMBER!>protected_val<!>)
}
class B: A() {
fun fromSubclass() {
devNull(A.internal_val)
devNull(A.public_val)
devNull(A.<!INVISIBLE_MEMBER!>private_val<!>)
devNull(A.<!SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC!>protected_val<!>)
}
}