D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4670 - Error compiling enum with string value in debug (compiles in release)
Summary: Error compiling enum with string value in debug (compiles in release)
Status: RESOLVED DUPLICATE of issue 2950
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 09:59 UTC by Rodéric Vicaire
Modified: 2010-10-22 14:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rodéric Vicaire 2010-08-17 09:59:37 UTC
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.
Comment 1 Tomasz Sowiński 2010-10-22 14:02:22 UTC

*** This issue has been marked as a duplicate of issue 2950 ***