Frontend: fixed resolve annotation parameters on properties, accessors, accessor parameters, function parameters when not need complete analysis.
This commit is contained in:
@@ -30,6 +30,7 @@ public class AnalyzeExhaust {
|
||||
return new AnalyzeExhaust(bindingContext, module, null, null);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static AnalyzeExhaust success(@NotNull BindingContext bindingContext,
|
||||
@Nullable BodiesResolveContext bodiesResolveContext,
|
||||
@NotNull ModuleDescriptor module
|
||||
@@ -37,6 +38,7 @@ public class AnalyzeExhaust {
|
||||
return new AnalyzeExhaust(bindingContext, module, bodiesResolveContext, null);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static AnalyzeExhaust error(@NotNull BindingContext bindingContext, @NotNull Throwable error) {
|
||||
return new AnalyzeExhaust(bindingContext, ErrorUtils.getErrorModule(), null, error);
|
||||
}
|
||||
|
||||
@@ -428,7 +428,6 @@ public class BodyResolver {
|
||||
for (Map.Entry<JetClassOrObject, MutableClassDescriptor> entry : context.getClasses().entrySet()) {
|
||||
if (!(entry.getKey() instanceof JetClass)) continue;
|
||||
JetClass jetClass = (JetClass) entry.getKey();
|
||||
if (!context.completeAnalysisNeeded(jetClass)) continue;
|
||||
MutableClassDescriptor classDescriptor = entry.getValue();
|
||||
|
||||
for (JetProperty property : jetClass.getProperties()) {
|
||||
@@ -462,7 +461,6 @@ public class BodyResolver {
|
||||
// Top-level properties & properties of objects
|
||||
for (Map.Entry<JetProperty, PropertyDescriptor> entry : this.context.getProperties().entrySet()) {
|
||||
JetProperty property = entry.getKey();
|
||||
if (!context.completeAnalysisNeeded(property)) continue;
|
||||
if (processed.contains(property)) continue;
|
||||
|
||||
PropertyDescriptor propertyDescriptor = entry.getValue();
|
||||
@@ -611,20 +609,22 @@ public class BodyResolver {
|
||||
@NotNull BindingTrace trace,
|
||||
@NotNull JetDeclarationWithBody function,
|
||||
@NotNull FunctionDescriptor functionDescriptor,
|
||||
@NotNull JetScope declaringScope) {
|
||||
if (!context.completeAnalysisNeeded(function)) return;
|
||||
|
||||
JetExpression bodyExpression = function.getBodyExpression();
|
||||
@NotNull JetScope declaringScope
|
||||
) {
|
||||
JetScope functionInnerScope = FunctionDescriptorUtil.getFunctionInnerScope(declaringScope, functionDescriptor, trace);
|
||||
if (bodyExpression != null) {
|
||||
expressionTypingServices.checkFunctionReturnType(functionInnerScope, function, functionDescriptor, context.getOuterDataFlowInfo(), null, trace);
|
||||
}
|
||||
|
||||
List<JetParameter> valueParameters = function.getValueParameters();
|
||||
List<ValueParameterDescriptor> valueParameterDescriptors = functionDescriptor.getValueParameters();
|
||||
|
||||
expressionTypingServices.resolveValueParameters(valueParameters, valueParameterDescriptors, functionInnerScope, context.getOuterDataFlowInfo(), trace);
|
||||
|
||||
if (!context.completeAnalysisNeeded(function)) return;
|
||||
|
||||
JetExpression bodyExpression = function.getBodyExpression();
|
||||
if (bodyExpression != null) {
|
||||
expressionTypingServices.checkFunctionReturnType(functionInnerScope, function, functionDescriptor, context.getOuterDataFlowInfo(), null, trace);
|
||||
}
|
||||
|
||||
assert functionDescriptor.getReturnType() != null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user