https://d.puremagic.com/issues/show_bug.cgi?id=11837



--- Comment #9 from yebblies <[email protected]> 2013-12-30 18:37:33 EST ---
(In reply to comment #8)
> There's code in dmd to specifically disallow this. I believe the reason is
> because of function and template overloading.

Do you know what the actual problem is/was?  The code in dmd that disallows
this is ancient, and may well address a problem that no longer exists.

Can you remember why you disabled it in the first place?  Did you document this
anywhere?

As for overloading, this code works as expected as the conversion to
const(char)* is preferred.

import core.stdc.stdio;

void call(const(char)* str) { printf("const(char)*\n"); }
void call(const(void)* str) { printf("const(void)*\n"); }

void call(const(int)[] arr) { printf("const(int)[]\n"); }
void call(const(void)[] arr) { printf("const(void)[]\n"); }

void main()
{
    call("abc"); // prints const(char)*
    call([1, 2, 3]); // prints const(int)[]
}

> I'm not content with this change
> simply passing the existing test suite. It's a more subtle, substantive change
> than that.

What _would_ you be content with?  Unless someone can come up with an actual
problem, putting this on hold is simply a waste of time.  If this does turn out
to cause a regression, it can trivially be rolled back.

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

Reply via email to