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: nob...@puremagic.com
        ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha <dsim...@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: -------

Reply via email to