www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7825] New: Hijacking of functions by non-function templates.

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

           Summary: Hijacking of functions by non-function templates.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



// traits.d:
module plot2kill.traits;

template defaultInit(T) {
    enum defaultInit = 1;
}

// subplot.d:
import plot2kill.traits;
import plot2kill.gtkwrapper;

class Subplot : FigureBase {
    override void toWidget() {
        defaultInit();
    }
}

// gtkwrapper.d:
module plot2kill.gtkwrapper;

void defaultInit() {}

abstract class FigureBase {
    void toWidget() {}
}

$ dmd traits.d gtkwrapper.d subplot.d
traits.d(3): Error: template plot2kill.traits.defaultInit(T) is not a function
template

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