eclipse-jdt / eclipse-jdt/eclipse.jdt.core

[type inference] Type mismatch: cannot convert error - javac compiles

Open
#2,238 2 comments 0 reactions 0 assignees View on GitHub
javac rawtypes
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

Test case to reproduce:
```
interface V {}
abstract class A implements V {
public static A getA(T value) {
return null;
}
}

interface J {}
interface K {
X foo();
}
// javac compiles while ecj gives the following error
public class X {
public A> bar() {
return A.getA( // ERROR: Type mismatch: cannot convert from A to A>
new K() {
@Override
public X foo() {
return null;
}
});
}
}

```
ecj throws "ERROR: Type mismatch: cannot convert from A to A>"

@srikanth-sankaran could you please have a quick look if time permits? thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.