[code-reflection] RFR: JavaRef extends TypeElement [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu May 1 08:36:07 UTC 2025


On Wed, 30 Apr 2025 23:02:57 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> It can go away if there are no suitable methods that are applicable to all refs. I was hoping there might be something around resolution or erasure. We could also relocate all the factory methods. I wish we could find a better name than `Ref`.

I agree --- I was wondering if we could have a resolve method in all Java "types" (we should find a better word for it) -- some resolve to a `j.l.r.Type`, other will resolve to `Method`/`Constructor`/`Field`/`Class`/`RecordComponent`. But they _all_ can be resolved, in a way. Not sure if this is a stretch too far -- but I wonder if the separation between "symbolic reference" and "type" -- which is useful when writing a compiler -- is something worth calling attention for here, or if we're better off just pretending they are all Java "symbols" of some kind (some representing types, some representing something else).

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

PR Comment: https://git.openjdk.org/babylon/pull/416#issuecomment-2844380563


More information about the babylon-dev mailing list