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

Unified Diff: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart

Issue 1371193004: Add bool value types to type inference. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index 9b2123e0029452d13dddd8c7d5cb58c47f3328e3..df00807da25519444f7223f320c81e2e5e701fd7 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -1127,6 +1127,20 @@ class StringLiteralTypeInformation extends ConcreteTypeInformation {
}
}
+class BoolLiteralTypeInformation extends ConcreteTypeInformation {
+ final ast.LiteralBool value;
+
+ BoolLiteralTypeInformation(value, TypeMask mask)
sra1 2015/09/29 04:12:16 What is the type of 'value'? Why do we need this
+ : super(new ValueTypeMask(mask, value.value)),
+ this.value = value;
+
+ String toString() => 'Type $type value ${value.value}';
+
+ accept(TypeInformationVisitor visitor) {
+ return visitor.visitBoolLiteralTypeInformation(this);
+ }
+}
+
/**
* A [NarrowTypeInformation] narrows a [TypeInformation] to a type,
* represented in [typeAnnotation].
@@ -1585,6 +1599,7 @@ abstract class TypeInformationVisitor<T> {
T visitMapTypeInformation(MapTypeInformation info);
T visitConcreteTypeInformation(ConcreteTypeInformation info);
T visitStringLiteralTypeInformation(StringLiteralTypeInformation info);
+ T visitBoolLiteralTypeInformation(BoolLiteralTypeInformation info);
T visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info);
T visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info);
T visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info);
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698