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

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

Issue 11348294: Follow-up to https://chromiumcodereview.appspot.com/11416144/. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed dart2dart malformed type handling in visitNewExpression(). Fixed comments. Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
index 93262f8a178fce7b3124af69a839a76a986a2954..24859f4358a7b7a3c3f0cdab8da7715518357a2c 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -365,8 +365,14 @@ class PlaceholderCollector extends Visitor {
Element constructor = treeElements[send];
assert(constructor != null);
assert(send.receiver == null);
- if (!Elements.isErroneousElement(constructor) &&
- !Elements.isMalformedElement(constructor)) {
+
+ // For constructors that refer to malformed class types retrieve
+ // class type like it is done in [ SsaBuilder.visitNewSend ].
+ if (type.kind == TypeKind.MALFORMED_TYPE) {
+ type = constructor.getEnclosingClass().thisType;
+ }
+
+ if (!Elements.isUnresolved(constructor)) {
makeConstructorPlaceholder(node.send.selector, constructor, type);
// TODO(smok): Should this be in visitNamedArgument?
// Field names can be exposed as names of optional arguments, e.g.
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698