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

Improved struct returns from mixins and block expressions

This commit is contained in:
Brian Fiete 2022-06-15 11:24:24 -07:00
parent 5268e103e9
commit e3ca70c153
3 changed files with 36 additions and 0 deletions

View file

@ -79,6 +79,11 @@ namespace Tests
ref a
}
static mixin Unwrap(var res)
{
res.Value
}
[Test]
public static void TestBasics()
{
@ -139,6 +144,11 @@ namespace Tests
var c = { ref b };
c = 99;
Test.Assert(b == 99);
Result<StringView> svRes = "ab ";
var sv2 = Unwrap!(svRes)..Trim();
Test.Assert(svRes.Value == "ab ");
Test.Assert(sv2 == "ab");
}
}