Closed McSinyx closed 7 months ago
Loops, like any other expressions, can also be used in type expressions:
fn foo(comptime T: type) for (.{u32, f32, bool}) |I| (if (I == T) break I) else void {
// IDK why you'd do something like this...
}
(if (I == T) break I)
Woah thanks, I missed that TypeExpr can just be an Expr in a trench coat of parentheses :sweat_smile:
In grammar.y, as part of PrimaryTypeExpr:
This confuses me, since it would match something like
while (true) u8
. What do I miss?