Kapt: never generate enums as final
Behavior differs between JVM and JVM_IR backends here because in JVM, the class descriptor comes from the frontend, and its modality for enum is never final. For JVM IR, the class descriptor is based on IrClass, whose modality is sometimes final for enum, presumably because it's easier for backends (see `ClassGenerator.getEffectiveModality`). #KT-49682
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
enum class Color {
|
||||
BLACK, `WHI-TE`
|
||||
}
|
||||
@@ -7,5 +5,5 @@ enum class Color {
|
||||
@Anno(Color.`WHI-TE`)
|
||||
annotation class Anno(val color: Color)
|
||||
|
||||
// EXPECTED_ERROR(kotlin:7:1) an enum annotation value must be an enum constant
|
||||
// EXPECTED_ERROR(kotlin:5:1) an enum annotation value must be an enum constant
|
||||
// EXPECTED_ERROR(other:-1:-1) 'WHI-TE' is an invalid Java enum value name
|
||||
|
||||
Reference in New Issue
Block a user