comptime fn WeirdRange(from: i32, to: i32) type {
return struct {
const Self = @This();
x: i32,
pub fn init(data: i32) !Self {
if (data > from) && (data < to) {
return Self { .x = data };
} else { throw error.NotWithinRange }
}
}
}
fn yourFun(thing: WeirdRange(7, 9)) {}