IDEA-97888

This commit is contained in:
anna
2012-12-20 17:10:07 +01:00
parent 1e10fd07c2
commit aa4e002ea2
4 changed files with 26 additions and 2 deletions

View File

@@ -217,7 +217,7 @@ public class PsiMethodCallExpressionImpl extends ExpressionPsiElement implements
if (is15OrHigher) {
final PsiSubstitutor substitutor = result.getSubstitutor();
PsiType substitutedReturnType = substitutor.substitute(ret);
if (substitutedReturnType == null) return TypeConversionUtil.erasure(ret);
if (PsiUtil.isRawSubstitutor(method, substitutor) && ret.equals(substitutedReturnType)) return TypeConversionUtil.erasure(ret);
PsiType lowerBound = PsiType.NULL;
if (substitutedReturnType instanceof PsiCapturedWildcardType) {
lowerBound = ((PsiCapturedWildcardType)substitutedReturnType).getLowerBound();

View File

@@ -1723,7 +1723,7 @@ class SystemClassLoaderAction implements <error descr="Cannot resolve symbol 'Pr
}
c = Class.forName<error descr="'forName(java.lang.String, boolean, java.lang.ClassLoader)' in 'java.lang.Class' cannot be applied to '(java.lang.String, boolean, ClassLoader)'">(cls, true, parent)</error>;
<error descr="Incompatible types. Found: 'java.lang.reflect.Constructor<T>', required: 'Constructor'">ctor = c.getDeclaredConstructor(cp)</error>;
ctor = c.getDeclaredConstructor(cp);
sys = (ClassLoader) ctor.<error descr="Cannot resolve method 'newInstance(java.lang.Object[])'">newInstance</error>(params);
Thread.currentThread().setContextClassLoader<error descr="'setContextClassLoader(java.lang.ClassLoader)' in 'java.lang.Thread' cannot be applied to '(ClassLoader)'">(sys)</error>;
return sys;

View File

@@ -0,0 +1,23 @@
import java.util.*;
import java.io.File;
class Foo {
public Collection<BuildTarget<?>> getDependencies(LayoutElementBuilderService builder, JpsPackagingElement element, TargetOutputIndex outputIndex) {
return builder.getDependencies(element, outputIndex);
}
}
class BuildTarget<R extends BuildRootDescriptor> {}
interface TargetOutputIndex {
Collection<BuildTarget<?>> getTargetsByOutputFile(File file);
}
class BuildRootDescriptor {}
class LayoutElementBuilderService<E extends JpsPackagingElement> {
public Collection<? extends BuildTarget<?>> getDependencies(E element, TargetOutputIndex outputIndex) {
return Collections.emptyList();
}
}
class JpsPackagingElement {}

View File

@@ -207,6 +207,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA97276() throws Exception { doTest17Incompatibility(false); }
public void testWildcardsBoundsIntersection() throws Exception { doTest17Incompatibility(false); }
public void testOverrideWithMoreSpecificReturn() throws Exception { doTest17Incompatibility(false); }
public void testIDEA97888() throws Exception { doTest17Incompatibility(false); }
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));