1
0
Fork 0
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:
Brian Fiete 2025-01-31 10:15:43 -08:00
parent 206023f4a6
commit 319755ca36
3 changed files with 96 additions and 22 deletions

View file

@ -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();
}
}
}
}