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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2946943002: Record static types in the desugaring of null-aware property gets. (Closed)
Patch Set: Fix inference of receiver type 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
Index: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index e6b316deb0ee62af509710e3d81e372a87e95cd2..66de118a5f1f852fbd1541c1c8b157df5e5d7cba 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -38,6 +38,7 @@ import 'package:kernel/ast.dart'
SuperPropertyGet,
SuperPropertySet,
TypeParameterType,
+ VariableDeclaration,
VoidType;
import 'package:kernel/class_hierarchy.dart';
import 'package:kernel/core_types.dart';
@@ -635,11 +636,13 @@ abstract class TypeInferrerImpl extends TypeInferrer {
int fileOffset,
PropertyGet desugaredGet,
DartType typeContext,
- bool typeNeeded) {
+ bool typeNeeded,
+ {VariableDeclaration receiverVariable}) {
typeNeeded =
listener.propertyGetEnter(expression, typeContext) || typeNeeded;
// First infer the receiver so we can look up the getter that was invoked.
var receiverType = inferExpression(receiver, null, true);
+ receiverVariable?.type = receiverType;
Member interfaceMember =
findInterfaceMember(receiverType, desugaredGet.name, fileOffset);
if (isTopLevel &&

Powered by Google App Engine
This is Rietveld 408576698