testdata for IDEA-127215

This commit is contained in:
Anna Kozlova
2015-12-03 19:11:09 +01:00
parent 4768643b60
commit 65194fd5f0
3 changed files with 40 additions and 1 deletions
@@ -256,7 +256,11 @@ public class MethodCandidateInfo extends CandidateInfo{
public PsiSubstitutor getSubstitutor(boolean includeReturnConstraint) {
PsiSubstitutor substitutor = myCalcedSubstitutor;
if (substitutor == null || !includeReturnConstraint && myLanguageLevel.isAtLeast(LanguageLevel.JDK_1_8) || isOverloadCheck()) {
myInferenceError = null;
if (includeReturnConstraint) {
myInferenceError = null;
}
PsiSubstitutor incompleteSubstitutor = super.getSubstitutor();
PsiMethod method = getElement();
if (myTypeArguments == null) {
@@ -0,0 +1,31 @@
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import static java.util.stream.Collectors.toList;
abstract class FooBar<M> {
abstract void collect(List<? extends M> collector);
void foo(FooBar<?> objectStream) {
objectStream. collect(toList( ));
}
static <T> List<T> toList() {
return null;
}
}
class Test {
<T> List<List<Object>> foo(List<T> objects, Function<T, ?>... functions) {
return objects.stream()
.map(object -> Arrays.stream(functions)
.map(fn -> fn.apply(object))
.collect(toList()))
.collect(toList<error descr="'toList()' in 'java.util.stream.Collectors' cannot be applied to '()'">()</error>);
}
}
@@ -240,6 +240,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest();
}
public void testIDEA127215() throws Exception {
doTest();
}
private void doTest() {
doTest(false);
}