Add a warning for a user-defined entries property call

^KT-53153
This commit is contained in:
Mikhail Zarechenskiy
2023-01-03 15:53:21 +01:00
committed by Space Team
parent 695a538529
commit 989fc886e1
24 changed files with 549 additions and 6 deletions
@@ -0,0 +1,27 @@
// !LANGUAGE: -EnumEntries
enum class A {
;
companion object {
val entries = 0
}
}
fun test() {
A.<!DEBUG_INFO_CALL("fqName: A.Companion.entries; typeCall: variable"), DEPRECATED_ACCESS_TO_ENUM_ENTRY_COMPANION_PROPERTY!>entries<!>
A.Companion.<!DEBUG_INFO_CALL("fqName: A.Companion.entries; typeCall: variable")!>entries<!>
with(A) {
<!DEBUG_INFO_CALL("fqName: A.Companion.entries; typeCall: variable")!>entries<!>
this.entries
<!UNRESOLVED_REFERENCE!>values<!>() // to be sure that we don't resolve into synthetic 'values'
}
with(A.Companion) {
<!DEBUG_INFO_CALL("fqName: A.Companion.entries; typeCall: variable")!>entries<!>
}
val aCompanion = A.Companion
aCompanion.<!DEBUG_INFO_CALL("fqName: A.Companion.entries; typeCall: variable")!>entries<!>
}