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

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 1855483003: Store initializer expressions for untyped vars/fields in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 4b08c5fe1e39c99e87c4a1c2428398069de35827..20a75cce3cb2a6e40554ccfdce0d07ee549085ea 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -2006,7 +2006,7 @@ class _UnitResynthesizer {
*/
LocalVariableElement buildLocalVariable(UnlinkedVariable serializedVariable) {
LocalVariableElementImpl element;
- if (serializedVariable.constExpr != null) {
+ if (serializedVariable.constExpr != null && serializedVariable.isConst) {
ConstLocalVariableElementImpl constElement =
new ConstLocalVariableElementImpl(
serializedVariable.name, serializedVariable.nameOffset);
@@ -2233,7 +2233,7 @@ class _UnitResynthesizer {
[ElementHolder holder]) {
if (holder == null) {
TopLevelVariableElementImpl element;
- if (serializedVariable.constExpr != null) {
+ if (serializedVariable.constExpr != null && serializedVariable.isConst) {
ConstTopLevelVariableElementImpl constElement =
new ConstTopLevelVariableElementImpl(
serializedVariable.name, serializedVariable.nameOffset);
@@ -2249,7 +2249,9 @@ class _UnitResynthesizer {
buildImplicitAccessors(element, unitHolder);
} else {
FieldElementImpl element;
- if (serializedVariable.constExpr != null) {
+ if (serializedVariable.constExpr != null &&
+ (serializedVariable.isConst ||
+ serializedVariable.isFinal && !serializedVariable.isStatic)) {
ConstFieldElementImpl constElement = new ConstFieldElementImpl(
serializedVariable.name, serializedVariable.nameOffset);
element = constElement;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summarize_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698