Typed throws

Back to Array.map I guess we need to find a way to update the Standard Library without a lot of friction for the users.

And for that, we need to solve the throw issue.

I guess the cleanest non source compat solution would be, if we could update source in Swift 6 from throw FooError() to throw FooError() as Error for all throw that happen directly in a do block or in closure that has it's type inferred.

With that we would solve the throw type inference issue as close as possible to its source.

Assuming the standard library functions are not converting the parameter errors to other errors, we could update them to the generic error type versions (speaking about, map etc.)

With that source change, we could even use general catch handlers with specific inferred errors. :flushed::heart_eyes: