You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Test {
private final int value;
Test(int value) {
this.value = value;
}
int getValue() {
return value;
}
static int merge(int value, Map<Integer, List<Test>> data) {
return value;
}
static void test(List<Test> externals) {
var testsByValue = Stream.of(new Test(1), new Test(2))
.collect(Collectors.groupingBy(Test::getValue));
var values = Stream.of(1, 2)
.map(
val -> merge(val, testsByValue))
.toList();
}
}
This leads to type.arguments.not.inferred, but I globally suppressed it and then it throws exception
java: StructuralEqualityComparer: unexpected combination: type: [TYPEVAR class org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedTypeVariable] capture#01 extends Object super Integer supertype: [DECLARED class org.checkerframework.framework.type.AnnotatedTypeMirror$AnnotatedDeclaredType] Integer
visitHistory = org.checkerframework.framework.type.StructuralEqualityVisitHistory@391e565e
; The Checker Framework crashed. Please report the crash. Version: Checker Framework 3.46.0.
Compilation unit: /C:/Projects/pvyscomponents/java/libs/kernel/repository/api/src/main/java/com/provys/repository/Test.java
Last visited tree at line 36 column 26:
val -> merge(val, testsByValue))
Exception: java.lang.Throwable; java.lang.Throwable
at org.checkerframework.javacutil.BugInCF.<init>(BugInCF.java:26)
I believe problem is in inference of testsByValue type, as if var is replaced with Map<Integer, List<Test>>, code compiles without problem.
The text was updated successfully, but these errors were encountered:
This leads to
type.arguments.not.inferred
, but I globally suppressed it and then it throws exceptionI believe problem is in inference of
testsByValue
type, as ifvar
is replaced withMap<Integer, List<Test>>
, code compiles without problem.The text was updated successfully, but these errors were encountered: