[Issue 276] New: Compiler erroneously thinks an aggregate inner template will add a field to it

Thomas Kuehne thomas-dloop at kuehne.cn
Mon Aug 14 04:45:21 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail at puremagic.com schrieb am 2006-08-02:
> http://d.puremagic.com/issues/show_bug.cgi?id=276

> Compiler erroneously thinks an aggregate inner template will add a field to it:
>
> ---
> import BUGMultiDisFunction;
>
> struct st {
>         template t1() {
>                 template t2(int n2) { }
>         }
>
> }
>
> alias st.t1!().t2 a;
> ---
> Error:
> " variable main.st.t1!().n2 cannot use template to add field to aggregate 'st'
> "
>
> This only happens because of the "int n2" parameter. If the parameter is a
> type, alias, or non-existent, there will be no compiler error.

http://dstress.kuehne.cn/compile/t/template_41_A.d
http://dstress.kuehne.cn/compile/t/template_41_B.d
http://dstress.kuehne.cn/compile/t/template_41_C.d
http://dstress.kuehne.cn/compile/t/template_41_D.d
http://dstress.kuehne.cn/compile/t/template_41_E.d
http://dstress.kuehne.cn/compile/t/template_41_F.d
http://dstress.kuehne.cn/compile/t/template_41_G.d
http://dstress.kuehne.cn/compile/t/template_41_H.d

Thomas

-----BEGIN PGP SIGNATURE-----

iD8DBQFE4FS/LK5blCcjpWoRAm/jAJ4qBt6D29AekJwhg27ykgbcKUaP9ACfS1W1
2DkM7qkwh1PWM2cCPAvD/A0=
=siLP
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list