| 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 9fc1dfb311802623f4f9e70422f44aa7148fb980..2bccd5e755fef5f8ed2b5741515d54a7f2cdfec2 100644
|
| --- a/pkg/analyzer/test/generated/non_hint_code_test.dart
|
| +++ b/pkg/analyzer/test/generated/non_hint_code_test.dart
|
| @@ -158,6 +158,76 @@ f() {
|
| verify([source]);
|
| }
|
|
|
| + void test_deadCode_statementAfterLabelledBreak() {
|
| + Source source = addSource(r'''
|
| +f() {
|
| + outer:
|
| + while (1 < 2) {
|
| + while (2 < 3) {
|
| + break outer;
|
| + int a = 1;
|
| + }
|
| + }
|
| +}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertNoErrors(source);
|
| + verify([source]);
|
| + }
|
| +
|
| + void test_deadCode_statementAfterIfWithoutThen() {
|
| + Source source = addSource(r'''
|
| +f() {
|
| + if (1 < 0);
|
| + int a = 1;
|
| +}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertNoErrors(source);
|
| + verify([source]);
|
| + }
|
| +
|
| + void test_deadCode_statementAfterIfWithoutElse() {
|
| + Source source = addSource(r'''
|
| +f() {
|
| + if (1 < 0) {
|
| + return;
|
| + }
|
| + int a = 1;
|
| +}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertNoErrors(source);
|
| + verify([source]);
|
| + }
|
| +
|
| + void test_deadCode_statementAfterIfDoesntExit() {
|
| + Source source = addSource(r'''
|
| +f() {
|
| + if (1 < 0) {
|
| + if (1 > 0)
|
| + return;
|
| + } else {
|
| + return;
|
| + }
|
| + int a = 1;
|
| +}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertNoErrors(source);
|
| + verify([source]);
|
| + }
|
| +
|
| + void test_deadCode_statementAfterDoDoesntAlwaysExit() {
|
| + Source source = addSource(r'''
|
| +f() {
|
| + do {
|
| + if (1 > 0)
|
| + return;
|
| + } while (1 > 0);
|
| + int a = 1;
|
| +}''');
|
| + computeLibrarySourceErrors(source);
|
| + assertNoErrors(source);
|
| + verify([source]);
|
| + }
|
| +
|
| void test_deprecatedMemberUse_inDeprecatedClass() {
|
| Source source = addSource(r'''
|
| @deprecated
|
|
|