Ambiguous method call - wrong IDE error
Answered
Hi, this code shows error to me on my IDE (IntelliJ 2016.3.5) but not on my colleagues IDEs (2017 and 2018 editions)
Code does compile.
And the generics combinations here are critical for reproducing the issue:
import java.util.HashMap;
import java.util.Map;
public class A<T1, T2> {
public static <T3, T4> void via(final HashMap<T3, T4> fn) {
System.out.println("static method");
}
public <T5> void via(Map<T5, T2> fn) {
System.out.println("non static method");
}
public static void main(String[] args) {
A.via(new HashMap<>());
}
}
Tried to invalidate caches and restart - didn't help
Please sign in to leave a comment.
Try to update, a lot of error highlighting issues were resolved since 2016.
I've got a paid subscription for this version, therefore i can't upgrade