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

Side by Side Diff: pkg/analyzer/test/generated/non_hint_code_test.dart

Issue 2064203002: Do not error on dead, mandated statements at end of switch cases (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Two tests Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/generated/hint_code_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.non_hint_code_test; 5 library analyzer.test.generated.non_hint_code_test;
6 6
7 import 'package:analyzer/src/generated/error.dart'; 7 import 'package:analyzer/src/generated/error.dart';
8 import 'package:analyzer/src/generated/source_io.dart'; 8 import 'package:analyzer/src/generated/source_io.dart';
9 9
10 import '../reflective_tests.dart'; 10 import '../reflective_tests.dart';
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (1 < 0) { 183 if (1 < 0) {
184 return; 184 return;
185 } 185 }
186 int a = 1; 186 int a = 1;
187 }'''); 187 }''');
188 computeLibrarySourceErrors(source); 188 computeLibrarySourceErrors(source);
189 assertNoErrors(source); 189 assertNoErrors(source);
190 verify([source]); 190 verify([source]);
191 } 191 }
192 192
193 void test_deadCode_deadFinalBreakInCase() {
194 Source source = addSource(r'''
195 f() {
196 switch (true) {
197 case true:
198 try {
199 int a = 1;
200 } finally {
201 return;
202 }
203 break;
204 default:
205 break;
206 }
207 }''');
208 computeLibrarySourceErrors(source);
209 assertNoErrors(source);
210 verify([source]);
211 }
212
193 void test_deprecatedMemberUse_inDeprecatedClass() { 213 void test_deprecatedMemberUse_inDeprecatedClass() {
194 Source source = addSource(r''' 214 Source source = addSource(r'''
195 @deprecated 215 @deprecated
196 f() {} 216 f() {}
197 217
198 @deprecated 218 @deprecated
199 class C { 219 class C {
200 m() { 220 m() {
201 f(); 221 f();
202 } 222 }
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 1278
1259 void test_import_valid_outside_lib() { 1279 void test_import_valid_outside_lib() {
1260 cacheSource("/myproj/pubspec.yaml", ""); 1280 cacheSource("/myproj/pubspec.yaml", "");
1261 cacheSource("/myproj/web/other.dart", ""); 1281 cacheSource("/myproj/web/other.dart", "");
1262 Source source = 1282 Source source =
1263 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';"); 1283 addNamedSource("/myproj/lib2/test.dart", "import '../web/other.dart';");
1264 computeLibrarySourceErrors(source); 1284 computeLibrarySourceErrors(source);
1265 assertNoErrors(source); 1285 assertNoErrors(source);
1266 } 1286 }
1267 } 1287 }
OLDNEW
« 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