[FE 1.0] Prohibit access to members of companion of enum from enum entry initializer

^KT-49461 Fixed
^KT-49110
This commit is contained in:
Dmitriy Novozhilov
2021-10-28 15:40:15 +03:00
committed by TeamCityServer
parent 4f0c3c3c0d
commit 58889a2b5c
14 changed files with 422 additions and 6 deletions
@@ -1,7 +1,7 @@
// SKIP_TXT
enum class A(val z: Any) {
Y(<!UNINITIALIZED_VARIABLE!>x<!>);
Y(<!UNINITIALIZED_ENUM_COMPANION_WARNING, UNINITIALIZED_VARIABLE!>x<!>);
companion object {
val x = A.Y.ordinal
@@ -9,7 +9,7 @@ enum class A(val z: Any) {
}
enum class B(val z: Any) {
Y(B.x);
Y(<!UNINITIALIZED_ENUM_COMPANION_WARNING!>B<!>.x);
companion object {
val x = B.Y.ordinal