Files
kotlin-fork/compiler/testData/diagnostics/tests/deprecated/companionObjectUsage.kt
T
2015-11-18 14:35:53 +03:00

20 lines
539 B
Kotlin
Vendored

class Another {
@Deprecated("Object")
companion object {
fun use() {}
const val USE = 42
}
}
fun first() {
<!DEPRECATION!>Another<!>.use()
Another.<!DEPRECATION!>Companion<!>.<!DEPRECATION!>USE<!> // TODO
<!DEPRECATION!>Another<!>.<!DEPRECATION!>USE<!> // TODO
}
fun useCompanion() {
val <!UNUSED_VARIABLE!>d<!> = <!DEPRECATION!>Another<!>
val <!UNUSED_VARIABLE!>x<!> = Another.<!DEPRECATION!>Companion<!>
Another.<!DEPRECATION!>Companion<!>.use()
<!DEPRECATION!>Another<!>.use()
}