mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 15:41:26 +07:00
check erased types for method calls on raw exprs (IDEA-97952)
This commit is contained in:
+32
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user