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

Side by Side Diff: pkg/compiler/lib/src/inferrer/locals_handler.dart

Issue 2940023004: fix inferrer bug (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698