Open bvkatwijk opened 6 years ago
Maybe a javac bug in the improved type inference code? Compiling on Java 8 works for me, but 9 and 10 fail. Passing -Xdiags:verbose
to javac provides additional details, note that the required/found actually match in spite of what the error says:
error: method range in interface IntStream cannot be applied to given types;
@Builder
^
required: int,int
found: int,int
reason: argument mismatch; no instance(s) of type variable(s) T exist so that Collector<T,?,List<T>> conforms to int
where T is a type-variable:
T extends Object declared in method <T>toList()
Possibly related:
On that second one, note these comments:
The dependencies of an inference node are currently stored in a 'HashSet' that doesn't preserve insertion order . . . In addition to that, 'hashCode()' is inherited from 'Object' giving no guarantee of consistency between two compilations of the same code sample . . .
Tarjan's algorithm iterates on these dependencies to compute the acyclic graph determining the solving order which is then non-deterministic . . .
Picking a node to be solved from a stuck expression also iterates on those dependencies leading to a non-deterministic solving order too . . .
I'm running into a compilation error when compiling with Gradle using
@Builder
. Eclipse with Lombok installed does not raise a compilation error. The following is a minimal reproduction of the issue:A.java
:Running
./gradlew jar
gives the following error:Some remarks about this example:
getInt
method removes the compilation errorCollectors.toList()
withCollectors.<Object>toList()
removes the compilation error@Builder
removes the compilation errorbuild.gradle
:Gradle Wrapper Version: