[Issue 9565] New: Index of static array should not print literal suffix

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 21 20:56:53 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9565

           Summary: Index of static array should not print literal suffix
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-02-21 20:56:52 PST ---
Index type of static array is always size_t, so suffix is not only just
redundant, but also is harmful for platform independent diagnostic message.

  alias T = int[10];
  pragma(msg, T);
  // should print `int[10]` rather than `int[10u]` or `int[10LU]`.

Similar problem exists in IndexExp and SliceExp

  int[] arr;
  pragma(msg, (arr[0]).stringof);        // arr[cast(uint)0]
  pragma(msg, (arr[0..1]).stringof);     // arr[cast(uint)0..cast(uint)1]
  // should print arr[0] and arr[0..1]

But, it would need to keep "cast(...)" output for some cases

  pragma(msg, (arr[int.min]).stringof);  // arr[cast(uint)-2147483648]

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


More information about the Digitalmars-d-bugs mailing list