http://d.puremagic.com/issues/show_bug.cgi?id=9948

           Summary: -deps dependency printing incorrect for templates
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: jfanati...@gmx.at


--- Comment #0 from jfanati...@gmx.at 2013-04-17 05:49:39 PDT ---
Currently the emitted dependencies are incorrect for templates:

Dependencies are emitted for the module that references the dependency, even if
this reference is within a template. This is incorrect, as only the code
instantiating the template really depends on the template dependencies, there
is no need to rebuild a module, if an import within a template changes.

Consider this simplified example, which makes the issue most clear:
```D
// module a
void templateFunc(string myImport)() {
   mixin(myImport);
// ....
}

// module b:
void main() {
   templateFunc("import std.string;")();
}
```
It seems a bit artificial, but in fact it is not (consider Diet templates for
example). In this example the dependencies for module "a" change, depending on
what code it uses.

The effect is not severe, it will just make build tools less efficient, because
modules need to be compiled needlessly, it should nevertheless be fixed.

I have a patch in the works already.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to