mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +00:00
14 lines
332 B
Zig
14 lines
332 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
const S = struct {
|
|
fn method() std.builtin.Type {
|
|
return @typeInfo(S);
|
|
}
|
|
};
|
|
|
|
test "functions with return type required to be comptime are generic" {
|
|
const ti = S.method();
|
|
try expect(@as(std.builtin.TypeId, ti) == std.builtin.TypeId.Struct);
|
|
}
|