OLD | NEW |
1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
3 library engine.element; | 3 library engine.element; |
4 import 'dart:collection'; | 4 import 'dart:collection'; |
5 import 'java_core.dart'; | 5 import 'java_core.dart'; |
6 import 'java_engine.dart'; | 6 import 'java_engine.dart'; |
7 import 'source.dart'; | 7 import 'source.dart'; |
8 import 'scanner.dart' show Keyword; | 8 import 'scanner.dart' show Keyword; |
9 import 'ast.dart' show Identifier, LibraryIdentifier; | 9 import 'ast.dart' show Identifier, LibraryIdentifier; |
10 import 'sdk.dart' show DartSdk; | 10 import 'sdk.dart' show DartSdk; |
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 if (javaSetAdd(visitedClasses, currentElement)) { | 1683 if (javaSetAdd(visitedClasses, currentElement)) { |
1684 for (FieldElement field in currentElement.fields) { | 1684 for (FieldElement field in currentElement.fields) { |
1685 if (!field.isFinal() && !field.isConst() && !field.isStatic() && !fiel
d.isSynthetic()) { | 1685 if (!field.isFinal() && !field.isConst() && !field.isStatic() && !fiel
d.isSynthetic()) { |
1686 return true; | 1686 return true; |
1687 } | 1687 } |
1688 } | 1688 } |
1689 for (InterfaceType mixinType in currentElement.mixins) { | 1689 for (InterfaceType mixinType in currentElement.mixins) { |
1690 ClassElement mixinElement = mixinType.element; | 1690 ClassElement mixinElement = mixinType.element; |
1691 classesToVisit.add(mixinElement); | 1691 classesToVisit.add(mixinElement); |
1692 } | 1692 } |
1693 InterfaceType supertype2 = currentElement.supertype; | 1693 InterfaceType supertype = currentElement.supertype; |
1694 if (supertype2 != null) { | 1694 if (supertype != null) { |
1695 ClassElement superElement = supertype2.element; | 1695 ClassElement superElement = supertype.element; |
1696 if (superElement != null) { | 1696 if (superElement != null) { |
1697 classesToVisit.add(superElement); | 1697 classesToVisit.add(superElement); |
1698 } | 1698 } |
1699 } | 1699 } |
1700 } | 1700 } |
1701 } | 1701 } |
1702 return false; | 1702 return false; |
1703 } | 1703 } |
1704 bool hasReferenceToSuper() => hasModifier(Modifier.REFERENCES_SUPER); | 1704 bool hasReferenceToSuper() => hasModifier(Modifier.REFERENCES_SUPER); |
1705 bool isAbstract() => hasModifier(Modifier.ABSTRACT); | 1705 bool isAbstract() => hasModifier(Modifier.ABSTRACT); |
(...skipping 10 matching lines...) Expand all Loading... |
1716 } | 1716 } |
1717 for (InterfaceType mixin in currentElement.mixins) { | 1717 for (InterfaceType mixin in currentElement.mixins) { |
1718 ClassElement mixinElement = mixin.element; | 1718 ClassElement mixinElement = mixin.element; |
1719 if (mixinElement != null) { | 1719 if (mixinElement != null) { |
1720 element = mixinElement.getGetter(getterName); | 1720 element = mixinElement.getGetter(getterName); |
1721 if (element != null && element.isAccessibleIn(library)) { | 1721 if (element != null && element.isAccessibleIn(library)) { |
1722 return element; | 1722 return element; |
1723 } | 1723 } |
1724 } | 1724 } |
1725 } | 1725 } |
1726 InterfaceType supertype2 = currentElement.supertype; | 1726 InterfaceType supertype = currentElement.supertype; |
1727 if (supertype2 == null) { | 1727 if (supertype == null) { |
1728 return null; | 1728 return null; |
1729 } | 1729 } |
1730 currentElement = supertype2.element; | 1730 currentElement = supertype.element; |
1731 } | 1731 } |
1732 return null; | 1732 return null; |
1733 } | 1733 } |
1734 MethodElement lookUpMethod(String methodName, LibraryElement library) { | 1734 MethodElement lookUpMethod(String methodName, LibraryElement library) { |
1735 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 1735 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
1736 ClassElement currentElement = this; | 1736 ClassElement currentElement = this; |
1737 while (currentElement != null && !visitedClasses.contains(currentElement)) { | 1737 while (currentElement != null && !visitedClasses.contains(currentElement)) { |
1738 javaSetAdd(visitedClasses, currentElement); | 1738 javaSetAdd(visitedClasses, currentElement); |
1739 MethodElement element = currentElement.getMethod(methodName); | 1739 MethodElement element = currentElement.getMethod(methodName); |
1740 if (element != null && element.isAccessibleIn(library)) { | 1740 if (element != null && element.isAccessibleIn(library)) { |
1741 return element; | 1741 return element; |
1742 } | 1742 } |
1743 for (InterfaceType mixin in currentElement.mixins) { | 1743 for (InterfaceType mixin in currentElement.mixins) { |
1744 ClassElement mixinElement = mixin.element; | 1744 ClassElement mixinElement = mixin.element; |
1745 if (mixinElement != null) { | 1745 if (mixinElement != null) { |
1746 element = mixinElement.getMethod(methodName); | 1746 element = mixinElement.getMethod(methodName); |
1747 if (element != null && element.isAccessibleIn(library)) { | 1747 if (element != null && element.isAccessibleIn(library)) { |
1748 return element; | 1748 return element; |
1749 } | 1749 } |
1750 } | 1750 } |
1751 } | 1751 } |
1752 InterfaceType supertype2 = currentElement.supertype; | 1752 InterfaceType supertype = currentElement.supertype; |
1753 if (supertype2 == null) { | 1753 if (supertype == null) { |
1754 return null; | 1754 return null; |
1755 } | 1755 } |
1756 currentElement = supertype2.element; | 1756 currentElement = supertype.element; |
1757 } | 1757 } |
1758 return null; | 1758 return null; |
1759 } | 1759 } |
1760 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
) { | 1760 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library
) { |
1761 Set<ClassElement> visitedClasses = new Set<ClassElement>(); | 1761 Set<ClassElement> visitedClasses = new Set<ClassElement>(); |
1762 ClassElement currentElement = this; | 1762 ClassElement currentElement = this; |
1763 while (currentElement != null && !visitedClasses.contains(currentElement)) { | 1763 while (currentElement != null && !visitedClasses.contains(currentElement)) { |
1764 javaSetAdd(visitedClasses, currentElement); | 1764 javaSetAdd(visitedClasses, currentElement); |
1765 PropertyAccessorElement element = currentElement.getSetter(setterName); | 1765 PropertyAccessorElement element = currentElement.getSetter(setterName); |
1766 if (element != null && element.isAccessibleIn(library)) { | 1766 if (element != null && element.isAccessibleIn(library)) { |
1767 return element; | 1767 return element; |
1768 } | 1768 } |
1769 for (InterfaceType mixin in currentElement.mixins) { | 1769 for (InterfaceType mixin in currentElement.mixins) { |
1770 ClassElement mixinElement = mixin.element; | 1770 ClassElement mixinElement = mixin.element; |
1771 if (mixinElement != null) { | 1771 if (mixinElement != null) { |
1772 element = mixinElement.getSetter(setterName); | 1772 element = mixinElement.getSetter(setterName); |
1773 if (element != null && element.isAccessibleIn(library)) { | 1773 if (element != null && element.isAccessibleIn(library)) { |
1774 return element; | 1774 return element; |
1775 } | 1775 } |
1776 } | 1776 } |
1777 } | 1777 } |
1778 InterfaceType supertype2 = currentElement.supertype; | 1778 InterfaceType supertype = currentElement.supertype; |
1779 if (supertype2 == null) { | 1779 if (supertype == null) { |
1780 return null; | 1780 return null; |
1781 } | 1781 } |
1782 currentElement = supertype2.element; | 1782 currentElement = supertype.element; |
1783 } | 1783 } |
1784 return null; | 1784 return null; |
1785 } | 1785 } |
1786 | 1786 |
1787 /** | 1787 /** |
1788 * Set whether this class is abstract to correspond to the given value. | 1788 * Set whether this class is abstract to correspond to the given value. |
1789 * @param isAbstract {@code true} if the class is abstract | 1789 * @param isAbstract {@code true} if the class is abstract |
1790 */ | 1790 */ |
1791 void set abstract(bool isAbstract) { | 1791 void set abstract(bool isAbstract) { |
1792 setModifier(Modifier.ABSTRACT, isAbstract); | 1792 setModifier(Modifier.ABSTRACT, isAbstract); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1943 supertypes.add(currentType); | 1943 supertypes.add(currentType); |
1944 } | 1944 } |
1945 InterfaceType supertype = currentType.superclass; | 1945 InterfaceType supertype = currentType.superclass; |
1946 if (supertype != null) { | 1946 if (supertype != null) { |
1947 typesToVisit.add(supertype); | 1947 typesToVisit.add(supertype); |
1948 } | 1948 } |
1949 for (InterfaceType type in currentElement.interfaces) { | 1949 for (InterfaceType type in currentElement.interfaces) { |
1950 typesToVisit.add(type); | 1950 typesToVisit.add(type); |
1951 } | 1951 } |
1952 for (InterfaceType type in currentElement.mixins) { | 1952 for (InterfaceType type in currentElement.mixins) { |
1953 ClassElement element2 = type.element; | 1953 ClassElement element = type.element; |
1954 if (!visitedClasses.contains(element2)) { | 1954 if (!visitedClasses.contains(element)) { |
1955 supertypes.add(type); | 1955 supertypes.add(type); |
1956 } | 1956 } |
1957 } | 1957 } |
1958 } | 1958 } |
1959 } | 1959 } |
1960 } | 1960 } |
1961 } | 1961 } |
1962 /** | 1962 /** |
1963 * Instances of the class {@code CompilationUnitElementImpl} implement a{@link C
ompilationUnitElement}. | 1963 * Instances of the class {@code CompilationUnitElementImpl} implement a{@link C
ompilationUnitElement}. |
1964 * @coverage dart.engine.element | 1964 * @coverage dart.engine.element |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 * declaration of this element | 2401 * declaration of this element |
2402 */ | 2402 */ |
2403 ElementImpl.con2(String name2, int nameOffset2) { | 2403 ElementImpl.con2(String name2, int nameOffset2) { |
2404 _jtd_constructor_195_impl(name2, nameOffset2); | 2404 _jtd_constructor_195_impl(name2, nameOffset2); |
2405 } | 2405 } |
2406 _jtd_constructor_195_impl(String name2, int nameOffset2) { | 2406 _jtd_constructor_195_impl(String name2, int nameOffset2) { |
2407 this._name = StringUtilities.intern(name2); | 2407 this._name = StringUtilities.intern(name2); |
2408 this._nameOffset = nameOffset2; | 2408 this._nameOffset = nameOffset2; |
2409 } | 2409 } |
2410 String computeDocumentationComment() { | 2410 String computeDocumentationComment() { |
2411 AnalysisContext context2 = context; | 2411 AnalysisContext context = this.context; |
2412 if (context2 == null) { | 2412 if (context == null) { |
2413 return null; | 2413 return null; |
2414 } | 2414 } |
2415 return context2.computeDocumentationComment(this); | 2415 return context.computeDocumentationComment(this); |
2416 } | 2416 } |
2417 bool operator ==(Object object) => object != null && object.runtimeType == run
timeType && ((object as Element)).location == location; | 2417 bool operator ==(Object object) => object != null && object.runtimeType == run
timeType && ((object as Element)).location == location; |
2418 Element getAncestor(Type elementClass) { | 2418 Element getAncestor(Type elementClass) { |
2419 Element ancestor = _enclosingElement; | 2419 Element ancestor = _enclosingElement; |
2420 while (ancestor != null && !isInstanceOf(ancestor, elementClass)) { | 2420 while (ancestor != null && !isInstanceOf(ancestor, elementClass)) { |
2421 ancestor = ancestor.enclosingElement; | 2421 ancestor = ancestor.enclosingElement; |
2422 } | 2422 } |
2423 return ancestor as Element; | 2423 return ancestor as Element; |
2424 } | 2424 } |
2425 | 2425 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2628 return JavaArrays.equals(_components, location._components); | 2628 return JavaArrays.equals(_components, location._components); |
2629 } | 2629 } |
2630 | 2630 |
2631 /** | 2631 /** |
2632 * Return the path to the element whose location is represented by this object
. | 2632 * Return the path to the element whose location is represented by this object
. |
2633 * @return the path to the element whose location is represented by this objec
t | 2633 * @return the path to the element whose location is represented by this objec
t |
2634 */ | 2634 */ |
2635 List<String> get components => _components; | 2635 List<String> get components => _components; |
2636 String get encoding { | 2636 String get encoding { |
2637 JavaStringBuilder builder = new JavaStringBuilder(); | 2637 JavaStringBuilder builder = new JavaStringBuilder(); |
2638 int length2 = _components.length; | 2638 int length = _components.length; |
2639 for (int i = 0; i < length2; i++) { | 2639 for (int i = 0; i < length; i++) { |
2640 if (i > 0) { | 2640 if (i > 0) { |
2641 builder.appendChar(_SEPARATOR_CHAR); | 2641 builder.appendChar(_SEPARATOR_CHAR); |
2642 } | 2642 } |
2643 encode(builder, _components[i]); | 2643 encode(builder, _components[i]); |
2644 } | 2644 } |
2645 return builder.toString(); | 2645 return builder.toString(); |
2646 } | 2646 } |
2647 int get hashCode => JavaArrays.makeHashCode(_components); | 2647 int get hashCode => JavaArrays.makeHashCode(_components); |
2648 String toString() => encoding; | 2648 String toString() => encoding; |
2649 | 2649 |
2650 /** | 2650 /** |
2651 * Decode the encoded form of a location into an array of components. | 2651 * Decode the encoded form of a location into an array of components. |
2652 * @param encoding the encoded form of a location | 2652 * @param encoding the encoded form of a location |
2653 * @return the components that were encoded | 2653 * @return the components that were encoded |
2654 */ | 2654 */ |
2655 List<String> decode(String encoding) { | 2655 List<String> decode(String encoding) { |
2656 List<String> components = new List<String>(); | 2656 List<String> components = new List<String>(); |
2657 JavaStringBuilder builder = new JavaStringBuilder(); | 2657 JavaStringBuilder builder = new JavaStringBuilder(); |
2658 int index = 0; | 2658 int index = 0; |
2659 int length2 = encoding.length; | 2659 int length = encoding.length; |
2660 while (index < length2) { | 2660 while (index < length) { |
2661 int currentChar = encoding.codeUnitAt(index); | 2661 int currentChar = encoding.codeUnitAt(index); |
2662 if (currentChar == _SEPARATOR_CHAR) { | 2662 if (currentChar == _SEPARATOR_CHAR) { |
2663 if (index + 1 < length2 && encoding.codeUnitAt(index + 1) == _SEPARATOR_
CHAR) { | 2663 if (index + 1 < length && encoding.codeUnitAt(index + 1) == _SEPARATOR_C
HAR) { |
2664 builder.appendChar(_SEPARATOR_CHAR); | 2664 builder.appendChar(_SEPARATOR_CHAR); |
2665 index += 2; | 2665 index += 2; |
2666 } else { | 2666 } else { |
2667 components.add(builder.toString()); | 2667 components.add(builder.toString()); |
2668 builder.length = 0; | 2668 builder.length = 0; |
2669 index++; | 2669 index++; |
2670 } | 2670 } |
2671 } else { | 2671 } else { |
2672 builder.appendChar(currentChar); | 2672 builder.appendChar(currentChar); |
2673 index++; | 2673 index++; |
2674 } | 2674 } |
2675 } | 2675 } |
2676 if (builder.length > 0) { | 2676 if (builder.length > 0) { |
2677 components.add(builder.toString()); | 2677 components.add(builder.toString()); |
2678 } | 2678 } |
2679 return new List.from(components); | 2679 return new List.from(components); |
2680 } | 2680 } |
2681 | 2681 |
2682 /** | 2682 /** |
2683 * Append an encoded form of the given component to the given builder. | 2683 * Append an encoded form of the given component to the given builder. |
2684 * @param builder the builder to which the encoded component is to be appended | 2684 * @param builder the builder to which the encoded component is to be appended |
2685 * @param component the component to be appended to the builder | 2685 * @param component the component to be appended to the builder |
2686 */ | 2686 */ |
2687 void encode(JavaStringBuilder builder, String component) { | 2687 void encode(JavaStringBuilder builder, String component) { |
2688 int length2 = component.length; | 2688 int length = component.length; |
2689 for (int i = 0; i < length2; i++) { | 2689 for (int i = 0; i < length; i++) { |
2690 int currentChar = component.codeUnitAt(i); | 2690 int currentChar = component.codeUnitAt(i); |
2691 if (currentChar == _SEPARATOR_CHAR) { | 2691 if (currentChar == _SEPARATOR_CHAR) { |
2692 builder.appendChar(_SEPARATOR_CHAR); | 2692 builder.appendChar(_SEPARATOR_CHAR); |
2693 } | 2693 } |
2694 builder.appendChar(currentChar); | 2694 builder.appendChar(currentChar); |
2695 } | 2695 } |
2696 } | 2696 } |
2697 } | 2697 } |
2698 /** | 2698 /** |
2699 * Instances of the class {@code EmbeddedHtmlScriptElementImpl} implement an{@li
nk EmbeddedHtmlScriptElement}. | 2699 * Instances of the class {@code EmbeddedHtmlScriptElementImpl} implement an{@li
nk EmbeddedHtmlScriptElement}. |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3639 } | 3639 } |
3640 return new List.from(libraries); | 3640 return new List.from(libraries); |
3641 } | 3641 } |
3642 List<ImportElement> get imports => _imports; | 3642 List<ImportElement> get imports => _imports; |
3643 ElementKind get kind => ElementKind.LIBRARY; | 3643 ElementKind get kind => ElementKind.LIBRARY; |
3644 LibraryElement get library => this; | 3644 LibraryElement get library => this; |
3645 List<CompilationUnitElement> get parts => _parts; | 3645 List<CompilationUnitElement> get parts => _parts; |
3646 List<PrefixElement> get prefixes { | 3646 List<PrefixElement> get prefixes { |
3647 Set<PrefixElement> prefixes = new Set<PrefixElement>(); | 3647 Set<PrefixElement> prefixes = new Set<PrefixElement>(); |
3648 for (ImportElement element in _imports) { | 3648 for (ImportElement element in _imports) { |
3649 PrefixElement prefix2 = element.prefix; | 3649 PrefixElement prefix = element.prefix; |
3650 if (prefix2 != null) { | 3650 if (prefix != null) { |
3651 javaSetAdd(prefixes, prefix2); | 3651 javaSetAdd(prefixes, prefix); |
3652 } | 3652 } |
3653 } | 3653 } |
3654 return new List.from(prefixes); | 3654 return new List.from(prefixes); |
3655 } | 3655 } |
3656 Source get source { | 3656 Source get source { |
3657 if (_definingCompilationUnit == null) { | 3657 if (_definingCompilationUnit == null) { |
3658 return null; | 3658 return null; |
3659 } | 3659 } |
3660 return _definingCompilationUnit.source; | 3660 return _definingCompilationUnit.source; |
3661 } | 3661 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3708 this._exports = exports2; | 3708 this._exports = exports2; |
3709 } | 3709 } |
3710 | 3710 |
3711 /** | 3711 /** |
3712 * Set the specifications of all of the imports defined in this library to the
given array. | 3712 * Set the specifications of all of the imports defined in this library to the
given array. |
3713 * @param imports the specifications of all of the imports defined in this lib
rary | 3713 * @param imports the specifications of all of the imports defined in this lib
rary |
3714 */ | 3714 */ |
3715 void set imports(List<ImportElement> imports2) { | 3715 void set imports(List<ImportElement> imports2) { |
3716 for (ImportElement importElement in imports2) { | 3716 for (ImportElement importElement in imports2) { |
3717 ((importElement as ImportElementImpl)).enclosingElement = this; | 3717 ((importElement as ImportElementImpl)).enclosingElement = this; |
3718 PrefixElementImpl prefix2 = importElement.prefix as PrefixElementImpl; | 3718 PrefixElementImpl prefix = importElement.prefix as PrefixElementImpl; |
3719 if (prefix2 != null) { | 3719 if (prefix != null) { |
3720 prefix2.enclosingElement = this; | 3720 prefix.enclosingElement = this; |
3721 } | 3721 } |
3722 } | 3722 } |
3723 this._imports = imports2; | 3723 this._imports = imports2; |
3724 } | 3724 } |
3725 | 3725 |
3726 /** | 3726 /** |
3727 * Set the compilation units that are included in this library using a {@code
part} directive. | 3727 * Set the compilation units that are included in this library using a {@code
part} directive. |
3728 * @param parts the compilation units that are included in this library using
a {@code part}directive | 3728 * @param parts the compilation units that are included in this library using
a {@code part}directive |
3729 */ | 3729 */ |
3730 void set parts(List<CompilationUnitElement> parts2) { | 3730 void set parts(List<CompilationUnitElement> parts2) { |
(...skipping 13 matching lines...) Expand all Loading... |
3744 /** | 3744 /** |
3745 * Answer {@code true} if the receiver directly or indirectly imports the dart
:html libraries. | 3745 * Answer {@code true} if the receiver directly or indirectly imports the dart
:html libraries. |
3746 * @return {@code true} if the receiver directly or indirectly imports the dar
t:html libraries | 3746 * @return {@code true} if the receiver directly or indirectly imports the dar
t:html libraries |
3747 */ | 3747 */ |
3748 bool isOrImportsBrowserLibrary() { | 3748 bool isOrImportsBrowserLibrary() { |
3749 List<LibraryElement> visited = new List<LibraryElement>(); | 3749 List<LibraryElement> visited = new List<LibraryElement>(); |
3750 Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML); | 3750 Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML); |
3751 visited.add(this); | 3751 visited.add(this); |
3752 for (int index = 0; index < visited.length; index++) { | 3752 for (int index = 0; index < visited.length; index++) { |
3753 LibraryElement library = visited[index]; | 3753 LibraryElement library = visited[index]; |
3754 Source source2 = library.definingCompilationUnit.source; | 3754 Source source = library.definingCompilationUnit.source; |
3755 if (source2 == htmlLibSource) { | 3755 if (source == htmlLibSource) { |
3756 return true; | 3756 return true; |
3757 } | 3757 } |
3758 for (LibraryElement importedLibrary in library.importedLibraries) { | 3758 for (LibraryElement importedLibrary in library.importedLibraries) { |
3759 if (!visited.contains(importedLibrary)) { | 3759 if (!visited.contains(importedLibrary)) { |
3760 visited.add(importedLibrary); | 3760 visited.add(importedLibrary); |
3761 } | 3761 } |
3762 } | 3762 } |
3763 for (LibraryElement exportedLibrary in library.exportedLibraries) { | 3763 for (LibraryElement exportedLibrary in library.exportedLibraries) { |
3764 if (!visited.contains(exportedLibrary)) { | 3764 if (!visited.contains(exportedLibrary)) { |
3765 visited.add(exportedLibrary); | 3765 visited.add(exportedLibrary); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3852 */ | 3852 */ |
3853 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set) { | 3853 MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOff
set) { |
3854 _jtd_constructor_218_impl(name, nameOffset); | 3854 _jtd_constructor_218_impl(name, nameOffset); |
3855 } | 3855 } |
3856 _jtd_constructor_218_impl(String name, int nameOffset) { | 3856 _jtd_constructor_218_impl(String name, int nameOffset) { |
3857 } | 3857 } |
3858 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); | 3858 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); |
3859 ClassElement get enclosingElement => super.enclosingElement as ClassElement; | 3859 ClassElement get enclosingElement => super.enclosingElement as ClassElement; |
3860 ElementKind get kind => ElementKind.METHOD; | 3860 ElementKind get kind => ElementKind.METHOD; |
3861 String get name { | 3861 String get name { |
3862 String name2 = super.name; | 3862 String name = super.name; |
3863 if (isOperator() && name2 == "-") { | 3863 if (isOperator() && name == "-") { |
3864 if (parameters.length == 0) { | 3864 if (parameters.length == 0) { |
3865 return "unary-"; | 3865 return "unary-"; |
3866 } | 3866 } |
3867 } | 3867 } |
3868 return super.name; | 3868 return super.name; |
3869 } | 3869 } |
3870 bool isAbstract() => hasModifier(Modifier.ABSTRACT); | 3870 bool isAbstract() => hasModifier(Modifier.ABSTRACT); |
3871 bool isOperator() { | 3871 bool isOperator() { |
3872 String name = displayName; | 3872 String name = displayName; |
3873 if (name.isEmpty) { | 3873 if (name.isEmpty) { |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4624 */ | 4624 */ |
4625 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType) { | 4625 ConstructorMember(ConstructorElement baseElement, InterfaceType definingType)
: super(baseElement, definingType) { |
4626 } | 4626 } |
4627 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); | 4627 accept(ElementVisitor visitor) => visitor.visitConstructorElement(this); |
4628 ConstructorElement get baseElement => super.baseElement as ConstructorElement; | 4628 ConstructorElement get baseElement => super.baseElement as ConstructorElement; |
4629 ClassElement get enclosingElement => baseElement.enclosingElement; | 4629 ClassElement get enclosingElement => baseElement.enclosingElement; |
4630 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); | 4630 ConstructorElement get redirectedConstructor => from(baseElement.redirectedCon
structor, definingType); |
4631 bool isConst() => baseElement.isConst(); | 4631 bool isConst() => baseElement.isConst(); |
4632 bool isFactory() => baseElement.isFactory(); | 4632 bool isFactory() => baseElement.isFactory(); |
4633 String toString() { | 4633 String toString() { |
4634 ConstructorElement baseElement2 = baseElement; | 4634 ConstructorElement baseElement = this.baseElement; |
4635 List<ParameterElement> parameters2 = parameters; | 4635 List<ParameterElement> parameters = this.parameters; |
4636 FunctionType type2 = type; | 4636 FunctionType type = this.type; |
4637 JavaStringBuilder builder = new JavaStringBuilder(); | 4637 JavaStringBuilder builder = new JavaStringBuilder(); |
4638 builder.append(baseElement2.enclosingElement.displayName); | 4638 builder.append(baseElement.enclosingElement.displayName); |
4639 String name = displayName; | 4639 String name = displayName; |
4640 if (name != null && !name.isEmpty) { | 4640 if (name != null && !name.isEmpty) { |
4641 builder.append("."); | 4641 builder.append("."); |
4642 builder.append(name); | 4642 builder.append(name); |
4643 } | 4643 } |
4644 builder.append("("); | 4644 builder.append("("); |
4645 int parameterCount = parameters2.length; | 4645 int parameterCount = parameters.length; |
4646 for (int i = 0; i < parameterCount; i++) { | 4646 for (int i = 0; i < parameterCount; i++) { |
4647 if (i > 0) { | 4647 if (i > 0) { |
4648 builder.append(", "); | 4648 builder.append(", "); |
4649 } | 4649 } |
4650 builder.append(parameters2[i]).toString(); | 4650 builder.append(parameters[i]).toString(); |
4651 } | 4651 } |
4652 builder.append(")"); | 4652 builder.append(")"); |
4653 if (type2 != null) { | 4653 if (type != null) { |
4654 builder.append(" -> "); | 4654 builder.append(" -> "); |
4655 builder.append(type2.returnType); | 4655 builder.append(type.returnType); |
4656 } | 4656 } |
4657 return builder.toString(); | 4657 return builder.toString(); |
4658 } | 4658 } |
4659 InterfaceType get definingType => super.definingType as InterfaceType; | 4659 InterfaceType get definingType => super.definingType as InterfaceType; |
4660 } | 4660 } |
4661 /** | 4661 /** |
4662 * The abstract class {@code ExecutableMember} defines the behavior common to me
mbers that represent | 4662 * The abstract class {@code ExecutableMember} defines the behavior common to me
mbers that represent |
4663 * an executable element defined in a parameterized type where the values of the
type parameters are | 4663 * an executable element defined in a parameterized type where the values of the
type parameters are |
4664 * known. | 4664 * known. |
4665 */ | 4665 */ |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4891 * @param baseElement the element on which the parameterized element was creat
ed | 4891 * @param baseElement the element on which the parameterized element was creat
ed |
4892 * @param definingType the type in which the element is defined | 4892 * @param definingType the type in which the element is defined |
4893 */ | 4893 */ |
4894 MethodMember(MethodElement baseElement, InterfaceType definingType) : super(ba
seElement, definingType) { | 4894 MethodMember(MethodElement baseElement, InterfaceType definingType) : super(ba
seElement, definingType) { |
4895 } | 4895 } |
4896 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); | 4896 accept(ElementVisitor visitor) => visitor.visitMethodElement(this); |
4897 MethodElement get baseElement => super.baseElement as MethodElement; | 4897 MethodElement get baseElement => super.baseElement as MethodElement; |
4898 ClassElement get enclosingElement => baseElement.enclosingElement; | 4898 ClassElement get enclosingElement => baseElement.enclosingElement; |
4899 bool isAbstract() => baseElement.isAbstract(); | 4899 bool isAbstract() => baseElement.isAbstract(); |
4900 String toString() { | 4900 String toString() { |
4901 MethodElement baseElement2 = baseElement; | 4901 MethodElement baseElement = this.baseElement; |
4902 List<ParameterElement> parameters2 = parameters; | 4902 List<ParameterElement> parameters = this.parameters; |
4903 FunctionType type2 = type; | 4903 FunctionType type = this.type; |
4904 JavaStringBuilder builder = new JavaStringBuilder(); | 4904 JavaStringBuilder builder = new JavaStringBuilder(); |
4905 builder.append(baseElement2.enclosingElement.displayName); | 4905 builder.append(baseElement.enclosingElement.displayName); |
4906 builder.append("."); | 4906 builder.append("."); |
4907 builder.append(baseElement2.displayName); | 4907 builder.append(baseElement.displayName); |
4908 builder.append("("); | 4908 builder.append("("); |
4909 int parameterCount = parameters2.length; | 4909 int parameterCount = parameters.length; |
4910 for (int i = 0; i < parameterCount; i++) { | 4910 for (int i = 0; i < parameterCount; i++) { |
4911 if (i > 0) { | 4911 if (i > 0) { |
4912 builder.append(", "); | 4912 builder.append(", "); |
4913 } | 4913 } |
4914 builder.append(parameters2[i]).toString(); | 4914 builder.append(parameters[i]).toString(); |
4915 } | 4915 } |
4916 builder.append(")"); | 4916 builder.append(")"); |
4917 if (type2 != null) { | 4917 if (type != null) { |
4918 builder.append(" -> "); | 4918 builder.append(" -> "); |
4919 builder.append(type2.returnType); | 4919 builder.append(type.returnType); |
4920 } | 4920 } |
4921 return builder.toString(); | 4921 return builder.toString(); |
4922 } | 4922 } |
4923 } | 4923 } |
4924 /** | 4924 /** |
4925 * Instances of the class {@code ParameterMember} represent a parameter element
defined in a | 4925 * Instances of the class {@code ParameterMember} represent a parameter element
defined in a |
4926 * parameterized type where the values of the type parameters are known. | 4926 * parameterized type where the values of the type parameters are known. |
4927 */ | 4927 */ |
4928 class ParameterMember extends VariableMember implements ParameterElement { | 4928 class ParameterMember extends VariableMember implements ParameterElement { |
4929 | 4929 |
(...skipping 24 matching lines...) Expand all Loading... |
4954 /** | 4954 /** |
4955 * Initialize a newly created element to represent a parameter of the given pa
rameterized type. | 4955 * Initialize a newly created element to represent a parameter of the given pa
rameterized type. |
4956 * @param baseElement the element on which the parameterized element was creat
ed | 4956 * @param baseElement the element on which the parameterized element was creat
ed |
4957 * @param definingType the type in which the element is defined | 4957 * @param definingType the type in which the element is defined |
4958 */ | 4958 */ |
4959 ParameterMember(ParameterElement baseElement, ParameterizedType definingType)
: super(baseElement, definingType) { | 4959 ParameterMember(ParameterElement baseElement, ParameterizedType definingType)
: super(baseElement, definingType) { |
4960 } | 4960 } |
4961 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); | 4961 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); |
4962 Element getAncestor(Type elementClass) { | 4962 Element getAncestor(Type elementClass) { |
4963 Element element = baseElement.getAncestor(elementClass); | 4963 Element element = baseElement.getAncestor(elementClass); |
4964 ParameterizedType definingType2 = definingType; | 4964 ParameterizedType definingType = this.definingType; |
4965 if (definingType2 is InterfaceType) { | 4965 if (definingType is InterfaceType) { |
4966 InterfaceType definingInterfaceType = definingType2 as InterfaceType; | 4966 InterfaceType definingInterfaceType = definingType as InterfaceType; |
4967 if (element is ConstructorElement) { | 4967 if (element is ConstructorElement) { |
4968 return ConstructorMember.from((element as ConstructorElement), definingI
nterfaceType) as Element; | 4968 return ConstructorMember.from((element as ConstructorElement), definingI
nterfaceType) as Element; |
4969 } else if (element is MethodElement) { | 4969 } else if (element is MethodElement) { |
4970 return MethodMember.from((element as MethodElement), definingInterfaceTy
pe) as Element; | 4970 return MethodMember.from((element as MethodElement), definingInterfaceTy
pe) as Element; |
4971 } else if (element is PropertyAccessorElement) { | 4971 } else if (element is PropertyAccessorElement) { |
4972 return PropertyAccessorMember.from((element as PropertyAccessorElement),
definingInterfaceType) as Element; | 4972 return PropertyAccessorMember.from((element as PropertyAccessorElement),
definingInterfaceType) as Element; |
4973 } | 4973 } |
4974 } | 4974 } |
4975 return element; | 4975 return element; |
4976 } | 4976 } |
4977 ParameterElement get baseElement => super.baseElement as ParameterElement; | 4977 ParameterElement get baseElement => super.baseElement as ParameterElement; |
4978 Element get enclosingElement => baseElement.enclosingElement; | 4978 Element get enclosingElement => baseElement.enclosingElement; |
4979 ParameterKind get parameterKind => baseElement.parameterKind; | 4979 ParameterKind get parameterKind => baseElement.parameterKind; |
4980 List<ParameterElement> get parameters { | 4980 List<ParameterElement> get parameters { |
4981 List<ParameterElement> baseParameters = baseElement.parameters; | 4981 List<ParameterElement> baseParameters = baseElement.parameters; |
4982 int parameterCount = baseParameters.length; | 4982 int parameterCount = baseParameters.length; |
4983 if (parameterCount == 0) { | 4983 if (parameterCount == 0) { |
4984 return baseParameters; | 4984 return baseParameters; |
4985 } | 4985 } |
4986 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); | 4986 List<ParameterElement> parameterizedParameters = new List<ParameterElement>(
parameterCount); |
4987 for (int i = 0; i < parameterCount; i++) { | 4987 for (int i = 0; i < parameterCount; i++) { |
4988 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); | 4988 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin
ingType); |
4989 } | 4989 } |
4990 return parameterizedParameters; | 4990 return parameterizedParameters; |
4991 } | 4991 } |
4992 SourceRange get visibleRange => baseElement.visibleRange; | 4992 SourceRange get visibleRange => baseElement.visibleRange; |
4993 bool isInitializingFormal() => baseElement.isInitializingFormal(); | 4993 bool isInitializingFormal() => baseElement.isInitializingFormal(); |
4994 String toString() { | 4994 String toString() { |
4995 ParameterElement baseElement2 = baseElement; | 4995 ParameterElement baseElement = this.baseElement; |
4996 String left = ""; | 4996 String left = ""; |
4997 String right = ""; | 4997 String right = ""; |
4998 while (true) { | 4998 while (true) { |
4999 if (baseElement2.parameterKind == ParameterKind.NAMED) { | 4999 if (baseElement.parameterKind == ParameterKind.NAMED) { |
5000 left = "{"; | 5000 left = "{"; |
5001 right = "}"; | 5001 right = "}"; |
5002 } else if (baseElement2.parameterKind == ParameterKind.POSITIONAL) { | 5002 } else if (baseElement.parameterKind == ParameterKind.POSITIONAL) { |
5003 left = "["; | 5003 left = "["; |
5004 right = "]"; | 5004 right = "]"; |
5005 } | 5005 } |
5006 break; | 5006 break; |
5007 } | 5007 } |
5008 JavaStringBuilder builder = new JavaStringBuilder(); | 5008 JavaStringBuilder builder = new JavaStringBuilder(); |
5009 builder.append(left); | 5009 builder.append(left); |
5010 builder.append(type); | 5010 builder.append(type); |
5011 builder.append(" "); | 5011 builder.append(" "); |
5012 builder.append(baseElement2.displayName); | 5012 builder.append(baseElement.displayName); |
5013 builder.append(right); | 5013 builder.append(right); |
5014 return builder.toString(); | 5014 return builder.toString(); |
5015 } | 5015 } |
5016 void visitChildren(ElementVisitor<Object> visitor) { | 5016 void visitChildren(ElementVisitor<Object> visitor) { |
5017 super.visitChildren(visitor); | 5017 super.visitChildren(visitor); |
5018 safelyVisitChildren(parameters, visitor); | 5018 safelyVisitChildren(parameters, visitor); |
5019 } | 5019 } |
5020 } | 5020 } |
5021 /** | 5021 /** |
5022 * Instances of the class {@code PropertyAccessorMember} represent a property ac
cessor element | 5022 * Instances of the class {@code PropertyAccessorMember} represent a property ac
cessor element |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5055 * @param definingType the type in which the element is defined | 5055 * @param definingType the type in which the element is defined |
5056 */ | 5056 */ |
5057 PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType defi
ningType) : super(baseElement, definingType) { | 5057 PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType defi
ningType) : super(baseElement, definingType) { |
5058 } | 5058 } |
5059 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); | 5059 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); |
5060 PropertyAccessorElement get baseElement => super.baseElement as PropertyAccess
orElement; | 5060 PropertyAccessorElement get baseElement => super.baseElement as PropertyAccess
orElement; |
5061 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond
ingGetter, definingType); | 5061 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond
ingGetter, definingType); |
5062 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond
ingSetter, definingType); | 5062 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond
ingSetter, definingType); |
5063 Element get enclosingElement => baseElement.enclosingElement; | 5063 Element get enclosingElement => baseElement.enclosingElement; |
5064 PropertyInducingElement get variable { | 5064 PropertyInducingElement get variable { |
5065 PropertyInducingElement variable2 = baseElement.variable; | 5065 PropertyInducingElement variable = baseElement.variable; |
5066 if (variable2 is FieldElement) { | 5066 if (variable is FieldElement) { |
5067 return FieldMember.from(((variable2 as FieldElement)), definingType); | 5067 return FieldMember.from(((variable as FieldElement)), definingType); |
5068 } | 5068 } |
5069 return variable2; | 5069 return variable; |
5070 } | 5070 } |
5071 bool isAbstract() => baseElement.isAbstract(); | 5071 bool isAbstract() => baseElement.isAbstract(); |
5072 bool isGetter() => baseElement.isGetter(); | 5072 bool isGetter() => baseElement.isGetter(); |
5073 bool isSetter() => baseElement.isSetter(); | 5073 bool isSetter() => baseElement.isSetter(); |
5074 InterfaceType get definingType => super.definingType as InterfaceType; | 5074 InterfaceType get definingType => super.definingType as InterfaceType; |
5075 } | 5075 } |
5076 /** | 5076 /** |
5077 * The abstract class {@code VariableMember} defines the behavior common to memb
ers that represent a | 5077 * The abstract class {@code VariableMember} defines the behavior common to memb
ers that represent a |
5078 * variable element defined in a parameterized type where the values of the type
parameters are | 5078 * variable element defined in a parameterized type where the values of the type
parameters are |
5079 * known. | 5079 * known. |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5284 _jtd_constructor_300_impl(FunctionTypeAliasElement element) { | 5284 _jtd_constructor_300_impl(FunctionTypeAliasElement element) { |
5285 } | 5285 } |
5286 bool operator ==(Object object) { | 5286 bool operator ==(Object object) { |
5287 if (object is! FunctionTypeImpl) { | 5287 if (object is! FunctionTypeImpl) { |
5288 return false; | 5288 return false; |
5289 } | 5289 } |
5290 FunctionTypeImpl otherType = object as FunctionTypeImpl; | 5290 FunctionTypeImpl otherType = object as FunctionTypeImpl; |
5291 return element == otherType.element && JavaArrays.equals(_normalParameterTyp
es, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterType
s, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType
._namedParameterTypes) && _returnType == otherType._returnType; | 5291 return element == otherType.element && JavaArrays.equals(_normalParameterTyp
es, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterType
s, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType
._namedParameterTypes) && _returnType == otherType._returnType; |
5292 } | 5292 } |
5293 String get displayName { | 5293 String get displayName { |
5294 String name2 = name; | 5294 String name = this.name; |
5295 if (name2 == null) { | 5295 if (name == null) { |
5296 JavaStringBuilder builder = new JavaStringBuilder(); | 5296 JavaStringBuilder builder = new JavaStringBuilder(); |
5297 builder.append("("); | 5297 builder.append("("); |
5298 bool needsComma = false; | 5298 bool needsComma = false; |
5299 if (_normalParameterTypes.length > 0) { | 5299 if (_normalParameterTypes.length > 0) { |
5300 for (Type2 type in _normalParameterTypes) { | 5300 for (Type2 type in _normalParameterTypes) { |
5301 if (needsComma) { | 5301 if (needsComma) { |
5302 builder.append(", "); | 5302 builder.append(", "); |
5303 } else { | 5303 } else { |
5304 needsComma = true; | 5304 needsComma = true; |
5305 } | 5305 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5341 } | 5341 } |
5342 builder.append("}"); | 5342 builder.append("}"); |
5343 needsComma = true; | 5343 needsComma = true; |
5344 } | 5344 } |
5345 builder.append(") -> "); | 5345 builder.append(") -> "); |
5346 if (_returnType == null) { | 5346 if (_returnType == null) { |
5347 builder.append("null"); | 5347 builder.append("null"); |
5348 } else { | 5348 } else { |
5349 builder.append(_returnType.displayName); | 5349 builder.append(_returnType.displayName); |
5350 } | 5350 } |
5351 name2 = builder.toString(); | 5351 name = builder.toString(); |
5352 } | 5352 } |
5353 return name2; | 5353 return name; |
5354 } | 5354 } |
5355 Map<String, Type2> get namedParameterTypes => _namedParameterTypes; | 5355 Map<String, Type2> get namedParameterTypes => _namedParameterTypes; |
5356 List<Type2> get normalParameterTypes => _normalParameterTypes; | 5356 List<Type2> get normalParameterTypes => _normalParameterTypes; |
5357 List<Type2> get optionalParameterTypes => _optionalParameterTypes; | 5357 List<Type2> get optionalParameterTypes => _optionalParameterTypes; |
5358 List<ParameterElement> get parameters { | 5358 List<ParameterElement> get parameters { |
5359 List<ParameterElement> baseParameters2 = baseParameters; | 5359 List<ParameterElement> baseParameters = this.baseParameters; |
5360 int parameterCount = baseParameters2.length; | 5360 int parameterCount = baseParameters.length; |
5361 if (parameterCount == 0) { | 5361 if (parameterCount == 0) { |
5362 return baseParameters2; | 5362 return baseParameters; |
5363 } | 5363 } |
5364 List<ParameterElement> specializedParameters = new List<ParameterElement>(pa
rameterCount); | 5364 List<ParameterElement> specializedParameters = new List<ParameterElement>(pa
rameterCount); |
5365 for (int i = 0; i < parameterCount; i++) { | 5365 for (int i = 0; i < parameterCount; i++) { |
5366 specializedParameters[i] = ParameterMember.from(baseParameters2[i], this); | 5366 specializedParameters[i] = ParameterMember.from(baseParameters[i], this); |
5367 } | 5367 } |
5368 return specializedParameters; | 5368 return specializedParameters; |
5369 } | 5369 } |
5370 Type2 get returnType => _returnType; | 5370 Type2 get returnType => _returnType; |
5371 List<Type2> get typeArguments => _typeArguments; | 5371 List<Type2> get typeArguments => _typeArguments; |
5372 List<TypeVariableElement> get typeVariables { | 5372 List<TypeVariableElement> get typeVariables { |
5373 Element element2 = element; | 5373 Element element = this.element; |
5374 if (element2 is FunctionTypeAliasElement) { | 5374 if (element is FunctionTypeAliasElement) { |
5375 return ((element2 as FunctionTypeAliasElement)).typeVariables; | 5375 return ((element as FunctionTypeAliasElement)).typeVariables; |
5376 } | 5376 } |
5377 return TypeVariableElementImpl.EMPTY_ARRAY; | 5377 return TypeVariableElementImpl.EMPTY_ARRAY; |
5378 } | 5378 } |
5379 int get hashCode { | 5379 int get hashCode { |
5380 Element element2 = element; | 5380 Element element = this.element; |
5381 if (element2 == null) { | 5381 if (element == null) { |
5382 return 0; | 5382 return 0; |
5383 } | 5383 } |
5384 return element2.hashCode; | 5384 return element.hashCode; |
5385 } | 5385 } |
5386 bool isSubtypeOf(Type2 type) { | 5386 bool isSubtypeOf(Type2 type) { |
5387 if (type == null) { | 5387 if (type == null) { |
5388 return false; | 5388 return false; |
5389 } else if (identical(this, type) || type.isDynamic() || type.isDartCoreFunct
ion() || type.isObject()) { | 5389 } else if (identical(this, type) || type.isDynamic() || type.isDartCoreFunct
ion() || type.isObject()) { |
5390 return true; | 5390 return true; |
5391 } else if (type is! FunctionType) { | 5391 } else if (type is! FunctionType) { |
5392 return false; | 5392 return false; |
5393 } else if (this == type) { | 5393 } else if (this == type) { |
5394 return true; | 5394 return true; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5503 this._typeArguments = typeArguments2; | 5503 this._typeArguments = typeArguments2; |
5504 } | 5504 } |
5505 FunctionTypeImpl substitute4(List<Type2> argumentTypes) => substitute2(argumen
tTypes, typeArguments); | 5505 FunctionTypeImpl substitute4(List<Type2> argumentTypes) => substitute2(argumen
tTypes, typeArguments); |
5506 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT
ypes) { | 5506 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT
ypes) { |
5507 if (argumentTypes.length != parameterTypes.length) { | 5507 if (argumentTypes.length != parameterTypes.length) { |
5508 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); | 5508 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes.
length}) != parameterTypes.length (${parameterTypes.length})"); |
5509 } | 5509 } |
5510 if (argumentTypes.length == 0) { | 5510 if (argumentTypes.length == 0) { |
5511 return this; | 5511 return this; |
5512 } | 5512 } |
5513 Element element2 = element; | 5513 Element element = this.element; |
5514 FunctionTypeImpl newType = (element2 is ExecutableElement) ? new FunctionTyp
eImpl.con1((element2 as ExecutableElement)) : new FunctionTypeImpl.con2((element
2 as FunctionTypeAliasElement)); | 5514 FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionType
Impl.con1((element as ExecutableElement)) : new FunctionTypeImpl.con2((element a
s FunctionTypeAliasElement)); |
5515 newType.returnType = _returnType.substitute2(argumentTypes, parameterTypes); | 5515 newType.returnType = _returnType.substitute2(argumentTypes, parameterTypes); |
5516 newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, ar
gumentTypes, parameterTypes); | 5516 newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, ar
gumentTypes, parameterTypes); |
5517 newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes
, argumentTypes, parameterTypes); | 5517 newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes
, argumentTypes, parameterTypes); |
5518 newType._namedParameterTypes = substitute3(_namedParameterTypes, argumentTyp
es, parameterTypes); | 5518 newType._namedParameterTypes = substitute3(_namedParameterTypes, argumentTyp
es, parameterTypes); |
5519 newType.typeArguments = argumentTypes; | 5519 newType.typeArguments = argumentTypes; |
5520 return newType; | 5520 return newType; |
5521 } | 5521 } |
5522 void appendTo(JavaStringBuilder builder) { | 5522 void appendTo(JavaStringBuilder builder) { |
5523 builder.append("("); | 5523 builder.append("("); |
5524 bool needsComma = false; | 5524 bool needsComma = false; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5573 builder.append("null"); | 5573 builder.append("null"); |
5574 } else { | 5574 } else { |
5575 ((_returnType as TypeImpl)).appendTo(builder); | 5575 ((_returnType as TypeImpl)).appendTo(builder); |
5576 } | 5576 } |
5577 } | 5577 } |
5578 | 5578 |
5579 /** | 5579 /** |
5580 * @return the base parameter elements of this function element, not {@code nu
ll}. | 5580 * @return the base parameter elements of this function element, not {@code nu
ll}. |
5581 */ | 5581 */ |
5582 List<ParameterElement> get baseParameters { | 5582 List<ParameterElement> get baseParameters { |
5583 Element element2 = element; | 5583 Element element = this.element; |
5584 if (element2 is ExecutableElement) { | 5584 if (element is ExecutableElement) { |
5585 return ((element2 as ExecutableElement)).parameters; | 5585 return ((element as ExecutableElement)).parameters; |
5586 } else { | 5586 } else { |
5587 return ((element2 as FunctionTypeAliasElement)).parameters; | 5587 return ((element as FunctionTypeAliasElement)).parameters; |
5588 } | 5588 } |
5589 } | 5589 } |
5590 } | 5590 } |
5591 /** | 5591 /** |
5592 * Instances of the class {@code InterfaceTypeImpl} defines the behavior common
to objects | 5592 * Instances of the class {@code InterfaceTypeImpl} defines the behavior common
to objects |
5593 * representing the type introduced by either a class or an interface, or a refe
rence to such a | 5593 * representing the type introduced by either a class or an interface, or a refe
rence to such a |
5594 * type. | 5594 * type. |
5595 * @coverage dart.engine.type | 5595 * @coverage dart.engine.type |
5596 */ | 5596 */ |
5597 class InterfaceTypeImpl extends TypeImpl implements InterfaceType { | 5597 class InterfaceTypeImpl extends TypeImpl implements InterfaceType { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5638 List<InterfaceType> superinterfaces = classElement.interfaces; | 5638 List<InterfaceType> superinterfaces = classElement.interfaces; |
5639 int pathLength; | 5639 int pathLength; |
5640 if (superinterfaces.length > 0) { | 5640 if (superinterfaces.length > 0) { |
5641 for (InterfaceType superinterface in superinterfaces) { | 5641 for (InterfaceType superinterface in superinterfaces) { |
5642 pathLength = computeLongestInheritancePathToObject2(superinterface, de
pth + 1, visitedClasses); | 5642 pathLength = computeLongestInheritancePathToObject2(superinterface, de
pth + 1, visitedClasses); |
5643 if (pathLength > longestPath) { | 5643 if (pathLength > longestPath) { |
5644 longestPath = pathLength; | 5644 longestPath = pathLength; |
5645 } | 5645 } |
5646 } | 5646 } |
5647 } | 5647 } |
5648 InterfaceType supertype2 = classElement.supertype; | 5648 InterfaceType supertype = classElement.supertype; |
5649 pathLength = computeLongestInheritancePathToObject2(supertype2, depth + 1,
visitedClasses); | 5649 pathLength = computeLongestInheritancePathToObject2(supertype, depth + 1,
visitedClasses); |
5650 if (pathLength > longestPath) { | 5650 if (pathLength > longestPath) { |
5651 longestPath = pathLength; | 5651 longestPath = pathLength; |
5652 } | 5652 } |
5653 } finally { | 5653 } finally { |
5654 visitedClasses.remove(classElement); | 5654 visitedClasses.remove(classElement); |
5655 } | 5655 } |
5656 return longestPath; | 5656 return longestPath; |
5657 } | 5657 } |
5658 | 5658 |
5659 /** | 5659 /** |
5660 * Returns the set of all superinterfaces of the passed {@link Type}. This is
a recursive method, | 5660 * Returns the set of all superinterfaces of the passed {@link Type}. This is
a recursive method, |
5661 * callers should call the public {@link #computeSuperinterfaceSet(Type)}. | 5661 * callers should call the public {@link #computeSuperinterfaceSet(Type)}. |
5662 * @param type the {@link Type} to compute the set of superinterfaces of | 5662 * @param type the {@link Type} to compute the set of superinterfaces of |
5663 * @param set a {@link HashSet} used recursively by this method | 5663 * @param set a {@link HashSet} used recursively by this method |
5664 * @return the {@link Set} of superinterfaces of the passed {@link Type} | 5664 * @return the {@link Set} of superinterfaces of the passed {@link Type} |
5665 * @see #computeSuperinterfaceSet(Type) | 5665 * @see #computeSuperinterfaceSet(Type) |
5666 * @see #getLeastUpperBound(Type) | 5666 * @see #getLeastUpperBound(Type) |
5667 */ | 5667 */ |
5668 static Set<InterfaceType> computeSuperinterfaceSet2(InterfaceType type, Set<In
terfaceType> set) { | 5668 static Set<InterfaceType> computeSuperinterfaceSet2(InterfaceType type, Set<In
terfaceType> set) { |
5669 Element element2 = type.element; | 5669 Element element = type.element; |
5670 if (element2 != null && element2 is ClassElement) { | 5670 if (element != null && element is ClassElement) { |
5671 ClassElement classElement = element2 as ClassElement; | 5671 ClassElement classElement = element as ClassElement; |
5672 List<InterfaceType> superinterfaces = classElement.interfaces; | 5672 List<InterfaceType> superinterfaces = classElement.interfaces; |
5673 for (InterfaceType superinterface in superinterfaces) { | 5673 for (InterfaceType superinterface in superinterfaces) { |
5674 if (javaSetAdd(set, superinterface)) { | 5674 if (javaSetAdd(set, superinterface)) { |
5675 computeSuperinterfaceSet2(superinterface, set); | 5675 computeSuperinterfaceSet2(superinterface, set); |
5676 } | 5676 } |
5677 } | 5677 } |
5678 InterfaceType supertype2 = classElement.supertype; | 5678 InterfaceType supertype = classElement.supertype; |
5679 if (supertype2 != null) { | 5679 if (supertype != null) { |
5680 if (javaSetAdd(set, supertype2)) { | 5680 if (javaSetAdd(set, supertype)) { |
5681 computeSuperinterfaceSet2(supertype2, set); | 5681 computeSuperinterfaceSet2(supertype, set); |
5682 } | 5682 } |
5683 } | 5683 } |
5684 } | 5684 } |
5685 return set; | 5685 return set; |
5686 } | 5686 } |
5687 | 5687 |
5688 /** | 5688 /** |
5689 * Return the intersection of the given sets of types, where intersection is b
ased on the equality | 5689 * Return the intersection of the given sets of types, where intersection is b
ased on the equality |
5690 * of the elements of the types rather than on the equality of the types thems
elves. In cases | 5690 * of the elements of the types rather than on the equality of the types thems
elves. In cases |
5691 * where two non-equal types have equal elements, which only happens when the
class is | 5691 * where two non-equal types have equal elements, which only happens when the
class is |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5772 if (object is! InterfaceTypeImpl) { | 5772 if (object is! InterfaceTypeImpl) { |
5773 return false; | 5773 return false; |
5774 } | 5774 } |
5775 InterfaceTypeImpl otherType = object as InterfaceTypeImpl; | 5775 InterfaceTypeImpl otherType = object as InterfaceTypeImpl; |
5776 return element == otherType.element && JavaArrays.equals(_typeArguments, oth
erType._typeArguments); | 5776 return element == otherType.element && JavaArrays.equals(_typeArguments, oth
erType._typeArguments); |
5777 } | 5777 } |
5778 ClassElement get element => super.element as ClassElement; | 5778 ClassElement get element => super.element as ClassElement; |
5779 PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getGetter(getterName), this); | 5779 PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getGetter(getterName), this); |
5780 List<InterfaceType> get interfaces { | 5780 List<InterfaceType> get interfaces { |
5781 ClassElement classElement = element; | 5781 ClassElement classElement = element; |
5782 List<InterfaceType> interfaces2 = classElement.interfaces; | 5782 List<InterfaceType> interfaces = classElement.interfaces; |
5783 List<TypeVariableElement> typeVariables2 = classElement.typeVariables; | 5783 List<TypeVariableElement> typeVariables = classElement.typeVariables; |
5784 if (typeVariables2.length == 0) { | 5784 if (typeVariables.length == 0) { |
5785 return interfaces2; | 5785 return interfaces; |
5786 } | 5786 } |
5787 int count = interfaces2.length; | 5787 int count = interfaces.length; |
5788 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count); | 5788 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count); |
5789 for (int i = 0; i < count; i++) { | 5789 for (int i = 0; i < count; i++) { |
5790 typedInterfaces[i] = interfaces2[i].substitute2(_typeArguments, TypeVariab
leTypeImpl.getTypes(typeVariables2)); | 5790 typedInterfaces[i] = interfaces[i].substitute2(_typeArguments, TypeVariabl
eTypeImpl.getTypes(typeVariables)); |
5791 } | 5791 } |
5792 return typedInterfaces; | 5792 return typedInterfaces; |
5793 } | 5793 } |
5794 Type2 getLeastUpperBound(Type2 type) { | 5794 Type2 getLeastUpperBound(Type2 type) { |
5795 if (identical(type, this)) { | 5795 if (identical(type, this)) { |
5796 return this; | 5796 return this; |
5797 } | 5797 } |
5798 Type2 dynamicType = DynamicTypeImpl.instance; | 5798 Type2 dynamicType = DynamicTypeImpl.instance; |
5799 if (identical(this, dynamicType) || identical(type, dynamicType)) { | 5799 if (identical(this, dynamicType) || identical(type, dynamicType)) { |
5800 return dynamicType; | 5800 return dynamicType; |
(...skipping 27 matching lines...) Expand all Loading... |
5828 } | 5828 } |
5829 if (numberOfTypesAtMaxDepth == 1) { | 5829 if (numberOfTypesAtMaxDepth == 1) { |
5830 return s[indexOfLeastUpperBound]; | 5830 return s[indexOfLeastUpperBound]; |
5831 } | 5831 } |
5832 } | 5832 } |
5833 return null; | 5833 return null; |
5834 } | 5834 } |
5835 MethodElement getMethod(String methodName) => MethodMember.from(((element as C
lassElementImpl)).getMethod(methodName), this); | 5835 MethodElement getMethod(String methodName) => MethodMember.from(((element as C
lassElementImpl)).getMethod(methodName), this); |
5836 List<InterfaceType> get mixins { | 5836 List<InterfaceType> get mixins { |
5837 ClassElement classElement = element; | 5837 ClassElement classElement = element; |
5838 List<InterfaceType> mixins2 = classElement.mixins; | 5838 List<InterfaceType> mixins = classElement.mixins; |
5839 List<TypeVariableElement> typeVariables2 = classElement.typeVariables; | 5839 List<TypeVariableElement> typeVariables = classElement.typeVariables; |
5840 if (typeVariables2.length == 0) { | 5840 if (typeVariables.length == 0) { |
5841 return mixins2; | 5841 return mixins; |
5842 } | 5842 } |
5843 int count = mixins2.length; | 5843 int count = mixins.length; |
5844 List<InterfaceType> typedMixins = new List<InterfaceType>(count); | 5844 List<InterfaceType> typedMixins = new List<InterfaceType>(count); |
5845 for (int i = 0; i < count; i++) { | 5845 for (int i = 0; i < count; i++) { |
5846 typedMixins[i] = mixins2[i].substitute2(_typeArguments, TypeVariableTypeIm
pl.getTypes(typeVariables2)); | 5846 typedMixins[i] = mixins[i].substitute2(_typeArguments, TypeVariableTypeImp
l.getTypes(typeVariables)); |
5847 } | 5847 } |
5848 return typedMixins; | 5848 return typedMixins; |
5849 } | 5849 } |
5850 PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getSetter(setterName), this); | 5850 PropertyAccessorElement getSetter(String setterName) => PropertyAccessorMember
.from(((element as ClassElementImpl)).getSetter(setterName), this); |
5851 InterfaceType get superclass { | 5851 InterfaceType get superclass { |
5852 ClassElement classElement = element; | 5852 ClassElement classElement = element; |
5853 InterfaceType supertype2 = classElement.supertype; | 5853 InterfaceType supertype = classElement.supertype; |
5854 if (supertype2 == null) { | 5854 if (supertype == null) { |
5855 return null; | 5855 return null; |
5856 } | 5856 } |
5857 return supertype2.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(
classElement.typeVariables)); | 5857 return supertype.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(c
lassElement.typeVariables)); |
5858 } | 5858 } |
5859 List<Type2> get typeArguments => _typeArguments; | 5859 List<Type2> get typeArguments => _typeArguments; |
5860 List<TypeVariableElement> get typeVariables => element.typeVariables; | 5860 List<TypeVariableElement> get typeVariables => element.typeVariables; |
5861 int get hashCode { | 5861 int get hashCode { |
5862 ClassElement element2 = element; | 5862 ClassElement element = this.element; |
5863 if (element2 == null) { | 5863 if (element == null) { |
5864 return 0; | 5864 return 0; |
5865 } | 5865 } |
5866 return element2.hashCode; | 5866 return element.hashCode; |
5867 } | 5867 } |
5868 bool isDartCoreFunction() { | 5868 bool isDartCoreFunction() { |
5869 ClassElement element2 = element; | 5869 ClassElement element = this.element; |
5870 if (element2 == null) { | 5870 if (element == null) { |
5871 return false; | 5871 return false; |
5872 } | 5872 } |
5873 return element2.name == "Function" && element2.library.isDartCore(); | 5873 return element.name == "Function" && element.library.isDartCore(); |
5874 } | 5874 } |
5875 bool isDirectSupertypeOf(InterfaceType type) { | 5875 bool isDirectSupertypeOf(InterfaceType type) { |
5876 ClassElement i = element; | 5876 ClassElement i = element; |
5877 ClassElement j = type.element; | 5877 ClassElement j = type.element; |
5878 InterfaceType supertype2 = j.supertype; | 5878 InterfaceType supertype = j.supertype; |
5879 if (supertype2 == null) { | 5879 if (supertype == null) { |
5880 return false; | 5880 return false; |
5881 } | 5881 } |
5882 ClassElement supertypeElement = supertype2.element; | 5882 ClassElement supertypeElement = supertype.element; |
5883 if (supertypeElement == i) { | 5883 if (supertypeElement == i) { |
5884 return true; | 5884 return true; |
5885 } | 5885 } |
5886 for (InterfaceType interfaceType in j.interfaces) { | 5886 for (InterfaceType interfaceType in j.interfaces) { |
5887 if (interfaceType.element == i) { | 5887 if (interfaceType.element == i) { |
5888 return true; | 5888 return true; |
5889 } | 5889 } |
5890 } | 5890 } |
5891 for (InterfaceType mixinType in j.mixins) { | 5891 for (InterfaceType mixinType in j.mixins) { |
5892 if (mixinType.element == i) { | 5892 if (mixinType.element == i) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6079 if (tArguments.length != sArguments.length) { | 6079 if (tArguments.length != sArguments.length) { |
6080 return false; | 6080 return false; |
6081 } | 6081 } |
6082 for (int i = 0; i < tArguments.length; i++) { | 6082 for (int i = 0; i < tArguments.length; i++) { |
6083 if (!tArguments[i].isMoreSpecificThan(sArguments[i])) { | 6083 if (!tArguments[i].isMoreSpecificThan(sArguments[i])) { |
6084 return false; | 6084 return false; |
6085 } | 6085 } |
6086 } | 6086 } |
6087 return true; | 6087 return true; |
6088 } | 6088 } |
6089 ClassElement element2 = element; | 6089 ClassElement element = this.element; |
6090 if (element2 == null || visitedClasses.contains(element2)) { | 6090 if (element == null || visitedClasses.contains(element)) { |
6091 return false; | 6091 return false; |
6092 } | 6092 } |
6093 javaSetAdd(visitedClasses, element2); | 6093 javaSetAdd(visitedClasses, element); |
6094 InterfaceType supertype2 = element2.supertype; | 6094 InterfaceType supertype = element.supertype; |
6095 if (supertype2 != null && ((supertype2 as InterfaceTypeImpl)).isMoreSpecific
Than2(s, visitedClasses)) { | 6095 if (supertype != null && ((supertype as InterfaceTypeImpl)).isMoreSpecificTh
an2(s, visitedClasses)) { |
6096 return true; | 6096 return true; |
6097 } | 6097 } |
6098 for (InterfaceType interfaceType in element2.interfaces) { | 6098 for (InterfaceType interfaceType in element.interfaces) { |
6099 if (((interfaceType as InterfaceTypeImpl)).isMoreSpecificThan2(s, visitedC
lasses)) { | 6099 if (((interfaceType as InterfaceTypeImpl)).isMoreSpecificThan2(s, visitedC
lasses)) { |
6100 return true; | 6100 return true; |
6101 } | 6101 } |
6102 } | 6102 } |
6103 for (InterfaceType mixinType in element2.mixins) { | 6103 for (InterfaceType mixinType in element.mixins) { |
6104 if (((mixinType as InterfaceTypeImpl)).isMoreSpecificThan2(s, visitedClass
es)) { | 6104 if (((mixinType as InterfaceTypeImpl)).isMoreSpecificThan2(s, visitedClass
es)) { |
6105 return true; | 6105 return true; |
6106 } | 6106 } |
6107 } | 6107 } |
6108 return false; | 6108 return false; |
6109 } | 6109 } |
6110 bool isSubtypeOf2(InterfaceType type, Set<ClassElement> visitedClasses) { | 6110 bool isSubtypeOf2(InterfaceType type, Set<ClassElement> visitedClasses) { |
6111 InterfaceType typeT = this; | 6111 InterfaceType typeT = this; |
6112 InterfaceType typeS = type; | 6112 InterfaceType typeS = type; |
6113 ClassElement elementT = element; | 6113 ClassElement elementT = element; |
(...skipping 12 matching lines...) Expand all Loading... |
6126 } | 6126 } |
6127 for (int i = 0; i < typeTArgs.length; i++) { | 6127 for (int i = 0; i < typeTArgs.length; i++) { |
6128 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) { | 6128 if (!typeTArgs[i].isSubtypeOf(typeSArgs[i])) { |
6129 return false; | 6129 return false; |
6130 } | 6130 } |
6131 } | 6131 } |
6132 return true; | 6132 return true; |
6133 } else if (typeS.isDartCoreFunction() && elementT.getMethod("call") != null)
{ | 6133 } else if (typeS.isDartCoreFunction() && elementT.getMethod("call") != null)
{ |
6134 return true; | 6134 return true; |
6135 } | 6135 } |
6136 InterfaceType supertype2 = elementT.supertype; | 6136 InterfaceType supertype = elementT.supertype; |
6137 if (supertype2 != null && ((supertype2 as InterfaceTypeImpl)).isSubtypeOf2(t
ypeS, visitedClasses)) { | 6137 if (supertype != null && ((supertype as InterfaceTypeImpl)).isSubtypeOf2(typ
eS, visitedClasses)) { |
6138 return true; | 6138 return true; |
6139 } | 6139 } |
6140 List<InterfaceType> interfaceTypes = elementT.interfaces; | 6140 List<InterfaceType> interfaceTypes = elementT.interfaces; |
6141 for (InterfaceType interfaceType in interfaceTypes) { | 6141 for (InterfaceType interfaceType in interfaceTypes) { |
6142 if (((interfaceType as InterfaceTypeImpl)).isSubtypeOf2(typeS, visitedClas
ses)) { | 6142 if (((interfaceType as InterfaceTypeImpl)).isSubtypeOf2(typeS, visitedClas
ses)) { |
6143 return true; | 6143 return true; |
6144 } | 6144 } |
6145 } | 6145 } |
6146 List<InterfaceType> mixinTypes = elementT.mixins; | 6146 List<InterfaceType> mixinTypes = elementT.mixins; |
6147 for (InterfaceType mixinType in mixinTypes) { | 6147 for (InterfaceType mixinType in mixinTypes) { |
(...skipping 13 matching lines...) Expand all Loading... |
6161 | 6161 |
6162 /** | 6162 /** |
6163 * Return an array containing the results of using the given argument types an
d parameter types to | 6163 * Return an array containing the results of using the given argument types an
d parameter types to |
6164 * perform a substitution on all of the given types. | 6164 * perform a substitution on all of the given types. |
6165 * @param types the types on which a substitution is to be performed | 6165 * @param types the types on which a substitution is to be performed |
6166 * @param argumentTypes the argument types for the substitution | 6166 * @param argumentTypes the argument types for the substitution |
6167 * @param parameterTypes the parameter types for the substitution | 6167 * @param parameterTypes the parameter types for the substitution |
6168 * @return the result of performing the substitution on each of the types | 6168 * @return the result of performing the substitution on each of the types |
6169 */ | 6169 */ |
6170 static List<Type2> substitute(List<Type2> types, List<Type2> argumentTypes, Li
st<Type2> parameterTypes) { | 6170 static List<Type2> substitute(List<Type2> types, List<Type2> argumentTypes, Li
st<Type2> parameterTypes) { |
6171 int length2 = types.length; | 6171 int length = types.length; |
6172 if (length2 == 0) { | 6172 if (length == 0) { |
6173 return types; | 6173 return types; |
6174 } | 6174 } |
6175 List<Type2> newTypes = new List<Type2>(length2); | 6175 List<Type2> newTypes = new List<Type2>(length); |
6176 for (int i = 0; i < length2; i++) { | 6176 for (int i = 0; i < length; i++) { |
6177 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes); | 6177 newTypes[i] = types[i].substitute2(argumentTypes, parameterTypes); |
6178 } | 6178 } |
6179 return newTypes; | 6179 return newTypes; |
6180 } | 6180 } |
6181 | 6181 |
6182 /** | 6182 /** |
6183 * The element representing the declaration of this type, or {@code null} if t
he type has not, or | 6183 * The element representing the declaration of this type, or {@code null} if t
he type has not, or |
6184 * cannot, be associated with an element. | 6184 * cannot, be associated with an element. |
6185 */ | 6185 */ |
6186 Element _element; | 6186 Element _element; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6264 } | 6264 } |
6265 bool operator ==(Object object) => object is TypeVariableTypeImpl && element =
= ((object as TypeVariableTypeImpl)).element; | 6265 bool operator ==(Object object) => object is TypeVariableTypeImpl && element =
= ((object as TypeVariableTypeImpl)).element; |
6266 TypeVariableElement get element => super.element as TypeVariableElement; | 6266 TypeVariableElement get element => super.element as TypeVariableElement; |
6267 int get hashCode => element.hashCode; | 6267 int get hashCode => element.hashCode; |
6268 bool isMoreSpecificThan(Type2 type) { | 6268 bool isMoreSpecificThan(Type2 type) { |
6269 Type2 upperBound = element.bound; | 6269 Type2 upperBound = element.bound; |
6270 return type == upperBound; | 6270 return type == upperBound; |
6271 } | 6271 } |
6272 bool isSubtypeOf(Type2 type) => true; | 6272 bool isSubtypeOf(Type2 type) => true; |
6273 Type2 substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) { | 6273 Type2 substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) { |
6274 int length2 = parameterTypes.length; | 6274 int length = parameterTypes.length; |
6275 for (int i = 0; i < length2; i++) { | 6275 for (int i = 0; i < length; i++) { |
6276 if (parameterTypes[i] == this) { | 6276 if (parameterTypes[i] == this) { |
6277 return argumentTypes[i]; | 6277 return argumentTypes[i]; |
6278 } | 6278 } |
6279 } | 6279 } |
6280 return this; | 6280 return this; |
6281 } | 6281 } |
6282 } | 6282 } |
6283 /** | 6283 /** |
6284 * The unique instance of the class {@code VoidTypeImpl} implements the type {@c
ode void}. | 6284 * The unique instance of the class {@code VoidTypeImpl} implements the type {@c
ode void}. |
6285 * @coverage dart.engine.type | 6285 * @coverage dart.engine.type |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6843 abstract class TypeVariableType implements Type2 { | 6843 abstract class TypeVariableType implements Type2 { |
6844 TypeVariableElement get element; | 6844 TypeVariableElement get element; |
6845 } | 6845 } |
6846 /** | 6846 /** |
6847 * The interface {@code VoidType} defines the behavior of the unique object repr
esenting the type{@code void}. | 6847 * The interface {@code VoidType} defines the behavior of the unique object repr
esenting the type{@code void}. |
6848 * @coverage dart.engine.type | 6848 * @coverage dart.engine.type |
6849 */ | 6849 */ |
6850 abstract class VoidType implements Type2 { | 6850 abstract class VoidType implements Type2 { |
6851 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); | 6851 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); |
6852 } | 6852 } |
OLD | NEW |