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

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

Issue 11412245: MalformedType used for all invalid type annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years 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 part of dart_backend; 5 part of dart_backend;
6 6
7 class LocalPlaceholder { 7 class LocalPlaceholder {
8 final String identifier; 8 final String identifier;
9 final Set<Node> nodes; 9 final Set<Node> nodes;
10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. 359 visitNode(Node node) { node.visitChildren(this); } // We must go deeper.
360 360
361 visitNewExpression(NewExpression node) { 361 visitNewExpression(NewExpression node) {
362 Send send = node.send; 362 Send send = node.send;
363 InterfaceType type = treeElements.getType(node); 363 InterfaceType type = treeElements.getType(node);
364 assert(type != null); 364 assert(type != null);
365 Element constructor = treeElements[send]; 365 Element constructor = treeElements[send];
366 assert(constructor != null); 366 assert(constructor != null);
367 assert(send.receiver == null); 367 assert(send.receiver == null);
368 368 if (!Elements.isErroneousElement(constructor)) {
369 // For constructors that refer to malformed class types retrieve
370 // class type like it is done in [ SsaBuilder.visitNewSend ].
371 if (type.kind == TypeKind.MALFORMED_TYPE) {
372 type = constructor.getEnclosingClass().thisType;
373 }
374
375 if (!Elements.isUnresolved(constructor)) {
376 makeConstructorPlaceholder(node.send.selector, constructor, type); 369 makeConstructorPlaceholder(node.send.selector, constructor, type);
377 // TODO(smok): Should this be in visitNamedArgument? 370 // TODO(smok): Should this be in visitNamedArgument?
378 // Field names can be exposed as names of optional arguments, e.g. 371 // Field names can be exposed as names of optional arguments, e.g.
379 // class C { 372 // class C {
380 // final field; 373 // final field;
381 // C([this.field]); 374 // C([this.field]);
382 // } 375 // }
383 // Do not forget to rename them as well. 376 // Do not forget to rename them as well.
384 FunctionElement constructorFunction = constructor; 377 FunctionElement constructorFunction = constructor;
385 Link<Element> optionalParameters = 378 Link<Element> optionalParameters =
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 615
623 visitBlock(Block node) { 616 visitBlock(Block node) {
624 for (Node statement in node.statements.nodes) { 617 for (Node statement in node.statements.nodes) {
625 if (statement is VariableDefinitions) { 618 if (statement is VariableDefinitions) {
626 makeVarDeclarationTypePlaceholder(statement); 619 makeVarDeclarationTypePlaceholder(statement);
627 } 620 }
628 } 621 }
629 node.visitChildren(this); 622 node.visitChildren(this);
630 } 623 }
631 } 624 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698