View previous topic :: View next topic |
Author |
Message |
mpt
Joined: 13 Sep 2008 Posts: 2 Location: Finland
|
Posted: Fri Mar 13, 2009 4:33 pm Post subject: wrapped object vs null |
|
|
The test code below outputs false, which is not what I expected. The d-null is wrapped in a minid object, so it doesn't equal the null type. Should MDValue.opEquals also look inside the wrapper to test for null?
Code: |
import minid.api;
import minid.bind;
class Foo {}
Foo GetFoo() { return null; }
void main() {
MDVM vm;
MDThread* t = openVM(&vm);
WrapGlobals!(
WrapFunc!(GetFoo),
WrapType!(Foo)
)(t);
runString(t, "writeln(GetFoo() is null)");
}
|
|
|
Back to top |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Sat Mar 14, 2009 11:18 am Post subject: |
|
|
Oops. I did null-checking when getting params (so passing a MiniD null to a D object reference would work), but not on return values. Just update MiniD |
|
Back to top |
|
|
|