redundant cast: ensure cast type compared with ground type (IDEA-174369)

remove attempts to emulate that and reuse getGroundTargetType api
This commit is contained in:
Anna Kozlova
2017-06-13 20:27:13 +03:00
parent 7f56e82578
commit 605dfb1c3c
3 changed files with 20 additions and 3 deletions
@@ -0,0 +1,18 @@
import java.util.HashMap;
import java.util.Map;
interface A8<A1, A2> {
A2 a(A1 a1);
}
interface B<B1, B2> {
B2 b(B1 b1);
}
class Bug {
<T1, T2> void bug(B<T1, T2> b) {
Map<String, A8<?, T2>> m = new HashMap<>();
// replace with lambda here
m.put("", (A8<T1, T2>) t1 -> b.b(t1));
}
}