Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart |
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 87f4778fe8da8db0f8b4d4ebec27b818ff46d505..0e985f8a1ef47ba209d0ad9d9ffc7a075cbd78c1 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 |
@@ -1893,7 +1893,12 @@ class KernelThisExpression extends ThisExpression implements KernelExpression { |
@override |
DartType _inferExpression( |
KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
- return typeNeeded ? (inferrer.thisType ?? const DynamicType()) : null; |
+ typeNeeded = |
+ inferrer.listener.thisExpressionEnter(this, typeContext) || typeNeeded; |
+ var inferredType = |
+ typeNeeded ? (inferrer.thisType ?? const DynamicType()) : null; |
+ inferrer.listener.thisExpressionExit(this, inferredType); |
+ return inferredType; |
} |
} |
@@ -2083,7 +2088,11 @@ class KernelTypeLiteral extends TypeLiteral implements KernelExpression { |
@override |
DartType _inferExpression( |
KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
- return typeNeeded ? inferrer.coreTypes.typeClass.rawType : null; |
+ typeNeeded = |
+ inferrer.listener.typeLiteralEnter(this, typeContext) || typeNeeded; |
+ var inferredType = typeNeeded ? inferrer.coreTypes.typeClass.rawType : null; |
+ inferrer.listener.typeLiteralExit(this, inferredType); |
+ return inferredType; |
} |
} |