Avatar
swiftbot BOT 7/5/2018 8:52 AM
Author icon
koher
let a = [[2], [3 ,5]] var iterator = a.enumerated().makeIterator() if var (i, numbers) = iterator.next() { numbers.append(0) print("\(i): \(numbers)") }
Version:
swift-4.1.1-RELEASE
Output:
0: [2, 0]
Error:
/usercode/main.swift:4:9: warning: variable 'i' was never mutated; consider changing to 'let' constant if var (i, numbers) = iterator.next() { ^