mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
new inference: check also variable instantiation for primitive wrappers (IDEA-127752)
This commit is contained in:
+1
-1
@@ -446,7 +446,7 @@ public class InferenceSession {
|
||||
}
|
||||
|
||||
private static boolean hasPrimitiveWrapperBound(InferenceVariable inferenceVariable) {
|
||||
final InferenceBound[] boundTypes = {InferenceBound.UPPER, InferenceBound.LOWER};
|
||||
final InferenceBound[] boundTypes = {InferenceBound.UPPER, InferenceBound.LOWER, InferenceBound.EQ};
|
||||
for (InferenceBound inferenceBound : boundTypes) {
|
||||
final List<PsiType> bounds = inferenceVariable.getBounds(inferenceBound);
|
||||
for (PsiType bound : bounds) {
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
class Test {
|
||||
static class TKey<T> {
|
||||
}
|
||||
|
||||
public interface Getter {
|
||||
<T> T getValue(TKey<T> key);
|
||||
}
|
||||
|
||||
static final TKey<Integer> KEY_I = null;
|
||||
|
||||
|
||||
public static void f(Getter getter, TKey<Integer> key) {
|
||||
double d1 = getter.getValue (key);
|
||||
}
|
||||
}
|
||||
+4
@@ -192,6 +192,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testPrimitiveWrapperConditionInReturnConstraint() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user