#@import struct from zon
1 messages · Page 1 of 1 (latest)
What does your zon look like?
.{
...
.default_target = .{ .os_tag = .linux, .abi = .gnu, .cpu_arch = .x86_64, .android_api_level = 21 },
...
}
and how are you importing it?
const build_zig_zon = @import("build.zig.zon");
I think you should specify the type to coerce to const zon: T = ...
Is there no way to do that automatically? That's really inconenient
it would be equivalent to writing:
const zon = .{
...
.default_target = .{ .os_tag = .linux, .abi = .gnu, .cpu_arch = .x86_64, .android_api_level = 21 },
...
}
so not really
yeah ig that makes sense
Is there no way to turn one struct type to another?
When the fields are the same
it does that automatically
but only when its RLS
this would coerce because it has the result location
const x: T = .{};
this doesn't
const x = .{};
const y: T = x;
Okay
Well that inconvenient
Thank you
you can just specify your own custom type of course
?
const zon: struct {default_target: std.Target.Query} = ...;
i think the fields match
Oh yeah okay