Remove CheckLibraryIsLoadedJudgment
Change-Id: I21d96c30ebf68371450cfa73d905fec8d48d9616
Reviewed-on: https://dart-review.googlesource.com/c/80663
Reviewed-by: Kevin Millikin <kmillikin@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/fangorn.dart b/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
index dccc2b1..dc3d66a 100644
--- a/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
@@ -9,13 +9,13 @@
import 'package:kernel/ast.dart'
show
Arguments,
- Throw,
AsExpression,
AssertInitializer,
AwaitExpression,
Block,
BoolLiteral,
Catch,
+ CheckLibraryIsLoaded,
ConditionalExpression,
DartType,
EmptyStatement,
@@ -38,6 +38,7 @@
StringConcatenation,
StringLiteral,
ThisExpression,
+ Throw,
TreeNode,
VariableDeclaration,
setParents;
@@ -81,7 +82,6 @@
BlockJudgment,
BreakJudgment,
CatchJudgment,
- CheckLibraryIsLoadedJudgment,
ContinueJudgment,
DoJudgment,
DoubleJudgment,
@@ -250,7 +250,7 @@
@override
Expression checkLibraryIsLoaded(LibraryDependency dependency) {
- return new CheckLibraryIsLoadedJudgment(dependency);
+ return new CheckLibraryIsLoaded(dependency);
}
@override
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 e8cce27..dd8209e 100644
--- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -1408,9 +1408,7 @@
return null;
}
- void visitCheckLibraryIsLoadedJudgment(
- CheckLibraryIsLoadedJudgment node, DartType typeContext) {
- node.inferredType = inferrer.typeSchemaEnvironment.objectType;
- return null;
- }
+ @override
+ void visitCheckLibraryIsLoaded(
+ CheckLibraryIsLoaded node, DartType typeContext) {}
}
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 526ce35..2c23370 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
@@ -153,4 +153,10 @@
DartType visitThrow(Throw node, TypeInferrerImpl inferrer) {
return const BottomType();
}
+
+ @override
+ DartType visitCheckLibraryIsLoaded(
+ CheckLibraryIsLoaded node, TypeInferrerImpl inferrer) {
+ return inferrer.coreTypes.objectClass.rawType;
+ }
}
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 4f91001..319b068 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
@@ -1977,19 +1977,6 @@
}
}
-/// Concrete shadow object representing a deferred library-is-loaded check.
-class CheckLibraryIsLoadedJudgment extends CheckLibraryIsLoaded
- implements ExpressionJudgment {
- DartType inferredType;
-
- CheckLibraryIsLoadedJudgment(LibraryDependency import) : super(import);
-
- @override
- void acceptInference(InferenceVistor visitor, DartType typeContext) {
- return visitor.visitCheckLibraryIsLoadedJudgment(this, typeContext);
- }
-}
-
/// Concrete shadow object representing a named expression.
class NamedExpressionJudgment extends NamedExpression {
NamedExpressionJudgment(String nameLexeme, Expression value)