[Issue 4689] New: Error: cast from const(int) to real not allowed in safe code
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 20 02:45:49 PDT 2010
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: nobody at puremagic.com
ReportedBy: zan77137 at nifty.com
--- Comment #0 from SHOO <zan77137 at 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: -------
More information about the Digitalmars-d-bugs
mailing list