All I need to do is start a new project in Swift and add to main.swift
struct Foo {
let bar: (inout baz: String) -> ()
}
When I try to build I get an error:Command failed due to signal: Segmentation fault: 11
Am I doing anything wrong?
I thought that perhaps inout
parameters in closures are not supported, but if I define a closure like so:
let baz: (inout baz: String) -> () = { baz in
baz += "x"
return
}
or even
var baz: (inout baz: String) -> ()?
it compiles and runs OK
Just tested it in Swift 1.2 shipped with Xcode 6.3 beta, and it compiled successfully. So it was definitely a bug on the compiler that they solved in the last release
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With