Bug 7849 – Manifest constants don't resolve the polysemous literal type
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-07T03:57:00Z
Last change time
2015-02-18T03:36:54Z
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2012-04-07T03:57:34Z
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.
Comment #1 by timon.gehr — 2012-04-07T04:00:22Z
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
}
Comment #2 by lovelydear — 2012-04-21T11:05:30Z
Compiles with 2.059 Win32
Comment #3 by timon.gehr — 2012-04-21T11:41:51Z
(In reply to comment #2)
> Compiles with 2.059 Win32
It seems to have been fixed indeed.
Comment #4 by timon.gehr — 2012-04-21T11:45:53Z
Reopening because there probably should be a regression test.
Comment #5 by github-bugzilla — 2014-09-14T21:55:51Z
(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".
Comment #8 by github-bugzilla — 2015-02-18T03:36:54Z