RFR: 8269121: Type inference bug with method references [v7]

Vicente Romero vromero at openjdk.java.net
Wed Sep 22 17:31:20 UTC 2021


> Please review this PR which is making a change to how javac generates the arguments for the lambda metafactory. There are cases like the one described in the JIRA bug entry for which the generated arguments won't be valid and the generated code will fail at execution. The problem arises when the erasure of the lambda method is incompatible with the erasure of the function descriptor. This can happen when at least one of the arguments of the lambda method has an intersection type, in case that the erasure of the intersection type is not compatible with the corresponding argument of the function descriptor. This fix's proposal is to analyze all the components of the intersection and select the first that is compatible with its corresponding argument in the function descriptor.
> 
> TIA

Vicente Romero has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:

 - Merge branch 'master' into JDK-8269121
 - merge
 - implement verification based on conversions used at MethodHandle::asType
 - implement verification based on conversions used at MethodHandle::asType
 - support for sealed classes
 - changing the verification of LMF
 - addressing review comments
 - 8269121: Type inference bug with method references

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

Changes: https://git.openjdk.java.net/jdk/pull/5406/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5406&range=06
  Stats: 198 lines in 3 files changed: 185 ins; 2 del; 11 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5406.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5406/head:pull/5406

PR: https://git.openjdk.java.net/jdk/pull/5406


More information about the compiler-dev mailing list