test for obsolete KT-1119 & proper final flag for enum class with entries overriding methods/properties
This commit is contained in:
@@ -130,6 +130,13 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
access |= ACC_ANNOTATION;
|
||||
}
|
||||
if (isEnum) {
|
||||
for (JetDeclaration declaration : myClass.getDeclarations()) {
|
||||
if (declaration instanceof JetEnumEntry) {
|
||||
if (state.getInjector().getClosureAnnotator().enumEntryNeedSubclass((JetEnumEntry) declaration)) {
|
||||
access &= ~ACC_FINAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
access |= ACC_ENUM;
|
||||
}
|
||||
v.defineClass(myClass, V1_6,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
enum class Direction() {
|
||||
NORTH {
|
||||
val someSpecialValue = "OK"
|
||||
}
|
||||
|
||||
SOUTH
|
||||
WEST
|
||||
EAST
|
||||
}
|
||||
|
||||
fun box() = Direction.NORTH.someSpecialValue
|
||||
@@ -131,4 +131,8 @@ public class EnumGenTest extends CodegenTestCase {
|
||||
catch (ClassNotFoundException e) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testKt1119() {
|
||||
blackBoxFile("regressions/kt1119.kt");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user