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

Unified Diff: pkg/compiler/lib/src/elements/elements.dart

Issue 1100073002: Allow access to type variables as expressions in factory constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/elements.dart
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index 8cda9671a994680c4fa1da6356c522bc407a220c..dc8650408d5eda22cf29027819a3b56d05381456 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -490,6 +490,12 @@ class Elements {
return true;
}
+ static bool hasAccessToTypeVariables(Element element) {
+ Element outer = element.outermostEnclosingMemberOrTopLevel;
+ return (outer != null && outer.isFactoryConstructor) ||
+ !isInStaticContext(element);
+ }
+
static bool isStaticOrTopLevelField(Element element) {
return isStaticOrTopLevel(element)
&& (identical(element.kind, ElementKind.FIELD)
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698