There's a curiously misleading behavior when overloading on the same underlying types:

struct Test
{
void* ptr;
uint num;
}

alias const(Test) A;

void foo(A)
{
import std.stdio;
writeln("mutable");
}

void foo(const(A))
{
import std.stdio;
writeln("const");
}

unittest
{
foo(A());
}

DMD outputs the following error:
C:\Users\g.gyolchanyan\Desktop\test.d(67): Error: function test.foo called with argument types:
((const(Test)))
matches both:
C:\Users\g.gyolchanyan\Desktop\test.d(53): test.foo(const(Test) _param_0)
and:
C:\Users\g.gyolchanyan\Desktop\test.d(59): test.foo(const(Test) _param_0)

The error should be about redefinition of foo(), since A and const(A) are the exact same type.
Is this a bug or am I mistaken on the expected behavior?

--
Bye,
Gor Gyolchanyan.