DMD 2.058/2.059head: void foo(string){} void foo(dstring){} enum str = "string"; immutable stri = "string"; enum str2 = stri; immutable stri2 = stri; enum str3 = stri2; void main(){ foo(str); // error foo(str2); // error foo(str3); // error } The code should compile, and the foo(string) overload should be called in all cases.
Without indirections via immutable static data, this even occurs if the type is given explicitly: void foo(string){} void foo(dstring){} enum string str = "string"; void main(){ foo(str); // error }
Compiles with 2.059 Win32
(In reply to comment #2) > Compiles with 2.059 Win32 It seems to have been fixed indeed.
Reopening because there probably should be a regression test.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/65fcdb45094b45a3563ac583e5eef509dafe43cc fix Issue 7849 - Manifest constants don't resolve the polysemous literal type
Adding a test case != FIXED.
(In reply to yebblies from comment #6) > Adding a test case != FIXED. I remember that I had fixed similar IFTI issue, but I cannot recall the exact issue number. So I added test case and we can surely say this issue i s"fixed".
Commit pushed to 2.067 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/65fcdb45094b45a3563ac583e5eef509dafe43cc fix Issue 7849 - Manifest constants don't resolve the polysemous literal type