mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
26 lines
641 B
Zig
26 lines
641 B
Zig
fn List(comptime Head: type, comptime Tail: type) type {
|
|
return union {
|
|
const Self = @This();
|
|
head: Head,
|
|
tail: Tail,
|
|
|
|
fn AppendReturnType(comptime item: anytype) type {
|
|
return List(Head, List(@TypeOf(item), void));
|
|
}
|
|
};
|
|
}
|
|
|
|
fn makeList(item: anytype) List(@TypeOf(item), void) {
|
|
return List(@TypeOf(item), void){ .head = item };
|
|
}
|
|
|
|
pub export fn entry() void {
|
|
@TypeOf(makeList(42)).AppendReturnType(64);
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :18:43: error: value of type 'type' ignored
|
|
// :18:43: note: all non-void values must be used
|
|
// :18:43: note: to discard the value, assign it to '_'
|