Remove Parentheses: Forbid on call inside a call without argument list
#KT-18699 Fixed
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun parenPB(p: (() -> Unit) -> Unit): (() -> Unit) -> Unit = p
|
||||
|
||||
fun somethingNext(p: (() -> Unit) -> Unit) {
|
||||
<caret>(parenPB (p)) {}
|
||||
}
|
||||
+1
-1
@@ -11,5 +11,5 @@ fun some2(p1: () -> Unit, p2: (() -> Unit) -> Unit) {
|
||||
parenP()
|
||||
parenBP { p1 }()
|
||||
parenPP()()
|
||||
parenPB(p2) {}
|
||||
(parenPB(p2)) {}
|
||||
}
|
||||
@@ -13439,6 +13439,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/removeUnnecessaryParentheses"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("callInsideCallWithLambdaOnly.kt")
|
||||
public void testCallInsideCallWithLambdaOnly() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/removeUnnecessaryParentheses/callInsideCallWithLambdaOnly.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("necessaryParentheses1.kt")
|
||||
public void testNecessaryParentheses1() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses1.kt");
|
||||
|
||||
Reference in New Issue
Block a user