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

Side by Side Diff: lib/compiler/implementation/world.dart

Issue 10310075: Fix typing spotted by checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | 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) 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 class World { 5 class World {
6 final Map<ClassElement, Set<ClassElement>> subtypes; 6 final Map<ClassElement, Set<ClassElement>> subtypes;
7 7
8 World() : subtypes = new Map<ClassElement, Set<ClassElement>>(); 8 World() : subtypes = new Map<ClassElement, Set<ClassElement>>();
9 9
10 void populate(Compiler compiler, Collection<LibraryElement> libraries) { 10 void populate(Compiler compiler, Collection<LibraryElement> libraries) {
11 void addSubtypes(ClassElement cls) { 11 void addSubtypes(ClassElement cls) {
12 for (Type type in cls.allSupertypes) { 12 for (Type type in cls.allSupertypes) {
13 List<Element> subtypes = subtypes.putIfAbsent( 13 Set<Element> subtypes = subtypes.putIfAbsent(
14 type.element, 14 type.element,
15 () => <ClassElement>[]); 15 () => new Set<ClassElement>());
16 subtypes.add(cls); 16 subtypes.add(cls);
17 } 17 }
18 } 18 }
19 19
20 libraries.forEach((LibraryElement library) { 20 libraries.forEach((LibraryElement library) {
21 for (Link<Element> link = library.topLevelElements; 21 for (Link<Element> link = library.topLevelElements;
22 !link.isEmpty(); 22 !link.isEmpty();
23 link = link.tail) { 23 link = link.tail) {
24 Element element = link.head; 24 Element element = link.head;
25 if (!element.isClass()) continue; 25 if (!element.isClass()) continue;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void add(Element element) { 68 void add(Element element) {
69 elements.add(element); 69 elements.add(element);
70 } 70 }
71 71
72 bool isEmpty() => elements.isEmpty(); 72 bool isEmpty() => elements.isEmpty();
73 73
74 bool hasJustFields() { 74 bool hasJustFields() {
75 return elements.every((Element element) => element.isField()); 75 return elements.every((Element element) => element.isField());
76 } 76 }
77 } 77 }
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