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

Side by Side Diff: dart/frog/leg/resolver.dart

Issue 9429047: Implement operator-is for interfaces' supertypes and String's supertypes. Also, improve stack trace… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 } 8 }
9 9
10 class TreeElementMapping implements TreeElements { 10 class TreeElementMapping implements TreeElements {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 Link<Type> superSupertypes = 256 Link<Type> superSupertypes =
257 getOrCalculateAllSupertypes(supertype.element, seen); 257 getOrCalculateAllSupertypes(supertype.element, seen);
258 Link<Type> supertypes = new Link<Type>(supertype, superSupertypes); 258 Link<Type> supertypes = new Link<Type>(supertype, superSupertypes);
259 for (Link<Type> interfaces = classElement.interfaces; 259 for (Link<Type> interfaces = classElement.interfaces;
260 !interfaces.isEmpty(); 260 !interfaces.isEmpty();
261 interfaces = interfaces.tail) { 261 interfaces = interfaces.tail) {
262 Element element = interfaces.head.element; 262 Element element = interfaces.head.element;
263 Link<Type> interfaceSupertypes = 263 Link<Type> interfaceSupertypes =
264 getOrCalculateAllSupertypes(element, seen); 264 getOrCalculateAllSupertypes(element, seen);
265 supertypes = supertypes.reversePrependAll(interfaceSupertypes); 265 supertypes = supertypes.reversePrependAll(interfaceSupertypes);
266 supertypes = supertypes.prepend(interfaces.head);
266 } 267 }
267 seen.remove(classElement); 268 seen.remove(classElement);
268 classElement.allSupertypes = supertypes; 269 classElement.allSupertypes = supertypes;
269 } else { 270 } else {
270 classElement.allSupertypes = const EmptyLink<Type>(); 271 classElement.allSupertypes = const EmptyLink<Type>();
271 } 272 }
272 } 273 }
273 274
274 error(Node node, MessageKind kind, [arguments = const []]) { 275 error(Node node, MessageKind kind, [arguments = const []]) {
275 ResolutionError message = new ResolutionError(kind, arguments); 276 ResolutionError message = new ResolutionError(kind, arguments);
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 class TopScope extends Scope { 1426 class TopScope extends Scope {
1426 LibraryElement get library() => element; 1427 LibraryElement get library() => element;
1427 1428
1428 TopScope(LibraryElement library) : super(null, library); 1429 TopScope(LibraryElement library) : super(null, library);
1429 Element lookup(SourceString name) => library.find(name); 1430 Element lookup(SourceString name) => library.find(name);
1430 1431
1431 Element add(Element element) { 1432 Element add(Element element) {
1432 throw "Cannot add an element in the top scope"; 1433 throw "Cannot add an element in the top scope";
1433 } 1434 }
1434 } 1435 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698