正常reduce
通话:
[1,2,3].reduce(0, { cur, val in
return val
})
尝试从reduce
调用EnumeratedSequence<Array<Element>>
:
[1,2,3].enumerated().reduce(0, { cur, (index, element) in
return element
})
// Error: consecutive statements on a line must be separated by ';'" (at initial reduce closure)