On Sat, 30 May 2026 05:38:12 GMT, Vicente Romero <[email protected]> wrote:

> When generating proxy locals to hold the arguments of a super invocation, 
> javac was taking the type from the actual argument. This was incorrect and 
> the test case shown in the bug entry proved it. The type is now being taken 
> from the declared argument type,
> 
> TIA
> 
> 
> 
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LocalProxyVarsGen.java 
line 229:

> 227:                 
> allDeclaredArgs.addAll(constructorCallSymbol.capturedLocals);
> 228:             }
> 229:             for (JCExpression arg : constructorCall.args) {

Maybe add an `Assert.check(constructorCall.args.length == 
allDeclaredArgs.size())`?

-------------

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2492#discussion_r3334704090

Reply via email to