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

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

Issue 10873033: Support non-const instance field initializers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
===================================================================
--- lib/compiler/implementation/resolver.dart (revision 11297)
+++ lib/compiler/implementation/resolver.dart (working copy)
@@ -930,7 +930,10 @@
ResolverVisitor(Compiler compiler, Element element)
: this.mapping = new TreeElementMapping(),
this.enclosingElement = element,
- inInstanceContext = element.isInstanceMember()
+ // When the element is a field, we are actually resolving its
+ // initial value, which should not have access to instance
+ // fields.
+ inInstanceContext = (element.isInstanceMember() && !element.isField())
|| element.isGenerativeConstructor(),
this.currentClass = element.isMember() ?
element.getEnclosingClass() :
« no previous file with comments | « lib/compiler/implementation/elements/elements.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698