zig/test/behavior/bugs/1421.zig
Jonathan Marler d805adddd6 deprecated TypeInfo in favor of Type
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-03-08 20:38:12 +02:00

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);
}