Files
kotlin-fork/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.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

49 lines
1.5 KiB
Kotlin
Vendored

// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
// FILE: test/Java.java
package test;
public class Java {
public static void method() { }
public static int property = 42;
public static class Classifier { }
public static void syntheticSam(Runnable r) { }
public static int getStaticSyntheticProperty() { return 42; }
public static int setStaticSyntheticProperty(int x) { return 42; }
public int getInstanceSyntheticProperty() { return 42; }
public int setInstanceSyntheticProperty(int x) { return 42; }
}
// FILE: Kotlin.kt
package test
open class Base {
companion object : Java() {
}
}
class Derived : Base() {
fun test(javaStaticInTypePosition: <!DEPRECATED_ACCESS_BY_SHORT_NAME!>Classifier<!>) {
<!DEPRECATED_ACCESS_BY_SHORT_NAME!>method()<!>
<!DEPRECATED_ACCESS_BY_SHORT_NAME!>property<!>
<!DEPRECATED_ACCESS_BY_SHORT_NAME!>Classifier()<!>
<!DEPRECATED_ACCESS_BY_SHORT_NAME!>syntheticSam { }<!>
// Instance members shouldn't be affected, but we check them, just in case
val y = instanceSyntheticProperty
instanceSyntheticProperty = 43
// Note that statics actually aren't converted into synthetic property in Kotlin
val x = <!UNRESOLVED_REFERENCE!>syntheticProperty<!>
<!UNRESOLVED_REFERENCE!>syntheticProperty<!> = 42
}
class JavaStaticInSupertypeList : <!DEPRECATED_ACCESS_BY_SHORT_NAME!>Classifier<!>() {
}
}