Properly handle the case of backing field access qualified with 'this' reference

This commit is contained in:
Andrey Breslav
2013-12-04 16:10:05 +04:00
parent 5b3bc7f839
commit 6df3a3042c
8 changed files with 57 additions and 8 deletions
@@ -373,7 +373,6 @@ public class JetFlowInformationProvider {
private boolean checkBackingField(@NotNull VariableContext cxtx, @NotNull JetElement element) {
VariableDescriptor variableDescriptor = cxtx.variableDescriptor;
boolean[] error = new boolean[1];
if (isCorrectBackingFieldReference((JetElement) element.getParent(), cxtx, error, false)) return false; // this expression has been already checked
if (!isCorrectBackingFieldReference(element, cxtx, error, true)) return false;
if (error[0]) return true;
if (!(variableDescriptor instanceof PropertyDescriptor)) {