blob 55b82d5f (336B) - Raw
1 const std = @import("std"); 2 const expect = std.testing.expect; 3 4 const S = struct { 5 fn method() std.builtin.TypeInfo { 6 return @typeInfo(S); 7 } 8 }; 9 10 test "functions with return type required to be comptime are generic" { 11 const ti = S.method(); 12 try expect(@as(std.builtin.TypeId, ti) == std.builtin.TypeId.Struct); 13 }