| Index: pkg/compiler/lib/src/resolution/type_resolver.dart
|
| diff --git a/pkg/compiler/lib/src/resolution/type_resolver.dart b/pkg/compiler/lib/src/resolution/type_resolver.dart
|
| index 9837a0999486284db717f99d77ba1fa51660f4c4..c1dbcfbccdafa3870c3ddfbfd10b20428a04f4db 100644
|
| --- a/pkg/compiler/lib/src/resolution/type_resolver.dart
|
| +++ b/pkg/compiler/lib/src/resolution/type_resolver.dart
|
| @@ -6,8 +6,6 @@ library dart2js.resolution.types;
|
|
|
| import '../common.dart';
|
| import '../common/resolution.dart' show Feature, Resolution;
|
| -import '../compiler.dart' show Compiler;
|
| -import '../dart_backend/dart_backend.dart' show DartBackend;
|
| import '../dart_types.dart';
|
| import '../elements/elements.dart'
|
| show
|
| @@ -18,25 +16,24 @@ import '../elements/elements.dart'
|
| ErroneousElement,
|
| PrefixElement,
|
| TypedefElement,
|
| - TypeDeclarationElement,
|
| TypeVariableElement;
|
| import '../elements/modelx.dart' show ErroneousElementX;
|
| +import '../resolution/resolution.dart';
|
| import '../tree/tree.dart';
|
| import '../util/util.dart' show Link;
|
| -
|
| import 'members.dart' show lookupInScope;
|
| import 'registry.dart' show ResolutionRegistry;
|
| import 'resolution_common.dart' show MappingVisitor;
|
| import 'scope.dart' show Scope;
|
|
|
| class TypeResolver {
|
| - final Compiler compiler;
|
| -
|
| - TypeResolver(this.compiler);
|
| + final Resolution resolution;
|
|
|
| - DiagnosticReporter get reporter => compiler.reporter;
|
| + TypeResolver(this.resolution);
|
|
|
| - Resolution get resolution => compiler.resolution;
|
| + ResolverTask get resolver => resolution.resolver;
|
| + DiagnosticReporter get reporter => resolution.reporter;
|
| + Types get types => resolution.types;
|
|
|
| /// Tries to resolve the type name as an element.
|
| Element resolveTypeName(
|
| @@ -50,12 +47,7 @@ class TypeResolver {
|
| // The receiver is a prefix. Lookup in the imported members.
|
| PrefixElement prefix = prefixElement;
|
| element = prefix.lookupLocalMember(typeName.source);
|
| - // TODO(17260, sigurdm): The test for DartBackend is there because
|
| - // dart2dart outputs malformed types with prefix.
|
| - if (element != null &&
|
| - prefix.isDeferred &&
|
| - deferredIsMalformed &&
|
| - compiler.backend is! DartBackend) {
|
| + if (element != null && prefix.isDeferred && deferredIsMalformed) {
|
| element = new ErroneousElementX(MessageKind.DEFERRED_TYPE_ANNOTATION,
|
| {'node': typeName}, element.name, element);
|
| }
|
| @@ -167,7 +159,7 @@ class TypeResolver {
|
| ClassElement cls = element;
|
| // TODO(johnniwinther): [ensureClassWillBeResolvedInternal] should imply
|
| // [computeType].
|
| - compiler.resolver.ensureClassWillBeResolvedInternal(cls);
|
| + resolver.ensureClassWillBeResolvedInternal(cls);
|
| cls.computeType(resolution);
|
| List<DartType> arguments = <DartType>[];
|
| bool hasTypeArgumentMismatch =
|
| @@ -240,7 +232,7 @@ class TypeResolver {
|
| void checkTypeVariableBounds(TypeAnnotation node, GenericType type) {
|
| void checkTypeVariableBound(_, DartType typeArgument,
|
| TypeVariableType typeVariable, DartType bound) {
|
| - if (!compiler.types.isSubtype(typeArgument, bound)) {
|
| + if (!types.isSubtype(typeArgument, bound)) {
|
| reporter.reportWarningMessage(
|
| node, MessageKind.INVALID_TYPE_VARIABLE_BOUND, {
|
| 'typeVariable': typeVariable,
|
| @@ -250,9 +242,8 @@ class TypeResolver {
|
| });
|
| }
|
| }
|
| - ;
|
|
|
| - compiler.types.checkTypeVariableBounds(type, checkTypeVariableBound);
|
| + types.checkTypeVariableBounds(type, checkTypeVariableBound);
|
| }
|
|
|
| /**
|
|
|