[code-reflection] RFR: Model String Template [v3]
Paul Sandoz
psandoz at openjdk.org
Wed Feb 28 19:15:05 UTC 2024
On Wed, 28 Feb 2024 18:32:26 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/reflect/code/op/ExtendedOps.java line 3195:
>>
>>> 3193: TypeDefinition processorReturnType = processorValue.type().toTypeDefinition().arguments().get(0);
>>> 3194: return CoreTypeFactory.JAVA_TYPE_FACTORY.constructType(processorReturnType);
>>> 3195: }
>>
>> That's a clever way to do it, but for now i recommend passing in the result type to the factory and constructor.
>>
>> The other, and more preferred, way to operate on types is to check if the processor value's type is an instance of `JavaType` and then access as that type to obtain the argument type. We will probably revisit this whole area after we have decided how to model Java types.
>
> If we pass resultType, result type will be fixed even if we do transformation that change the processor, e.g. RAW -> STR
Yeah, that's a downside. But, i think we need to revisit that issue more generally.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/30#discussion_r1506458702
More information about the babylon-dev
mailing list