RFR: 8288120: VerifyError with JEP 405 pattern match
Vicente Romero
vromero at openjdk.org
Fri Jun 17 20:26:56 UTC 2022
On Fri, 17 Jun 2022 13:50:39 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> When pattern matching is looking up the accessor methods, it currently uses `Scope.findFirst`. This method may find a method with the same name from the record's supertype. The proposal is to use `Resolve.resolveInternalMethod` which should lookup the methods based on the ordinary rules, and should find the accessor from the record.
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java line 351:
> 349: return component2Proxy.computeIfAbsent(component, c -> {
> 350: MethodSymbol realAccessor =
> 351: rs.resolveInternalMethod(pos, env, component.owner.type,
why not just reading the accessor field in the record component? it should point to the method symbol of the accessor
-------------
PR: https://git.openjdk.org/jdk19/pull/34
More information about the compiler-dev
mailing list