mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
new inference: ignore additional constraints when performed for overload resolution (IDEA-127928)
This commit is contained in:
@@ -220,7 +220,7 @@ public class InferenceSession {
|
||||
return prepareSubstitution();
|
||||
}
|
||||
|
||||
if (parameters != null && args != null) {
|
||||
if (parameters != null && args != null && !MethodCandidateInfo.isOverloadCheck()) {
|
||||
final Set<ConstraintFormula> additionalConstraints = new HashSet<ConstraintFormula>();
|
||||
if (parameters.length > 0) {
|
||||
collectAdditionalConstraints(parameters, args, properties.getMethod(), PsiSubstitutor.EMPTY, additionalConstraints, properties.isVarargs(), true);
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
class CastLambdaParameter {
|
||||
|
||||
void main(final Map<Integer, String> map) {
|
||||
Set<Function<Object, String>> property2formatter = foo(bar((joint) -> map.get((Integer)joint)));
|
||||
}
|
||||
|
||||
public static <B> Set<B> foo(List<B> property2name) {return property2name != null ? null : null;}
|
||||
public static <B> Set<B> foo(List<B>... property2name) {return property2name != null ? null : null;}
|
||||
public static <B> Set<B> foo(Set<B> property2name) {return property2name != null ? null : null;}
|
||||
|
||||
public static <TB> List<TB> bar(TB b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -208,6 +208,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA127928() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user