mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-16 15:24:10 +02:00
Fixes for type initializer blocks
This commit is contained in:
parent
9cd47a784b
commit
34dcd47dd5
6 changed files with 98 additions and 11 deletions
|
@ -1,9 +1,23 @@
|
|||
using System;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
class Objects
|
||||
{
|
||||
class ClassA
|
||||
{
|
||||
public int mA = 1;
|
||||
|
||||
this
|
||||
{
|
||||
mA *= 11;
|
||||
}
|
||||
|
||||
public this()
|
||||
{
|
||||
mA += 100;
|
||||
}
|
||||
|
||||
public virtual void MethodA()
|
||||
{
|
||||
|
||||
|
@ -17,5 +31,12 @@ namespace Tests
|
|||
base.MethodA();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
ClassA ca = scope .();
|
||||
Test.Assert(ca.mA == 111);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue