Avatar
swiftbot BOT 7/30/2018 7:16 AM
Author icon
t.ae
struct Foo { var foo: Int var bar: Int var buz: Int init(foo: Int, buz: Int) { self.foo = foo self.bar = foo*3 guard foo < bar && bar > 0 else { fatalError() } self.buz = buz } }
Version:
swift-4.1.1-RELEASE
Output:
Error:
/usercode/main.swift:10:28: error: variable 'self.buz' captured by a closure before being initialized guard foo < bar && bar > 0 else { ^