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

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

Issue 1797583003: Warn about deprecated fields (issue 22963) (Closed) Base URL: https://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/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 d49262357802b50bb90ee2b36202de1d6e88b313..118b80b862a13343fad4c245bbfa9b69500b3c2b 100644
--- a/pkg/analyzer/test/generated/hint_code_test.dart
+++ b/pkg/analyzer/test/generated/hint_code_test.dart
@@ -624,10 +624,10 @@ f(A a) {
verify([source]);
}
- void test_deprecatedAnnotationUse_Deprecated() {
+ void test_deprecatedAnnotationUse_deprecated() {
Source source = addSource(r'''
class A {
- @Deprecated('0.9')
+ @deprecated
m() {}
n() {m();}
}''');
@@ -636,10 +636,10 @@ class A {
verify([source]);
}
- void test_deprecatedAnnotationUse_deprecated() {
+ void test_deprecatedAnnotationUse_Deprecated() {
Source source = addSource(r'''
class A {
- @deprecated
+ @Deprecated('0.9')
m() {}
n() {m();}
}''');
@@ -661,6 +661,20 @@ class A {}''');
verify([source]);
}
+ void test_deprecatedAnnotationUse_field() {
+ Source source = addSource(r'''
+class A {
+ @deprecated
+ int x = 1;
+}
+f(A a) {
+ return a.x;
+}''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [HintCode.DEPRECATED_MEMBER_USE]);
+ verify([source]);
+ }
+
void test_deprecatedAnnotationUse_getter() {
Source source = addSource(r'''
class A {
« 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