Fix valid_returns tests.

The valid return tests were misnamed and hence not run.  Also remove
duplicate tests from one file, and add status to the informal proposal.

Change-Id: I20179e81a0281302056f601ee3b7a51e2aec180e
Reviewed-on: https://dart-review.googlesource.com/73562
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This commit is contained in:
Leaf Petersen 2018-09-06 20:37:06 +00:00 committed by commit-bot@chromium.org
parent 39535676c8
commit 9883fcca08
4 changed files with 3 additions and 13 deletions

View file

@ -2,6 +2,8 @@
leafp@google.com
Status: Ready for implementation
**Note: Also see alternative presentation at the bottom for a dual presentation
of these rules in terms of which things are errors, rather than which things are
valid*.*

View file

@ -20,7 +20,6 @@ FutureOr<Object> fovo = null;
FutureOr<Null> fovn = null;
FutureOr<int> fovi = null;
/* Test the cases where expression bodied functions are more permissive
* than block bodied functions (places where they behave the same
* are tested below).
@ -32,7 +31,6 @@ expression `e` has a valid return if:
with return type `T` as defined below.
*/
void async_int_to_void_e() async => vi;
Future<void> async_int_to_Future_void__e() async => vi;
FutureOr<void> async_int_to_FutureOr_void__e() async => vi;
@ -343,42 +341,34 @@ Future<int> async_Future_int__to_Future_int_() async {
return fvi;
}
Future<void> async_int_to_Future_void__e() async => vi;
Future<void> async_int_to_Future_void_() async {
return vi;
}
Future<void> async_Object_to_Future_void__e() async => vo;
Future<void> async_Object_to_Future_void_() async {
return vo;
}
Future<void> async_FutureOr_int__to_Future_void__e() async => fovi;
Future<void> async_FutureOr_int__to_Future_void_() async {
return fovi;
}
Future<void> async_Future_int__to_Future_void__e() async => fvi;
Future<void> async_Future_int__to_Future_void_() async {
return fvi;
}
FutureOr<void> async_int_to_FutureOr_void__e() async => vi;
FutureOr<void> async_int_to_FutureOr_void_() async {
return vi;
}
FutureOr<void> async_Object_to_FutureOr_void__e() async => vo;
FutureOr<void> async_Object_to_FutureOr_void_() async {
return vo;
}
FutureOr<void> async_FutureOr_int__to_FutureOr_void__e() async => fovi;
FutureOr<void> async_FutureOr_int__to_FutureOr_void_() async {
return fovi;
}
FutureOr<void> async_Future_int__to_FutureOr_void__e() async => fvi;
FutureOr<void> async_Future_int__to_FutureOr_void_() async {
return fvi;
}

View file

@ -37,7 +37,6 @@ void sync_FutureOr_int__to_void_e() => fovi;
void sync_Future_Object__to_void_e() => fvo;
void sync_FutureOr_Object__to_void_e() => fovo;
/* Test the cases that apply only to block bodied functions
*/
@ -62,8 +61,6 @@ Null sync_empty_to_Null() {
/* Test the cases that apply to both expression bodied and block bodied
* functions
*/
/*
* `return exp;` where `exp` has static type `S` is a valid return if:

View file

@ -225,6 +225,7 @@ f_bounded_quantification_test/02: MissingCompileTimeError # Issue 33308
factory4_test/00: MissingCompileTimeError # Issue 31590
generic_methods_bounds_test/01: MissingCompileTimeError # Issue 33308
generic_methods_recursive_bound_test/02: MissingCompileTimeError # Issue 33308
invalid_returns/async_valid_returns_test: CompileTimeError #34014
issue31596_super_test/02: MissingCompileTimeError # Issue 31596
issue31596_super_test/04: MissingCompileTimeError # Issue 31596
malbounded_instantiation_test/01: MissingCompileTimeError # Issue 33308