| Index: pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
|
| diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
|
| index 50f0058565aff5dbf5710b0be9fc89759ffa8980..0f99a4fb5f10070e129e18c3ebc375ceb5d2150b 100644
|
| --- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
|
| +++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
|
| @@ -6,6 +6,9 @@ library type_graph_inferrer;
|
|
|
| import 'dart:collection' show Queue, IterableBase;
|
|
|
| +import '../common/names.dart'
|
| + show Identifiers,
|
| + Names;
|
| import '../compiler.dart'
|
| show Compiler;
|
| import '../constants/values.dart';
|
| @@ -580,14 +583,14 @@ class TypeGraphInferrerEngine
|
| */
|
| final Set<Selector> _returnsListElementTypeSet = new Set<Selector>.from(
|
| <Selector>[
|
| - new Selector.getter('first', null),
|
| - new Selector.getter('last', null),
|
| - new Selector.getter('single', null),
|
| - new Selector.call('singleWhere', null, 1),
|
| - new Selector.call('elementAt', null, 1),
|
| + new Selector.getter(const PublicName('first')),
|
| + new Selector.getter(const PublicName('last')),
|
| + new Selector.getter(const PublicName('single')),
|
| + new Selector.call(const PublicName('singleWhere'), 1),
|
| + new Selector.call(const PublicName('elementAt'), 1),
|
| new Selector.index(),
|
| - new Selector.call('removeAt', null, 1),
|
| - new Selector.call('removeLast', null, 0)
|
| + new Selector.call(const PublicName('removeAt'), 1),
|
| + new Selector.call(const PublicName('removeLast'), 0)
|
| ]);
|
|
|
| bool returnsListElementType(Selector selector, TypeMask mask) {
|
| @@ -727,8 +730,7 @@ class TypeGraphInferrerEngine
|
| // need to trace the call method here.
|
| assert(info.calledElement.isConstructor);
|
| ClassElement cls = info.calledElement.enclosingClass;
|
| - FunctionElement callMethod =
|
| - cls.lookupMember(Compiler.CALL_OPERATOR_NAME);
|
| + FunctionElement callMethod = cls.lookupMember(Identifiers.call);
|
| assert(invariant(cls, callMethod != null));
|
| Iterable<FunctionElement> elements = [callMethod];
|
| trace(elements, new ClosureTracerVisitor(elements, info, this));
|
| @@ -794,8 +796,7 @@ class TypeGraphInferrerEngine
|
| }
|
| } else if (info is StaticCallSiteTypeInformation) {
|
| ClassElement cls = info.calledElement.enclosingClass;
|
| - FunctionElement callMethod =
|
| - cls.lookupMember(Compiler.CALL_OPERATOR_NAME);
|
| + FunctionElement callMethod = cls.lookupMember(Identifiers.call);
|
| print('${types.getInferredSignatureOf(callMethod)} for ${cls}');
|
| } else {
|
| print('${info.type} for some unknown kind of closure');
|
| @@ -946,7 +947,7 @@ class TypeGraphInferrerEngine
|
| Selector selector,
|
| TypeMask mask,
|
| {bool remove, bool addToQueue: true}) {
|
| - if (callee.name == Compiler.NO_SUCH_METHOD) return;
|
| + if (callee.name == Identifiers.noSuchMethod_) return;
|
| if (callee.isField) {
|
| if (selector.isSetter) {
|
| ElementTypeInformation info = types.getInferredTypeOf(callee);
|
| @@ -1261,7 +1262,7 @@ class TypeGraphInferrerEngine
|
| */
|
| TypeInformation typeOfElementWithSelector(Element element,
|
| Selector selector) {
|
| - if (element.name == Compiler.NO_SUCH_METHOD &&
|
| + if (element.name == Identifiers.noSuchMethod_ &&
|
| selector.name != element.name) {
|
| // An invocation can resolve to a [noSuchMethod], in which case
|
| // we get the return type of [noSuchMethod].
|
|
|