| Index: compiler/java/com/google/dart/compiler/resolver/ConstructorElementImplementation.java
|
| diff --git a/compiler/java/com/google/dart/compiler/resolver/ConstructorElementImplementation.java b/compiler/java/com/google/dart/compiler/resolver/ConstructorElementImplementation.java
|
| index 9f4a96ad32e62d21cdf99871f21430df66e140b8..7f174aaf8d1fb583548e4a30ff1df7d4ea68ec5d 100644
|
| --- a/compiler/java/com/google/dart/compiler/resolver/ConstructorElementImplementation.java
|
| +++ b/compiler/java/com/google/dart/compiler/resolver/ConstructorElementImplementation.java
|
| @@ -4,12 +4,16 @@
|
|
|
| package com.google.dart.compiler.resolver;
|
|
|
| +import com.google.dart.compiler.ast.DartIdentifier;
|
| import com.google.dart.compiler.ast.DartMethodDefinition;
|
| -import com.google.dart.compiler.ast.Modifiers;
|
| +import com.google.dart.compiler.ast.DartNode;
|
| +import com.google.dart.compiler.ast.DartParameterizedTypeNode;
|
| +import com.google.dart.compiler.ast.DartPropertyAccess;
|
|
|
| class ConstructorElementImplementation extends MethodElementImplementation
|
| implements ConstructorElement {
|
| private final ClassElement constructorType;
|
| + private final String rawName;
|
| private ConstructorElement defaultConstructor;
|
|
|
| private ConstructorElementImplementation(DartMethodDefinition node,
|
| @@ -18,18 +22,28 @@ class ConstructorElementImplementation extends MethodElementImplementation
|
| ClassElement constructorType) {
|
| super(node, name, declaringClass);
|
| this.constructorType = constructorType;
|
| + this.rawName = getRawName(node.getName());
|
| }
|
|
|
| - private ConstructorElementImplementation(String name,
|
| - ClassElement declaringClass,
|
| - ClassElement constructorType) {
|
| - super(name, declaringClass, Modifiers.NONE.makeFactory());
|
| - this.constructorType = constructorType;
|
| + private static String getRawName(DartNode name) {
|
| + if (name instanceof DartIdentifier) {
|
| + return ((DartIdentifier) name).getName();
|
| + } else if (name instanceof DartParameterizedTypeNode) {
|
| + return getRawName(((DartParameterizedTypeNode) name).getExpression());
|
| + } else {
|
| + DartPropertyAccess propertyAccess = (DartPropertyAccess) name;
|
| + return getRawName(propertyAccess.getQualifier()) + "." + getRawName(propertyAccess.getName());
|
| + }
|
| }
|
|
|
| public ClassElement getConstructorType() {
|
| return constructorType;
|
| }
|
| +
|
| + @Override
|
| + public String getRawName() {
|
| + return rawName;
|
| + }
|
|
|
| @Override
|
| public ElementKind getKind() {
|
| @@ -40,6 +54,11 @@ class ConstructorElementImplementation extends MethodElementImplementation
|
| public boolean isConstructor() {
|
| return true;
|
| }
|
| +
|
| + @Override
|
| + public boolean isSynthetic() {
|
| + return false;
|
| + }
|
|
|
| @Override
|
| public ConstructorElement getDefaultConstructor() {
|
| @@ -57,10 +76,4 @@ class ConstructorElementImplementation extends MethodElementImplementation
|
| ClassElement constructorType) {
|
| return new ConstructorElementImplementation(node, name, declaringClass, constructorType);
|
| }
|
| -
|
| - public static ConstructorElementImplementation named(String name,
|
| - ClassElement declaringClass,
|
| - ClassElement constructorType) {
|
| - return new ConstructorElementImplementation(name, declaringClass, constructorType);
|
| - }
|
| }
|
|
|