Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2961693002: Add listener calls to ThisExpression and KernelTypeLiteral. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698