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 b568d03b6da29db177fe171cfacd09fa6c0868a1..e5201e9805974bd336bc69298287dd91e85acad1 100644 |
--- a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
@@ -17,7 +17,7 @@ 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, Constant; |
+import '../dart2jslib.dart' show invariant, Constant, FunctionConstant; |
part 'type_graph_nodes.dart'; |
part 'closure_tracer.dart'; |
@@ -555,7 +555,12 @@ class TypeGraphInferrerEngine |
Constant value = |
compiler.constantHandler.getConstantForVariable(element); |
if (value != null) { |
- type = types.getConcreteTypeFor(value.computeMask(compiler)); |
+ if (value.isFunction()) { |
+ FunctionConstant functionConstant = value; |
+ type = types.allocateClosure(node, functionConstant.element); |
+ } else { |
+ type = types.getConcreteTypeFor(value.computeMask(compiler)); |
+ } |
} |
} |
recordType(element, type); |