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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 1679493002: Serialize initializers for final fields. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/analyzer/lib/src/summary/summarize_elements.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index b10c35046e1efff7ab1d6c0e3efd43ddf7515bb7..41737589144f75efe371464219ca6f3853ac822e 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -3854,6 +3854,7 @@ int foo(int a, String b) => 0;
expect(variable.isConst, isFalse);
expect(variable.isStatic, isFalse);
expect(variable.isFinal, isFalse);
+ expect(variable.constExpr, isNull);
expect(findExecutable('i', executables: cls.executables), isNull);
expect(findExecutable('i=', executables: cls.executables), isNull);
}
@@ -3883,6 +3884,8 @@ class C {
UnlinkedVariable variable =
serializeClassText('class C { final int i = 0; }').fields[0];
expect(variable.isFinal, isTrue);
+ _assertUnlinkedConst(variable.constExpr,
+ operators: [UnlinkedConstOperation.pushInt], ints: [0]);
}
test_field_formal_param_inferred_type_explicit() {
@@ -5253,6 +5256,7 @@ var v;''';
UnlinkedVariable variable =
serializeVariableText('final int i = 0;', variableName: 'i');
expect(variable.isFinal, isTrue);
+ expect(variable.constExpr, isNull);
}
test_variable_implicit_dynamic() {
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698