mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: already resolved vars can't have bounds problems (IDEA-149740)
This commit is contained in:
+1
@@ -975,6 +975,7 @@ public class InferenceSession {
|
||||
private boolean hasBoundProblems(final List<InferenceVariable> typeParams,
|
||||
final PsiSubstitutor substitutor) {
|
||||
for (InferenceVariable typeParameter : typeParams) {
|
||||
if (typeParameter.getInstantiation() != PsiType.NULL) continue;
|
||||
final List<PsiType> extendsTypes = typeParameter.getBounds(InferenceBound.UPPER);
|
||||
final PsiType[] bounds = extendsTypes.toArray(new PsiType[extendsTypes.size()]);
|
||||
if (GenericsUtil.findTypeParameterBoundError(typeParameter, bounds, substitutor, myContext, true) != null) {
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import java.util.Map;
|
||||
|
||||
interface RawEntity<T> {}
|
||||
interface AoContributor extends RawEntity<Integer> {}
|
||||
class Test {
|
||||
void foo(Map<String, AoContributor> contributors) {
|
||||
AoContributor c = contributors.computeIfAbsent("", email -> create(AoContributor.class, of("clmn", email)));
|
||||
}
|
||||
|
||||
static <T extends RawEntity<K>, K> T create(Class<T> c, Map<String, Object> v2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
static <K1, V1> Map<K1, V1> of(K1 k1, V1 v1) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+4
@@ -260,6 +260,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testResolveOrderShouldTakeIntoAccountDependenciesOfAlreadyResolvedVars() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user