Closed
Description
I would expect this to work, but it doesn't.
const T1 = struct {
pub fn v() error{}!usize {
return usize(0);
}
};
const T2 = struct {
pub fn v() error{Error}!usize {
return usize(1);
}
};
test "" {
const ts = []type{
T1,
T2,
};
inline for (ts) |T|
_ = try T.v();
}
test.zig:19:13: error: control flow attempts to use compile-time variable at runtime
_ = try T.v();
^
test.zig:18:12: note: compile-time variable assigned here
inline for (ts) |T|