[Issue 2792] New: Enum manifest constants and string produces errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 3 11:47:59 PDT 2009


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

           Summary: Enum manifest constants and string produces errors
           Product: D
           Version: 2.026
          Platform: PC
               URL: http://www.digitalmars.com/webnews/newsgroups.php?art_gr
                    oup=digitalmars.D&article_id=87067
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: gide at nwawudu.com


Using const, static const, auto, immutable instead of enum makes it work.
Might be related to BUG 1884.

import std.stdio;

void main()
{
        enum members = ["foo", "bar"];
        for (uint i=0; i<members.length; i++) {
                writefln(members[i]);
        }
}

C:> dmd test.d
C:> test
object.Error: Access Violation
std.encoding.EncodingSchemeASCII            ðæB ANSI_X3.4-1968  ♫    ÆB
ANSI_X3.
4-1986  ♫   ↑ÆB ASCII   ♣   0ÆB IBM367  ♠   @ÆB ISO646-US           
      PÆB I
SO_646.irv:1991        ►   hÆB US-ASCII         êÆB cp367   ♣   áÆB
csASCIIiso-i


-- 



More information about the Digitalmars-d-bugs mailing list