digitalmars.D.bugs - [Issue 580] New: Inconsistent constant->enum conversion rules
- d-bugmail puremagic.com (34/34) Nov 20 2006 http://d.puremagic.com/issues/show_bug.cgi?id=580
- d-bugmail puremagic.com (9/9) Jun 29 2008 http://d.puremagic.com/issues/show_bug.cgi?id=580
http://d.puremagic.com/issues/show_bug.cgi?id=580
Summary: Inconsistent constant->enum conversion rules
Product: D
Version: 0.174
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: sean f4.ca
Compiling the code:
enum A : uint
{
a = 0,
b = 1
}
enum B : ulong
{
a = 0,
b = 1
}
void main()
{
A a = 1;
B b = 1;
}
Gives:
test.d(16): Error: cannot implicitly convert expression (1) of type int to
B
Changing the second constant to 1UL has the same result. This is inconsistent.
Either both assignments should work or neither should.
--
Nov 20 2006
http://d.puremagic.com/issues/show_bug.cgi?id=580
bugzilla digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
In dmd 1.031 and 2.015, both produce a compile error as expected.
--
Jun 29 2008








d-bugmail puremagic.com