initialization of 'hasInferredReturnType' property
moved to its getter
This commit is contained in:
+6
-3
@@ -87,7 +87,7 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
|||||||
private ResolutionStatus status = UNKNOWN_STATUS;
|
private ResolutionStatus status = UNKNOWN_STATUS;
|
||||||
private boolean hasUnknownTypeParameters = false;
|
private boolean hasUnknownTypeParameters = false;
|
||||||
private ConstraintSystem constraintSystem = null;
|
private ConstraintSystem constraintSystem = null;
|
||||||
private boolean hasInferredReturnType;
|
private Boolean hasInferredReturnType = null;
|
||||||
private boolean completed = false;
|
private boolean completed = false;
|
||||||
|
|
||||||
private ResolvedCallImpl(
|
private ResolvedCallImpl(
|
||||||
@@ -289,14 +289,17 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasInferredReturnType() {
|
public boolean hasInferredReturnType() {
|
||||||
if (!completed) throw new IllegalStateException("Inferred return type is not known before resolution completion.");
|
if (!completed) {
|
||||||
|
hasInferredReturnType = constraintSystem == null || CallResolverUtil.hasInferredReturnType(candidateDescriptor, constraintSystem);
|
||||||
|
}
|
||||||
|
assert hasInferredReturnType != null : "The property 'hasInferredReturnType' was not set when the call was completed.";
|
||||||
return hasInferredReturnType;
|
return hasInferredReturnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void markCallAsCompleted() {
|
public void markCallAsCompleted() {
|
||||||
if (!completed) {
|
if (!completed) {
|
||||||
hasInferredReturnType = CallResolverUtil.hasInferredReturnType(candidateDescriptor, constraintSystem);
|
hasInferredReturnType();
|
||||||
}
|
}
|
||||||
trace = null;
|
trace = null;
|
||||||
constraintSystem = null;
|
constraintSystem = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user