Skip to content

[fix] report Java arity on interface methods (#3848) - #10110

Open
kares wants to merge 2 commits into
jruby:masterfrom
kares:iface-impl-arity
Open

kares wants to merge 2 commits into
jruby:masterfrom
kares:iface-impl-arity

Conversation

@kares

@kares kares commented Nov 18, 2026

Copy link
Copy Markdown
Member

Iface.impl { } and proc-to-interface conversion previously bound all methods with an optional (-1) signature

compute actual signature from the Java overloads (min/max, param count, varargs) like RubyToJavaInvoker does for Java methods

impl(:names) now also resolves methods inherited from super-interfaces

@kares kares added this to the JRuby 10.1.4.0 milestone Nov 18, 2026
`Iface.impl { }` and proc-to-interface conversion previously bound all
methods with an optional (-1) signature

compute actual signature from the Java overloads (min/max, param count,
varargs) like RubyToJavaInvoker does for Java methods

`impl(:names)` now also resolves methods inherited from super-interfaces
@kares kares linked an issue Nov 18, 2026 that may be closed by this pull request
end

def javac_compile(files)
compiler = javax.tools.ToolProvider.getSystemJavaCompiler

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a bit too much, there's existing fixtures - left as is (generated)

@kares
kares marked this pull request as draft November 18, 2026 08:50
JDK 22 added resolve(Path, Path...) and resolve(String, String...)
overloads, so the arity is -2 on newer JDKs

sameArityDiffTypes in custom interface already covers same-arity
@kares
kares marked this pull request as ready for review November 18, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

correct arity with implemented iface methods

1 participant