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

           Summary: Cannot cast const(int) to long in @safe function
           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: clugd...@yahoo.com.au


--- Comment #0 from Don <clugd...@yahoo.com.au> 2010-10-20 15:24:31 PDT ---
Even though they are value types. It seems to want to you to do
cast(const(long))
---
@safe:
void foo5088(const(int)[] x)
{
   long a = cast(long)x[0];
}

void main()
{
   int[2] a;
   a[] = 6;
   foo5088(a);
}

----
bug.d(36): Error: cast from const(int) to ulong not allowed in safe code

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

Reply via email to