http://d.puremagic.com/issues/show_bug.cgi?id=4689

           Summary: Error: cast from const(int) to real not allowed in
                    safe code
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: zan77...@nifty.com


--- Comment #0 from SHOO <zan77...@nifty.com> 2010-08-20 02:45:43 PDT ---
This code should be compiled:

struct S{
    int x;
    @safe const real getX(){ return cast(real)x; }
}

Error: cast from const(int) to real not allowed in safe code

See also: http://lists.puremagic.com/pipermail/phobos/2010-August/001958.html
(2010/08/20 0:08), Andrei Alexandrescu wrote:
>>> Line 414: no need for @trusted, casting numbers is not unsafe.
>>>
>>
>> Error: cast from const(long) to real not allowed in safe code
>
>Compiler bug. I wonder whether const has anything to do with (shouldn't).

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

Reply via email to