Bug again?

2013-10-03 Thread Zhouxuan

mixin template test()
{
int next;
}

void foo(alias l, alias t)()
{
t.next = l.next;
}

void main()
{
struct A
{
int next;
}

A a;

mixin test l1;
mixin test l2;

foo!(l1,a); //ok!
foo!(l1,l2);//compilation error!
}



Re: Bug again?

2013-10-03 Thread simendsjo

On Thursday, 3 October 2013 at 12:24:38 UTC, Zhouxuan wrote:

mixin template test()
{
int next;
}

void foo(alias l, alias t)()
{
t.next = l.next;
}

void main()
{
struct A
{
int next;
}

A a;

mixin test l1;
mixin test l2;

foo!(l1,a); //ok!
foo!(l1,l2);//compilation error!
}


Local aliasing problems..?

The error message is
  Error: function D main is a nested function and cannot be 
accessed from t.foo!(l1, l2).foo


Moving the mixins out of main works.