type distinction when assignment to parameter bound doesn't work (IDEA-205883)

This commit is contained in:
Anna.Kozlova
2019-01-28 18:34:34 +01:00
parent 85c7286d3a
commit 582bee8427
3 changed files with 25 additions and 18 deletions
@@ -0,0 +1,15 @@
import java.io.Serializable;
import java.util.List;
class MyTest {
static <T extends Object & Serializable, J> void m1(List<J> other) {
List<T> list = (List<T>) other;
}
static <T extends Object & Serializable> void m2(List<Object> other) {
List<T> list = <error descr="Inconvertible types; cannot cast 'java.util.List<java.lang.Object>' to 'java.util.List<T>'">(List<T>) other</error>;
}
static <T extends Serializable> void m3(List<Object> other) {
List<T> list = <error descr="Inconvertible types; cannot cast 'java.util.List<java.lang.Object>' to 'java.util.List<T>'">(List<T>) other</error>;
}
}