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

Generic constructors

This commit is contained in:
Brian Fiete 2024-11-06 07:31:55 -05:00
parent 64d646e130
commit 04ea8a6634
13 changed files with 267 additions and 37 deletions

View file

@ -385,7 +385,22 @@ namespace Tests
public class InnerB
{
public T mVal;
public this<T3>(T3 val) where T : operator implicit T3
{
mVal = (.)val;
}
}
public struct InnerC
{
public T mVal;
public this<T3>(T3 val) where T : operator implicit T3
{
mVal = (.)val;
}
}
public static OuterA<int,float>.Inner<int16> sVal;
@ -491,6 +506,13 @@ namespace Tests
Test.Assert(specializedType.UnspecializedType == typeof(Dictionary<,>.Enumerator));
var t = typeof(Array2<>);
t = typeof(ClassH<,>.Inner<>);
var innerB = new OuterA<int, float>.InnerB.this<int32>(123);
Test.Assert(innerB.mVal == 123);
delete innerB;
var innerC = OuterA<int, float>.InnerC.this<int32>(123);
Test.Assert(innerC.mVal == 123);
}
}