Remove StaticInvocationJudgment
Change-Id: I52da9574e99307bd7afad440100491ac5264f1a0
Reviewed-on: https://dart-review.googlesource.com/c/80602
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 912ee0c..ab45917 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -3068,7 +3068,7 @@
library.checkBoundsInFactoryInvocation(node, typeEnvironment);
return node;
} else {
- StaticInvocation node = new StaticInvocationJudgment(
+ StaticInvocation node = new StaticInvocation(
target, forest.castArguments(arguments),
isConst: isConst)
..fileOffset = charOffset;
diff --git a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
index e2d723f..af744ac 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -1060,21 +1060,18 @@
inferrer.storeInferredType(node, type);
}
- void visitStaticInvocationJudgment(
- StaticInvocationJudgment node, DartType typeContext) {
+ @override
+ void visitStaticInvocation(StaticInvocation node, DartType typeContext) {
FunctionType calleeType = node.target != null
? node.target.function.functionType
: new FunctionType([], const DynamicType());
bool hadExplicitTypeArguments =
- getExplicitTypeArguments(node.argumentJudgments) != null;
+ getExplicitTypeArguments(node.arguments) != null;
var inferenceResult = inferrer.inferInvocation(typeContext, node.fileOffset,
- calleeType, calleeType.returnType, node.argumentJudgments);
- node.inferredType = inferenceResult.type;
- KernelLibraryBuilder inferrerLibrary = inferrer.library;
- if (!hadExplicitTypeArguments &&
- node.target != null &&
- inferrerLibrary is KernelLibraryBuilder) {
- inferrerLibrary.checkBoundsInStaticInvocation(
+ calleeType, calleeType.returnType, node.arguments);
+ inferrer.storeInferredType(node, inferenceResult.type);
+ if (!hadExplicitTypeArguments && node.target != null) {
+ inferrer.library?.checkBoundsInStaticInvocation(
node, inferrer.typeSchemaEnvironment,
inferred: true);
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/inferred_type_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inferred_type_visitor.dart
index d0c813e..5d63fa1 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inferred_type_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inferred_type_visitor.dart
@@ -142,4 +142,10 @@
DartType visitStaticGet(StaticGet node, TypeInferrerImpl inferrer) {
return inferrer.readInferredType(node);
}
+
+ @override
+ DartType visitStaticInvocation(
+ StaticInvocation node, TypeInferrerImpl inferrer) {
+ return inferrer.readInferredType(node);
+ }
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart
index b6c20cc..9d1a203 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart
@@ -115,7 +115,6 @@
ReturnJudgment,
ShadowLargeIntLiteral,
StaticAssignmentJudgment,
- StaticInvocationJudgment,
SuperInitializerJudgment,
SuperMethodInvocationJudgment,
SuperPropertyGetJudgment,
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 97152c3..ead87c5 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -1329,23 +1329,6 @@
}
}
-/// Shadow object for [StaticInvocation].
-class StaticInvocationJudgment extends StaticInvocation
- implements ExpressionJudgment {
- DartType inferredType;
-
- StaticInvocationJudgment(Procedure target, ArgumentsJudgment arguments,
- {bool isConst: false})
- : super(target, arguments, isConst: isConst);
-
- ArgumentsJudgment get argumentJudgments => arguments;
-
- @override
- void acceptInference(InferenceVistor visitor, DartType typeContext) {
- return visitor.visitStaticInvocationJudgment(this, typeContext);
- }
-}
-
/// Concrete shadow object representing a super initializer in kernel form.
class SuperInitializerJudgment extends SuperInitializer
implements InitializerJudgment {