Forum: IronRuby nil != null ?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ivan P. (Guest)
on 2009-05-01 12:19
(Received via mailing list)
I had specs that used to work but now apparently they don't anymore.
I'd expect that a nil from ruby maps to null in C# but this doesn't seem
be the case.

I'm using the following code

        public static bool IsNotNull(this object value)
            return value != null;

        public static bool IsNull(this object value)
            return value == null;

>>> ObjectExtensions.is_null(nil)
:0: can't convert NilClass into Object (TypeError)

I'd expect it to return true ;)

Author of IronRuby in Action (
This topic is locked and can not be replied to.