You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ensure that instrumentation works with functions that return coroutines. #10
useGeneratorasCoroutine;
functiona() : Coroutine
{
yield1;
}
/** * This function is annotated as coroutine, but is not actually a generator, * which is probably tripping up the stack trace generator. */functionb() : Coroutine
{
returna();
}
The problem is that the tracing code injections a yield statement, changing this non-generator to a generator. This may be a little involved to fix properly, as the instrumentor will need to travserse the AST to look for existing yield statements before outputting the start of the instrumentation code.
As a workaround, simply annotate the outer function's return value as Generator instead of Coroutine.
That is:
FYI @ezzatron