mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java 6 is free from boxing problem in covariant position
This commit is contained in:
+1
-1
@@ -534,7 +534,7 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
|
||||
if (!(param instanceof PsiClassType)) return null;
|
||||
PsiManager manager = typeParam.getManager();
|
||||
if (arg instanceof PsiPrimitiveType) {
|
||||
if (!JavaVersionService.getInstance().isAtLeast(typeParam, JavaSdkVersion.JDK_1_7)) return null;
|
||||
if (!JavaVersionService.getInstance().isAtLeast(typeParam, JavaSdkVersion.JDK_1_7) && !isContraVariantPosition) return null;
|
||||
arg = ((PsiPrimitiveType)arg).getBoxedType(typeParam);
|
||||
if (arg == null) return null;
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
static class Pair<A, B> {
|
||||
Pair(A a, B b) {
|
||||
}
|
||||
|
||||
static <A, B> Pair<A, B> create(A a, B b) {
|
||||
return new Pair<A, B>(a, b);
|
||||
}
|
||||
}
|
||||
|
||||
public static void getWordsWithOffset(String s, int startInd, final List<Pair<String, Integer>> res) {
|
||||
res.add(Pair.create(s, startInd));
|
||||
}
|
||||
}
|
||||
@@ -198,6 +198,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testRawOnParameterized() throws Exception { doTest(false); }
|
||||
public void testFailedInferenceWithBoxing() throws Exception { doTest(false); }
|
||||
public void testFixedFailedInferenceWithBoxing() throws Exception { doTest17Incompatibility(false); }
|
||||
public void testInferenceWithBoxingCovariant() throws Exception { doTest17Incompatibility(false); }
|
||||
public void testSuperWildcardIsNotWithinItsBound() throws Exception { doTest17Incompatibility(false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user