Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.5.1
-
Fix Version/s: JRuby 1.6RC2
-
Component/s: Ruby 1.9.2, RubySpec, Standard Library
-
Labels:None
-
Number of attachments :
Description
require 'delegate'
class MyDelegator < Delegator
attr_reader :__getobj__
def __setobj__(o)
@__getobj__ = o
end
end
d = MyDelegator.new(10)
d.freeze ## fails HERE
An attempt to execute the example above leads to:
jruby --1.9 deleg.rb
org/jruby/RubyObject$i_method_0_0$RUBYINVOKER$freeze.gen:65535:in `call': java.lang.ClassCastException: org.jruby.RubyBasicObject
cannot be cast to org.jruby.RubyObject
from JavaMethod.java:836:in `call'
from JavaMethod.java:642:in `call'
from SuperCallSite.java:286:in `cacheAndCall'
from SuperCallSite.java:70:in `callBlock'
from SuperCallSite.java:75:in `call'
from ZSuperNode.java:100:in `interpret'
from NewlineNode.java:104:in `interpret'
from BlockNode.java:71:in `interpret'
from InterpretedMethod.java:139:in `call'
from CachingCallSite.java:293:in `cacheAndCall'
from CachingCallSite.java:112:in `call'
from CallNoArgNode.java:61:in `interpret'
from NewlineNode.java:104:in `interpret'
from BlockNode.java:71:in `interpret'
from RootNode.java:129:in `interpret'
from Ruby.java:707:in `runInterpreter'
from Ruby.java:568:in `runNormally'
from Ruby.java:410:in `runFromMain'
from Main.java:286:in `run'
from Main.java:128:in `run'
from Main.java:97:in `main'
This also causes LOTS of new rubyspec failures for Delegate library.
Issue Links
- is duplicated by
-
JRUBY-5366
jruby 1.6 RC1 ruby 1.9: org.jruby.RubyBasicObject cannot be cast to org.jruby.RubyObject
-