generate pseudocode for property accessor only if the property is local
otherwise check it independently like a function
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user