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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 3008453002: Build / resynthesize final fields as ConstFieldElementImpl only if the enclosing class has a consta… (Closed)
Patch Set: Created 3 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
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 241d53009526d08ffb3173aa8b6ea8e4443a04f1..aed62ae5c8ecd8086f67cb0d1ec3256dd044513e 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -6139,11 +6139,7 @@ class ResolverVisitor extends ScopedVisitor {
// have to clone the initializers for non-static final fields (because if
// they occur in a class with a const constructor, they will be needed to
// evaluate the const constructor).
- if ((element.isConst ||
- (element is FieldElement &&
- element.isFinal &&
- !element.isStatic)) &&
- node.initializer != null) {
+ if (element is ConstVariableElement) {
(element as ConstVariableElement).constantInitializer =
new ConstantAstCloner().cloneNode(node.initializer);
}
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698