Skip to content

Instantly share code, notes, and snippets.

@zacharycarter
Created December 15, 2018 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zacharycarter/984542b8530c185d643da5bb9c031397 to your computer and use it in GitHub Desktop.
Save zacharycarter/984542b8530c185d643da5bb9c031397 to your computer and use it in GitHub Desktop.
zig_thread_error
const std = @import("std");
fn start1(ctx: void) u8 {
return 0;
}
pub fn main() u8 {
const thread1 = try std.os.spawnThread({}, start1);
}
// ➜ zeal git:(master) ✗ zig build-exe t_test.zig
// /Users/zachcarter/projects/zeal/t_test.zig:8:21: error: expected type 'u8', found 'SpawnThreadError'
// const thread1 = try std.os.spawnThread({}, start1);
// ^
// /Users/zachcarter/projects/zeal/t_test.zig:7:15: note: return type declared here
// pub fn main() u8 {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment