The following code will reproduce the issue:
fn test() {
let blub = @|cont: fn()->()| {};
while (true) {
blub(continue)
}
}
Compiling the above code results in:
terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
I assume this may be caused by the incorrect return type in the function type of the parameter the continuation is passed to.
One workaround seems to be wrapping the continuation in a lambda:
fn test() {
let blub = @|cont: fn()->()| {};
while (true) {
blub(@||continue())
}
}
The following code will reproduce the issue:
Compiling the above code results in:
I assume this may be caused by the incorrect return type in the function type of the parameter the continuation is passed to.
One workaround seems to be wrapping the continuation in a lambda: