> On Dec 20, 2015, at 3:14 AM, Brent Royal-Gordon <[email protected]> 
> wrote:
> 
> Anyway, my point remains: this _SwiftNativeNSError should use a userInfo 
> property on your ErrorType to populate NSError.userInfo. There should be no 
> need to go through the full rigamarole of calling NSError's initializer 
> yourself—just return a dictionary at the appropriate moment.

Having a userInfo property by which I could return the dictionary would work 
fine, and I’d be perfectly happy with it. I’m not sure if the Swift team would 
be happy with such a solution, though, since it necessarily involves 
dynamically typed objects, whereas my proposal enforces the correct types for 
all of the individual objects within the userInfo dictionary; String for the 
failure reason, NSURL for the URL, [String] for the recovery options, etc.

Charles

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to