mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
inference: substitution for captures (IDEA-186844)
This commit is contained in:
@@ -65,7 +65,7 @@ class InitialInferenceState {
|
||||
final PsiType substitute = topInferenceSubstitutor.substitute(parameters[i]);
|
||||
newParameters[i] = (InferenceVariable)PsiUtil.resolveClassInClassTypeOnly(substitute);
|
||||
}
|
||||
myCaptures.add(Pair.create(newParameters, (PsiClassType)subst.substitute(capture.second)));
|
||||
myCaptures.add(Pair.create(newParameters, (PsiClassType)topInferenceSubstitutor.substitute(subst.substitute(capture.second))));
|
||||
}
|
||||
myInferenceSessionContainer = inferenceSessionContainer;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class ExceptionStream {
|
||||
|
||||
void foo(Supplier<Stream<String>> mapper) {
|
||||
bar(flatMap (transform(mapper)));
|
||||
}
|
||||
|
||||
<R> Stream<R> flatMap(Supplier<? extends Stream<R>> mapper) {
|
||||
return null;
|
||||
}
|
||||
|
||||
void bar(Stream<String> s) {}
|
||||
|
||||
<T> Supplier<? extends T> transform(Supplier<T> function) {
|
||||
return function;
|
||||
}
|
||||
}
|
||||
@@ -182,6 +182,7 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
|
||||
public void testRecursiveTypeWithCapture() { doTest(); }
|
||||
public void testFreshVariablesDuringApplicabilityCheck() { doTest(); }
|
||||
public void testPostponeConditionalExpressionErrorToMethodLevel() { doTest(); }
|
||||
public void testNestedCallsWithFreshVariables() { doTest(); }
|
||||
|
||||
public void testPertinentToApplicabilityCheckForBlockLambda() { doTest(); }
|
||||
public void testCheckGlbConflictsAfterIntersectionTypeCreated() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user