erasure method call type if unchecked assignment was applied during applicability check (IDEA-67862)

(cherry picked from commit f106f813559768f90952caac6a2eec4cfeed7103)
This commit is contained in:
Anna Kozlova
2014-10-17 21:07:43 +02:00
parent 763ba4e270
commit 9fce6c0640
3 changed files with 49 additions and 3 deletions
@@ -0,0 +1,22 @@
import java.util.Collection;
import java.util.List;
class Main1 {
static <T> Collection<Collection<T>> foo(Collection<Collection<T>> x) { return x; }
public static void main(String[] args) {
List x = null;
foo(x).iterator().next().<error descr="Cannot resolve method 'iterator()'">iterator</error>();
}
}
class Main {
static <T> List<String> foo(Collection<String> x) { return null; }
public static void main(String[] args) {
List x = null;
<error descr="Incompatible types. Found: 'java.lang.Object', required: 'java.lang.String'">String s = foo(x).get(0);</error>
foo(x).iterator().next().<error descr="Cannot resolve method 'toLowerCase()'">toLowerCase</error>();
}
}