Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| index 69c82d4f294c3f0a779d01d5e7bc9106e6dd80ca..f61ef66e0427625b60569b3d324be3858f339716 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| @@ -1627,21 +1627,15 @@ class TypeResolver { |
| Identifier prefixName, |
| Identifier typeName) { |
| if (prefixName != null) { |
| - Element e = lookupInScope(compiler, prefixName, scope, prefixName.source); |
| - if (e != null) { |
| - if (identical(e.kind, ElementKind.PREFIX)) { |
| - // The receiver is a prefix. Lookup in the imported members. |
| - PrefixElement prefix = e; |
| - return prefix.lookupLocalMember(typeName.source); |
| - } else if (identical(e.kind, ElementKind.CLASS)) { |
| - // TODO(johnniwinther): Remove this case. |
| - // The receiver is the class part of a named constructor. |
| - return e; |
| - } |
| - } else { |
| - // The caller creates the ErroneousElement for the MalformedType. |
| - return null; |
| - } |
| + Element element = |
| + lookupInScope(compiler, prefixName, scope, prefixName.source); |
| + if (element != null && element.isPrefix()) { |
| + // The receiver is a prefix. Lookup in the imported members. |
| + PrefixElement prefix = element; |
| + return prefix.lookupLocalMember(typeName.source); |
| + } |
| + // The caller creates the ErroneousElement for the MalformedType. |
|
ngeoffray
2013/10/21 13:28:56
caller creates -> the caller of this method will c
Johnni Winther
2013/10/22 06:25:54
Done.
|
| + return null; |
| } else { |
| String stringValue = typeName.source; |
| if (identical(stringValue, 'void')) { |
| @@ -1668,7 +1662,6 @@ class TypeResolver { |
| } |
| Element element = resolveTypeName(visitor.scope, prefixName, typeName); |
| - DartType type; |
| DartType reportFailureAndCreateType(DualKind messageKind, |
| Map messageArguments, |
| @@ -1701,6 +1694,7 @@ class TypeResolver { |
| return type; |
| } |
| + DartType type; |
| if (element == null) { |
| type = reportFailureAndCreateType( |
| MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.typeName}); |