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

Allow (.) inferred type cast inside ref and * unary operations

This commit is contained in:
Brian Fiete 2024-12-02 13:53:36 -05:00
parent c555b8b7ef
commit 124d191bab
3 changed files with 34 additions and 6 deletions

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Numerics;
namespace Tests
{
@ -217,6 +218,16 @@ namespace Tests
return span[0];
}
public static float GetFirstFloat(float[3] fVals)
{
return fVals[0];
}
public static float GetFirstFloatRef(ref float[3] fVals)
{
return fVals[0];
}
[Test]
public static void TestBasics()
{
@ -290,6 +301,10 @@ namespace Tests
fList.Add(1.2f);
Test.Assert(ParamsTest(params fList) == 1.2f);
Test.Assert(ParamsTest2(params fList) == 1.2f);
float4 fVals = .(123, 234, 345, 456);
Test.Assert(GetFirstFloat(*(.)&fVals) == 123);
Test.Assert(GetFirstFloatRef(ref *(.)&fVals) == 123);
}
}
}