-
Notifications
You must be signed in to change notification settings - Fork 436
Open
Description
I get the following error from the Unit checker, but no Units are configured:
[ERROR] BugHunting\src\main\java\bugs\Main.java:[15,38] Fehler: [type.argument.inference.crashed] Type argument inference crashed for Comparator.thenComparing
[ERROR] error: An exception occurred: False bound for: Constraint: @UnknownUnits Main.@UnknownUnits A <: @UnknownUnits Main.@UnknownUnits B Result: FALSE
Code:
public class Main {
static List<B> filter(final Collection<A> collection) {
return collection.stream()
.map(x->(B)x)
.sorted(Comparator.comparing(B::getX)
.thenComparing(B::getY))
.toList();
}
public class A {
public Long getX() {
return 0L;
}
}
public class B extends A {
public String getY() {
return null;
}
}
}
Maven call:
<properties>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<checker.version>3.53.1</checker.version>
<maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>${checker.version}</version>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-util</artifactId>
<version>${checker.version}</version>
</dependency>
</dependencies>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<fork>true</fork>
<annotationProcessorPaths>
<path>
<groupId>org.checkerframework</groupId>
<artifactId>checker</artifactId>
<version>${checker.version}</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessor>org.checkerframework.checker.units.UnitsChecker</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<arg>-Xmaxerrs</arg>
<arg>10000</arg>
<arg>-Xmaxwarns</arg>
<arg>10000</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels