Users:
I’m updating more code to beta 6 and have noticed a strange difference
when calling functions with closure parameters where that closure is declared
with a typealias. Take this class:
typealias Closure = () -> Void
class Thing {
var array: [String] = []
func doClosure(closure: Closure) {
array.append("closure")
}
func doManualClosure(manualClosure: () -> Void) {
array.append("manualClosure")
}
func append() {
doClosure {
doClosure {
}
}
}
func appendManual() {
doManualClosure {
doManualClosure {
}
}
}
}
There’s an error triggered by the doClosure call inside a doClosure call saying
that I need an explicit self capture. However, the same pattern in
appendManual() builds just fine. I’m guessing this is a bug?
Jon
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users