| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.element; | 8 library engine.element; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 10018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10029 * | 10029 * |
| 10030 * @param baseAccessor the base property accessor | 10030 * @param baseAccessor the base property accessor |
| 10031 * @param definingType the type defining the parameters and arguments to be us
ed in the | 10031 * @param definingType the type defining the parameters and arguments to be us
ed in the |
| 10032 * substitution | 10032 * substitution |
| 10033 * @return true if the type is changed by type substitution. | 10033 * @return true if the type is changed by type substitution. |
| 10034 */ | 10034 */ |
| 10035 static bool _isChangedByTypeSubstitution(PropertyAccessorElement baseAccessor,
InterfaceType definingType) { | 10035 static bool _isChangedByTypeSubstitution(PropertyAccessorElement baseAccessor,
InterfaceType definingType) { |
| 10036 List<DartType> argumentTypes = definingType.typeArguments; | 10036 List<DartType> argumentTypes = definingType.typeArguments; |
| 10037 if (baseAccessor != null && argumentTypes.length != 0) { | 10037 if (baseAccessor != null && argumentTypes.length != 0) { |
| 10038 FunctionType baseType = baseAccessor.type; | 10038 FunctionType baseType = baseAccessor.type; |
| 10039 if (baseType == null) { |
| 10040 AnalysisEngine.instance.logger.logInformation( |
| 10041 'Type of $baseAccessor is null in PropertyAccessorMember._isChangedB
yTypeSubstitution'); |
| 10042 return false; |
| 10043 } |
| 10039 List<DartType> parameterTypes = definingType.element.type.typeArguments; | 10044 List<DartType> parameterTypes = definingType.element.type.typeArguments; |
| 10040 FunctionType substitutedType = baseType.substitute2(argumentTypes, paramet
erTypes); | 10045 FunctionType substitutedType = baseType.substitute2(argumentTypes, paramet
erTypes); |
| 10041 if (baseType != substitutedType) { | 10046 if (baseType != substitutedType) { |
| 10042 return true; | 10047 return true; |
| 10043 } | 10048 } |
| 10044 // If this property accessor is based on a field, that field might have a
propagated type. | 10049 // If this property accessor is based on a field, that field might have a
propagated type. |
| 10045 // In which case we need to check whether the propagated type of the field
needs substitution. | 10050 // In which case we need to check whether the propagated type of the field
needs substitution. |
| 10046 PropertyInducingElement field = baseAccessor.variable; | 10051 PropertyInducingElement field = baseAccessor.variable; |
| 10047 if (!field.isSynthetic) { | 10052 if (!field.isSynthetic) { |
| 10048 DartType baseFieldType = field.propagatedType; | 10053 DartType baseFieldType = field.propagatedType; |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10672 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); | 10677 accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this); |
| 10673 | 10678 |
| 10674 @override | 10679 @override |
| 10675 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; | 10680 ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE; |
| 10676 | 10681 |
| 10677 @override | 10682 @override |
| 10678 bool get isStatic => true; | 10683 bool get isStatic => true; |
| 10679 } | 10684 } |
| 10680 | 10685 |
| 10681 /** | 10686 /** |
| 10682 * The abstract class `TypeImpl` implements the behavior common to objects repre
senting the | 10687 * The abstract class `TypeImpl` implements the behavior common to objects |
| 10683 * declared type of elements in the element model. | 10688 * representing the declared type of elements in the element model. |
| 10684 */ | 10689 */ |
| 10685 abstract class TypeImpl implements DartType { | 10690 abstract class TypeImpl implements DartType { |
| 10686 static bool equalArrays(List<DartType> typeArgs1, List<DartType> typeArgs2, Se
t<ElementPair> visitedElementPairs) { | 10691 /** |
| 10687 if (typeArgs1.length != typeArgs2.length) { | 10692 * Return `true` if corresponding elements of the [first] and [second] lists |
| 10693 * of type arguments are all equal. Use the set of [visitedElementPairs] to |
| 10694 * prevent infinite loops when the types are recursively defined. |
| 10695 */ |
| 10696 static bool equalArrays(List<DartType> first, List<DartType> second, |
| 10697 Set<ElementPair> visitedElementPairs) { |
| 10698 if (first.length != second.length) { |
| 10688 return false; | 10699 return false; |
| 10689 } | 10700 } |
| 10690 for (int i = 0; i < typeArgs1.length; i++) { | 10701 for (int i = 0; i < first.length; i++) { |
| 10691 if (!(typeArgs1[i] as TypeImpl).internalEquals(typeArgs2[i], visitedElemen
tPairs)) { | 10702 if (first[i] == null) { |
| 10703 AnalysisEngine.instance.logger.logInformation( |
| 10704 'Found null type argument in TypeImpl.equalArrays'); |
| 10705 return second[i] == null; |
| 10706 } else if (second[i] == null) { |
| 10707 AnalysisEngine.instance.logger.logInformation( |
| 10708 'Found null type argument in TypeImpl.equalArrays'); |
| 10709 return false; |
| 10710 } |
| 10711 if (!(first[i] as TypeImpl).internalEquals(second[i], visitedElementPairs)
) { |
| 10692 return false; | 10712 return false; |
| 10693 } | 10713 } |
| 10694 } | 10714 } |
| 10695 return true; | 10715 return true; |
| 10696 } | 10716 } |
| 10697 | 10717 |
| 10698 /** | 10718 /** |
| 10699 * Return an array containing the results of using the given argument types an
d parameter types to | 10719 * Return an array containing the results of using the given argument types an
d parameter types to |
| 10700 * perform a substitution on all of the given types. | 10720 * perform a substitution on all of the given types. |
| 10701 * | 10721 * |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11766 if (type is UnionType) { | 11786 if (type is UnionType) { |
| 11767 return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(this, visite
dTypePairs); | 11787 return (type as UnionTypeImpl).internalUnionTypeIsSuperTypeOf(this, visite
dTypePairs); |
| 11768 } | 11788 } |
| 11769 // The only subtype relations that pertain to void are therefore: | 11789 // The only subtype relations that pertain to void are therefore: |
| 11770 // void <: void (by reflexivity) | 11790 // void <: void (by reflexivity) |
| 11771 // bottom <: void (as bottom is a subtype of all types). | 11791 // bottom <: void (as bottom is a subtype of all types). |
| 11772 // void <: dynamic (as dynamic is a supertype of all types) | 11792 // void <: dynamic (as dynamic is a supertype of all types) |
| 11773 return identical(type, this) || type.isDynamic; | 11793 return identical(type, this) || type.isDynamic; |
| 11774 } | 11794 } |
| 11775 } | 11795 } |
| OLD | NEW |