I came across this error recently and figured I am not the only one who was wondering about this. // Error [1, 2, 3, 4].forEach(foo.add) // Works [1, 2, 3, 4].forEach { foo.add($0) } Explanation In the error-case Swift tries to mutate `foo` directly by reassigning a copy of it with…