Re: [swift-users] Closure typing changed in Swift 3

2016-09-12 Thread Greg Parker via swift-users
> On Sep 9, 2016, at 8:05 PM, Rick Mann via swift-users > wrote: > > I figured it out. The real problem is that .json accepts AnyObject, and the > Dictionary is not AnyObject (not sure what this change is, since it worked in > Swift 2). Anyway, that confused the type

Re: [swift-users] Closure typing changed in Swift 3

2016-09-09 Thread Rick Mann via swift-users
I figured it out. The real problem is that .json accepts AnyObject, and the Dictionary is not AnyObject (not sure what this change is, since it worked in Swift 2). Anyway, that confused the type inference, which resulted in the red herring error message about the closure assignment. > On Sep

[swift-users] Closure typing changed in Swift 3

2016-09-09 Thread Rick Mann via swift-users
I have some code that implements an HTTP server. You use it like this: server["/some/path"] = { inReq in return .ok(.json(["key" : "value"])) } ".ok" is a case in the HttpResponse enum. The subscript on "server" above looks like this: class HttpServer { typealias Handler =