stack-switching
stack-switching copied to clipboard
[explainer] Remove unnecessary constraint on switch
Although it is necessary for the target continuation's return type to match the return type expected at the handler and communicated via the tag, it is not necessary for the return continuation's return type to match the expected return type as well. If the same handler (and therefore tag) is to be used to return to the previous continuation, then that returning switch will only validate if the return result type matches, but in general the return switch could be done with a different handler with an arbitrary type.