1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-22 09:38:01 +02:00

Allow mixins and expression blocks to end in a ref expression

This commit is contained in:
Brian Fiete 2022-06-15 06:45:53 -07:00
parent 3cc0ba2ed6
commit 5268e103e9
6 changed files with 60 additions and 18 deletions

View file

@ -73,6 +73,12 @@ namespace Tests
total + 100
}
static mixin GetRef(var a)
{
a += 1000;
ref a
}
[Test]
public static void TestBasics()
{
@ -125,6 +131,14 @@ namespace Tests
AppendAndNullify!(str0);
Test.Assert(str0 == null);
Test.Assert(str1 == "AB");
int b = 12;
GetRef!(b) += 200;
Test.Assert(b == 1212);
var c = { ref b };
c = 99;
Test.Assert(b == 99);
}
}