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

Unified Diff: pkg/kernel/lib/type_checker.dart

Issue 2778223002: Add primitive to create closures and use it for closure conversion (Closed)
Patch Set: Follow common pattern for AST nodes with References in ClosureCreation Created 3 years, 9 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/kernel/lib/transformations/closure/converter.dart ('k') | pkg/kernel/lib/visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/type_checker.dart
diff --git a/pkg/kernel/lib/type_checker.dart b/pkg/kernel/lib/type_checker.dart
index bee75b2f1aeb20aa66c345e0a106dd51b54c4073..6c48a6d91d17175c928b6e0c574200e659ab3fb9 100644
--- a/pkg/kernel/lib/type_checker.dart
+++ b/pkg/kernel/lib/type_checker.dart
@@ -690,6 +690,11 @@ class TypeCheckingVisitor
}
@override
+ DartType visitVectorCreation(VectorCreation node) {
+ return const VectorType();
+ }
+
+ @override
DartType visitVectorGet(VectorGet node) {
var type = visitExpression(node.vectorExpression);
if (type is! VectorType) {
@@ -726,8 +731,15 @@ class TypeCheckingVisitor
}
@override
- DartType visitVectorCreation(VectorCreation node) {
- return const VectorType();
+ visitClosureCreation(ClosureCreation node) {
+ var contextType = visitExpression(node.contextVector);
+ if (contextType is! VectorType) {
+ fail(
+ node.contextVector,
+ "The second child of 'ClosureConversion' node is supposed to be a "
+ "Vector, but $contextType found.");
+ }
+ return node.functionType;
}
@override
« no previous file with comments | « pkg/kernel/lib/transformations/closure/converter.dart ('k') | pkg/kernel/lib/visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698