www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - mixin forward reference error (array)

reply "Ilya Zaitseff" <sark7 mail333.com> writes:
template Foo(alias x)
{
}

struct Bar
{
   mixin Foo!(x);
   int[] x;
}

void main()
{
}

DMD 0.120.2 output:

mixinfr.d(7): mixin mixinfr.Bar.Foo!(x) forward reference of x

If make 'x' type just 'int' or move 'x' declaration before mixin, error  
disappears.
Apr 09 2005
next sibling parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ilya Zaitseff schrieb am Sun, 10 Apr 2005 00:56:13 +1100:
 template Foo(alias x)
 {
 }

 struct Bar
 {
    mixin Foo!(x);
    int[] x;
 }

 void main()
 {
 }

 DMD 0.120.2 output:

 mixinfr.d(7): mixin mixinfr.Bar.Foo!(x) forward reference of x
Known problem: http://dstress.kuehne.cn/run/mixin_07.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCWfTh3w+/yD4P9tIRAtArAJ4vkTs7ZLYyoWbnOsgBn6TRQs19RQCgqsbx IljwYyyUlEogOLq+bkM3jPU= =QLpG -----END PGP SIGNATURE-----
Apr 10 2005
prev sibling parent =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ilya Zaitseff wrote:
| template Foo(alias x)
| {
| }
|
| struct Bar
| {
|   mixin Foo!(x);
|   int[] x;
| }
|
| void main()
| {
| }
|
| DMD 0.120.2 output:
|
| mixinfr.d(7): mixin mixinfr.Bar.Foo!(x) forward reference of x
|
| If make 'x' type just 'int' or move 'x' declaration before mixin,
| error disappears.

Known (http://dstress.kuehne.cn/run/mixin_07.d)

Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCWQNA3w+/yD4P9tIRAq5cAJ455A4oei9JcpVLEyaClHckIJeKRQCgtgRI
hBynIDe63jBPwGfRKxZnRY8=
=o2zL
-----END PGP SIGNATURE-----
Apr 10 2005