generate pseudocode for property accessor only if the property is local

otherwise check it independently like a function
This commit is contained in:
Svetlana Isakova
2014-01-23 17:27:08 +04:00
parent 1c4db84d92
commit aa713ef1f6
9 changed files with 123 additions and 64 deletions
@@ -792,8 +792,10 @@ public class JetControlFlowProcessor {
if (delegate != null) {
generateInstructions(delegate, NOT_IN_CONDITION);
}
for (JetPropertyAccessor accessor : property.getAccessors()) {
generateInstructions(accessor, NOT_IN_CONDITION);
if (JetPsiUtil.isLocal(property)) {
for (JetPropertyAccessor accessor : property.getAccessors()) {
generateInstructions(accessor, NOT_IN_CONDITION);
}
}
}
@@ -96,20 +96,14 @@ public class JetFlowInformationProvider {
@NotNull JetType expectedReturnType,
boolean isLocalObject
) {
boolean isPropertyAccessor = function instanceof JetPropertyAccessor;
if (!isPropertyAccessor) {
recordInitializedVariables();
}
recordInitializedVariables();
checkDefiniteReturn(expectedReturnType);
checkLocalFunctions();
if (isLocalObject) return;
if (!isPropertyAccessor) {
// Property accessor is checked through initialization of a class/object or package properties (at 'checkDeclarationContainer')
markUninitializedVariables();
}
markUninitializedVariables();
markUnusedVariables();