[Issue 4670] New: Error compiling enum with string value in debug (compiles in release)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 17 09:59:43 PDT 2010


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

           Summary: Error compiling enum with string value in debug
                    (compiles in release)
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ingenu at libertysurf.fr


--- Comment #0 from Rodéric Vicaire <ingenu at libertysurf.fr> 2010-08-17 09:59:37 PDT ---
The following program 
"
module main;

import std.stdio;

enum TEST_ENUM : string
{
    E_INT = int.stringof,
    E_FLOAT = float.stringof
}

void main( string[] args )
{
    writeln( "Hello World!" );
}
"
produces the following error when compiled in release mode on DMD2.048:
"
Building Debug\DTest.exe...
main.d(7): Error: Integer constant expression expected instead of "int"c
main.d(8): Error: Integer constant expression expected instead of "float"c
main.d(7): Error: Integer constant expression expected instead of "int"c
main.d(8): Error: Integer constant expression expected instead of "float"c
"

however it does compile fine in Release mode.

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