RFR: JDK-8300857: State return value for Types.asElement(NoType) explicitly

Joe Darcy darcy at openjdk.org
Tue Jan 24 22:51:10 UTC 2023


On Tue, 24 Jan 2023 05:38:36 GMT, Joe Darcy <darcy at openjdk.org> wrote:

> Just sending out the proposed API changes for now, will add tests later.
> 
> Please also review the corresponding CSR [JDK-8300951](https://bugs.openjdk.org/browse/JDK-8300951).

PS I purposely did not provide an explicit specification on how a TypeMirror with a kind of OTHER or ERROR might be handled here to preserve implementation flexibility.

As an aside, if we had more time for the original JSR 269 effort, we would likely have worked so that there was a PrimitiveElement enum to host the element form of the built-in primitive types, but we ran out of time do to that work. That would have allowed a fuller round-trip relation of

element.asType().asElement()

returning something equal to the initial value.

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

PR: https://git.openjdk.org/jdk/pull/12159


More information about the compiler-dev mailing list