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:
parent
fa6bdc0d04
commit
5e9ac07804
3 changed files with 54 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue