mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-17 23:56:05 +02:00
Fixed 'base' lookup for properties
This commit is contained in:
parent
473246fa51
commit
f9bed24c00
4 changed files with 30 additions and 12 deletions
|
@ -47,6 +47,8 @@ namespace Tests
|
|||
class ClassB
|
||||
{
|
||||
public StructA B { get; set; }
|
||||
public int IVal { get => 1; }
|
||||
public virtual int IVal2 { get => 2; }
|
||||
|
||||
int mZ = 9;
|
||||
|
||||
|
@ -55,6 +57,12 @@ namespace Tests
|
|||
}
|
||||
}
|
||||
|
||||
class ClassC : ClassB
|
||||
{
|
||||
public new int IVal { get => base.IVal + 100; }
|
||||
public override int IVal2 { get => base.IVal2 + 100; }
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
|
@ -71,6 +79,13 @@ namespace Tests
|
|||
cb.B = .(333);
|
||||
sa = cb.B;
|
||||
Test.Assert(sa.mA == 333);
|
||||
|
||||
ClassC cc = scope .();
|
||||
Test.Assert(cc.IVal == 101);
|
||||
Test.Assert(cc.IVal2 == 102);
|
||||
ClassB cb2 = cc;
|
||||
Test.Assert(cb2.IVal == 1);
|
||||
Test.Assert(cb2.IVal2 == 102);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue