zig/test/cases/bugs/1421.zig
Andrew Kelley 526d8425ab
fix false negative determining if function is generic
This solves the smaller test case of #1421 but the
other test case is still an assertion failure.
2018-08-27 16:14:48 -04: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);
}