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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java

Issue 10911009: Stop creating a synthetic node so that parent links will be preserved (issue 4833) (Closed) Base URL: http://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 | « compiler/java/com/google/dart/compiler/ast/DartClass.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java
===================================================================
--- compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java (revision 11616)
+++ compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java (working copy)
@@ -7,9 +7,10 @@
import com.google.common.collect.Lists;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartDeclaration;
+import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartObsoleteMetadata;
-import com.google.dart.compiler.ast.DartParameterizedTypeNode;
import com.google.dart.compiler.ast.DartStringLiteral;
+import com.google.dart.compiler.ast.DartTypeParameter;
import com.google.dart.compiler.ast.Modifiers;
import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.type.InterfaceType;
@@ -65,7 +66,7 @@
metadata = node.getObsoleteMetadata();
modifiers = node.getModifiers();
nameLocation = node.getName().getSourceInfo();
- declarationNameWithTypeParameter = new DartParameterizedTypeNode(node.getName(), node.getTypeParameters()).toSource();
+ declarationNameWithTypeParameter = createDeclarationName(node.getName(), node.getTypeParameters());
} else {
isInterface = false;
metadata = DartObsoleteMetadata.EMPTY;
@@ -355,6 +356,24 @@
return supertypes;
}
+ private String createDeclarationName(
+ DartIdentifier name, List<DartTypeParameter> typeParameters) {
+ StringBuilder builder = new StringBuilder();
+ builder.append(name.toSource());
+ int count = typeParameters.size();
+ if (count > 0) {
+ builder.append("<");
+ for (int i = 0; i < count; i++) {
+ if (i > 0) {
+ builder.append(", ");
+ }
+ builder.append(typeParameters.get(i).toSource());
+ }
+ builder.append(">");
+ }
+ return builder.toString();
+ }
+
private void addInterfaceToSupertypes(Map<ClassElement, InterfaceType> interfaces,
ArrayList<InterfaceType> supertypes,
InterfaceType intf) {
« no previous file with comments | « compiler/java/com/google/dart/compiler/ast/DartClass.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698