[Bug 106] New: template - mixin sequence

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 14 09:47:49 PDT 2006


           Summary: template - mixin sequence
           Product: D
           Version: 0.150
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: benoit at tionex.de

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.

My project relies very strong on the mixin feature. :(
Please give this bug a high priority.


More information about the Digitalmars-d-bugs mailing list