digitalmars.D - std.boxer problem
- Tydr Schnubbis (4/4) Apr 29 2006 Why can't I cast from Object to Box? That seems to defeat the purpose
- Alexander Panek (6/11) Apr 29 2006 Object o = new Object();
- Tydr Schnubbis (18/30) Apr 29 2006 No luck.
- John Demme (4/42) Apr 29 2006 That one's a bug with templating code inside of libraries. You need to
- Tydr Schnubbis (3/46) Apr 29 2006 Ah, so I guess it's currently unusable for real projects, then. I
- Daniel Keep (16/63) Apr 29 2006 If I remember correctly, it's because we don't have a debug build of
- Sean Kelly (4/9) Apr 29 2006 A compiler crash is never a good thing. Please file a bug report for
Why can't I cast from Object to Box? That seems to defeat the purpose of boxing. I get this error: serverlist.d(185): e2ir: cannot cast from object.Object to Box Internal error: e2ir.c 267
Apr 29 2006
Tydr Schnubbis wrote:Why can't I cast from Object to Box? That seems to defeat the purpose of boxing. I get this error: serverlist.d(185): e2ir: cannot cast from object.Object to Box Internal error: e2ir.c 267Object o = new Object(); Box b = box(o); foo bar = unbox!(foo)(b); Regards, Alexander Panek
Apr 29 2006
Alexander Panek wrote:Tydr Schnubbis wrote:No luck. import std.boxer; void main() { Object o = new Object(); Box b = box(o); int bar = unbox!(int)(b); } c:\prog\test\D>dmd boxing2.d c:\prog\dmd\bin\..\..\dm\bin\link.exe boxing2,,,user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved boxing2.obj(boxing2) Error 42: Symbol Undefined _assert_3std5boxer --- errorlevel 1 -------- Maybe it's just a configuration problem? I've got dmd 0.155.Why can't I cast from Object to Box? That seems to defeat the purpose of boxing. I get this error: serverlist.d(185): e2ir: cannot cast from object.Object to Box Internal error: e2ir.c 267Object o = new Object(); Box b = box(o); foo bar = unbox!(foo)(b);
Apr 29 2006
Tydr Schnubbis wrote:Alexander Panek wrote:That one's a bug with templating code inside of libraries. You need to compile your code with -release. ~John DemmeTydr Schnubbis wrote:No luck. import std.boxer; void main() { Object o = new Object(); Box b = box(o); int bar = unbox!(int)(b); } c:\prog\test\D>dmd boxing2.d c:\prog\dmd\bin\..\..\dm\bin\link.exe boxing2,,,user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved boxing2.obj(boxing2) Error 42: Symbol Undefined _assert_3std5boxer --- errorlevel 1 -------- Maybe it's just a configuration problem? I've got dmd 0.155.Why can't I cast from Object to Box? That seems to defeat the purpose of boxing. I get this error: serverlist.d(185): e2ir: cannot cast from object.Object to Box Internal error: e2ir.c 267Object o = new Object(); Box b = box(o); foo bar = unbox!(foo)(b);
Apr 29 2006
John Demme wrote:Tydr Schnubbis wrote:Ah, so I guess it's currently unusable for real projects, then. I solved my original problem without using boxing. So I'm okay for now. :)Alexander Panek wrote:That one's a bug with templating code inside of libraries. You need to compile your code with -release.Tydr Schnubbis wrote:No luck. import std.boxer; void main() { Object o = new Object(); Box b = box(o); int bar = unbox!(int)(b); } c:\prog\test\D>dmd boxing2.d c:\prog\dmd\bin\..\..\dm\bin\link.exe boxing2,,,user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved boxing2.obj(boxing2) Error 42: Symbol Undefined _assert_3std5boxer --- errorlevel 1 -------- Maybe it's just a configuration problem? I've got dmd 0.155.Why can't I cast from Object to Box? That seems to defeat the purpose of boxing. I get this error: serverlist.d(185): e2ir: cannot cast from object.Object to Box Internal error: e2ir.c 267Object o = new Object(); Box b = box(o); foo bar = unbox!(foo)(b);
Apr 29 2006
Tydr Schnubbis wrote:John Demme wrote:If I remember correctly, it's because we don't have a debug build of Phobos. You can build one yourself (ie: rebuild phobos with debug stuff in). Or, you can do what I did and "provide" the function that it's missing: // Burton Radons <burton-radons[at]smocky[dot]com> // This entry allows -unittest for testing, and/or no need // for the -release switch private extern (C) void assert_3std5boxer() {} I personally just stuck that in a file called "dmdbug_std_boxer_assert.d", so that I can just remove the import when it gets fixed :) -- Daniel -- v1sw5+8Yhw5ln4+5pr6OFma8u6+7Lw4Tm6+7l6+7D a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/Tydr Schnubbis wrote:Ah, so I guess it's currently unusable for real projects, then. I solved my original problem without using boxing. So I'm okay for now. :)Alexander Panek wrote:That one's a bug with templating code inside of libraries. You need to compile your code with -release.Tydr Schnubbis wrote:No luck. import std.boxer; void main() { Object o = new Object(); Box b = box(o); int bar = unbox!(int)(b); } c:\prog\test\D>dmd boxing2.d c:\prog\dmd\bin\..\..\dm\bin\link.exe boxing2,,,user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved boxing2.obj(boxing2) Error 42: Symbol Undefined _assert_3std5boxer --- errorlevel 1 -------- Maybe it's just a configuration problem? I've got dmd 0.155.Why can't I cast from Object to Box? That seems to defeat the purpose of boxing. I get this error: serverlist.d(185): e2ir: cannot cast from object.Object to Box Internal error: e2ir.c 267Object o = new Object(); Box b = box(o); foo bar = unbox!(foo)(b);
Apr 29 2006
Tydr Schnubbis wrote:Why can't I cast from Object to Box? That seems to defeat the purpose of boxing. I get this error: serverlist.d(185): e2ir: cannot cast from object.Object to Box Internal error: e2ir.c 267A compiler crash is never a good thing. Please file a bug report for this :-) Sean
Apr 29 2006