www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13862] New: function is not callable using argument types ()

https://issues.dlang.org/show_bug.cgi?id=13862

          Issue ID: 13862
           Summary: function is not callable using argument types ()
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: ellery-newcomer utulsa.edu

the code:

template _dumb(I, string m, string op) {
    I _dumb(I amin, I amax, I bmin, I bmax) {
        return amin;
    }
}

template dumb(I, string m, string op) {
    alias dumb = _dumb!(I,m,op)._dumb;
}

void main(){
    dumb!(uint, "max", "|")(1,2,3,4);
}



the compile:

dmd bitall.d # dmd 2.066.1, 2.067 beta

the fireworks:

bitall.d(8): Error: _dumb (uint amin, uint amax, uint bmin, uint bmax) is not
callable using argument types ()
bitall.d(8): Error: _dumb (uint amin, uint amax, uint bmin, uint bmax) is not
callable using argument types ()
bitall.d(12): Error: template instance bitall.dumb!(uint, "max", "|") error
instantiating


the workaround:

replace the inner _dumb with a non-eponymous name.

--
Dec 14 2014