RmoveUnnecessaryParenthesesIntention

This commit is contained in:
Wojciech Lopata
2013-04-04 13:36:33 +02:00
parent 3e76fc2902
commit cd0e1b7508
32 changed files with 299 additions and 5 deletions
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
fun foo(x: Int, y: Int) {
x + <caret>(x + y)
}
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
fun foo() : Any {
return <caret>(@a{})
}
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
fun foo(x: Int) : Any {
return <caret>(x as Int) < 42
}
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
fun foo(x: Int) {
+<caret>(+x)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
trait Foo {
fun get(x : Any) : Foo
fun plus(x : Any) : Foo
}
fun foo(x: Foo) {
<caret>(x + x)[x]
}
@@ -0,0 +1,3 @@
fun foo(x: Int) {
<caret>(x * x / x) + x
}
@@ -0,0 +1,3 @@
fun foo(x: Int) {
x * x / x + x
}
@@ -0,0 +1,3 @@
fun foo(x: Int) : Int {
return <caret>(x)
}
@@ -0,0 +1,3 @@
fun foo(x: Int) : Int {
return <caret>x
}
@@ -0,0 +1,6 @@
trait Foo {
fun get(x : Any) : Foo
}
fun foo(x: Foo) {
<caret>(x[x])[x]
}
@@ -0,0 +1,6 @@
trait Foo {
fun get(x : Any) : Foo
}
fun foo(x: Foo) {
x[x][x]
}
@@ -0,0 +1,7 @@
trait Foo {
fun inc() : Foo
fun not() : Foo
}
fun foo(x: Foo) {
!(<caret>x.inc())
}
@@ -0,0 +1,7 @@
trait Foo {
fun inc() : Foo
fun not() : Foo
}
fun foo(x: Foo) {
!x.inc()
}
@@ -0,0 +1,3 @@
fun foo(x: Boolean) : Boolean {
return x || (x || x<caret>)
}
@@ -0,0 +1,3 @@
fun foo(x: Boolean) : Boolean {
return x || x || x
}
@@ -0,0 +1,3 @@
fun foo(x: Boolean) : Boolean {
return x && (x && x<caret>)
}
@@ -0,0 +1,3 @@
fun foo(x: Boolean) : Boolean {
return x && x && x
}
@@ -0,0 +1,3 @@
fun foo(i: Int) {
array(42)[(i + i<caret>)]
}
@@ -0,0 +1,3 @@
fun foo(i: Int) {
array(42)[i + i]
}