The following code is causing a compiler crash when compiled with Swift 3 and Xcode 8...
The problem:
The following code is causing a compiler crash when compiled with Swift 3 and Xcode 8:
import Foundation
public typealias IntCompletion = (Int) -> Void
public typealias FetchIntBlock = (IntCompletion) -> Void
class ATSwiftTest<T: NSURL>: NSObject {
var fetchIntBlock: FetchIntBlock
override init() {
fetchIntBlock = { (aFunc) in }
super.init()
}
}By the process of elimination we were able to figure out that the problem is caused by the nested function declaration.
var fetchIntBlock: FetchIntBlock
The code crashes a Playground compiler as well.
Solution:
If we make the fetchIntBlock var private the code compiles just fine.
It would still be nice for the var to be public.
Welcome to The infinite monkey theorem
Somewhere a monkey just typed Shakespeare in TypeScript. Be the first to read the masterpieces (and the hilarious misfires) landing on the blog.

