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

Unified Diff: frog/value.dart

Issue 9107067: Work in progress: changes to interpretation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: work in progress Created 8 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 | « frog/utils.dart ('k') | frog/var_member.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/value.dart
diff --git a/frog/value.dart b/frog/value.dart
index a1c7499c7cfb75b8e4bc86138662e5c8aa8e7236..7f20ce7f6c0bc3c2360e243ee5593a1463ebcb0d 100644
--- a/frog/value.dart
+++ b/frog/value.dart
@@ -66,11 +66,14 @@ class Value {
// TODO(jmesserly): should use something like UnionValue and track the
// precise set of types. For now we find the Type.union.
+ var t = Type.union(x.type, y.type);
+ if (t == x.type) return x;
+ if (t == y.type) return y;
// TODO(jmesserly): What to do about code? Right now, we're intentionally
// throwing it away because they aren't used in the current flow-insensitive
// inference.
- return new Value(Type.union(x.type, y.type), null, null);
+ return new Value(t, null, null);
}
Value _tryUnion(Value right) => null;
@@ -1474,3 +1477,4 @@ class VariableValue extends Value {
return super.binop(kind, other, context, node);
}
}
+
« no previous file with comments | « frog/utils.dart ('k') | frog/var_member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698