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

^KT-49110
This commit is contained in:
Dmitriy Novozhilov
2021-10-29 14:50:41 +03:00
committed by TeamCityServer
parent 58889a2b5c
commit 877b53201b
13 changed files with 176 additions and 11 deletions
@@ -18,14 +18,14 @@ enum class SomeEnum(val x: Int) {
}
enum class OtherEnum(val x: Int) {
G(extensionFun().length), // UNINITIALIZED_ENUM_COMPANION
H(extensionProp.length),
G(<!UNINITIALIZED_ENUM_COMPANION!>extensionFun<!>().length), // UNINITIALIZED_ENUM_COMPANION
H(<!UNINITIALIZED_ENUM_COMPANION!>extensionProp<!>.length),
I(OtherEnum.extensionFun().length),
J(OtherEnum.extensionProp.length),
I(<!UNINITIALIZED_ENUM_COMPANION!>OtherEnum<!>.extensionFun().length),
J(<!UNINITIALIZED_ENUM_COMPANION!>OtherEnum<!>.extensionProp.length),
K(OtherEnum.Companion.extensionFun().length),
L(OtherEnum.Companion.extensionProp.length);
K(OtherEnum.<!UNINITIALIZED_ENUM_COMPANION!>Companion<!>.extensionFun().length),
L(OtherEnum.<!UNINITIALIZED_ENUM_COMPANION!>Companion<!>.extensionProp.length);
companion object {
val companionProp = "someString"