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: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 32363003: Handle resolution of Class.named<TypeArg> correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 2 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 | sdk/lib/_internal/lib/isolate_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d2c968a4265fb17346959a57c1898849e974d257..1021d62bed41b9a919d38e13f5d12156b3e6b7a4 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -1627,21 +1627,16 @@ 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 of this method will create the ErroneousElement for
+ // the MalformedType.
+ return null;
} else {
String stringValue = typeName.source;
if (identical(stringValue, 'void')) {
@@ -1668,7 +1663,6 @@ class TypeResolver {
}
Element element = resolveTypeName(visitor.scope, prefixName, typeName);
- DartType type;
DartType reportFailureAndCreateType(DualKind messageKind,
Map messageArguments,
@@ -1701,6 +1695,7 @@ class TypeResolver {
return type;
}
+ DartType type;
if (element == null) {
type = reportFailureAndCreateType(
MessageKind.CANNOT_RESOLVE_TYPE, {'typeName': node.typeName});
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/isolate_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698