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

Unified Diff: pkg/compiler/lib/src/resolution/members.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 | « pkg/compiler/lib/src/elements/elements.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index 91c47871288a2a267d088d53784b8d83d88882a4..1630f52f0e75a20a317a189bfba2bf8566ba89d4 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1960,8 +1960,7 @@ class TypeResolver {
outer != null && outer.isFactoryConstructor;
if (!outer.isClass &&
!outer.isTypedef &&
- !isInFactoryConstructor &&
- Elements.isInStaticContext(visitor.enclosingElement)) {
+ !Elements.hasAccessToTypeVariables(visitor.enclosingElement)) {
registry.registerThrowRuntimeError();
type = reportFailureAndCreateType(
MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
@@ -2841,7 +2840,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
} else if (target.isTypeVariable) {
ClassElement cls = target.enclosingClass;
assert(enclosingElement.enclosingClass == cls);
- if (Elements.isInStaticContext(enclosingElement)) {
+ if (!Elements.hasAccessToTypeVariables(enclosingElement)) {
compiler.reportError(node,
MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
{'typeVariableName': node.selector});
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698