[FIR] Fix reporting of UNINITIALIZED_ENUM_ENTRY in init blocks

^KT-41126 Fixed
This commit is contained in:
Dmitriy Novozhilov
2023-02-07 14:17:10 +02:00
committed by Space Team
parent c596c1ad73
commit a9248569a6
17 changed files with 135 additions and 110 deletions
@@ -1,55 +0,0 @@
// LANGUAGE: +ProhibitQualifiedAccessToUninitializedEnumEntry
// ISSUE: KT-41124
enum class SomeEnum11(var x: Int) {
A(1),
B(2);
init {
A.x = 10 // Error
}
}
enum class SomeEnum12(var x: Int) {
A(1),
B(2);
init {
SomeEnum12.A.x = 10 // Error
}
}
enum class SomeEnum21(var x: Int) {
A(1) {
init {
A.x = 10 // OK
SomeEnum21.A.x = 10 // OK
B.x = 10 // Error
}
},
B(2)
}
enum class SomeEnum22(var x: Int) {
A(1) {
init {
A.x = 10 // OK
SomeEnum22.A.x = 10 // OK
SomeEnum22.B.x = 10 // Migration error
}
},
B(2)
}
enum class SomeEnum3(var x: Int) {
A(1),
B(2) {
init {
A.x = 10 // OK
SomeEnum3.A.x = 10 // OK
B.x = 10 // OK
SomeEnum3.B.x = 10 // OK
}
};
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// LANGUAGE: +ProhibitQualifiedAccessToUninitializedEnumEntry
// ISSUE: KT-41124