On Fri, 29 Aug 2025 10:15:54 GMT, Maurizio Cimadamore <[email protected]> 
wrote:

>> I think I like the trade-off, we could try to infer if a constructor 
>> invocation corresponds to the class we are interested in. Like for example 
>> analyzing the symbol associated to a `super` or `this` invocation. But for 
>> erroneous invocations the symbol could be null. So what to do when we find a 
>> null symbol? We would have no clues I think.
>
> let's wait until we address the other comments first. What I had in mind (but 
> can be addressed in a separate PR) was maybe have a general visitor for 
> prologue -- e.g. an helper visitor class that only visits things inside the 
> prologue. Then you can extend that helper visitor here, to do what you need 
> to do.

Fyi, at one point I determined that you can't assume `super()` calls are always 
top-level statements because I found that some synthetic calls to `super()` are 
added inside `{ }` blocks. See also `TreeInfo.ConstructorCallFinder` (which you 
might be able to modify and/or reuse somehow).

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1523#discussion_r2323449443

Reply via email to