#What's the correct `*Writer*` to use for the comptime zon serialisation?
1 messages · Page 1 of 1 (latest)
it looks like there's a intFromPtr limitation stopping this if i read this issue correctly: https://github.com/ziglang/zig/issues/23072
In future, it's intended for this to work, by making @ptrToInt return a "lazy" value at comptime which can be replaced with a relocation later. I don't think there's currently an issue to track that feature, so this issue could become that: maybe rename it to cannot evaluate @ptrToInt at comptime? https://github.com/ziglang/zig/issues/15080
i was trying to do```rust
const sig = @typeInfo(@TypeOf(kmain)).@"fn";
const fmt = "{any} -> {any}";
const args = .{sig.param_types, sig.return_type};
var space: [std.fmt.count(fmt, args)]u8 = undefined;
break :serialize std.fmt.bufPrint(&space, fmt, args) catch unreachable;