mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
inline functional expression: surround with parenthesis if inlined in method reference qualifier (IDEA-152600)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
class Test {
|
||||
interface Task {
|
||||
void doit();
|
||||
}
|
||||
|
||||
class SuperClient {
|
||||
public static void main(String[] args) {
|
||||
Task t = () -> System.out.println("hello");
|
||||
Runnable r = <caret>t::doit;
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
interface Task {
|
||||
void doit();
|
||||
}
|
||||
|
||||
class SuperClient {
|
||||
public static void main(String[] args) {
|
||||
Runnable r = ((Task) () -> System.out.println("hello"))::doit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,6 +248,10 @@ public class InlineLocalTest extends LightCodeInsightTestCase {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testParenthesisAroundInlinedLambda() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
public void testArrayAccessPriority() throws Exception {
|
||||
doTest(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user