[code-reflection] RFR: Remove MethodTypeDesc [v2]
Paul Sandoz
psandoz at openjdk.org
Fri Mar 1 16:50:57 UTC 2024
On Fri, 1 Mar 2024 12:40:37 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Paul Sandoz has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Rename
>
> test/langtools/tools/javac/reflect/BoxingConversionTest.java line 132:
>
>> 130: @IR("""
>> 131: func @"test7" (%0 : BoxingConversionTest)void -> {
>> 132: %1 : BoxingConversionTest$Box = new @"func<BoxingConversionTest$Box>";
>
> Question: how fundamental it is that function types should be spelled with `<>` ? After all, function type is a "core type", so perhaps we can afford some special syntactic support. For dialects and user-defined types, I understand that it might be harder to support ad-hoc syntax.
It's not fundamental, we do a similar trick with arrays (motivated by not wanted to update the textual form in many more places). However, i wanted to wait until we improve the modeling of Java types, since that will i think help determine the lexical space we have to play with.
FWIW i find it helpful to think in terms of a tree, i.e. `TypeDefinition`, where some identifiers are "sigils" e.g. we could use `$` to identify enclosing with two arguments for the enclosing and enclosed types, or `#` for type variable, `->` for function type, and `[]+` for arrays, etc. Then we can have a translation between the textual form.
It may be that custom types require a specific sigil and qualifier, e.g. `!` following by some dialect name, which i think is what MLIR does.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/31#discussion_r1509255763
More information about the babylon-dev
mailing list