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

Side by Side Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10875006: Remove a few warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | lib/compiler/implementation/scanner/partial_parser.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) 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 LocalPlaceholder implements Hashable { 5 class LocalPlaceholder implements Hashable {
6 final String identifier; 6 final String identifier;
7 final Set<Node> nodes; 7 final Set<Node> nodes;
8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
9 int hashCode() => identifier.hashCode(); 9 int hashCode() => identifier.hashCode();
10 String toString() => 10 String toString() =>
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 if (node.name !== null) { 432 if (node.name !== null) {
433 assert(node.name is Identifier); 433 assert(node.name is Identifier);
434 tryMakeLocalPlaceholder(element, node.name); 434 tryMakeLocalPlaceholder(element, node.name);
435 } 435 }
436 } 436 }
437 } 437 }
438 node.visitChildren(this); 438 node.visitChildren(this);
439 } 439 }
440 440
441 visitClassNode(ClassNode node) { 441 visitClassNode(ClassNode node) {
442 assert(currentElement is ClassElement); 442 ClassElement classElement = currentElement;
443 makeElementPlaceholder(node.name, currentElement); 443 makeElementPlaceholder(node.name, classElement);
444 node.visitChildren(this); 444 node.visitChildren(this);
445 if (node.typeParameters !== null) { 445 if (node.typeParameters !== null) {
446 // Another poor man resolution. 446 // Another poor man resolution.
447 final typeVariableTypes = 447 final typeVariableTypes =
448 new List<Type>.from(currentElement.typeVariables); 448 new List<Type>.from(classElement.typeVariables);
449 int i = 0; 449 int i = 0;
450 for (TypeVariable typeVariable in node.typeParameters) { 450 for (TypeVariable typeVariable in node.typeParameters) {
451 makeTypePlaceholder(typeVariable.name, typeVariableTypes[i]); 451 makeTypePlaceholder(typeVariable.name, typeVariableTypes[i]);
452 i++; 452 i++;
453 } 453 }
454 } 454 }
455 if (node.defaultClause !== null) { 455 if (node.defaultClause !== null) {
456 // Can't just visit class node's default clause because of the bug in the 456 // Can't just visit class node's default clause because of the bug in the
457 // resolver, it just crashes when it meets type variable. 457 // resolver, it just crashes when it meets type variable.
458 Type defaultType = (currentElement as ClassElement).defaultClass; 458 Type defaultType = classElement.defaultClass;
459 assert(defaultType !== null); 459 assert(defaultType !== null);
460 makeTypePlaceholder(node.defaultClause.typeName, defaultType); 460 makeTypePlaceholder(node.defaultClause.typeName, defaultType);
461 visit(node.defaultClause.typeArguments); 461 visit(node.defaultClause.typeArguments);
462 } 462 }
463 } 463 }
464 464
465 visitTypedef(Typedef node) { 465 visitTypedef(Typedef node) {
466 assert(currentElement is TypedefElement); 466 assert(currentElement is TypedefElement);
467 makeElementPlaceholder(node.name, currentElement); 467 makeElementPlaceholder(node.name, currentElement);
468 node.visitChildren(this); 468 node.visitChildren(this);
469 } 469 }
470 } 470 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/scanner/partial_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698