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

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

Issue 2989243003: Resynthesize values of final fields of classes with const constructors. (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
« no previous file with comments | « pkg/analyzer/lib/src/kernel/resynthesize.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/resynthesize_common.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index bd1c556a1ce8af1fd7f514c343471792ad62298c..3dd04d41b917e7a3b0e9a96994ab2c663bd3e59a 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -2454,6 +2454,21 @@ final dynamic f;
}
}
+ test_const_finalField_hasConstConstructor() async {
+ var library = await checkLibrary(r'''
+class C {
+ final int f = 42;
+ const C();
+}
+''');
+ checkElementText(library, r'''
+class C {
+ final int f = 42;
+ const C();
+}
+''');
+ }
+
test_const_invalid_field_const() async {
variablesWithNotConstInitializers.add('f');
var library = await checkLibrary(r'''
« no previous file with comments | « pkg/analyzer/lib/src/kernel/resynthesize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698