completeAnalysisNeeded() removed
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.jetbrains.kotlin.resolve;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Mutable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.ReadOnly;
|
||||
@@ -63,6 +62,4 @@ public interface BodiesResolveContext extends GlobalContext {
|
||||
|
||||
@NotNull
|
||||
TopDownAnalysisParameters getTopDownAnalysisParameters();
|
||||
|
||||
boolean completeAnalysisNeeded(@NotNull PsiElement element);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,6 @@ public class BodyResolver {
|
||||
@Nullable final ConstructorDescriptor primaryConstructor,
|
||||
@NotNull JetScope scopeForSupertypeResolution,
|
||||
@NotNull final JetScope scopeForMemberResolution) {
|
||||
if (!c.completeAnalysisNeeded(jetClass)) return;
|
||||
final JetScope scopeForConstructor = primaryConstructor == null
|
||||
? null
|
||||
: FunctionDescriptorUtil.getFunctionInnerScope(scopeForSupertypeResolution, primaryConstructor, trace);
|
||||
@@ -316,8 +315,6 @@ public class BodyResolver {
|
||||
@NotNull JetClassInitializer anonymousInitializer,
|
||||
@NotNull ClassDescriptorWithResolutionScopes classDescriptor
|
||||
) {
|
||||
if (!c.completeAnalysisNeeded(anonymousInitializer)) return;
|
||||
|
||||
JetScope scopeForInitializers = classDescriptor.getScopeForInitializerResolution();
|
||||
if (classDescriptor.getUnsubstitutedPrimaryConstructor() != null) {
|
||||
expressionTypingServices.getType(scopeForInitializers, anonymousInitializer.getBody(), NO_EXPECTED_TYPE, c.getOuterDataFlowInfo(), trace);
|
||||
@@ -350,7 +347,7 @@ public class BodyResolver {
|
||||
if (unsubstitutedPrimaryConstructor != null) {
|
||||
WritableScope parameterScope = getPrimaryConstructorParametersScope(classDescriptor.getScopeForClassHeaderResolution(), unsubstitutedPrimaryConstructor);
|
||||
expressionTypingServices.resolveValueParameters(klass.getPrimaryConstructorParameters(), unsubstitutedPrimaryConstructor.getValueParameters(),
|
||||
parameterScope, c.getOuterDataFlowInfo(), trace, c.completeAnalysisNeeded(klass));
|
||||
parameterScope, c.getOuterDataFlowInfo(), trace);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -572,12 +569,8 @@ public class BodyResolver {
|
||||
List<JetParameter> valueParameters = function.getValueParameters();
|
||||
List<ValueParameterDescriptor> valueParameterDescriptors = functionDescriptor.getValueParameters();
|
||||
|
||||
boolean needCompleteAnalysis = c.completeAnalysisNeeded(function);
|
||||
|
||||
expressionTypingServices.resolveValueParameters(valueParameters, valueParameterDescriptors, functionInnerScope,
|
||||
c.getOuterDataFlowInfo(), trace, needCompleteAnalysis);
|
||||
|
||||
if (!needCompleteAnalysis) return;
|
||||
c.getOuterDataFlowInfo(), trace);
|
||||
|
||||
if (function.hasBody()) {
|
||||
expressionTypingServices.checkFunctionReturnType(functionInnerScope, function, functionDescriptor, c.getOuterDataFlowInfo(), null, trace);
|
||||
@@ -593,15 +586,13 @@ public class BodyResolver {
|
||||
@NotNull ConstructorDescriptor constructorDescriptor,
|
||||
@NotNull JetScope declaringScope
|
||||
) {
|
||||
if (!c.completeAnalysisNeeded(klass)) return;
|
||||
|
||||
List<JetParameter> valueParameters = klass.getPrimaryConstructorParameters();
|
||||
List<ValueParameterDescriptor> valueParameterDescriptors = constructorDescriptor.getValueParameters();
|
||||
|
||||
JetScope scope = getPrimaryConstructorParametersScope(declaringScope, constructorDescriptor);
|
||||
|
||||
expressionTypingServices.resolveValueParameters(valueParameters, valueParameterDescriptors, scope,
|
||||
c.getOuterDataFlowInfo(), trace, /* needCompleteAnalysis = */ true);
|
||||
c.getOuterDataFlowInfo(), trace);
|
||||
}
|
||||
|
||||
private void resolveAnnotationArguments(@NotNull JetScope scope, @NotNull JetModifierListOwner owner) {
|
||||
|
||||
@@ -40,17 +40,14 @@ public class ControlFlowAnalyzer {
|
||||
|
||||
public void process(@NotNull BodiesResolveContext c) {
|
||||
for (JetFile file : c.getFiles()) {
|
||||
if (!c.completeAnalysisNeeded(file)) continue;
|
||||
checkDeclarationContainer(c, file);
|
||||
}
|
||||
for (JetClassOrObject aClass : c.getDeclaredClasses().keySet()) {
|
||||
if (!c.completeAnalysisNeeded(aClass)) continue;
|
||||
checkDeclarationContainer(c, aClass);
|
||||
}
|
||||
for (Map.Entry<JetNamedFunction, SimpleFunctionDescriptor> entry : c.getFunctions().entrySet()) {
|
||||
JetNamedFunction function = entry.getKey();
|
||||
SimpleFunctionDescriptor functionDescriptor = entry.getValue();
|
||||
if (!c.completeAnalysisNeeded(function)) continue;
|
||||
JetType expectedReturnType = !function.hasBlockBody() && !function.hasDeclaredReturnType()
|
||||
? NO_EXPECTED_TYPE
|
||||
: functionDescriptor.getReturnType();
|
||||
@@ -58,7 +55,6 @@ public class ControlFlowAnalyzer {
|
||||
}
|
||||
for (Map.Entry<JetProperty, PropertyDescriptor> entry : c.getProperties().entrySet()) {
|
||||
JetProperty property = entry.getKey();
|
||||
if (!c.completeAnalysisNeeded(property)) continue;
|
||||
PropertyDescriptor propertyDescriptor = entry.getValue();
|
||||
checkProperty(c, property, propertyDescriptor);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ public class DeclarationsChecker {
|
||||
for (Map.Entry<JetClassOrObject, ClassDescriptorWithResolutionScopes> entry : classes.entrySet()) {
|
||||
JetClassOrObject classOrObject = entry.getKey();
|
||||
ClassDescriptorWithResolutionScopes classDescriptor = entry.getValue();
|
||||
if (!bodiesResolveContext.completeAnalysisNeeded(classOrObject)) continue;
|
||||
|
||||
checkSupertypesForConsistency(classDescriptor);
|
||||
checkTypesInClassHeader(classOrObject);
|
||||
@@ -93,7 +92,6 @@ public class DeclarationsChecker {
|
||||
JetNamedFunction function = entry.getKey();
|
||||
SimpleFunctionDescriptor functionDescriptor = entry.getValue();
|
||||
|
||||
if (!bodiesResolveContext.completeAnalysisNeeded(function)) continue;
|
||||
checkFunction(function, functionDescriptor);
|
||||
modifiersChecker.checkModifiersForDeclaration(function, functionDescriptor);
|
||||
}
|
||||
@@ -103,7 +101,6 @@ public class DeclarationsChecker {
|
||||
JetProperty property = entry.getKey();
|
||||
PropertyDescriptor propertyDescriptor = entry.getValue();
|
||||
|
||||
if (!bodiesResolveContext.completeAnalysisNeeded(property)) continue;
|
||||
checkProperty(property, propertyDescriptor);
|
||||
modifiersChecker.checkModifiersForDeclaration(property, propertyDescriptor);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ public class FunctionAnalyzerExtension {
|
||||
void process(@NotNull FunctionDescriptor descriptor, @NotNull JetNamedFunction function, @NotNull BindingTrace trace);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private BindingTrace trace;
|
||||
|
||||
@Inject
|
||||
@@ -46,8 +45,6 @@ public class FunctionAnalyzerExtension {
|
||||
JetNamedFunction function = entry.getKey();
|
||||
SimpleFunctionDescriptor functionDescriptor = entry.getValue();
|
||||
|
||||
if (!bodiesResolveContext.completeAnalysisNeeded(function.getContainingFile())) continue;
|
||||
|
||||
List<AnalyzerExtension> extensions = getExtensions(functionDescriptor);
|
||||
for (AnalyzerExtension extension : extensions) {
|
||||
extension.process(functionDescriptor, function, trace);
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Functions;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import kotlin.Function1;
|
||||
import kotlin.KotlinPackage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -86,11 +85,6 @@ public class TopDownAnalysisContext implements BodiesResolveContext {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean completeAnalysisNeeded(@NotNull PsiElement element) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<JetClassOrObject, ClassDescriptorWithResolutionScopes> getDeclaredClasses() {
|
||||
return classes;
|
||||
|
||||
+1
-4
@@ -365,8 +365,7 @@ public class ExpressionTypingServices {
|
||||
@NotNull List<ValueParameterDescriptor> valueParameterDescriptors,
|
||||
@NotNull JetScope declaringScope,
|
||||
@NotNull DataFlowInfo dataFlowInfo,
|
||||
@NotNull BindingTrace trace,
|
||||
boolean needCompleteAnalysis
|
||||
@NotNull BindingTrace trace
|
||||
) {
|
||||
for (int i = 0; i < valueParameters.size(); i++) {
|
||||
ValueParameterDescriptor valueParameterDescriptor = valueParameterDescriptors.get(i);
|
||||
@@ -374,8 +373,6 @@ public class ExpressionTypingServices {
|
||||
|
||||
AnnotationResolver.resolveAnnotationsArguments(jetParameter.getModifierList(), trace);
|
||||
|
||||
if (!needCompleteAnalysis) continue;
|
||||
|
||||
resolveDefaultValue(declaringScope, valueParameterDescriptor, jetParameter, dataFlowInfo, trace);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
|
||||
components.expressionTypingServices.checkFunctionReturnType(functionInnerScope, function, functionDescriptor, context.dataFlowInfo, null, context.trace);
|
||||
|
||||
components.expressionTypingServices.resolveValueParameters(function.getValueParameters(), functionDescriptor.getValueParameters(),
|
||||
scope, context.dataFlowInfo, context.trace, /* needCompleteAnalysis = */ true);
|
||||
scope, context.dataFlowInfo, context.trace);
|
||||
|
||||
ModifiersChecker.create(context.trace, components.additionalCheckerProvider).checkModifiersForLocalDeclaration(function, functionDescriptor);
|
||||
if (!function.hasBody()) {
|
||||
|
||||
@@ -619,10 +619,5 @@ public abstract class ElementResolver {
|
||||
public TopDownAnalysisParameters getTopDownAnalysisParameters() {
|
||||
return topDownAnalysisParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean completeAnalysisNeeded(@NotNull PsiElement element) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user