www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 4] New: reverse allowed on string (gdc 4.6.3 !)

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 gdcproject.org
        ReportedBy: kwez555 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.
Aug 12 2012