mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:32:49 +00:00
90652bc314
Makes the synthetic sync* iterator dynamic to allow the internal, synthetic sync* code to handle nested iterators of differing types. Bug: https://github.com/dart-lang/sdk/issues/42234 Change-Id: I309885b27555142cd7f8ab13a5637b35545f1d44 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160071 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Clement Skau <cskau@google.com>
21 lines
384 B
Dart
21 lines
384 B
Dart
// Copyright (c) 2020, the Dart Team. All rights reserved. Use of this
|
|
// source code is governed by a BSD-style license that can be found in
|
|
// the LICENSE file.
|
|
|
|
// Regression test for: https://github.com/dart-lang/sdk/issues/42234
|
|
|
|
Iterable<Object> f() sync* {
|
|
yield* g();
|
|
}
|
|
|
|
Iterable<int> g() sync* {
|
|
yield 1;
|
|
yield 2;
|
|
}
|
|
|
|
main() {
|
|
for (var i in f()) {
|
|
print(i);
|
|
}
|
|
}
|