| Index: compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
|
| diff --git a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
|
| index df8618d79df308c8e5c3553fa5eb0ceaa9d73f6e..cd1bb418768fc7699019e01801da70afd8fef00e 100644
|
| --- a/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
|
| +++ b/compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java
|
| @@ -176,11 +176,31 @@ public class ResolutionContext implements ResolutionErrorListener {
|
| if (node == null) {
|
| return null;
|
| } else {
|
| - return resolveType(node, node.getIdentifier(), node.getTypeArguments(), isStatic, isFactory,
|
| + Type type = resolveType(node, node.getIdentifier(), node.getTypeArguments(), isStatic, isFactory,
|
| errorCode);
|
| + recordTypeIdentifier(node.getIdentifier(), type.getElement());
|
| + return type;
|
| }
|
| }
|
|
|
| + protected <E extends Element> E recordTypeIdentifier(DartNode node, E element) {
|
| + node.getClass();
|
| + if (node instanceof DartPropertyAccess) {
|
| + recordTypeIdentifier(((DartPropertyAccess)node).getQualifier(),
|
| + element.getEnclosingElement());
|
| + return recordTypeIdentifier(((DartPropertyAccess)node).getName(), element);
|
| + } else if (node instanceof DartIdentifier) {
|
| + if (element == null) {
|
| + // TypeAnalyzer will diagnose unresolved identifiers.
|
| + return null;
|
| + }
|
| + node.setSymbol(element);
|
| + } else {
|
| + throw internalError(node, "Unexpected node: %s", node);
|
| + }
|
| + return element;
|
| + }
|
| +
|
| Type resolveType(DartNode diagnosticNode, DartNode identifier, List<DartTypeNode> typeArguments,
|
| boolean isStatic, boolean isFactory, ErrorCode errorCode) {
|
| Element element = resolveName(identifier);
|
| @@ -247,6 +267,7 @@ public class ResolutionContext implements ResolutionErrorListener {
|
| boolean isFactory,
|
| ErrorCode errorCode) {
|
| List<? extends Type> typeParameters = element.getTypeParameters();
|
| +
|
| Type[] typeArguments;
|
| if (typeArgumentNodes == null || typeArgumentNodes.size() != typeParameters.size()) {
|
| typeArguments = new Type[typeParameters.size()];
|
|
|