> I think the problem really comes down to the inflexibility of it; if you
> specify X, Y, and Z as throwable types, then all code calling that method
> must handle those types in some way.
Imho this is no problem:
Right now, we basically have "throws Error", and no matter what is actually
thrown, we can always catch exhaustive by keeping the statement unspecific.
> func myMethod(args:[String:Any]) throws IOError, IllegalArgumentError?
> { … }
Imho to much confusion with no real benefit:
Shouldn't it be up to the caller to decide which errors need special treatment?
The library can't enforce proper handling at all.
One thing to note with explicit errors is that we'd basically introduce sum
types… I think this wouldn't be bad at all, but afaics, core strongly favours
enums (and I fear it's to late to really discuss pros and cons of both
approaches)_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution