| ▲ | hocuspocus 18 hours ago | |
The problem is that that the Swift function signature is telling you that someone else needs dealing with async suspension and exception handling, clearly not the same semantics. | ||
| ▲ | tarentel 18 hours ago | parent | next [-] | |
In a sense it is telling someone else that yes, but more importantly, it is telling the compiler. I am not sure what the alternative is here, is this not common in other languages? I know Java does this at least. In Python it is hidden and you have to know to catch the exception. I'm not sure how that is better as it can be easily forgotten or ignored. There may be another alternative I'm not aware of? | ||
| ▲ | vips7L 11 hours ago | parent | prev [-] | |
Isn’t the Go version also forcing the callers to deal with the errors by returning them? The swift version just lets the compiler do it rather than manually returning them. | ||