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 1eed9f52c74e1f34d71d51d709ae1a574b3f8be9..58fa571b419ca431365667d006cd4c623edde538 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'; |
@@ -472,8 +473,12 @@ class TypeGraphInferrerEngine |
if (analyzedElements.contains(element)) return; |
analyzedElements.add(element); |
- SimpleTypeInferrerVisitor visitor = |
- new SimpleTypeInferrerVisitor(element, compiler, this); |
+ var visitor; |
+ if (compiler.irBuilder.hasIr(element)) { |
+ visitor = new IrTypeInferrerVisitor(compiler, element, this); |
+ } else { |
+ visitor = new SimpleTypeInferrerVisitor(element, compiler, this); |
+ } |
TypeInformation type; |
compiler.withCurrentElement(element, () { |
type = visitor.run(); |
@@ -684,6 +689,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 |