False positive removed in replace single line let intention #KT-14791 Fixed
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun withAssign(arg: String?): String {
|
||||
var result: String = ""
|
||||
arg?.let<caret> { result = it }
|
||||
return result
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun isAlphaOrBeta(str: String) = str.let<caret> { it == "Alpha" || it == "Beta" }
|
||||
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun plusNullable(arg: String?) = arg?.let<caret> { it + "#" } ?: ""
|
||||
@@ -0,0 +1,15 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
|
||||
interface A
|
||||
|
||||
interface B : A {
|
||||
val bar: Any?
|
||||
}
|
||||
|
||||
class Foo {
|
||||
private val a: A = object : A {}
|
||||
|
||||
val isB: Boolean
|
||||
get() = a.let<caret> { it is B && it.bar != null }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
|
||||
interface Base
|
||||
|
||||
class A : Base
|
||||
class B : Base
|
||||
|
||||
fun isAB(arg: Base) = arg.let<caret> { it is A || it is B }
|
||||
Reference in New Issue
Block a user