Skip to content

add compile error for copying an async frame #3074

@andrewrk

Description

@andrewrk
export fn a() void {
    const f = async func();
    var f2 = f;
    resume f2;
}
fn func() void {
    suspend;
}

Expected output: error: cannot copy @Frame(func)

Actual output: builds successfully

This cannot work because local variables can, for example, be pointers to each other. Copying the frame would break this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions