From eea08cf4e1ddc01832bfec6ca059eb15d05b58dc Mon Sep 17 00:00:00 2001 From: svtk Date: Fri, 1 Nov 2013 13:17:09 +0400 Subject: [PATCH] initialization of 'hasInferredReturnType' property moved to its getter --- .../jet/lang/resolve/calls/model/ResolvedCallImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java index e0e4661c674..f69c1617fdb 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java @@ -87,7 +87,7 @@ public class ResolvedCallImpl implements ResolvedC private ResolutionStatus status = UNKNOWN_STATUS; private boolean hasUnknownTypeParameters = false; private ConstraintSystem constraintSystem = null; - private boolean hasInferredReturnType; + private Boolean hasInferredReturnType = null; private boolean completed = false; private ResolvedCallImpl( @@ -289,14 +289,17 @@ public class ResolvedCallImpl implements ResolvedC } 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; } @Override public void markCallAsCompleted() { if (!completed) { - hasInferredReturnType = CallResolverUtil.hasInferredReturnType(candidateDescriptor, constraintSystem); + hasInferredReturnType(); } trace = null; constraintSystem = null;