[Bug 106] New: template - mixin sequence

Thomas Kuehne thomas-dloop at kuehne.cn
Mon Apr 17 23:32:37 PDT 2006


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

d-bugmail at puremagic.com schrieb am 2006-04-14:
> for a mixin it is important where the template is declared.
>
> mixin T!(int);
> template T(t){
>  t a;
> }
>
> does not work. Error: mixin forward reference to template.
>
> In one module this is no problem. I can modify the sequence.
> The problem comes, if the template and the mixin are in different modules.
>
> I added "import A" to my file "B", and _suddenly_ the compile fails in module
> "C" with the "forward refer..." message.
> In module "C" i also have an "import A" and there I use mixins with
> templates out of A.
>
> I changed the source file order in the dmd command line and it compiles. So it
> seems to me, it is the sequence of template declaration and mixin which depends
> on the order of the source files.
>
> Solution should be to drop the dependency to the sequence template declaration
> and mixin.

Added to DStress as
http://dstress.kuehne.cn/compile/f/forward_reference_13_E.d

Thomas


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

iD8DBQFERJGB3w+/yD4P9tIRAvQLAKCZlMeVCuB2WGV975S0pfioob051ACfTKWi
3gBu7yGjWtVeFKhflqz73GQ=
=LV2Z
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list