This commit is contained in:
agra
2026-03-02 21:00:55 +02:00
parent 2f4f898d54
commit bbb5426777
42 changed files with 483 additions and 9023 deletions

View File

@@ -1,25 +0,0 @@
// Issue: enum literal inference in match expression used as assignment RHS
// When a match expression is assigned to a field with a known enum type,
// the enum literals in case arms should infer their type from the assignment target.
Color :: enum {
red;
green;
blue;
none;
}
Thing :: struct {
color: Color;
}
main :: () {
t : Thing = ---;
value : u8 = 1;
t.color = if value == {
case 1: .red; // error: cannot infer enum type for literal
case 2: .green;
case 3: .blue;
else: .none;
};
}