master
1fn List(comptime Head: type, comptime Tail: type) type {
2 return union {
3 const Self = @This();
4 head: Head,
5 tail: Tail,
6
7 fn AppendReturnType(comptime item: anytype) type {
8 return List(Head, List(@TypeOf(item), void));
9 }
10 };
11}
12
13fn makeList(item: anytype) List(@TypeOf(item), void) {
14 return List(@TypeOf(item), void){ .head = item };
15}
16
17pub export fn entry() void {
18 @TypeOf(makeList(42)).AppendReturnType(64);
19}
20
21// error
22//
23// :18:43: error: value of type 'type' ignored
24// :18:43: note: all non-void values must be used
25// :18:43: note: to discard the value, assign it to '_'