Internal error from DMD
Bradley Smith
digitalmars-com at baysmith.com
Sat Jun 24 00:59:35 PDT 2006
I didn't mean to be overly critical of the compiler. I wasn't sure how
to interpret the "Internal error" message, and I just wanted to confirm
that the objective was to not have any internal errors.
What is the proper procedure for reporting a bug?
Thanks for the pointer about Box and Object. I'm still learning how D
handles data.
Thanks,
Bradley
Jarrett Billingsley wrote:
> "Bradley Smith" <digitalmars-com at baysmith.com> wrote in message
> news:e7hvil$1ffi$1 at digitaldaemon.com...
>> Is this a bug? Should the DMD compiler ever give an internal error?
>
> Considering it's in alpha, the compiler is allowed to have some slack ;)
> But no, it's not _supposed_ to have internal errors. Any internal error is
> a bug.
>
>> import std.stdio;
>> import std.boxer;
>>
>> void main() {
>> Object[] l;
>> l ~= cast(Object) box(1);
>
> You can't cast a box to Object; box is a struct, not a class. If you want
> an array of boxes, hava a look at boxArray().
>
>> int a = unbox!(int)(cast(Box) l[0]);
>> writefln("value %d", a);
>> }
>>
>>> dmd tmp.d c:\dmd\src\phobos\std\boxer.d
>> tmp.d(6): e2ir: cannot cast from Box to object.Object
>> tmp.d(7): e2ir: cannot cast from object.Object to Box
>> Internal error: e2ir.c 267
>
>
More information about the Digitalmars-d-learn
mailing list