gpu: correct implementation initialization

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-07-31 00:11:31 -07:00 committed by Stephen Gutekanst
parent a468c51ad4
commit 2a39ff8f7e
2 changed files with 5 additions and 6 deletions

View file

@ -9,8 +9,8 @@ pub const Impl = blk: {
break :blk StubInterface;
} else {
const root = @import("root");
if (!@hasField(root, "GPUInterface")) @compileError("expected to find `pub const GPUInterface = T;` in root file");
_ = gpu.Interface(@TypeOf(root.GPUInterface)); // verify the type
if (!@hasDecl(root, "GPUInterface")) @compileError("expected to find `pub const GPUInterface = T;` in root file");
_ = gpu.Interface(root.GPUInterface); // verify the type
break :blk root.GPUInterface;
}
};