Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect compile error on inferred error set from async function #856

Closed
andrewrk opened this issue Mar 24, 2018 · 0 comments
Closed

incorrect compile error on inferred error set from async function #856

andrewrk opened this issue Mar 24, 2018 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@andrewrk
Copy link
Member

In creating a test case for #821 I ran into this:

const std = @import("std");

export fn entry() void {
    const p = nonFailing();
    resume p;
    cancel p;
}

fn nonFailing() promise {
    return (async<std.debug.global_allocator> failing()) catch unreachable;
}

async fn failing() !void {
    suspend;
    return error.Fail;
}

const builtin = @import("builtin");
pub fn panic(msg: []const u8, error_return_trace: ?&builtin.StackTrace) noreturn {
    while (true) {}
}

compile:

$ zig build-obj test.zig
/home/andy/dev/zig/build/test.zig:13:21: error: function with inferred error set must return at least one possible error
async fn failing() !void {
                    ^
@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Mar 24, 2018
@andrewrk andrewrk added this to the 0.3.0 milestone Mar 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant