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

Unified Diff: pkg/kernel/lib/type_algebra.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/transformations/treeshaker.dart ('k') | pkg/kernel/lib/type_checker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/type_algebra.dart
diff --git a/pkg/kernel/lib/type_algebra.dart b/pkg/kernel/lib/type_algebra.dart
index ce4a553dc4a851e34e003d9e907e98002f8abd15..c86f4d21f80ec258cf0fa3dc8eb9806cad3c2852 100644
--- a/pkg/kernel/lib/type_algebra.dart
+++ b/pkg/kernel/lib/type_algebra.dart
@@ -365,6 +365,7 @@ abstract class _TypeSubstitutor extends DartTypeVisitor<DartType> {
DartType visitDynamicType(DynamicType node) => node;
DartType visitVoidType(VoidType node) => node;
DartType visitBottomType(BottomType node) => node;
+ DartType visitVector(VectorType node) => node;
DartType visitInterfaceType(InterfaceType node) {
if (node.typeArguments.isEmpty) return node;
@@ -539,6 +540,7 @@ class _TypeUnification {
if (type1 is VoidType && type2 is VoidType) return true;
if (type1 is InvalidType && type2 is InvalidType) return true;
if (type1 is BottomType && type2 is BottomType) return true;
+ if (type1 is VectorType && type2 is VectorType) return true;
if (type1 is InterfaceType && type2 is InterfaceType) {
if (type1.classNode != type2.classNode) return _fail();
assert(type1.typeArguments.length == type2.typeArguments.length);
@@ -647,6 +649,7 @@ class _OccurrenceVisitor extends DartTypeVisitor<bool> {
bool visitInvalidType(InvalidType node) => false;
bool visitDynamicType(DynamicType node) => false;
bool visitVoidType(VoidType node) => false;
+ bool visitVectorType(VectorType node) => false;
bool visitInterfaceType(InterfaceType node) {
return node.typeArguments.any(visit);
« no previous file with comments | « pkg/kernel/lib/transformations/treeshaker.dart ('k') | pkg/kernel/lib/type_checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698