/
githubmirror
/
panama-vector
Обзор
Документация
Войти
/
githubmirror
/
panama-vector
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/langtools/tools/javac/lambda/funcInterfaces/LambdaTest1_neg2.java
17 строк
504 B
Erik Joelsson
8187443: Forest Consolidation: Move files to unified layout
12 сен 2017, 20:03
12 сен 2017, 20:03
3789983
Код
Авторство
О чём код?
/* * @test /nodynamiccopyright/ * @bug 8003280 * @summary Add lambda tests * This test is to verify mis-use of accessing "this" from within lambda expression * @compile/fail/ref=LambdaTest1_neg2.out -XDrawDiagnostics LambdaTest1_neg2.java */ public class LambdaTest1_neg2 { static void method() { ((Runnable) ()-> { Object o = this; //use "this" inside lambda expression which is inside a static method, not allowed } ).run(); } }