Commit 61718742f7

Andrew Kelley <superjoe30@gmail.com>
2018-02-03 20:42:20
*WIP* error sets - std lib test compile but try to link against windows
1 parent ef5e7bb
Changed files (3)
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;
         }
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,
 
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();