http://d.puremagic.com/issues/show_bug.cgi?id=11158
Summary: __MODULE__ as default template parameter doesn't use
the instantiating module
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Martin Nowak <[email protected]> 2013-10-02 11:09:36 PDT ---
cat > buga.d << CODE
struct Uniq(string name, string mod=__MODULE__)
{
pragma(msg, name, mod);
string toString() { return mod~"."~name; }
}
CODE
cat > bug.d << CODE
import buga;
alias UniqFoo = Uniq!("foo");
CODE
dmd -c bug;
----
As with __FILE__ or __LINE__ they should be used from the instantiating module.
This allows to generically implement somewhat unique types and is useful for
printing additional information.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------