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

Unified Diff: pkg/analyzer2dart/lib/src/identifier_semantics.dart

Issue 712313004: Fix AccessSemantics for function typedefs and "dynamic". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | pkg/analyzer2dart/lib/src/semantic_visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer2dart/lib/src/identifier_semantics.dart
diff --git a/pkg/analyzer2dart/lib/src/identifier_semantics.dart b/pkg/analyzer2dart/lib/src/identifier_semantics.dart
index 70747cf7852d851eae3f38d32812c2606ad32097..d78a9395f29c8f4c3f4dbbb75fd7341886e6ea28 100644
--- a/pkg/analyzer2dart/lib/src/identifier_semantics.dart
+++ b/pkg/analyzer2dart/lib/src/identifier_semantics.dart
@@ -59,10 +59,11 @@ class AccessKind {
const AccessKind._('STATIC_PROPERTY');
/**
- * The destination of the access is a toplevel class.
+ * The destination of the access is a toplevel class, function typedef, mixin
+ * application, or the built-in type "dynamic".
*/
- static const AccessKind TOPLEVEL_CLASS =
- const AccessKind._('TOPLEVEL_CLASS');
+ static const AccessKind TOPLEVEL_TYPE =
+ const AccessKind._('TOPLEVEL_TYPE');
/**
* The destination of the access is a type parameter of the enclosing class.
@@ -167,8 +168,8 @@ class AccessSemantics {
: kind = AccessKind.STATIC_PROPERTY,
target = null;
- AccessSemantics.toplevelClass(this.identifier, this.element)
- : kind = AccessKind.TOPLEVEL_CLASS,
+ AccessSemantics.toplevelType(this.identifier, this.element)
+ : kind = AccessKind.TOPLEVEL_TYPE,
classElement = null,
isInvoke = false,
target = null;
@@ -379,8 +380,9 @@ class AccessSemanticsVisitor extends RecursiveAstVisitor<AccessSemantics> {
}
} else if (rhsElement is FunctionElement) {
return new AccessSemantics.staticMethod(rhs, rhsElement, null);
- } else if (rhsElement is ClassElement) {
- return new AccessSemantics.toplevelClass(rhs, rhsElement);
+ } else if (rhsElement is ClassElement ||
+ rhsElement is FunctionTypeAliasElement) {
+ return new AccessSemantics.toplevelType(rhs, rhsElement);
} else {
return new AccessSemantics.dynamic(rhs, null);
}
@@ -480,8 +482,10 @@ class AccessSemanticsVisitor extends RecursiveAstVisitor<AccessSemantics> {
staticElement.enclosingElement);
} else if (staticElement is TypeParameterElement) {
return new AccessSemantics.typeParameter(node, staticElement);
- } else if (staticElement is ClassElement) {
- return new AccessSemantics.toplevelClass(node, staticElement);
+ } else if (staticElement is ClassElement ||
+ staticElement is FunctionTypeAliasElement ||
+ staticElement is DynamicElementImpl) {
+ return new AccessSemantics.toplevelType(node, staticElement);
}
return new AccessSemantics.dynamic(node, null);
}
« no previous file with comments | « no previous file | pkg/analyzer2dart/lib/src/semantic_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698