www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4628] New: Casting away const should be allowed in safe mode if no indirection

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

           Summary: Casting away const should be allowed in safe mode if
                    no indirection
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com


--- Comment #0 from David Simcha <dsimcha yahoo.com> 2010-08-11 19:36:45 PDT ---
void fun()  safe {
    const uint foo = 2;
    uint bar = foo;  // Works.
    auto bar = cast(uint) foo;  // Doesn't work;
}


test9.d(4): Error: cast from const(uint) to uint not allowed in safe code
test9.d(4): Error: declaration test9.fun.bar is already defined

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 11 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4628


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from yebblies <yebblies gmail.com> 2011-06-11 01:01:22 PDT ---
*** This issue has been marked as a duplicate of issue 5088 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 11 2011