[StubIR] Fix generation of enums as constants
This commit is contained in:
committed by
Sergey Bogolepov
parent
c35279a8e6
commit
9ca6b50d47
+9
-2
@@ -432,8 +432,15 @@ internal class EnumStubBuilder(
|
|||||||
|
|
||||||
for (constant in constants) {
|
for (constant in constants) {
|
||||||
val literal = context.tryCreateIntegralStub(enumDef.baseType, constant.value) ?: continue
|
val literal = context.tryCreateIntegralStub(enumDef.baseType, constant.value) ?: continue
|
||||||
val getter = PropertyAccessor.Getter.SimpleGetter(constant = literal)
|
val kind = when (context.generationMode) {
|
||||||
val kind = PropertyStub.Kind.Val(getter)
|
GenerationMode.SOURCE_CODE -> {
|
||||||
|
val getter = PropertyAccessor.Getter.SimpleGetter(constant = literal)
|
||||||
|
PropertyStub.Kind.Val(getter)
|
||||||
|
}
|
||||||
|
GenerationMode.METADATA -> {
|
||||||
|
PropertyStub.Kind.Constant(literal)
|
||||||
|
}
|
||||||
|
}
|
||||||
entries += PropertyStub(
|
entries += PropertyStub(
|
||||||
constant.name,
|
constant.name,
|
||||||
kotlinType.toStubIrType(),
|
kotlinType.toStubIrType(),
|
||||||
|
|||||||
Reference in New Issue
Block a user