[Issue 8888] New: char enums inside functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 24 18:49:13 PDT 2012


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

           Summary: char enums inside functions
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-10-24 18:49:12 PDT ---
If I try to define the char enum inside the function I receive error messages
from the compiler and the linker (DMD 2.061alpha):

-------------------

void main() {
    enum Code : char { A='A', B='B', C='C' }
    auto arr = [Code.A, Code.B];
}


OPTLINK (R) for Win32  Release 8.00.12
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
test.obj(test) 
 Error 42: Symbol Undefined _Dmain4Code6__initZ

-------------------

void main() {
    enum Code : char { A='A', B='B', C='C' }
    auto arr = [Code.A, Code.B];
}

test.d(2): Error: no identifier for declarator Code
test.d(2): Error: semicolon expected, not ':'
test.d(2): Error: found ':' instead of statement
test.d(4): Error: unrecognized declaration

-------------------

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