check erased types for method calls on raw exprs (IDEA-97952)

This commit is contained in:
anna
2012-12-27 20:14:17 +01:00
parent c66e1c07b8
commit ea55d12eb3
3 changed files with 41 additions and 0 deletions
@@ -0,0 +1,32 @@
class TestOnRawType {
public static void main(String[] args) {
new FooGenerator().process(TestOnRawType.class);
new FooGenerator().process(AFoo.class);
new FooGenerator().process(MFoo.class);
new FooGenerator<String>().process<error descr="'process(java.lang.Class<TestOnRawType.AFoo>)' in 'TestOnRawType.FooGenerator' cannot be applied to '(java.lang.Class<TestOnRawType>)'">(TestOnRawType.class)</error>;
new FooGenerator<String>().process(AFoo.class);
new FooGenerator<String>().process<error descr="'process(java.lang.Class<TestOnRawType.AFoo>)' in 'TestOnRawType.FooGenerator' cannot be applied to '(java.lang.Class<TestOnRawType.MFoo>)'">(MFoo.class)</error>;
}
static class AFoo {}
static class MFoo extends AFoo {}
static class FooGenerator<T> {
public void process(Class<AFoo> cls) {
}
}
}
class TestNonGenericType {
public static void main(String[] args) {
new FooGenerator().process<error descr="'process(java.lang.Class<TestNonGenericType.AFoo>)' in 'TestNonGenericType.FooGenerator' cannot be applied to '(java.lang.Class<TestNonGenericType>)'">(TestNonGenericType.class)</error>;
new FooGenerator().process(AFoo.class);
new FooGenerator().process<error descr="'process(java.lang.Class<TestNonGenericType.AFoo>)' in 'TestNonGenericType.FooGenerator' cannot be applied to '(java.lang.Class<TestNonGenericType.MFoo>)'">(MFoo.class)</error>;
}
static class AFoo {}
static class MFoo extends AFoo {}
static class FooGenerator {
public void process(Class<AFoo> cls) {
}
}
}
@@ -208,6 +208,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testWildcardsBoundsIntersection() throws Exception { doTest17Incompatibility(false); }
public void testOverrideWithMoreSpecificReturn() throws Exception { doTest17Incompatibility(false); }
public void testIDEA97888() throws Exception { doTest17Incompatibility(false); }
public void testMethodCallParamsOnRawType() throws Exception { doTest(false); }
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));