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

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

Issue 2182773002: Issue 26787. Report HintCode.OVERRIDE_ON_NON_OVERRIDING_GETTER for non-overriding fields. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/generated/hint_code_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/generated/non_hint_code_test.dart
diff --git a/pkg/analyzer/test/generated/non_hint_code_test.dart b/pkg/analyzer/test/generated/non_hint_code_test.dart
index 13abb033c61f3ade9cce1eca22d910bf5a05c31b..ae908e0432908a1d1aa75f2a3a21bc7f870db2d5 100644
--- a/pkg/analyzer/test/generated/non_hint_code_test.dart
+++ b/pkg/analyzer/test/generated/non_hint_code_test.dart
@@ -155,6 +155,26 @@ f() {
verify([source]);
}
+ void test_deadCode_deadFinalBreakInCase() {
+ Source source = addSource(r'''
+f() {
+ switch (true) {
+ case true:
+ try {
+ int a = 1;
+ } finally {
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+}''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_deadCode_deadOperandLHS_and_debugConst() {
Source source = addSource(r'''
const bool DEBUG = false;
@@ -190,26 +210,6 @@ f() {
verify([source]);
}
- void test_deadCode_deadFinalBreakInCase() {
- Source source = addSource(r'''
-f() {
- switch (true) {
- case true:
- try {
- int a = 1;
- } finally {
- return;
- }
- break;
- default:
- break;
- }
-}''');
- computeLibrarySourceErrors(source);
- assertNoErrors(source);
- verify([source]);
- }
-
void test_deprecatedMemberUse_inDeprecatedClass() {
Source source = addSource(r'''
@deprecated
@@ -486,6 +486,38 @@ class A {
verify([source]);
}
+ void test_overrideOnNonOverridingGetter_field_inInterface() {
+ Source source = addSource(r'''
+library dart.core;
+const override = null;
+class A {
+ int get m => 0;
+}
+class B implements A {
+ @override
+ final int m = 1;
+}''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void test_overrideOnNonOverridingGetter_field_inSuperclass() {
+ Source source = addSource(r'''
+library dart.core;
+const override = null;
+class A {
+ int get m => 0;
+}
+class B extends A {
+ @override
+ final int m = 1;
+}''');
+ computeLibrarySourceErrors(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_overrideOnNonOverridingGetter_inInterface() {
Source source = addSource(r'''
library dart.core;
« no previous file with comments | « pkg/analyzer/test/generated/hint_code_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698