1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-26 19:48:01 +02:00

Added nullable(T), Result<T> can use null conditionals

This commit is contained in:
Brian Fiete 2020-04-27 15:09:10 -07:00
parent 336226d686
commit 68bf7bc801
19 changed files with 343 additions and 210 deletions

View file

@ -59,6 +59,15 @@ namespace System
return default(T);
}
public static nullable(T) operator?(Self val)
{
switch (val)
{
case .Ok(let inner): return inner;
case .Err: return null;
}
}
[SkipCall]
public void Dispose()
{
@ -151,6 +160,15 @@ namespace System
return default(T);
}
public static nullable(T) operator?(Self val)
{
switch (val)
{
case .Ok(let inner): return inner;
case .Err: return null;
}
}
[SkipCall]
public void Dispose()
{