Avatar
swiftbot BOT 7/30/2018 7:24 AM
Author icon
koher
struct Foo { var a: Int var b: Int init() { a = 2 b = [2, 3, 5].reduce(0) { $0 + $1 + a } } }
Version:
swift-4.1.1-RELEASE
Output:
Error:
/usercode/main.swift:7:33: error: variable 'self.b' captured by a closure before being initialized b = [2, 3, 5].reduce(0) { $0 + $1 + a } ^