Adjusted wording for "return anything from void =>" to include setters

Addresses issue https://github.com/dart-lang/sdk/issues/29683.

R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2899753002 .
This commit is contained in:
Erik Ernst 2017-05-22 15:58:19 +02:00
parent 8f17ae7709
commit ecd86d9bfc

View file

@ -4,9 +4,10 @@
* During a dynamic type check, `void` is not required to be `null` anymore. * During a dynamic type check, `void` is not required to be `null` anymore.
In practice, this makes overriding `void` functions with non-`void` functions In practice, this makes overriding `void` functions with non-`void` functions
safer. safer.
* During static analysis, a function declared using `=>` with return type `void` * During static analysis, a function or setter declared using `=>` with return
now allows the returned expression to have any type. For example, assuming the type `void` now allows the returned expression to have any type. For example,
declaration `int x;`, it is now type correct to have `void f() => ++x;`. assuming the declaration `int x;`, it is now type correct to have
`void f() => ++x;`.
#### Strong Mode #### Strong Mode
@ -21,8 +22,8 @@ Packages that implement `Future` must either type the `onValue` parameter to
entirely to allow inference to fill in the type. entirely to allow inference to fill in the type.
* The following is also a change in strong mode: During static analysis, a * The following is also a change in strong mode: During static analysis, a
function declared using `=>` with return type `void` now allows the returned function or setter declared using `=>` with return type `void` now allows the
expression to have any type. returned expression to have any type.
### Core library changes ### Core library changes