Improve wording in invalid return spec per comments.

Change-Id: I78f94a2e36c5ba8156fffc840e7bc8a9dd6aeafb
Reviewed-on: https://dart-review.googlesource.com/70542
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This commit is contained in:
Leaf Petersen 2018-08-20 18:19:22 +00:00
parent fc24d41b47
commit f88582e74f

View file

@ -11,14 +11,14 @@ valid*.*
### Expression bodied functions
An asynchronous expression bodied function with return type `T` and return
expression `e` has a valid return if:
An asynchronous expression bodied function with return type `T` and body `exp`
has a valid return if:
* `flatten(T)` is `void`
* or `return exp;` is a valid return for an equivalent block bodied function
with return type `T` as defined below.
A synchronous expression bodied function with return type `T` and return expression
`e` has a valid return if:
A synchronous expression bodied function with return type `T` and body `exp` has
a valid return if:
* `T` is `void`
* or `return exp;` is a valid return for an equivalent block bodied function
with return type `T` as defined below.
@ -77,14 +77,14 @@ The rules for an asynchronous non-generator function with declared return type
### Expression bodied functions
It is an error if an asynchronous expression bodied function with return type `T`
has return expression `exp` and both:
It is an error if an asynchronous expression bodied function with return type
`T` has body `exp` and both:
* `flatten(T)` is not `void`
* `return exp;` would be an error in an equivalent block bodied function
with return type `T` as defined below.
It is an error if a synchronous expression bodied function with return type `T`
has return expression `exp` and both:
has body `exp` and both:
* `T` is not `void`
* `return exp;` would be an error in an equivalent block bodied function
with return type `T` as defined below.