KT-4568 Bug Fix: Refactored the convertNegatedExpressionWithDemorgansLaw intention to better handle longer and more complex expressions. Fixed bug and added appropriate test cases as well.

This commit is contained in:
Ross Hanson
2014-04-16 21:09:26 -04:00
committed by Mikhael Bogdanov
parent de273c0418
commit 4de6960443
6 changed files with 70 additions and 30 deletions
@@ -0,0 +1,3 @@
fun foo(a: Boolean, c: Int, d: Int) : Boolean {
return !(a <caret>&& c == d)
}
@@ -0,0 +1,3 @@
fun foo(a: Boolean, c: Int, d: Int) : Boolean {
return !a || !(c == d)
}
@@ -0,0 +1,3 @@
fun foo(a: Int, b: Int, c: Int, d: Int) : Boolean {
return !(a < b && c ==<caret> d && a < d)
}
@@ -0,0 +1,3 @@
fun foo(a: Int, b: Int, c: Int, d: Int) : Boolean {
return !(a < b) || !(c == d) || !(a < d)
}