On Tue, 3 Feb 2026 14:10:05 GMT, Maurizio Cimadamore <[email protected]> wrote:
> A witness lookup of the kind `T.__witness` is translated as a condy > instruction. > Condy-backed `ldc` are modelled in the AST as references to > `DynamicVariableSymbol`. > Such symbols have a owner. While the owner of a dynamic symbol is relatively > unimportant for code generation issues (we don't need it to emit the correct > bytecode), other compilation steps (such as `LambdaToMethod`) might be > tricked into thinking that the dynamic symbol is actually a reference to an > enclosing class symbol. This happens if the dynamic symbol owner is set to be > a class symbol, instead of a method symbol. > > The fix is therefore to translate the dynamic symbol of a witness lookup as a > "local variable" -- that is, a variable symbol whose owner is a method (not a > class) symbol. This pull request has now been integrated. Changeset: ffef89ab Author: Maurizio Cimadamore <[email protected]> URL: https://git.openjdk.org/valhalla/commit/ffef89aba3f213733859b76ad2facd878c680c6e Stats: 70 lines in 2 files changed: 69 ins; 0 del; 1 mod [type-classes] Witness symbols with wrong owner lead to verifier errors ------------- PR: https://git.openjdk.org/valhalla/pull/2021
