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

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

Issue 2767773004: Add Vector type to Kernel (Closed)
Patch Set: Reformat comment with Markdown, throw exception in type propagation 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/type_algebra.dart ('k') | pkg/kernel/lib/type_propagation/builder.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 c6a89373d2e416b251279de6171918c7582f95e8..bee75b2f1aeb20aa66c345e0a106dd51b54c4073 100644
--- a/pkg/kernel/lib/type_checker.dart
+++ b/pkg/kernel/lib/type_checker.dart
@@ -690,6 +690,47 @@ class TypeCheckingVisitor
}
@override
+ DartType visitVectorGet(VectorGet node) {
+ var type = visitExpression(node.vectorExpression);
+ if (type is! VectorType) {
+ fail(
+ node.vectorExpression,
+ 'The type of vector-expression in vector-get node is expected to be '
+ 'VectorType, but $type found');
+ }
+ return const DynamicType();
+ }
+
+ @override
+ visitVectorSet(VectorSet node) {
+ var type = visitExpression(node.vectorExpression);
+ if (type is! VectorType) {
+ fail(
+ node.vectorExpression,
+ 'The type of vector-expression in vector-set node is expected to be '
+ 'VectorType, but $type found');
+ }
+ return visitExpression(node.value);
+ }
+
+ @override
+ visitVectorCopy(VectorCopy node) {
+ var type = visitExpression(node.vectorExpression);
+ if (type is! VectorType) {
+ fail(
+ node.vectorExpression,
+ 'The type of vector-expression in vector-copy node is exected to be '
+ 'VectorType, but $type found');
+ }
+ return const VectorType();
+ }
+
+ @override
+ DartType visitVectorCreation(VectorCreation node) {
+ return const VectorType();
+ }
+
+ @override
visitAssertStatement(AssertStatement node) {
visitExpression(node.condition);
if (node.message != null) {
« no previous file with comments | « pkg/kernel/lib/type_algebra.dart ('k') | pkg/kernel/lib/type_propagation/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698