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

Unified Diff: pkg/analyzer/test/generated/hint_code_test.dart

Issue 2805443002: Restrict `@immutable` checks to instance fields (Closed)
Patch Set: Created 3 years, 8 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/generated/resolver.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/generated/hint_code_test.dart
diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart
index 93ea7b340d16dbd44fe3fcd0bff55732f03d3b70..f0852ba7191d6869b03c49dad8c2b1e3f635adb0 100644
--- a/pkg/analyzer/test/generated/hint_code_test.dart
+++ b/pkg/analyzer/test/generated/hint_code_test.dart
@@ -2007,6 +2007,19 @@ class A {
verify([source]);
}
+ test_mustBeImmutable_instance() async {
+ Source source = addSource(r'''
+import 'package:meta/meta.dart';
+@immutable
+class A {
+ static int x;
+}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(source, []);
+ verify([source]);
+ }
+
test_mustBeImmutable_extends() async {
Source source = addSource(r'''
import 'package:meta/meta.dart';
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698