RFR: 8303820: Simplify type metadata [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Mar 8 23:43:12 UTC 2023


On Wed, 8 Mar 2023 15:47:04 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Further simplify code
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java line 325:
> 
>> 323:      *  and with given constant value
>> 324:      */
>> 325:     public Type constType(Object constValue) {
> 
> so now any type can have a constant value? shouldn't this be restricted to primitives and Strings?

Yeah - not sure which way to go - in reality we have a also a couple of types which implement this method and just return `this`. Only the toplevel `Type` declaration throws. I'm happy to revert to the old ways if that is preferred - it was mostly a way not to duplicate the method body twice (but that's not a big deal).

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

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


More information about the compiler-dev mailing list