Fix android build
This commit is contained in:
@@ -1031,7 +1031,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
iv.putstatic(implClass, enumConstant.getName(), "L" + implClass + ";");
|
iv.putstatic(implClass, enumConstant.getName(), "L" + implClass + ";");
|
||||||
iv.astore(TYPE_OBJECT);
|
iv.astore(TYPE_OBJECT);
|
||||||
}
|
}
|
||||||
iv.putstatic(myAsmType.getClassName(), "$VALUES", arrayAsmType.getDescriptor());
|
iv.putstatic(myAsmType.getInternalName(), "$VALUES", arrayAsmType.getDescriptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void generateInitializers(@NotNull ExpressionCodegen codegen, @NotNull InstructionAdapter iv, @NotNull List<JetDeclaration> declarations,
|
public static void generateInitializers(@NotNull ExpressionCodegen codegen, @NotNull InstructionAdapter iv, @NotNull List<JetDeclaration> declarations,
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
enum class Season {
|
||||||
|
WINTER
|
||||||
|
SPRING
|
||||||
|
SUMMER
|
||||||
|
AUTUMN
|
||||||
|
}
|
||||||
|
|
||||||
|
fun foo(): Season = Season.SPRING
|
||||||
|
|
||||||
|
fun box() =
|
||||||
|
if (foo() == Season.SPRING) "OK"
|
||||||
|
else "fail"
|
||||||
@@ -73,6 +73,10 @@ public class EnumGenTest extends CodegenTestCase {
|
|||||||
blackBoxFile("enum/simple.kt");
|
blackBoxFile("enum/simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testSimpleEnumInPackage() throws NoSuchFieldException, IllegalAccessException {
|
||||||
|
blackBoxFile("enum/inPackage.kt");
|
||||||
|
}
|
||||||
|
|
||||||
public void testAsReturnExpression() {
|
public void testAsReturnExpression() {
|
||||||
blackBoxFile("enum/asReturnExpression.kt");
|
blackBoxFile("enum/asReturnExpression.kt");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user