2014-04-14 14:23:05 +00:00
|
|
|
var a = new Fiber {
|
2014-01-13 14:58:27 +00:00
|
|
|
IO.print("run")
|
2014-04-03 00:31:58 +00:00
|
|
|
}
|
2014-01-13 14:58:27 +00:00
|
|
|
|
2014-04-14 14:23:05 +00:00
|
|
|
// Run a through an intermediate fiber since it will get discarded and we need
|
|
|
|
|
// to return to the main one after a completes.
|
|
|
|
|
var b = new Fiber {
|
|
|
|
|
a.run
|
|
|
|
|
IO.print("nope")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
b.call // expect: run
|
|
|
|
|
a.run // expect runtime error: Cannot run a finished fiber.
|