[code-reflection] RFR: Enable pattern matching for JavaType hierarchy
Paul Sandoz
psandoz at openjdk.org
Mon Apr 29 16:32:19 UTC 2024
On Fri, 26 Apr 2024 21:11:26 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> > For `TypeVarRef` should we collapse the methods `methodOwner` and `classOwner` to `owner()`, or in addition to, and document one should pattern match on the resulting object.
>
> I considered that when I did the original work - but it feels odd to just return Object? Perhaps a new sealed type for both JavaType and MethodRef?
Yes, e.g., `sealed interface TypeVarOwner permits JavaType, MethodRef`?
-------------
PR Comment: https://git.openjdk.org/babylon/pull/64#issuecomment-2083173223
More information about the babylon-dev
mailing list