blob: 2b4df81206636b988c492029a61afcfa6456c167 [file] [log] [blame]
// Copyright (c) 2019, 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.
f() {
var ints = [1, 2, 3];
print(['a']..addAll(ints.map((i) => i.toString()))..addAll(['c'])); // LINT
}
var l = ['a']..addAll(['b']); // LINT
var l1 = [];
var l2 = l1..addAll(['b']); //OK
var things;
var l3 = ['a']..addAll(things ?? const []); // LINT
var l4 = ['a']..addAll(things ?? []); //LINT
// Control flow.
bool condition;
var l5 = ['a']..addAll(condition ? things : const []); // LINT
var l6 = ['a']..addAll(condition ? things : []); // LINT
class A {
void addAll(Iterable iterable) { }
}
g() {
new A()..addAll(['a']); // OK
}