useful asserts in codegen

This commit is contained in:
Stepan Koltsov
2012-01-18 12:10:37 +04:00
parent 2d36f30d77
commit cfecf50698
@@ -1097,6 +1097,11 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
if (propertyDescriptor.getGetter() == null) {
getter = null;
}
if (getter == null && propertyDescriptor.getReceiverParameter().exists()) {
throw new IllegalStateException();
}
}
//noinspection ConstantConditions
if (isInsideClass && (propertyDescriptor.getSetter() == null || propertyDescriptor.getSetter().isDefault())) {
@@ -1109,6 +1114,10 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
if (propertyDescriptor.getSetter() == null) {
setter = null;
}
if (setter == null && propertyDescriptor.isVar() && propertyDescriptor.getReceiverParameter().exists()) {
throw new IllegalStateException();
}
}
}