FE 1.0: deprecate resolve to property when enum entry is at same level

See also KT-52802
#KT-49200 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-06-09 13:22:57 +02:00
committed by Space
parent 088f472117
commit d44f180aa9
10 changed files with 128 additions and 26 deletions
@@ -0,0 +1,3 @@
/test.kt:26:9: warning: ambiguous access to property 'first.KtNodeTypes.SOME' is deprecated because similar enum entry 'second.SomeEnum.SOME' is available. Please add explicit named import or use fully qualified name
SOME -> true
^
@@ -1,4 +1,5 @@
// KT-49200
// !RENDER_DIAGNOSTICS_FULL_TEXT
// FILE: first/KtNodeTypes.java
package first;
@@ -1,4 +1,5 @@
// KT-49200
// !RENDER_DIAGNOSTICS_FULL_TEXT
// FILE: first/KtNodeTypes.java
package first;
@@ -22,7 +23,7 @@ import second.SomeEnum.*
fun test(arg: String): Boolean {
return when (arg) {
SOME -> true
<!DEPRECATED_RESOLVE_WITH_AMBIGUOUS_ENUM_ENTRY!>SOME<!> -> true
else -> false
}
}