Index: sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
index 9e16b5778da355eaecd88fe7edba1191b765630b..fe095dec47591eb59ec45ef36512bad0dae7863f 100644 |
--- a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
@@ -15,6 +15,7 @@ import 'inferrer_visitor.dart' show TypeSystem, ArgumentsTypes; |
import '../native_handler.dart' as native; |
import '../util/util.dart' show Spannable, Setlet; |
import 'simple_types_inferrer.dart'; |
+import 'ir_type_inferrer.dart'; |
import '../dart2jslib.dart' show invariant; |
part 'type_graph_nodes.dart'; |
@@ -468,8 +469,14 @@ class TypeGraphInferrerEngine |
if (analyzedElements.contains(element)) return; |
analyzedElements.add(element); |
- SimpleTypeInferrerVisitor visitor = |
- new SimpleTypeInferrerVisitor(element, compiler, this); |
+ var visitor; |
+ if (element.hasIrNode(compiler)) { |
+ visitor = new IrTypeInferrerVisitor(compiler, element, this); |
+ } else { |
+ visitor = new SimpleTypeInferrerVisitor(element, compiler, this); |
+ } |
+// SimpleTypeInferrerVisitor visitor = |
ngeoffray
2013/11/21 15:02:05
Remove commented code.
lukas
2013/11/21 17:14:27
Done.
|
+// new SimpleTypeInferrerVisitor(element, compiler, this); |
TypeInformation type; |
compiler.withCurrentElement(element, () { |
type = visitor.run(); |
@@ -680,6 +687,7 @@ class TypeGraphInferrerEngine |
void recordReturnType(Element element, TypeInformation type) { |
TypeInformation info = types.getInferredTypeOf(element); |
if (element.name == '==') { |
+ // Even if x.== doesn't return a bool, 'x == null' evaluates to 'false'. |
info.addAssignment(types.boolType); |
} |
// TODO(ngeoffray): Clean up. We do these checks because |