On Mon, 1 Jun 2026 14:02:11 GMT, Chen Liang <[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())`? Can we use either meth.type, or, better, constructorCallSymbol.externalType(types). That one will give you the Lowered-transformed signature w/o needing to look into all these ancillary fields. E.g. `constructorCallSymbol.externalType(types).getParameterTypes() === allDeclaredArgs` ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2492#discussion_r3340450224
