2018-08-28 04:14:48 +08:00
|
|
|
const std = @import("std");
|
|
|
|
const builtin = @import("builtin");
|
|
|
|
const assert = std.debug.assert;
|
|
|
|
|
2018-10-15 21:51:15 +08:00
|
|
|
const S = struct.{
|
2018-08-28 04:14:48 +08:00
|
|
|
fn method() builtin.TypeInfo {
|
|
|
|
return @typeInfo(S);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
test "functions with return type required to be comptime are generic" {
|
|
|
|
const ti = S.method();
|
|
|
|
assert(builtin.TypeId(ti) == builtin.TypeId.Struct);
|
|
|
|
}
|