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

Side by Side Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 2870363003: Allowing `e` of any type in `void f(...) => e` in the analyzer. (Closed)
Patch Set: Rebased Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.src.task.strong.checker_test; 5 library analyzer.test.src.task.strong.checker_test;
6 6
7 import 'package:test_reflective_loader/test_reflective_loader.dart'; 7 import 'package:test_reflective_loader/test_reflective_loader.dart';
8 8
9 import 'strong_test_helper.dart'; 9 import 'strong_test_helper.dart';
10 10
(...skipping 3518 matching lines...) Expand 10 before | Expand all | Expand 10 after
3529 } 3529 }
3530 '''); 3530 ''');
3531 } 3531 }
3532 3532
3533 test_setterReturnTypes() async { 3533 test_setterReturnTypes() async {
3534 await checkFile(''' 3534 await checkFile('''
3535 void voidFn() => null; 3535 void voidFn() => null;
3536 class A { 3536 class A {
3537 set a(y) => 4; 3537 set a(y) => 4;
3538 set b(y) => voidFn(); 3538 set b(y) => voidFn();
3539 void set c(y) => /*error:RETURN_OF_INVALID_TYPE*/4; 3539 void set c(y) => 4;
3540 void set d(y) => voidFn(); 3540 void set d(y) => voidFn();
3541 /*warning:NON_VOID_RETURN_FOR_SETTER*/int set e(y) => 4; 3541 /*warning:NON_VOID_RETURN_FOR_SETTER*/int set e(y) => 4;
3542 /*warning:NON_VOID_RETURN_FOR_SETTER*/int set f(y) => 3542 /*warning:NON_VOID_RETURN_FOR_SETTER*/int set f(y) =>
3543 /*error:RETURN_OF_INVALID_TYPE*/voidFn(); 3543 /*error:RETURN_OF_INVALID_TYPE*/voidFn();
3544 set g(y) {return /*error:RETURN_OF_INVALID_TYPE*/4;} 3544 set g(y) {return /*error:RETURN_OF_INVALID_TYPE*/4;}
3545 void set h(y) {return /*error:RETURN_OF_INVALID_TYPE*/4;} 3545 void set h(y) {return /*error:RETURN_OF_INVALID_TYPE*/4;}
3546 /*warning:NON_VOID_RETURN_FOR_SETTER*/int set i(y) {return 4;} 3546 /*warning:NON_VOID_RETURN_FOR_SETTER*/int set i(y) {return 4;}
3547 } 3547 }
3548 '''); 3548 ''');
3549 } 3549 }
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
4203 class CheckerTest_Driver extends CheckerTest { 4203 class CheckerTest_Driver extends CheckerTest {
4204 @override 4204 @override
4205 bool get enableNewAnalysisDriver => true; 4205 bool get enableNewAnalysisDriver => true;
4206 4206
4207 @failingTest 4207 @failingTest
4208 @override 4208 @override
4209 test_covariantOverride_fields() async { 4209 test_covariantOverride_fields() async {
4210 await super.test_covariantOverride_fields(); 4210 await super.test_covariantOverride_fields();
4211 } 4211 }
4212 } 4212 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/static_type_warning_code_test.dart ('k') | tests/language/void_arrow_return_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698