zig/test/behavior/bugs/1421.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

14 lines
332 B
Zig

const std = @import("std");
const expect = std.testing.expect;
const S = struct {
fn method() std.builtin.TypeInfo {
return @typeInfo(S);
}
};
test "functions with return type required to be comptime are generic" {
const ti = S.method();
expect(@as(std.builtin.TypeId, ti) == std.builtin.TypeId.Struct);
}