www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2860] New: enum convert error

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2860

           Summary: enum convert error
           Product: D
           Version: 2.028
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: davidl 126.com


import std.stdio;
enum abc:int{
  vv,cc
}
enum kkk:abc
{
  mm = cast(abc)(abc.cc+1)
}
void main()
{
  kkk t;
  t = kkk.vv;   // this should work?  instead I get this error message: Error:
cannot implicitly convert expression (cast(abc)0) of type abc to kkk
}


-- 
Apr 19 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2860


fvbommel wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




------- Comment #1 from fvbommel wxs.nl  2009-04-20 01:33 -------


*** This bug has been marked as a duplicate of 2859 ***


-- 
Apr 19 2009