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

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

Issue 10832083: Properly emit and rename generic types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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/renamer.dart
diff --git a/lib/compiler/implementation/dart_backend/renamer.dart b/lib/compiler/implementation/dart_backend/renamer.dart
index 794f6b05e785a0c91428f807fe33d8a448f1d03b..3f2e063bcb73c3a27ccb9162856a4d7a52d2a24d 100644
--- a/lib/compiler/implementation/dart_backend/renamer.dart
+++ b/lib/compiler/implementation/dart_backend/renamer.dart
@@ -43,8 +43,25 @@ class ConflictingRenamer extends Renamer {
// Don't want to rename super calls.
&& !Initializers.isSuperConstructorCall(send)) {
FunctionExpression constructor = element.asFunctionElement().cachedNode;
- return '${renameType(element.getEnclosingClass().type)}'
- '.${getFactoryName(constructor)}';
+ TypeAnnotation typeAnnotation;
+ if (send.selector is TypeAnnotation) {
+ // <simple class name>.<name> case.
+ typeAnnotation = send.selector;
+ } else if (send.selector.receiver is TypeAnnotation) {
+ // <complex generic type>.<name> case.
+ typeAnnotation = send.selector.receiver;
+ compiler.cancel(
+ reason: "Don't know how to deduce type ${send.toDebugString()}",
+ element: element,
+ node: send);
+ } else {
+ compiler.cancel(
+ reason: "Don't know how to deduce type",
+ element: element,
+ node: send);
+ }
+ final type = new Unparser(this).unparse(typeAnnotation);
+ return '$type.${getFactoryName(constructor)}';
} else {
return null;
}
« 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