Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 908603002: Fix a stack overflow (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool get isBottom => true; 80 bool get isBottom => true;
81 81
82 @override 82 @override
83 bool operator ==(Object object) => identical(object, this); 83 bool operator ==(Object object) => identical(object, this);
84 84
85 @override 85 @override
86 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => 86 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
87 identical(object, this); 87 identical(object, this);
88 88
89 @override 89 @override
90 int internalHashCode(List<DartType> visitedTypes) => hashCode;
91
92 @override
90 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, 93 bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
91 Set<TypeImpl_TypePair> visitedTypePairs) => 94 Set<TypeImpl_TypePair> visitedTypePairs) =>
92 true; 95 true;
93 96
94 @override 97 @override
95 bool internalIsSubtypeOf(DartType type, 98 bool internalIsSubtypeOf(DartType type,
96 Set<TypeImpl_TypePair> visitedTypePairs) => 99 Set<TypeImpl_TypePair> visitedTypePairs) =>
97 true; 100 true;
98 101
99 @override 102 @override
(...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after
2172 bool get isDynamic => true; 2175 bool get isDynamic => true;
2173 2176
2174 @override 2177 @override
2175 bool operator ==(Object object) => identical(object, this); 2178 bool operator ==(Object object) => identical(object, this);
2176 2179
2177 @override 2180 @override
2178 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => 2181 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
2179 identical(object, this); 2182 identical(object, this);
2180 2183
2181 @override 2184 @override
2185 int internalHashCode(List<DartType> visitedTypes) => hashCode;
2186
2187 @override
2182 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, 2188 bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
2183 Set<TypeImpl_TypePair> visitedTypePairs) { 2189 Set<TypeImpl_TypePair> visitedTypePairs) {
2184 // T is S 2190 // T is S
2185 if (identical(this, type)) { 2191 if (identical(this, type)) {
2186 return true; 2192 return true;
2187 } 2193 }
2188 // else 2194 // else
2189 return withDynamic; 2195 return withDynamic;
2190 } 2196 }
2191 2197
(...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after
4784 buffer.write("null"); 4790 buffer.write("null");
4785 } else { 4791 } else {
4786 buffer.write(returnType.displayName); 4792 buffer.write(returnType.displayName);
4787 } 4793 }
4788 name = buffer.toString(); 4794 name = buffer.toString();
4789 } 4795 }
4790 return name; 4796 return name;
4791 } 4797 }
4792 4798
4793 @override 4799 @override
4794 int get hashCode { 4800 int get hashCode => internalHashCode(<DartType>[]);
4801
4802 @override
4803 int internalHashCode(List<DartType> visitedTypes) {
4795 if (element == null) { 4804 if (element == null) {
4796 return 0; 4805 return 0;
4806 } else if (visitedTypes.contains(this)) {
4807 return 3;
4797 } 4808 }
4809 visitedTypes.add(this);
4798 // Reference the arrays of parameters 4810 // Reference the arrays of parameters
4799 List<DartType> normalParameterTypes = this.normalParameterTypes; 4811 List<DartType> normalParameterTypes = this.normalParameterTypes;
4800 List<DartType> optionalParameterTypes = this.optionalParameterTypes; 4812 List<DartType> optionalParameterTypes = this.optionalParameterTypes;
4801 Iterable<DartType> namedParameterTypes = this.namedParameterTypes.values; 4813 Iterable<DartType> namedParameterTypes = this.namedParameterTypes.values;
4802 // Generate the hashCode 4814 // Generate the hashCode
4803 int hashCode = returnType.hashCode; 4815 int code = (returnType as TypeImpl).internalHashCode(visitedTypes);
4804 for (int i = 0; i < normalParameterTypes.length; i++) { 4816 for (int i = 0; i < normalParameterTypes.length; i++) {
4805 hashCode = (hashCode << 1) + normalParameterTypes[i].hashCode; 4817 code = (code << 1) + (normalParameterTypes[i] as TypeImpl).internalHashCod e(visitedTypes);
4806 } 4818 }
4807 for (int i = 0; i < optionalParameterTypes.length; i++) { 4819 for (int i = 0; i < optionalParameterTypes.length; i++) {
4808 hashCode = (hashCode << 1) + optionalParameterTypes[i].hashCode; 4820 code = (code << 1) + (optionalParameterTypes[i] as TypeImpl).internalHashC ode(visitedTypes);
4809 } 4821 }
4810 for (DartType type in namedParameterTypes) { 4822 for (DartType type in namedParameterTypes) {
4811 hashCode = (hashCode << 1) + type.hashCode; 4823 code = (code << 1) + (type as TypeImpl).internalHashCode(visitedTypes);
4812 } 4824 }
4813 return hashCode; 4825 return code;
4814 } 4826 }
4815 4827
4816 @override 4828 @override
4817 Map<String, DartType> get namedParameterTypes { 4829 Map<String, DartType> get namedParameterTypes {
4818 LinkedHashMap<String, DartType> namedParameterTypes = 4830 LinkedHashMap<String, DartType> namedParameterTypes =
4819 new LinkedHashMap<String, DartType>(); 4831 new LinkedHashMap<String, DartType>();
4820 List<ParameterElement> parameters = baseParameters; 4832 List<ParameterElement> parameters = baseParameters;
4821 if (parameters.length == 0) { 4833 if (parameters.length == 0) {
4822 return namedParameterTypes; 4834 return namedParameterTypes;
4823 } 4835 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4928 return definingClass.typeParameters; 4940 return definingClass.typeParameters;
4929 } 4941 }
4930 return TypeParameterElementImpl.EMPTY_ARRAY; 4942 return TypeParameterElementImpl.EMPTY_ARRAY;
4931 } 4943 }
4932 4944
4933 @override 4945 @override
4934 bool operator ==(Object object) => 4946 bool operator ==(Object object) =>
4935 internalEquals(object, new HashSet<ElementPair>()); 4947 internalEquals(object, new HashSet<ElementPair>());
4936 4948
4937 @override 4949 @override
4938 void appendTo(StringBuffer buffer) { 4950 void appendTo(StringBuffer buffer, Set<DartType> visitedTypes) {
4951 if (!visitedTypes.add(this)) {
4952 buffer.write(name == null ? '...' : name);
4953 return;
4954 }
4939 List<DartType> normalParameterTypes = this.normalParameterTypes; 4955 List<DartType> normalParameterTypes = this.normalParameterTypes;
4940 List<DartType> optionalParameterTypes = this.optionalParameterTypes; 4956 List<DartType> optionalParameterTypes = this.optionalParameterTypes;
4941 Map<String, DartType> namedParameterTypes = this.namedParameterTypes; 4957 Map<String, DartType> namedParameterTypes = this.namedParameterTypes;
4942 DartType returnType = this.returnType; 4958 DartType returnType = this.returnType;
4943 buffer.write("("); 4959 buffer.write("(");
4944 bool needsComma = false; 4960 bool needsComma = false;
4945 if (normalParameterTypes.length > 0) { 4961 if (normalParameterTypes.length > 0) {
4946 for (DartType type in normalParameterTypes) { 4962 for (DartType type in normalParameterTypes) {
4947 if (needsComma) { 4963 if (needsComma) {
4948 buffer.write(", "); 4964 buffer.write(", ");
4949 } else { 4965 } else {
4950 needsComma = true; 4966 needsComma = true;
4951 } 4967 }
4952 (type as TypeImpl).appendTo(buffer); 4968 (type as TypeImpl).appendTo(buffer, visitedTypes);
4953 } 4969 }
4954 } 4970 }
4955 if (optionalParameterTypes.length > 0) { 4971 if (optionalParameterTypes.length > 0) {
4956 if (needsComma) { 4972 if (needsComma) {
4957 buffer.write(", "); 4973 buffer.write(", ");
4958 needsComma = false; 4974 needsComma = false;
4959 } 4975 }
4960 buffer.write("["); 4976 buffer.write("[");
4961 for (DartType type in optionalParameterTypes) { 4977 for (DartType type in optionalParameterTypes) {
4962 if (needsComma) { 4978 if (needsComma) {
4963 buffer.write(", "); 4979 buffer.write(", ");
4964 } else { 4980 } else {
4965 needsComma = true; 4981 needsComma = true;
4966 } 4982 }
4967 (type as TypeImpl).appendTo(buffer); 4983 (type as TypeImpl).appendTo(buffer, visitedTypes);
4968 } 4984 }
4969 buffer.write("]"); 4985 buffer.write("]");
4970 needsComma = true; 4986 needsComma = true;
4971 } 4987 }
4972 if (namedParameterTypes.length > 0) { 4988 if (namedParameterTypes.length > 0) {
4973 if (needsComma) { 4989 if (needsComma) {
4974 buffer.write(", "); 4990 buffer.write(", ");
4975 needsComma = false; 4991 needsComma = false;
4976 } 4992 }
4977 buffer.write("{"); 4993 buffer.write("{");
4978 namedParameterTypes.forEach((String name, DartType type) { 4994 namedParameterTypes.forEach((String name, DartType type) {
4979 if (needsComma) { 4995 if (needsComma) {
4980 buffer.write(", "); 4996 buffer.write(", ");
4981 } else { 4997 } else {
4982 needsComma = true; 4998 needsComma = true;
4983 } 4999 }
4984 buffer.write(name); 5000 buffer.write(name);
4985 buffer.write(": "); 5001 buffer.write(": ");
4986 (type as TypeImpl).appendTo(buffer); 5002 (type as TypeImpl).appendTo(buffer, visitedTypes);
4987 }); 5003 });
4988 buffer.write("}"); 5004 buffer.write("}");
4989 needsComma = true; 5005 needsComma = true;
4990 } 5006 }
4991 buffer.write(")"); 5007 buffer.write(")");
4992 buffer.write(Element.RIGHT_ARROW); 5008 buffer.write(Element.RIGHT_ARROW);
4993 if (returnType == null) { 5009 if (returnType == null) {
4994 buffer.write("null"); 5010 buffer.write("null");
4995 } else { 5011 } else {
4996 (returnType as TypeImpl).appendTo(buffer); 5012 (returnType as TypeImpl).appendTo(buffer, visitedTypes);
4997 } 5013 }
4998 } 5014 }
4999 5015
5000 @override 5016 @override
5001 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) { 5017 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) {
5002 if (object is! FunctionTypeImpl) { 5018 if (object is! FunctionTypeImpl) {
5003 return false; 5019 return false;
5004 } 5020 }
5005 FunctionTypeImpl otherType = object as FunctionTypeImpl; 5021 FunctionTypeImpl otherType = object as FunctionTypeImpl;
5006 // If the visitedTypePairs already has the pair (this, type), 5022 // If the visitedTypePairs already has the pair (this, type),
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
6249 @override 6265 @override
6250 int get hashCode { 6266 int get hashCode {
6251 ClassElement element = this.element; 6267 ClassElement element = this.element;
6252 if (element == null) { 6268 if (element == null) {
6253 return 0; 6269 return 0;
6254 } 6270 }
6255 return element.hashCode; 6271 return element.hashCode;
6256 } 6272 }
6257 6273
6258 @override 6274 @override
6275 int internalHashCode(List<DartType> visitedTypes) => hashCode;
6276
6277 @override
6259 List<InterfaceType> get interfaces { 6278 List<InterfaceType> get interfaces {
6260 ClassElement classElement = element; 6279 ClassElement classElement = element;
6261 List<InterfaceType> interfaces = classElement.interfaces; 6280 List<InterfaceType> interfaces = classElement.interfaces;
6262 List<TypeParameterElement> typeParameters = classElement.typeParameters; 6281 List<TypeParameterElement> typeParameters = classElement.typeParameters;
6263 List<DartType> parameterTypes = classElement.type.typeArguments; 6282 List<DartType> parameterTypes = classElement.type.typeArguments;
6264 if (typeParameters.length == 0) { 6283 if (typeParameters.length == 0) {
6265 return interfaces; 6284 return interfaces;
6266 } 6285 }
6267 int count = interfaces.length; 6286 int count = interfaces.length;
6268 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count); 6287 List<InterfaceType> typedInterfaces = new List<InterfaceType>(count);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
6328 } 6347 }
6329 6348
6330 @override 6349 @override
6331 List<TypeParameterElement> get typeParameters => element.typeParameters; 6350 List<TypeParameterElement> get typeParameters => element.typeParameters;
6332 6351
6333 @override 6352 @override
6334 bool operator ==(Object object) => 6353 bool operator ==(Object object) =>
6335 internalEquals(object, new HashSet<ElementPair>()); 6354 internalEquals(object, new HashSet<ElementPair>());
6336 6355
6337 @override 6356 @override
6338 void appendTo(StringBuffer buffer) { 6357 void appendTo(StringBuffer buffer, Set<DartType> visitedTypes) {
6358 if (!visitedTypes.add(this)) {
6359 buffer.write(name == null ? '...' : name);
6360 return;
6361 }
6339 buffer.write(name); 6362 buffer.write(name);
6340 int argumentCount = typeArguments.length; 6363 int argumentCount = typeArguments.length;
6341 if (argumentCount > 0) { 6364 if (argumentCount > 0) {
6342 buffer.write("<"); 6365 buffer.write("<");
6343 for (int i = 0; i < argumentCount; i++) { 6366 for (int i = 0; i < argumentCount; i++) {
6344 if (i > 0) { 6367 if (i > 0) {
6345 buffer.write(", "); 6368 buffer.write(", ");
6346 } 6369 }
6347 (typeArguments[i] as TypeImpl).appendTo(buffer); 6370 (typeArguments[i] as TypeImpl).appendTo(buffer, visitedTypes);
6348 } 6371 }
6349 buffer.write(">"); 6372 buffer.write(">");
6350 } 6373 }
6351 } 6374 }
6352 6375
6353 @override 6376 @override
6354 PropertyAccessorElement getGetter(String getterName) => 6377 PropertyAccessorElement getGetter(String getterName) =>
6355 PropertyAccessorMember.from( 6378 PropertyAccessorMember.from(
6356 (element as ClassElementImpl).getGetter(getterName), 6379 (element as ClassElementImpl).getGetter(getterName),
6357 this); 6380 this);
(...skipping 3620 matching lines...) Expand 10 before | Expand all | Expand 10 after
9978 @override 10001 @override
9979 bool get isObject => false; 10002 bool get isObject => false;
9980 10003
9981 @override 10004 @override
9982 bool get isUndefined => false; 10005 bool get isUndefined => false;
9983 10006
9984 @override 10007 @override
9985 bool get isVoid => false; 10008 bool get isVoid => false;
9986 10009
9987 /** 10010 /**
9988 * Append a textual representation of this type to the given [buffer]. 10011 * Append a textual representation of this type to the given [buffer]. The set
10012 * of [visitedTypes] is used to prevent infinite recusion.
9989 */ 10013 */
9990 void appendTo(StringBuffer buffer) { 10014 void appendTo(StringBuffer buffer, Set<DartType> visitedTypes) {
10015 if (!visitedTypes.add(this)) {
10016 buffer.write(name == null ? '...' : name);
10017 return;
10018 }
9991 if (name == null) { 10019 if (name == null) {
9992 buffer.write("<unnamed type>"); 10020 buffer.write("<unnamed type>");
9993 } else { 10021 } else {
9994 buffer.write(name); 10022 buffer.write(name);
9995 } 10023 }
9996 } 10024 }
9997 10025
9998 @override 10026 @override
9999 DartType getLeastUpperBound(DartType type) => null; 10027 DartType getLeastUpperBound(DartType type) => null;
10000 10028
10001 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs); 10029 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs);
10002 10030
10031 int internalHashCode(List<DartType> visitedTypes);
10032
10003 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, 10033 bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
10004 Set<TypeImpl_TypePair> visitedTypePairs); 10034 Set<TypeImpl_TypePair> visitedTypePairs);
10005 10035
10006 bool internalIsSubtypeOf(DartType type, 10036 bool internalIsSubtypeOf(DartType type,
10007 Set<TypeImpl_TypePair> visitedTypePairs); 10037 Set<TypeImpl_TypePair> visitedTypePairs);
10008 10038
10009 @override 10039 @override
10010 bool isAssignableTo(DartType type) => 10040 bool isAssignableTo(DartType type) =>
10011 isAssignableTo2(type, new HashSet<TypeImpl_TypePair>()); 10041 isAssignableTo2(type, new HashSet<TypeImpl_TypePair>());
10012 10042
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
10120 visitedTypePairs.remove(typePair); 10150 visitedTypePairs.remove(typePair);
10121 return result; 10151 return result;
10122 } 10152 }
10123 10153
10124 @override 10154 @override
10125 bool isSupertypeOf(DartType type) => type.isSubtypeOf(this); 10155 bool isSupertypeOf(DartType type) => type.isSubtypeOf(this);
10126 10156
10127 @override 10157 @override
10128 String toString() { 10158 String toString() {
10129 StringBuffer buffer = new StringBuffer(); 10159 StringBuffer buffer = new StringBuffer();
10130 appendTo(buffer); 10160 appendTo(buffer, new HashSet<DartType>());
10131 return buffer.toString(); 10161 return buffer.toString();
10132 } 10162 }
10133 10163
10134 /** 10164 /**
10135 * Return `true` if corresponding elements of the [first] and [second] lists 10165 * Return `true` if corresponding elements of the [first] and [second] lists
10136 * of type arguments are all equal. Use the set of [visitedElementPairs] to 10166 * of type arguments are all equal. Use the set of [visitedElementPairs] to
10137 * prevent infinite loops when the types are recursively defined. 10167 * prevent infinite loops when the types are recursively defined.
10138 */ 10168 */
10139 static bool equalArrays(List<DartType> first, List<DartType> second, 10169 static bool equalArrays(List<DartType> first, List<DartType> second,
10140 Set<ElementPair> visitedElementPairs) { 10170 Set<ElementPair> visitedElementPairs) {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
10339 10369
10340 @override 10370 @override
10341 bool operator ==(Object object) => 10371 bool operator ==(Object object) =>
10342 object is TypeParameterTypeImpl && (element == object.element); 10372 object is TypeParameterTypeImpl && (element == object.element);
10343 10373
10344 @override 10374 @override
10345 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => 10375 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
10346 this == object; 10376 this == object;
10347 10377
10348 @override 10378 @override
10379 int internalHashCode(List<DartType> visitedTypes) => hashCode;
10380
10381 @override
10349 bool internalIsMoreSpecificThan(DartType s, bool withDynamic, 10382 bool internalIsMoreSpecificThan(DartType s, bool withDynamic,
10350 Set<TypeImpl_TypePair> visitedTypePairs) { 10383 Set<TypeImpl_TypePair> visitedTypePairs) {
10351 // 10384 //
10352 // A type T is more specific than a type S, written T << S, 10385 // A type T is more specific than a type S, written T << S,
10353 // if one of the following conditions is met: 10386 // if one of the following conditions is met:
10354 // 10387 //
10355 // Reflexivity: T is S. 10388 // Reflexivity: T is S.
10356 // 10389 //
10357 if (this == s) { 10390 if (this == s) {
10358 return true; 10391 return true;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
10496 bool get isUndefined => true; 10529 bool get isUndefined => true;
10497 10530
10498 @override 10531 @override
10499 bool operator ==(Object object) => identical(object, this); 10532 bool operator ==(Object object) => identical(object, this);
10500 10533
10501 @override 10534 @override
10502 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => 10535 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
10503 identical(object, this); 10536 identical(object, this);
10504 10537
10505 @override 10538 @override
10539 int internalHashCode(List<DartType> visitedTypes) => hashCode;
10540
10541 @override
10506 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, 10542 bool internalIsMoreSpecificThan(DartType type, bool withDynamic,
10507 Set<TypeImpl_TypePair> visitedTypePairs) { 10543 Set<TypeImpl_TypePair> visitedTypePairs) {
10508 // T is S 10544 // T is S
10509 if (identical(this, type)) { 10545 if (identical(this, type)) {
10510 return true; 10546 return true;
10511 } 10547 }
10512 // else 10548 // else
10513 return withDynamic; 10549 return withDynamic;
10514 } 10550 }
10515 10551
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
10576 return buffer.toString(); 10612 return buffer.toString();
10577 } 10613 }
10578 10614
10579 @override 10615 @override
10580 Set<DartType> get elements => _types; 10616 Set<DartType> get elements => _types;
10581 10617
10582 @override 10618 @override
10583 int get hashCode => _types.hashCode; 10619 int get hashCode => _types.hashCode;
10584 10620
10585 @override 10621 @override
10622 int internalHashCode(List<DartType> visitedTypes) => hashCode;
10623
10624 @override
10586 bool operator ==(Object other) { 10625 bool operator ==(Object other) {
10587 if (other == null || other is! UnionType) { 10626 if (other == null || other is! UnionType) {
10588 return false; 10627 return false;
10589 } else if (identical(this, other)) { 10628 } else if (identical(this, other)) {
10590 return true; 10629 return true;
10591 } else { 10630 } else {
10592 return javaSetEquals(_types, (other as UnionType).elements); 10631 return javaSetEquals(_types, (other as UnionType).elements);
10593 } 10632 }
10594 } 10633 }
10595 10634
10596 @override 10635 @override
10597 void appendTo(StringBuffer buffer) { 10636 void appendTo(StringBuffer buffer, Set<DartType> visitedTypes) {
10637 if (!visitedTypes.add(this)) {
10638 buffer.write(name == null ? '...' : name);
10639 return;
10640 }
10598 String prefix = "{"; 10641 String prefix = "{";
10599 for (DartType type in _types) { 10642 for (DartType type in _types) {
10600 buffer.write(prefix); 10643 buffer.write(prefix);
10601 (type as TypeImpl).appendTo(buffer); 10644 (type as TypeImpl).appendTo(buffer, visitedTypes);
10602 prefix = ","; 10645 prefix = ",";
10603 } 10646 }
10604 buffer.write("}"); 10647 buffer.write("}");
10605 } 10648 }
10606 10649
10607 @override 10650 @override
10608 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => 10651 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
10609 this == object; 10652 this == object;
10610 10653
10611 @override 10654 @override
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
11080 11123
11081 /** 11124 /**
11082 * Prevent the creation of instances of this class. 11125 * Prevent the creation of instances of this class.
11083 */ 11126 */
11084 VoidTypeImpl() : super(null, Keyword.VOID.syntax); 11127 VoidTypeImpl() : super(null, Keyword.VOID.syntax);
11085 11128
11086 @override 11129 @override
11087 int get hashCode => 2; 11130 int get hashCode => 2;
11088 11131
11089 @override 11132 @override
11133 int internalHashCode(List<DartType> visitedTypes) => hashCode;
11134
11135 @override
11090 bool get isVoid => true; 11136 bool get isVoid => true;
11091 11137
11092 @override 11138 @override
11093 bool operator ==(Object object) => identical(object, this); 11139 bool operator ==(Object object) => identical(object, this);
11094 11140
11095 @override 11141 @override
11096 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => 11142 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) =>
11097 identical(object, this); 11143 identical(object, this);
11098 11144
11099 @override 11145 @override
(...skipping 14 matching lines...) Expand all
11114 // bottom <: void (as bottom is a subtype of all types). 11160 // bottom <: void (as bottom is a subtype of all types).
11115 // void <: dynamic (as dynamic is a supertype of all types) 11161 // void <: dynamic (as dynamic is a supertype of all types)
11116 return identical(type, this) || type.isDynamic; 11162 return identical(type, this) || type.isDynamic;
11117 } 11163 }
11118 11164
11119 @override 11165 @override
11120 VoidTypeImpl substitute2(List<DartType> argumentTypes, 11166 VoidTypeImpl substitute2(List<DartType> argumentTypes,
11121 List<DartType> parameterTypes) => 11167 List<DartType> parameterTypes) =>
11122 this; 11168 this;
11123 } 11169 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698