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

Unified Diff: pkg/compiler/lib/src/types/types.dart

Issue 2653633002: Further improve precision of the type of node that hold type inference data. (Closed)
Patch Set: dartfmt Created 3 years, 11 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 | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/types/types.dart
diff --git a/pkg/compiler/lib/src/types/types.dart b/pkg/compiler/lib/src/types/types.dart
index cd9e86000e7a910b45342ff1a24b82e0f230712b..26d29eac41ff18cbb47e17fa5d42f1f2e51488c6 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -44,12 +44,14 @@ abstract class GlobalTypeInferenceElementResult {
/// The inferred return type when this result belongs to a function element.
TypeMask get returnType;
- /// Returns the type of a list allocation [node] (which can be a list
- /// literal or a list new expression).
- TypeMask typeOfNewList(Node node);
+ /// Returns the type of a list new expression [node].
+ TypeMask typeOfNewList(Send node);
+
+ /// Returns the type of a list literal [node].
+ TypeMask typeOfListLiteral(LiteralList node);
/// Returns the type of a send [node].
- TypeMask typeOfSend(Node node);
+ TypeMask typeOfSend(Send node);
/// Returns the type of the operator of a complex send-set [node], for
/// example, the type of `+` in `a += b`.
@@ -99,10 +101,13 @@ class GlobalTypeInferenceElementResultImpl
return mask != null && mask.isEmpty;
}
- TypeMask typeOfNewList(Node node) =>
+ TypeMask typeOfNewList(Send node) =>
+ _inferrer.getTypeForNewList(_owner, node);
+
+ TypeMask typeOfListLiteral(LiteralList node) =>
_inferrer.getTypeForNewList(_owner, node);
- TypeMask typeOfSend(Node node) => _data?.typeOfSend(node);
+ TypeMask typeOfSend(Send node) => _data?.typeOfSend(node);
TypeMask typeOfGetter(SendSet node) => _data?.typeOfGetter(node);
TypeMask typeOfOperator(SendSet node) => _data?.typeOfOperator(node);
TypeMask typeOfIterator(ForIn node) => _data?.typeOfIterator(node);
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698