check context for functional expressions once (IDEA-159362)

This commit is contained in:
Anna Kozlova
2016-08-08 07:39:04 +02:00
parent ccf3beba42
commit 8ac15c13de
3 changed files with 18 additions and 10 deletions

View File

@@ -1,6 +1,10 @@
public class Test {
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
class Test {
{
if (<error descr="Method reference expression is not expected here">Test::length instanceof String</error>) {
if (<error descr="Method reference expression is not expected here">Test::length</error> instanceof String) {
}
bar(Test::length);
}
@@ -14,4 +18,10 @@ public class Test {
interface Bar {
Integer _(String s);
}
void f() throws IOException {
try (BufferedReader reader = new BufferedReader(new FileReader(""))) {
for (String line : <error descr="Method reference expression is not expected here">reader::lines</error>) {}
}
}
}