zig/test/cases/bugs/1421.zig
Jimmi Holst Christensen 8139c5a516
New Zig formal grammar (#1685)
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-11-13 05:08:37 -08:00

15 lines
349 B
Zig

const std = @import("std");
const builtin = @import("builtin");
const assert = std.debug.assert;
const S = struct {
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);
}