Yes, it is permissible for the promisetype of a coroutine to not have returnvoid or returnvalue, as long as the coroutine body does not conclude abruptly. In this case, the compiler will assume that the coroutine returns void, and it will not generate any code for the return statement. However, it is recommended to always have either returnvoid or returnvalue in the promisetype, as it makes the intent of the coroutine more clear and avoids any confusion or unintended behavior.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-06-27 11:00:00 +0000
Seen: 12 times
Last updated: Feb 09 '23