When I tried to migrate to Swift 4 an error occurred with my generic typealias for closures if you give it Void as an input. This worked fine in Swift 3 but not so much now, anybody know why, and is this a bug or a feature?
There is a workaround by defying another closure that explicit handles this case. But would be nice to not have to use this workaround and to understand why this error arose in Swift 4.
typealias Handler<T> = (T) -> Void
func foo(completion: Handler<String>) {
completion("fooing")
}
// This worked in Swift 3, but not in Swift 4
func bar(completion: Handler<Void>) {
completion() // Missing argument for parameter #1 in call
}