From 7d48135e5817c9b586f87adc6ec772cf05f87b1f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 22 Apr 2022 13:28:59 -0700 Subject: [PATCH] libuv: fix self-dependent zig error --- src/libuv/handle.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libuv/handle.zig b/src/libuv/handle.zig index cc67bdebb..d44605ed4 100644 --- a/src/libuv/handle.zig +++ b/src/libuv/handle.zig @@ -9,10 +9,12 @@ const Loop = @import("Loop.zig"); pub fn Handle(comptime T: type) type { // 1. T should be a struct // 2. First field should be the handle pointer - const tInfo = @typeInfo(T).Struct; - const HandleType = tInfo.fields[0].field_type; return struct { + // note: this has to be here: https://github.com/ziglang/zig/issues/11367 + const tInfo = @typeInfo(T).Struct; + const HandleType = tInfo.fields[0].field_type; + // Request handle to be closed. close_cb will be called asynchronously // after this call. This MUST be called on each handle before memory // is released. Moreover, the memory can only be released in close_cb