1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fallthrough fixes for destructuring and allHadReturns

This commit is contained in:
Brian Fiete 2021-06-19 09:29:36 -07:00
parent fa6bdc0d04
commit 5e9ac07804
3 changed files with 54 additions and 1 deletions

View file

@ -21,5 +21,29 @@ namespace IDETest
int a = val1; //FAIL
}
}
int Switch1(Result<int> res)
{
switch (res)
{
case .Ok(let a):
fallthrough;
case .Err(let b): //FAIL
return 1;
}
}
int Switch2(Result<int> res)
{
switch (res)
{
case .Ok(let a):
if (a > 0)
return 2;
fallthrough;
case .Err:
return 1;
}
} //FAIL
}
}