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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.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 | « pkg/analyzer/test/src/summary/resynthesize_test.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 5b7ebd22174aab7925d845ceeb49d1573f39921e..94e5b5e501f91525d44707d9057f546542c3c580 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -6002,6 +6002,28 @@ class C<T> {
expect(variable.constExpr, isNull);
}
+ test_field_static_final_untyped() {
+ if (!checkAstDerivedData) {
+ // The element model doesn't contain the initializer expressions needed
+ // for type inference. TODO(paulberry): fix.
+ return;
+ }
+ UnlinkedVariable variable =
+ serializeClassText('class C { static final x = 0; }').fields[0];
+ expect(variable.constExpr, isNotNull);
+ }
+
+ test_field_untyped() {
+ if (!checkAstDerivedData) {
+ // The element model doesn't contain the initializer expressions needed
+ // for type inference. TODO(paulberry): fix.
+ return;
+ }
+ UnlinkedVariable variable =
+ serializeClassText('class C { var x = 0; }').fields[0];
+ expect(variable.constExpr, isNotNull);
+ }
+
test_fully_linked_references_follow_other_references() {
if (skipFullyLinkedData) {
return;
@@ -8007,6 +8029,16 @@ var v;''';
expect(variable.constExpr, isNull);
}
+ test_variable_final_top_level_untyped() {
+ if (!checkAstDerivedData) {
+ // The element model doesn't contain the initializer expressions needed
+ // for type inference. TODO(paulberry): fix.
+ return;
+ }
+ UnlinkedVariable variable = serializeVariableText('final v = 0;');
+ expect(variable.constExpr, isNotNull);
+ }
+
test_variable_implicit_dynamic() {
UnlinkedVariable variable = serializeVariableText('var v;');
expect(variable.type, isNull);
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698