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

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

Issue 10855127: Fix the case of function field via this initialization. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index 94835409a2aa7dc016f0c80dd9fe73bd3883327e..01aae10aba4551a29de2a47103c02152338a67b6 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -92,7 +92,15 @@ class PlaceholderCollector extends AbstractVisitor {
Send send = definition.asSend();
if (send !== null) {
assert(send.receiver.isThis());
- tryMakePrivateIdentifier(send.selector.asIdentifier());
+ if (send.selector is Identifier) {
+ tryMakePrivateIdentifier(send.selector.asIdentifier());
+ } else if (send.selector is FunctionExpression) {
+ // C(int this.f()) case where f is field of function type.
+ tryMakePrivateIdentifier(
+ send.selector.asFunctionExpression().name.asIdentifier());
+ } else {
+ internalError('Unreachable case');
+ }
} else {
assert(definition is Identifier);
}
@@ -126,7 +134,7 @@ class PlaceholderCollector extends AbstractVisitor {
tryMakePrivateIdentifier(
definition.asSendSet().selector.asIdentifier());
} else {
- assert(false); // Unreachable.
+ internalError('Unreachable case');
}
}
}
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698