[Issue 4] New: reverse allowed on string (gdc 4.6.3 !)

gdc-bugzilla at gdcproject.org gdc-bugzilla at gdcproject.org
Sun Aug 12 14:31:09 PDT 2012


http://gdcproject.org/bugzilla/show_bug.cgi?id=4

             Bug #: 4
           Summary: reverse allowed on string (gdc 4.6.3 !)
    Classification: Unclassified
           Product: GDC
           Version: development
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
        AssignedTo: ibuclaw at gdcproject.org
        ReportedBy: kwez555 at hotmail.com


(Note that I don't have access to 4.7.x or 4.8.x on Ubuntu, this might not
apply anymore ! sorry if it is the case)

gdc (Ubuntu/Linaro 4.6.3-1ubuntu1) 4.6.3
DMD32 D Compiler v2.059

GDC allows this:
(it will crash on execution)

void main() {
    string str = "allo";
    str.reverse;
    str.sort;
}

But dmd will catch the error at compile time:

dmd testStringReverse.d 
  testStringReverse.d(4): Error: can only reverse a mutable array
  testStringReverse.d(5): Error: can only sort a mutable array

-- 
Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all issue changes.


More information about the D.gnu mailing list