Code inspection: Collection can be moved to a spread element
This inspection reports a collection passed as an argument to with(...) in a collection expression. You can replace this argument with a spread element in the same collection expression, which shows the source collection directly in the list of elements.
Example
List<int> result = [with(other), 4, 5];
List<int> result = [.. other, 4, 5];
27 October 2026