about summary refs log tree commit diff
path: root/lang/zig/struct-name.zig
blob: 8c3affca5679b012100406440681eeb9e7d4309b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const print = @import("std").debug.print;

pub fn main() void {
    const Foo = struct {};
    print("variable: {}\n", .{@typeName(Foo)});
    print("anonymous: {}\n", .{@typeName(struct {})});
    print("function: {}\n", .{@typeName(List(i32))});
}

fn List(comptime T: type) type {
    return struct {
        x: T,
    };
}