| 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);
|
| }
|
| }
|
| +
|
|
|