new inference: check also variable instantiation for primitive wrappers (IDEA-127752)

This commit is contained in:
Anna Kozlova
2014-07-23 19:19:13 +02:00
parent 24be503eb2
commit 502a3e9a65
3 changed files with 20 additions and 1 deletions
@@ -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) {
@@ -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);
}
}
@@ -192,6 +192,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
doTest();
}
public void testPrimitiveWrapperConditionInReturnConstraint() throws Exception {
doTest();
}
private void doTest() throws Exception {
doTest(false);
}