Skip to content

Commit

Permalink
add missing comptime
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuyadong committed Sep 20, 2024
1 parent 52c2194 commit e747a43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn assert(b: bool) void {

pub fn main() !void {
if (zoop.interfaceIndex(IAge, zoop.IObject) == comptime zoop.interfaceIndex(IHuman, zoop.IObject)) {
std.debug.print("", .{});
std.debug.print("aaaaabbbbbccccc", .{});
}
if (false) {
const s = try zoop.new(allocator, Sub, null);
Expand Down
6 changes: 3 additions & 3 deletions src/zoop.zig
Original file line number Diff line number Diff line change
Expand Up @@ -886,14 +886,14 @@ fn ClassInfoGetter(comptime T: type) type {
if (isKlassType(T)) {
return struct {
pub fn get(_: anytype) *const ClassInfo {
return makeClassInfo(T.Class);
return comptime makeClassInfo(T.Class);
}
};
}
if (isClassType(T)) {
return struct {
pub fn get(_: anytype) *const ClassInfo {
return makeClassInfo(T);
return comptime makeClassInfo(T);
}
};
}
Expand Down Expand Up @@ -992,7 +992,7 @@ fn classChecker(comptime T: type) *const ClassCheckFunc {

return (struct {
pub fn func(class_id: type_id) bool {
inline for (classes(T).items) |Class| {
inline for (comptime classes(T).items) |Class| {
if (class_id == comptime makeTypeId(Class)) return true;
}
return false;
Expand Down

0 comments on commit e747a43

Please sign in to comment.