new inference: cls copy replacement

This commit is contained in:
Anna Kozlova
2014-02-19 09:46:10 +01:00
parent 4ba1e5f0ab
commit 15740a3cff
3 changed files with 30 additions and 3 deletions
@@ -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);
@@ -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;
}
}
@@ -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();
}