Way to print type inference engine progress?
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Tue Feb 2 11:10:14 UTC 2021
Hi Cesar,
There should be an option:
"-Ddebug.dumpInferenceGraphsTo=<folder-name>"
which should generate a lot of .dot files showing constraints and
dependencies between inference variables. The option generates a ton of
output though, so it might take a while to figure out what graph you are
staring at.
Cheers
Maurizio
On 02/02/2021 01:31, Cesar Soares Lucas wrote:
> Hey there,
>
> I'm debugging a portion of Java 11 code that seems to be hitting a problem like the bugs reported here [1][2]. I'm not very familiar with javac internals so I'm wondering if there is a way to make the type inference engine operate in verbose mode so I can get a list of type/constraints that it resolved during the evaluation of a Java statement.
>
> I have a piece of code similar to the one below and I wanted to see all types the engine considered for each method:
>
> Workflow<Map<FeatureSourceKey, Document<?>>> result = Workflow
> .value(strs)
> .flatMap(operator)
> .map(
> batchResult -> batchResult
> .values()
> .stream()
> .map(item -> getReMixBulkResponseItemValue(item))
> .collect(Collectors.toMap(d -> null, Function.identity())));
>
> Is this possible?
>
>
> Thanks,
> Cesar
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8222171
> [2] https://bugs.openjdk.java.net/browse/JDK-8222035
More information about the compiler-dev
mailing list