[code-reflection] RFR: 8337162: Support primitives in patterns [v4]

Mourad Abbay mabbay at openjdk.org
Mon Oct 7 18:03:44 UTC 2024


On Fri, 4 Oct 2024 16:15:05 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Mourad Abbay has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Rename test file
>>  - Remove unnecessary import
>
> test/jdk/java/lang/reflect/code/TestPrimitiveTypePatterns.java line 51:
> 
>> 49:         // builds the model of:
>> 50:         // static boolean f(sourceType a) { return a instanceof targetType _; }
>> 51:         return func("f", functionType(JavaType.BOOLEAN, sourceType)).body(fblock -> {
> 
> A different approach to explicitly building the model is to reflect on code in Java method and transform it. The compiler already knows how to build models. Might be a good test case for transforming. Perhaps consider as a follow up PR?

Seems a good approach, I will implement it.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/246#discussion_r1790657778


More information about the babylon-dev mailing list