mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
367761987b
Since we only add elements if the iterator is non-empty, we shouldn't get a ConcurrentModificationError if both the iterator and receiver are the same empty EfficientLengthIterator. Fixes https://github.com/dart-lang/sdk/issues/42011 TEST=New regression test added that fails without the sdk change. Fixed: 42011 Change-Id: Ib5259c8f043cc8277d2fea407d1f64a24430c4d3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173901 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com>
10 lines
403 B
Dart
10 lines
403 B
Dart
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. 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/42011
|
|
main() {
|
|
var a = [];
|
|
// No elements are added, so should not get a ConcurrentModificationError.
|
|
a.addAll(a);
|
|
}
|