D can not override template and nontemplate function:

void foo(bool param)
{
        if(param)
        {
                //do something useful
        }
        else
        {
                //do something else
        }
}

void foo(bool param)()
{
        static if(param)
        {
                //do something useful
        }
        else
        {
                //do something else
        }
}

void main()
{
}

dmd output:
src/main.d(13): Error: template main.foo(bool param)() conflicts with function main.foo at src/main.d(1)

Does exist any reason to deny this, or it's just compiler bug?
I think that compiler can always understand what I want:

//nontemplate function call
foo(true);
//template function call
foo!true();

Reply via email to