Bug 13802 – Improve pretty-print result for the const(string) type
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-01T14:39:00Z
Last change time
2015-02-18T03:40:33Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2014-12-01T14:39:00Z
Compiler knows the name 'string' as an alias of immutable(char)[] type.
string s;
char[] a = s;
--------
Error: cannot implicitly convert expression (s) of type string to char[]
But, if the 'string' type is qualified, the diagnostic message will be difficult to read.
const(string) cs;
char[] a = cs;
--------
Error: cannot implicitly convert expression (cs) of type const(immutable(char)[]) to char[]
I think it should be improved to:
Error: cannot implicitly convert expression (cs) of type const(string) to char[]
Comment #1 by bearophile_hugs — 2014-12-01T14:42:12Z
The errors with dstring/wstring are not common, but the error messages where I read things like "const(immutable(char)[])" are quite common. So this will be a nice improvement of errors readability.