Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6RC1
-
Fix Version/s: JRuby 1.7.0.RC2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Number of attachments :
Description
It is possible to subclass a class with no public constructors. However, it is not possible to create instances of that class. A more helpful error message than
ArgumentError: Constructor invocation failed: tried to access method com.foo.bar.Foo.(Ljava/lang/String;)V from class org.jruby.proxy.com.foo.bar.Foo$Proxy0
would be nice.
My suggestion on IRC was that we could add an early check to confirm the target superclass has public constructors, similar to how we check if it is final. That would avoid the confusing error message that comes when you try to construct the Ruby subclass.