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

--- Comment #0 from David Simcha <> 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 is already defined

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to