diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index 9f8655b0f41..2f6632fe4d3 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -1097,6 +1097,11 @@ public class ExpressionCodegen extends JetVisitor { 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 { if (propertyDescriptor.getSetter() == null) { setter = null; } + + if (setter == null && propertyDescriptor.isVar() && propertyDescriptor.getReceiverParameter().exists()) { + throw new IllegalStateException(); + } } }