RFR: 8325859: Potential information loss during type inference [v9]
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue May 20 16:30:59 UTC 2025
On Tue, 20 May 2025 14:35:04 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>>
>> updating IC::toString
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java line 575:
>
>> 573: "Undet vars: " + undetvars + '\n';
>> 574: if (parentIC != null) {
>> 575: result += "\nParent : " + parentIC.toString();
>
> I was thinking about using an indentation, probably with a toString overload, but if the chain of parents gets long then one will need to scroll to the sides to see them all
I see what you mean. The fact that the string representation is multiline, but also recursively used leads to issues -- because every time we do a `\n` we will break indentation. It's not terribly important. Another possibility would be to list the "other variables" (e.g. the ones that appear in the parent contexts), without listing all the parent contexts explicitly. That should scale a bit better.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25011#discussion_r2098397581
More information about the compiler-dev
mailing list