I'm trying to reproduce (minimize) your exception but so far I'm hitting others (no success yet). I understand the value of local functions, too, but the current version of JVM backend has a number of bugs in local functions support that bite with coroutines, too. I know that it makes code less pretty to workaround those bugs, but there are workaround. So we may fix some of them for 1.1. release, but not all of them. We'll definitely fix all of them over time, though.