[foreign-jextract] RFR: Represent typedef with Declaration.Variable instead of Declaration.Scoped

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Apr 30 16:53:33 UTC 2020


On Thu, 30 Apr 2020 15:00:24 GMT, Henry Jen <henryjen at openjdk.org> wrote:

> As current Declaration.Variable stands, it's perfect, with name(), type() and kind(). We can either create a different
> interface, or rename to something else if that helps.

Variable is perfect in the sense that it has the right structure. But it's not at all what a typdef is! Imagine I write
a visitor for the declaration API: if I see vistVariable and I'd expect to see a global, or a struct field, I would now
have to defend _against_ typedefs?

>From a logical point of view a typedef has nothing to do with a variable declaration, so a new `Declaration.Typedef`
interface would be preferrable

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

PR: https://git.openjdk.java.net/panama-foreign/pull/137


More information about the panama-dev mailing list