Add "Control flow with empty body" inspection
#KT-30970 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
d2fcb8cc6a
commit
65f06454be
@@ -0,0 +1,8 @@
|
||||
// PROBLEM: 'else' has empty body
|
||||
// FIX: none
|
||||
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
} <caret>else {
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: 'else' has empty body
|
||||
// FIX: none
|
||||
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
} <caret>else {
|
||||
// comment
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
} <caret>else {
|
||||
foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {}
|
||||
@@ -0,0 +1,6 @@
|
||||
// PROBLEM: 'else' has empty body
|
||||
// FIX: none
|
||||
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {}<caret>else {};
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
} <caret>else foo()
|
||||
}
|
||||
|
||||
fun foo() {}
|
||||
Reference in New Issue
Block a user