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

Unified Diff: lib/compiler/implementation/elements/elements.dart

Issue 11229002: Handle type variable in static member. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Status updated Created 8 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 | lib/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/elements/elements.dart
diff --git a/lib/compiler/implementation/elements/elements.dart b/lib/compiler/implementation/elements/elements.dart
index 7a48158f8be865ff49a592ae4b13e56db5103c90..5da84bcafd882921018d3d6ec859a86f0c1fb303 100644
--- a/lib/compiler/implementation/elements/elements.dart
+++ b/lib/compiler/implementation/elements/elements.dart
@@ -159,6 +159,16 @@ class Element implements Spannable {
return enclosingElement != null && enclosingElement.isClass();
}
bool isInstanceMember() => false;
+
+ /**
+ * Returns [:true:] if this element is enclosed in a static member or is
+ * itself a static member.
+ */
+ bool isInStaticMember() {
+ Element member = getEnclosingMember();
+ return member != null && member.modifiers.isStatic();
+ }
+
bool isFactoryConstructor() => modifiers.isFactory();
bool isGenerativeConstructor() =>
identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR);
@@ -296,6 +306,10 @@ class Element implements Spannable {
return null;
}
+ /**
+ * Returns the member enclosing this element or the element itself if it is a
+ * member. If no enclosing element is found, [:null:] is returned.
+ */
Element getEnclosingMember() {
for (Element e = this; e != null; e = e.enclosingElement) {
if (e.isMember()) return e;
« no previous file with comments | « no previous file | lib/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698