Files
kotlin-fork/compiler/testData/diagnostics/tests/privateInFile/visibility.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

55 lines
1.1 KiB
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_VARIABLE
//FILE:file1.kt
package a
private open class A {
fun bar() {}
}
private var x: Int = 10
var xx: Int = 20
private set(<!UNUSED_PARAMETER!>value<!>: Int) {}
private fun foo() {}
private fun bar() {
val y = x
x = 20
xx = 30
}
fun <!EXPOSED_FUNCTION_RETURN_TYPE!>makeA<!>() = A()
private object PO {}
//FILE:file2.kt
package a
fun test() {
val y = makeA()
y.<!INVISIBLE_MEMBER("A; private; file")!>bar<!>()
<!INVISIBLE_MEMBER("foo; private; file")!>foo<!>()
val u : <!INVISIBLE_REFERENCE("A; private; file")!>A<!> = <!INVISIBLE_MEMBER("A; private; file")!>A<!>()
val z = <!INVISIBLE_MEMBER("x; private; file")!>x<!>
<!INVISIBLE_MEMBER("x; private; file")!>x<!> = 30
val po = <!INVISIBLE_MEMBER("PO; private; file")!>PO<!>
val v = xx
<!INVISIBLE_SETTER("xx; private; file")!>xx<!> = 40
}
class B : <!EXPOSED_SUPER_CLASS!><!INVISIBLE_MEMBER("A; private; file"), INVISIBLE_REFERENCE("A; private; file")!>A<!>()<!> {}
class Q {
class W {
fun foo() {
val y = makeA() //assure that 'makeA' is visible
}
}
}