mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Make case expression work with nullable Result<T>
This commit is contained in:
parent
206023f4a6
commit
319755ca36
3 changed files with 96 additions and 22 deletions
|
@ -114,6 +114,24 @@ namespace Tests
|
|||
|
||||
iNull ??= iNull2;
|
||||
Test.Assert(iNull == 123);
|
||||
|
||||
Result<int32> ir = .Ok(234);
|
||||
Result<int32>? irn = ir;
|
||||
|
||||
if (irn case .Ok(let val))
|
||||
{
|
||||
Test.Assert(val == 234);
|
||||
}
|
||||
else
|
||||
{
|
||||
Test.FatalError();
|
||||
}
|
||||
|
||||
irn = null;
|
||||
if (irn case .Ok(let val))
|
||||
{
|
||||
Test.FatalError();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue