mirror of
https://github.com/dart-lang/sdk
synced 2024-10-04 16:54:55 +00:00
Announced #28939 (void f() => e
allows an e of any type) in changelog
Addresses sdk issue #29646. R=floitsch@google.com Review-Url: https://codereview.chromium.org/2887253003 .
This commit is contained in:
parent
25a770fc97
commit
9820535bc1
|
@ -4,6 +4,9 @@
|
||||||
* 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`
|
||||||
|
now allows the returned expression to have any type. For example, assuming the
|
||||||
|
declaration `int x;`, it is now type correct to have `void f() => ++x;`.
|
||||||
|
|
||||||
#### Strong Mode
|
#### Strong Mode
|
||||||
|
|
||||||
|
@ -17,6 +20,9 @@ Packages that implement `Future` must either type the `onValue` parameter to
|
||||||
`.then` as returning `FutureOr<T>`, or else must leave the type of the parameter
|
`.then` as returning `FutureOr<T>`, or else must leave the type of the parameter
|
||||||
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
|
||||||
|
function declared using `=>` with return type `void` now allows the returned
|
||||||
|
expression to have any type.
|
||||||
|
|
||||||
### Core library changes
|
### Core library changes
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue