eclipse-jdt / eclipse-jdt/eclipse.jdt.core
Unexpected problem during inference
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
This program
```java
import java.util.function.Function;
interface C { }
interface S {
A m1(C c);
}
public abstract class X {
void foo2(S s) {
s.m1(m2(String::toUpperCase, xyz -> "NODATA"));
}
public abstract
C m2(Function keyMapper,
Function valueMapper);
}
```
triggers these errors:
```
----------\n
1. ERROR in X.java (at line 8)\n
s.m1(m2(String::toUpperCase, xyz -> "NODATA"));\n
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n
Problem detected during type inference: Unknown error at invocation of m2(Function, Function)\n
----------\n
2. ERROR in X.java (at line 8)\n
s.m1(m2(String::toUpperCase, xyz -> "NODATA"));\n
^^^^^^^^^^^^^^^^^^^\n
The type String does not define toUpperCase(Object) that is applicable here\n
----------\n
```
The first message should of course never be seen.
Contributor guide
Assessment
This issue has not been assessed yet.