mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed wrappable props and fixed fixed generic binding in MemberRefExpr
This commit is contained in:
parent
4cd8fe7742
commit
b1181a936d
2 changed files with 80 additions and 1 deletions
|
@ -432,6 +432,29 @@ namespace Tests
|
|||
T sum = a + b;
|
||||
}
|
||||
|
||||
interface IIntVal
|
||||
{
|
||||
int IntVal { get; }
|
||||
}
|
||||
|
||||
struct StructC : IIntVal
|
||||
{
|
||||
int IIntVal.IntVal
|
||||
{
|
||||
get
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int GetIntVals<T>(T val) where T : IIntVal
|
||||
{
|
||||
int a = (val).[Friend]IntVal;
|
||||
int b = val.IntVal;
|
||||
return a + b;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestDefaults()
|
||||
{
|
||||
|
@ -473,6 +496,7 @@ namespace Tests
|
|||
Test.Assert(TestIFaceD2(cg) == 999);
|
||||
|
||||
ClassH ch = scope .();
|
||||
Test.Assert(GetIntVals(StructC()) == 246);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue