mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
new inference: ensure erased target type if substitutor was raw (IDEA-143183)
This commit is contained in:
@@ -710,7 +710,9 @@ public class InferenceSession {
|
||||
}
|
||||
final int i = ArrayUtilRt.find(args, arg);
|
||||
if (i < 0) return null;
|
||||
return getParameterType(parameters, i, substitutor, varargs);
|
||||
final PsiType parameterType = getParameterType(parameters, i, substitutor, varargs);
|
||||
final boolean isRaw = substitutor != null && PsiUtil.isRawSubstitutor((PsiMethod)parentMethod, substitutor);
|
||||
return isRaw ? TypeConversionUtil.erasure(parameterType) : parameterType;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import java.util.Collection;
|
||||
|
||||
class Test {
|
||||
Expression expression;
|
||||
|
||||
void foo() {
|
||||
expression.in(parameter(Collection.class));
|
||||
}
|
||||
|
||||
<T> Expression<T> parameter(Class<T> paramClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
interface Expression<T> {
|
||||
Expression in(Expression<Collection<?>> values);
|
||||
}
|
||||
}
|
||||
@@ -283,6 +283,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testOuterMethodCallOnRawType() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user