Put enum entries into enum class in JDR
This commit is contained in:
@@ -1642,10 +1642,6 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
||||
}
|
||||
}
|
||||
|
||||
if (descriptor instanceof VariableDescriptorForObject) {
|
||||
return genObjectClassInstance((VariableDescriptorForObject) descriptor);
|
||||
}
|
||||
|
||||
int index = lookupLocalIndex(descriptor);
|
||||
if (index >= 0) {
|
||||
return stackValueForLocal(descriptor, index);
|
||||
@@ -1731,20 +1727,6 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
||||
throw new UnsupportedOperationException("don't know how to generate reference " + descriptor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StackValue genObjectClassInstance(@NotNull VariableDescriptorForObject variableDescriptor) {
|
||||
boolean isEnumEntry = DescriptorUtils.isEnumClassObject(variableDescriptor.getContainingDeclaration());
|
||||
if (isEnumEntry) {
|
||||
ClassDescriptor containing = (ClassDescriptor) variableDescriptor.getContainingDeclaration().getContainingDeclaration();
|
||||
assert containing != null;
|
||||
Type type = typeMapper.mapType(containing);
|
||||
return StackValue.field(type, type, variableDescriptor.getName().asString(), true);
|
||||
}
|
||||
else {
|
||||
return StackValue.singleton(variableDescriptor.getObjectClass(), typeMapper);
|
||||
}
|
||||
}
|
||||
|
||||
private StackValue stackValueForLocal(DeclarationDescriptor descriptor, int index) {
|
||||
if (descriptor instanceof VariableDescriptor) {
|
||||
Type sharedVarType = typeMapper.getSharedVarType(descriptor);
|
||||
|
||||
@@ -279,7 +279,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
if (inner == null || isTopLevelDeclaration(inner)) {
|
||||
break;
|
||||
}
|
||||
if (inner instanceof ClassDescriptor && !isEnumClassObject(inner)) {
|
||||
if (inner instanceof ClassDescriptor) {
|
||||
writeInnerClass((ClassDescriptor) inner);
|
||||
}
|
||||
inner = inner.getContainingDeclaration();
|
||||
|
||||
Reference in New Issue
Block a user