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
Bug: Task.is_done() on Task parameters fails MIR/codegen lowering #569
Calling Task.is_done() on a Task[T] function parameter reaches MIR/codegen as an unhandled MirIntrinsic.GENERIC_CALL instead of lowering to the Task surface intrinsic. The same expression shape matters for §14.7 Task methods and for §14.22 task-disposition proofs.
Minimal reproduction
async fn work -> i32: 1
fn done(t: Task[i32]) -> bool:
t.is_done()
fn main:
let t = work()
assert(not done(t))
Run with the project compiler:
./out/release/bin/with -e 'async fn work -> i32: 1fn done(t: Task[i32]) -> bool: t.is_done()fn main: let t = work() assert(not done(t))'
Task.is_done() should lower for Task[T] parameters the same way it lowers for other Task values, or Sema should fail loudly earlier with a targeted diagnostic if some receiver form is unsupported. It must not reach a fatal generic-call backend path.
Notes
Found while implementing #355. The #355 tests avoid is_done() so the ephemeral-task escape fix stays scoped, but this bug should be fixed rather than worked around permanently.
Closing as fixed on HEAD (verified by probe): Task.is_done() on Task[T] parameters checks and runs, exit 0 (§14.7/§14.22). The FATAL GENERIC_CALL for sym=is_done is gone.
Activity
ehartford commentedon Jul 2, 2026
Closing as fixed on HEAD (verified by probe):
Task.is_done()on Task[T] parameters checks and runs, exit 0 (§14.7/§14.22). The FATAL GENERIC_CALL for sym=is_done is gone.