От: | catbert | ||
Дата: | 26.06.11 10:44 | ||
Оценка: |
public module Program
{
Main() : void
{
def x = First();
Console.WriteLine($"$x");
}
public class Base
{
}
public class First : Base
{
field : Second = Second(this);
}
public class Second
{
field : First;
internal this(first : First)
{
field = first;
}
}
}
``this'' or ``base'' usage before base is constructed
public module Program
{
Main() : void
{
def x = First();
Console.WriteLine($"$x");
}
public class Base
{
}
public class First : Base
{
field : Second = Second(() => this);
}
public class Second
{
field : First;
internal this(first : void -> First)
{
field = first();
}
}
}
Keyword 'this' is not available in the current context