This reverts commit 9ab51b8012.
Reason for revert: Test failure in google3; please see internal b/150195057.
Original change's description:
> [vm/tfa] Convert named and optional parameters to required parameters where possible.
>
> Flutter Gallery code size (total):
> ARM64: -2.31%
> ARM32: -2.38%
>
> Change-Id: Ide7764afb06bf6f8387015de612cd4798b301541
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135305
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
TBR=alexmarkov@google.com,sjindel@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ib198c7cf265384c336d9db6776742db23fb4e999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137102
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
This check is necessary to make 'for await (var i in null) {} ' throw at runtime.
Change-Id: Id68c3d422671decbe4cb3e3326d9597ad7153d84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134871
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Stream.asyncExpand used to test result of 'convert' callback for null.
Moreover, this is a documented behavior: "If the call returns `null`,
no further action is taken for the elements." This ability was lost
when dart:async was migrated to NNBD as return type of 'convert'
becomes non-nullable. This change restores this behavior and changes
return type of 'convert' callback to be nullable.
Fixes the following tests with unforked SDK:
co19_2/LibTest/async/Stream/Stream.fromFutures_A04_t01
co19_2/LibTest/async/Stream/Stream.fromIterable_A03_t01
co19_2/LibTest/async/Stream/Stream.periodic_A04_t01
co19_2/LibTest/async/StreamController/StreamController.broadcast_A09_t01
co19_2/LibTest/async/StreamController/StreamController.broadcast_A10_t01
co19_2/LibTest/async/StreamController/stream_A02_t01
co19_2/LibTest/async/StreamController/stream_A03_t01
Change-Id: I7c9236475dc27eb2ada5bdd57cfb27fc84f72592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135200
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
The least upper bound of _SyncBroadcastStreamController and
_SyncStreamController is StreamController (according to the CFE) leading
to an implicit downcast from StreamController to _StreamControllerBase.
The analyzer and CFE sometimes disagree on the hierarchy depth
computation (see https://github.com/dart-lang/sdk/issues/38377)
which is probably the root cause of this.
Change-Id: I276bdc894d3926eae603b023b29462571c620c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133980
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
The List constructor has been disallowed in NNBD code, so the NNBD SDK
should not be using it.
This changes all uses, not just in the already migrated libraries.
(Also found some bad typing in the `RegExpMatch` class along the way).
Change-Id: Ic61bd64427c0961c23aaf7ce59af5c2c271890ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132282
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
For `foo() async* {}` frames we find the "caller" by finding out
what closure is registered as listener on the _AsyncStreamController.
There can be two cases:
a) The caller does a regular `foo().listen((_) {})`:
The stack trace will have the closure as the caller and unwinding stops.
b) The caller uses 'await for (... foo())':
In this case the listener will be a StreamIterator.
This CL changes our unwinding code to get the awaiter of `await it.moveNext()`.
Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I13f76025a15682aaf55fd968088fc2059982d842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132841
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The List.generate didn't fail on negative values, and could be simpler.
The isEmpty documentation was wrong, and fixed for non-NNBD in a separate CL.
Fixes#40229.
Bug: http://dartbug.com/40229
Change-Id: I2413d44d8be435f4124156cde3ba03d9b1835484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132643
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
The `is!` check is causing test failures when null flows through as `value`.
There is still no type promotion in place to make this work without the cast.
`null is! int*` is true while `null as int*` is a safe cast.
Fixes runtime failures in:
- language_2/async/identifier_test
- language_2/await/and_ifnull_test
- language_2/invalid_returns/async_invalid_return_00_test/none
- language_2/invalid_returns/async_invalid_return_01_test/none
- language_2/invalid_returns/async_invalid_return_02_test/none
- language_2/invalid_returns/async_invalid_return_03_test/none
- language_2/invalid_returns/async_invalid_return_04_test/none
- language_2/invalid_returns/async_valid_returns_test
- language_2/regress/regress26668_test
- lib/async/future_foreach_test
- lib/async/futures_test
- lib_2/async/future_foreach_test
Change-Id: I25d0dfb10d558ef7c167f99d1fba11f379cd8815
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131719
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Now that the LUB has been updated in the CFE we no longer need this workaround
to avoid errors.
Issue: #39534
Change-Id: I570efd0cb92755731572d1ddb4b1b9a018e85750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130582
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The information is expressed in the signature now, previously the return
type was implicitly `dynamic`.
Change-Id: Ib4a0106c94dc394e8126773442cd0886f81e0c79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130739
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
I believe this fixes `language_2/await/await_test`, but there might be other
tests affected.
Change-Id: I573beda1b40540691f58fb38bda56814b70a9343
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130730
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The front end is failing to consistently find the correct LUB for function types
with generic type arguments (especially with nullability).
We should revert this change after it is fixed.
https://github.com/dart-lang/sdk/issues/39534
Change-Id: Ie7f6856ccc269c6b287a1f96f264bdd53a2d1782
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126404
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is done by collecting all frames on the current stack until an async/async* frame is hit
which has yielded before (i.e. is not in sync-async case).
From there on it finds the closure of the async/async* frame and starts traversing the listeners:
while (closure != null) {
yield_index = closure.context[Context::kAsyncJumpVarIndex]
pc = closure.function.code.pc_descriptors.LookupPcFromYieldIndex(yield_index);
<emit pc in frame>
closure = closure.context[Context::kAsyncCompleterVarIndex]._future._resultOrListeners.callback;
}
Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: I97030d22e529bf8a74ecd30a8a2589cfe57ad330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122644
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: I5bcb7c40be12ee1dc887620281b4807469d67bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125729
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>