java: single underscore variables highlighting for Java 8

This commit is contained in:
Roman Shevchenko
2013-08-07 15:07:21 +02:00
parent 5435f1c3bf
commit cfc55bcb41
5 changed files with 48 additions and 7 deletions
@@ -0,0 +1,16 @@
class C {
void test() {
{
I <warning descr="Use of '_' as an identifier might not be supported in releases after Java 8">_</warning> = new I() { public void f(int i) { } };
accept(_);
}
{
accept(<error descr="Use of '_' as a lambda parameter name is not allowed">_</error> -> System.out.println(_));
accept((int <error descr="Use of '_' as a lambda parameter name is not allowed">_</error>) -> System.out.println(_));
}
}
interface I { void f(int i); }
void accept(I i) { i.f(42); }
}