From 61718742f7f20cde1469d4db811cd6dd6c3f8266 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 3 Feb 2018 14:42:20 -0500 Subject: [PATCH] *WIP* error sets - std lib test compile but try to link against windows --- src/ir.cpp | 6 +++--- std/os/child_process.zig | 2 +- std/os/index.zig | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ir.cpp b/src/ir.cpp index 06b46646e..56ead2b90 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -6577,11 +6577,11 @@ static ConstCastOnly types_match_const_cast_only(IrAnalyze *ira, TypeTableEntry TypeTableEntry *contained_set = actual_type; TypeTableEntry *container_set = expected_type; - if (!resolve_inferred_error_set(ira, container_set, source_node)) { - result.id = ConstCastResultIdUnresolvedInferredErrSet; + // if the container set is inferred, then this will always work. + if (container_set->data.error_set.infer_fn != nullptr) { return result; } - + // if the container set is the global one, it will always work. if (type_is_global_error_set(container_set)) { return result; } diff --git a/std/os/child_process.zig b/std/os/child_process.zig index 48f638e32..360a1bfb9 100644 --- a/std/os/child_process.zig +++ b/std/os/child_process.zig @@ -28,7 +28,7 @@ pub const ChildProcess = struct { pub stdout: ?io.File, pub stderr: ?io.File, - pub term: ?SpawnError!Term, + pub term: ?(SpawnError!Term), pub argv: []const []const u8, diff --git a/std/os/index.zig b/std/os/index.zig index e57968dca..33707676b 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -1515,7 +1515,7 @@ const unexpected_error_tracing = false; /// Call this when you made a syscall or something that sets errno /// and you get an unexpected error. -pub fn unexpectedErrorPosix(errno: usize) error { +pub fn unexpectedErrorPosix(errno: usize) (error{Unexpected}) { if (unexpected_error_tracing) { debug.warn("unexpected errno: {}\n", errno); debug.dumpStackTrace(); @@ -1525,7 +1525,7 @@ pub fn unexpectedErrorPosix(errno: usize) error { /// Call this when you made a windows DLL call or something that does SetLastError /// and you get an unexpected error. -pub fn unexpectedErrorWindows(err: windows.DWORD) error { +pub fn unexpectedErrorWindows(err: windows.DWORD) (error{Unexpected}) { if (unexpected_error_tracing) { debug.warn("unexpected GetLastError(): {}\n", err); debug.dumpStackTrace();