www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13802] New: Improve pretty-print result for the const(string)

https://issues.dlang.org/show_bug.cgi?id=13802

          Issue ID: 13802
           Summary: Improve pretty-print result for the const(string) type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

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[]

--
Dec 01 2014