www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 96] New: Unable to overload functions injected from mixins.

reply d-bugmail puremagic.com writes:

           Summary: Unable to overload functions injected from mixins.
           Product: D
           Version: 0.151
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: daiphoenix lycos.com

The following code doesn't compile:

template T1() {
        void func(int x) { }

template T2() {
        void func() { }

mixin T1!();
mixin T2!();

void main()
        func(); // A name conflict occurs here between the two func's.

Apr 08 2006
parent d-bugmail puremagic.com writes:

------- Comment #1 from daiphoenix lycos.com  2006-04-08 16:23 -------
Note: If by design one does not want mixins to enable function overloading,
then the doc should be clear on that. Specifically, on "If two different mixins
are put in the same scope, and each define a declaration with the same name,
there is an ambiguity error when the declaration is referenced:",
http://www.digitalmars.com/d/mixin.html .

Apr 08 2006