Thread overview
mixin forward reference error (array)
Apr 09, 2005
Ilya Zaitseff
Apr 11, 2005
Thomas Kuehne
Apr 11, 2005
Thomas Kühne
April 09, 2005
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.
April 11, 2005
-----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-----
April 11, 2005
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