Delete JvmClassName.byClassDescriptor
It only worked correctly by coincidence: mapping from the Kotlin world to the JVM world should always be done through JetTypeMapper
This commit is contained in:
@@ -103,7 +103,7 @@ public class ClosureCodegen extends GenerationStateAware {
|
||||
}
|
||||
else {
|
||||
interfaceFunction = SingleAbstractMethodUtils.getAbstractMethodOfSamInterface(samInterface);
|
||||
superInterfaces = new String[] {JvmClassName.byClassDescriptor(samInterface).getInternalName()};
|
||||
superInterfaces = new String[] { typeMapper.mapType(samInterface).getInternalName() };
|
||||
}
|
||||
|
||||
cv.defineClass(fun,
|
||||
|
||||
@@ -1095,6 +1095,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
|
||||
//This field are always static and final so if it has constant initializer don't do anything in clinit,
|
||||
//field would be initialized via default value in v.newField(...) - see JVM SPEC Ch.4
|
||||
// TODO: test this code
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.FULL && propertyInfo.defaultValue == null) {
|
||||
ExpressionCodegen codegen = createOrGetClInitCodegen();
|
||||
int classObjectIndex = putClassObjectInLocalVar(codegen);
|
||||
@@ -1122,7 +1123,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
ExpressionCodegen codegen = createOrGetClInitCodegen();
|
||||
StackValue property = codegen.intermediateValueForProperty(propertyDescriptor, false, null);
|
||||
property.put(property.type, codegen.v);
|
||||
StackValue.Field field = StackValue.field(property.type, JvmClassName.byClassDescriptor(descriptor),
|
||||
StackValue.Field field = StackValue.field(property.type, JvmClassName.byType(classAsmType),
|
||||
propertyDescriptor.getName().asString(), true);
|
||||
field.store(field.type, codegen.v);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class SamWrapperCodegen extends GenerationStateAware {
|
||||
name.getInternalName(),
|
||||
null,
|
||||
OBJECT_TYPE.getInternalName(),
|
||||
new String[]{JvmClassName.byClassDescriptor(samInterface).getInternalName()}
|
||||
new String[]{ typeMapper.mapType(samInterface).getInternalName() }
|
||||
);
|
||||
cv.visitSource(file.getName(), null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user