OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library locals_handler; | 5 library locals_handler; |
6 | 6 |
7 import 'dart:collection' show IterableMixin; | 7 import 'dart:collection' show IterableMixin; |
8 | 8 |
9 import '../options.dart' show CompilerOptions; | 9 import '../options.dart' show CompilerOptions; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 Iterator<TypeInformation> get iterator => new ArgumentsTypesIterator(this); | 183 Iterator<TypeInformation> get iterator => new ArgumentsTypesIterator(this); |
184 | 184 |
185 String toString() => "{ positional = $positional, named = $named }"; | 185 String toString() => "{ positional = $positional, named = $named }"; |
186 | 186 |
187 bool operator ==(other) { | 187 bool operator ==(other) { |
188 if (positional.length != other.positional.length) return false; | 188 if (positional.length != other.positional.length) return false; |
189 if (named.length != other.named.length) return false; | 189 if (named.length != other.named.length) return false; |
190 for (int i = 0; i < positional.length; i++) { | 190 for (int i = 0; i < positional.length; i++) { |
191 if (positional[i] != other.positional[i]) return false; | 191 if (positional[i] != other.positional[i]) return false; |
192 } | 192 } |
| 193 var result = true; |
193 named.forEach((name, type) { | 194 named.forEach((name, type) { |
194 // Issue 29885. | 195 if (other.named[name] != type) result = false; |
195 // ignore: RETURN_OF_INVALID_TYPE | |
196 if (other.named[name] != type) return false; | |
197 }); | 196 }); |
198 return true; | 197 return result; |
199 } | 198 } |
200 | 199 |
201 int get hashCode => throw new UnsupportedError('ArgumentsTypes.hashCode'); | 200 int get hashCode => throw new UnsupportedError('ArgumentsTypes.hashCode'); |
202 | 201 |
203 bool hasNoArguments() => positional.isEmpty && named.isEmpty; | 202 bool hasNoArguments() => positional.isEmpty && named.isEmpty; |
204 | 203 |
205 void forEach(void f(TypeInformation type)) { | 204 void forEach(void f(TypeInformation type)) { |
206 positional.forEach(f); | 205 positional.forEach(f); |
207 named.values.forEach(f); | 206 named.values.forEach(f); |
208 } | 207 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 if (newType != type) { | 544 if (newType != type) { |
546 locals[variable] = newType; | 545 locals[variable] = newType; |
547 } | 546 } |
548 }); | 547 }); |
549 } | 548 } |
550 | 549 |
551 void updateField(Element element, TypeInformation type) { | 550 void updateField(Element element, TypeInformation type) { |
552 fieldScope.updateField(element, type); | 551 fieldScope.updateField(element, type); |
553 } | 552 } |
554 } | 553 } |
OLD | NEW |