Inline Variable: Parenthesize arguments of the form "e1 < e2" if the next argument has the form "e1 > e2"

#KT-8261 Fixed
This commit is contained in:
Alexey Sedunov
2015-12-04 16:37:05 +03:00
parent b2bdb8ed02
commit 5c88a1c63e
5 changed files with 47 additions and 18 deletions
@@ -0,0 +1,4 @@
fun f(a : (Any, Any) -> Unit, b : Int, c : Int, d : Int, e : Int, f : Int) {
val <caret>g = b < c
a(g, d > (e + f))
}
@@ -0,0 +1,3 @@
fun f(a : (Any, Any) -> Unit, b : Int, c : Int, d : Int, e : Int, f : Int) {
a((b < c), d > (e + f))
}
@@ -59,6 +59,12 @@ public class InlineTestGenerated extends AbstractInlineTest {
doTest(fileName);
}
@TestMetadata("lessAndGreaterInCallArgs.kt")
public void testLessAndGreaterInCallArgs() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/lessAndGreaterInCallArgs.kt");
doTest(fileName);
}
@TestMetadata("MethodReference.kt")
public void testMethodReference() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/inline/MethodReference.kt");