[Issue 10833] DMD puts mixin's source code in the binary

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 19 05:01:23 PDT 2013


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |enhancement


--- Comment #3 from Don <clugdbug at yahoo.com.au> 2013-08-19 05:01:21 PDT ---
The mixin source isn't put into the binary. What you're seeing is the
executable code of the template that you instantiated. It's exactly as if you
wrote:

string foo() {
    return `void main() { writefln("hello world"); }`;
}

There's a possible optimisation: templates instantiated only in a compile-time
context don't need to be put into the binary. Unfortunately the linker isn't
smart enough to detect they are never used. This should be fixable, but it's
not actually a bug.

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


More information about the Digitalmars-d-bugs mailing list