Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.