Forum: IronRuby Re: apparently only with extension methods nil != System::Object

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-05-01 16:25
(Received via mailing list)
I've done some more investigation and it appears that it has to do with
Extension methods.

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

and

public static bool IsNull2(object value)
{
return value == null;
}

>>> System::Web::Mvc::IronRuby::Extensions::ObjectExtensions.is_null nil
:0: can't convert NilClass into Object (TypeError)

>>> System::Web::Mvc::IronRuby::Extensions::ObjectExtensions.is_null2 nil
=> true

I've commented the issue on codeplex but couldn't change the title of
the
bug.


---
Author of IronRuby in Action (http://manning.com/carrero)

Andy Warhol
<http://www.brainyquote.com/quotes/authors/a/andy_w...
- "I am a deeply superficial person."
This topic is locked and can not be replied to.