提交 42a36e0c 编写于 作者: D Dmitry Jemerov

some fixes to bring the test a bit closer to working condition

上级 86536deb
......@@ -69,7 +69,7 @@ public class ClassCodegen {
ClassVisitor v = kind == OwnerKind.IMPLEMENTATION ? factory.forClassImplementation(descriptor) : factory.forClassDelegatingImplementation(descriptor);
v.visit(Opcodes.V1_6,
Opcodes.ACC_PUBLIC,
JetTypeMapper.jvmNameForImplementation(descriptor),
JetTypeMapper.jvmName(descriptor, kind),
null,
superClass,
new String[] {JetTypeMapper.jvmNameForInterface(descriptor)}
......@@ -197,7 +197,7 @@ public class ClassCodegen {
if (specifiers.isEmpty() || !(specifiers.get(0) instanceof JetDelegatorToSuperCall)) {
String superClass = getSuperClass(aClass, kind);
iv.load(0, Type.getType("L" + superClass + ";"));
iv.invokespecial(superClass, "<init>", method.getDescriptor());
iv.invokespecial(superClass, "<init>", /* TODO super constructor descriptor */"()V");
}
int n = 0;
......
......@@ -466,6 +466,7 @@ public class ExpressionCodegen extends JetVisitor {
boolean isStatic = propertyDescriptor.getContainingDeclaration() instanceof NamespaceDescriptor;
String owner = JetTypeMapper.getOwner(propertyDescriptor);
final JetType outType = propertyDescriptor.getOutType();
boolean isInsideClass = propertyDescriptor.getContainingDeclaration() == contextType;
Method getter;
Method setter;
if (directToField) {
......@@ -473,8 +474,8 @@ public class ExpressionCodegen extends JetVisitor {
setter = null;
}
else {
getter = propertyDescriptor.getGetter() == null ? null : typeMapper.mapGetterSignature(propertyDescriptor);
setter = propertyDescriptor.getSetter() == null ? null : typeMapper.mapSetterSignature(propertyDescriptor);
getter = isInsideClass && propertyDescriptor.getGetter() == null ? null : typeMapper.mapGetterSignature(propertyDescriptor);
setter = isInsideClass && propertyDescriptor.getSetter() == null ? null : typeMapper.mapSetterSignature(propertyDescriptor);
}
return StackValue.property(propertyDescriptor.getName(), owner, typeMapper.mapType(outType), isStatic, getter, setter);
}
......
......@@ -203,7 +203,11 @@ public class JetTypeMapper {
}
public Method mapSetterSignature(PropertyDescriptor descriptor) {
Type paramType = mapType(descriptor.getInType());
final JetType inType = descriptor.getInType();
if (inType == null) {
return null;
}
Type paramType = mapType(inType);
return new Method(PropertyCodegen.setterName(descriptor.getName()), Type.VOID_TYPE, new Type[] { paramType });
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册