| Index: pkg/compiler/lib/src/typechecker.dart
|
| diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
|
| index 74b9659d39e1bf3c60dc4a426305e3ca51a394d2..2f22dae370ae5e3faab6d8083b94ef6fbd6bee7b 100644
|
| --- a/pkg/compiler/lib/src/typechecker.dart
|
| +++ b/pkg/compiler/lib/src/typechecker.dart
|
| @@ -741,35 +741,6 @@ class TypeCheckerVisitor extends Visitor<DartType> {
|
| Name memberName = new Name(name, currentLibrary,
|
| isSetter: memberKind == MemberKind.SETTER);
|
|
|
| - // Compute the unaliased type of the first non type variable bound of
|
| - // [type].
|
| - DartType computeUnaliasedBound(DartType type) {
|
| - DartType originalType = type;
|
| - while (identical(type.kind, TypeKind.TYPE_VARIABLE)) {
|
| - TypeVariableType variable = type;
|
| - type = variable.element.bound;
|
| - if (type == originalType) {
|
| - type = compiler.objectClass.rawType;
|
| - }
|
| - }
|
| - if (type.isMalformed) {
|
| - return const DynamicType();
|
| - }
|
| - return type.unalias(compiler);
|
| - }
|
| -
|
| - // Compute the interface type of [type]. For type variable it is the
|
| - // interface type of the bound, for function types and typedefs it is the
|
| - // `Function` type.
|
| - InterfaceType computeInterfaceType(DartType type) {
|
| - if (type.isFunctionType) {
|
| - type = compiler.functionClass.rawType;
|
| - }
|
| - assert(invariant(node, type.isInterfaceType,
|
| - message: "unexpected type kind ${type.kind}."));
|
| - return type;
|
| - }
|
| -
|
| // Lookup the class or interface member [name] in [interface].
|
| MemberSignature lookupMemberSignature(Name name, InterfaceType interface) {
|
| MembersCreator.computeClassMembersByName(
|
| @@ -802,11 +773,13 @@ class TypeCheckerVisitor extends Visitor<DartType> {
|
| return null;
|
| }
|
|
|
| - DartType unaliasedBound = computeUnaliasedBound(receiverType);
|
| + DartType unaliasedBound =
|
| + Types.computeUnaliasedBound(compiler, receiverType);
|
| if (unaliasedBound.treatAsDynamic) {
|
| return new DynamicAccess();
|
| }
|
| - InterfaceType interface = computeInterfaceType(unaliasedBound);
|
| + InterfaceType interface =
|
| + Types.computeInterfaceType(compiler, unaliasedBound);
|
| ElementAccess access = getAccess(memberName, unaliasedBound, interface);
|
| if (access != null) {
|
| return access;
|
| @@ -818,9 +791,11 @@ class TypeCheckerVisitor extends Visitor<DartType> {
|
| while (!typePromotions.isEmpty) {
|
| TypePromotion typePromotion = typePromotions.head;
|
| if (!typePromotion.isValid) {
|
| - DartType unaliasedBound = computeUnaliasedBound(typePromotion.type);
|
| + DartType unaliasedBound =
|
| + Types.computeUnaliasedBound(compiler, typePromotion.type);
|
| if (!unaliasedBound.treatAsDynamic) {
|
| - InterfaceType interface = computeInterfaceType(unaliasedBound);
|
| + InterfaceType interface =
|
| + Types.computeInterfaceType(compiler, unaliasedBound);
|
| if (getAccess(memberName, unaliasedBound, interface) != null) {
|
| reportTypePromotionHint(typePromotion);
|
| }
|
|
|