- Second value in switch range not checked properly, causing an error on non-const values. #2777

This commit is contained in:
Christoffer Lerno
2026-01-20 17:12:41 +01:00
parent 3fe55b5e51
commit 9c435352b9
3 changed files with 14 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
fn void main()
{
for (int i = 0; ; )
{
switch (i)
{
case 4 .. i: // #error: Ranges must be constant integers or enum values, but this is not an integer
}
}
}