How about adding NilClass#as(class)? This is much less likely to cause name
collisions. We have the same issue with IronRuby, and this is the solution
we are favoring currently.

obj.doSomething(nil.as(Component), 0)

~Jimmy


On Thu, Aug 6, 2009 at 9:33 AM, Martin McNulty <[email protected]>wrote:

> HashMap.null
>
> Doesn't use 'nil', but then I guess it is a Java
> null you're passing into the method...  Handily can't conflict with a
> Java field name.
>
> I have almost no idea of how this would be implemented though, so
> perhaps this suggestion's a really bad one ;)
>
> Martin
>
> 2009/8/6 Thomas E Enebo <[email protected]>:
> > nil.to_java(HashMap)
> >
> > -Tom
> >
> > On Thu, Aug 6, 2009 at 1:50 AM, Charles Oliver
> > Nutter<[email protected]> wrote:
> >> This is an important one:
> >>
> >> http://jira.codehaus.org/browse/JRUBY-3865
> >>
> >> It's definitely not a hypothetical situation, and I have had this come
> >> up a few times myself. Perhaps we can have some discussion here or on
> >> the bug about what our casting syntax should look like?
> >>
> >> - Charlie
>

Reply via email to