mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
new inference: cls copy replacement
This commit is contained in:
+4
-2
@@ -384,7 +384,7 @@ public class InferenceSession {
|
||||
PsiTypeParameter[] copy = new PsiTypeParameter[typeParameters.length];
|
||||
for (int i = 0; i < typeParameters.length; i++) {
|
||||
PsiTypeParameter typeParameter = typeParameters[i];
|
||||
copy[i] = (PsiTypeParameter)typeParameter.copy();
|
||||
copy[i] = elementFactory.createTypeParameterFromText(typeParameter.getName(), null);
|
||||
initBounds(copy[i]);
|
||||
subst = subst.put(typeParameter, elementFactory.createType(copy[i]));
|
||||
}
|
||||
@@ -691,8 +691,10 @@ public class InferenceSession {
|
||||
}
|
||||
}
|
||||
|
||||
final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(getManager().getProject());
|
||||
for (InferenceVariable var : vars) {
|
||||
final PsiTypeParameter copy = (PsiTypeParameter)var.getParameter().copy();
|
||||
final PsiTypeParameter parameter = var.getParameter();
|
||||
final PsiTypeParameter copy = elementFactory.createTypeParameterFromText(parameter.getName(), null);
|
||||
final PsiType lub = getLowerBound(var, substitutor);
|
||||
final PsiType glb = getUpperBound(var, substitutor);
|
||||
final InferenceVariable zVariable = new InferenceVariable(copy);
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collector;
|
||||
|
||||
|
||||
public class Bug {
|
||||
|
||||
|
||||
{
|
||||
Collector<String, ?, Map<String, Long>> stringTreeMapCollector = groupingBy(counting());
|
||||
}
|
||||
|
||||
public static <T, D, M extends Map<String, D>> Collector<T, ?, M> groupingBy(Collector<? super T, ?, Long> downstream) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <Tc> Collector<Tc, ?, Long> counting() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+5
-1
@@ -88,7 +88,11 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void _testCapturedReturnTypes() throws Exception {//todo waiting for capture incorporation
|
||||
public void _testCapturedReturnTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testClsCapturedReturnTypes() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user