KT-14191 FormattingModelInconsistencyException Exception on applying intention Replace with count()
#KT-14191 Fixed
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterNotNull().count()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().count()'"
|
||||
fun f11(list: List<Any?>): Int{
|
||||
var objs = 0
|
||||
<caret>for (d in list) {
|
||||
if (d != null) {
|
||||
objs++
|
||||
}
|
||||
}
|
||||
return objs
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterNotNull().count()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().count()'"
|
||||
fun f11(list: List<Any?>): Int{
|
||||
val <caret>objs = list
|
||||
.filterNotNull()
|
||||
.count()
|
||||
return objs
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterNotNull().count()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().count()'"
|
||||
fun f11(list: List<Any?>): Int{
|
||||
val <caret>objs = list
|
||||
.asSequence()
|
||||
.filterNotNull()
|
||||
.count()
|
||||
return objs
|
||||
}
|
||||
Reference in New Issue
Block a user