Do not show warning about useless elvis for error function types
#KT-17214 Fixed #KT-12112 Fixed
This commit is contained in:
@@ -35,10 +35,14 @@ fun test() {
|
||||
takeNotNull(dependOn(dependOn(x)) <!USELESS_ELVIS!>?: ""<!>)
|
||||
takeNotNull(dependOn(dependOn(x) <!USELESS_CAST!>as? String<!>) ?: "")
|
||||
}
|
||||
|
||||
takeNotNull(bar()!!)
|
||||
}
|
||||
|
||||
inline fun <reified T : Any> reifiedNull(): T? = null
|
||||
|
||||
fun testFrom13648() {
|
||||
takeNotNull(reifiedNull() ?: "")
|
||||
}
|
||||
}
|
||||
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>unresolved<!>
|
||||
@@ -1,5 +1,6 @@
|
||||
package
|
||||
|
||||
public fun bar(): [ERROR : Error function type]
|
||||
public fun </*0*/ T> dependOn(/*0*/ x: T): T
|
||||
public fun </*0*/ T> notNull(): T
|
||||
public fun </*0*/ T> nullable(): T?
|
||||
|
||||
+1
@@ -61,6 +61,7 @@ fun test() {
|
||||
takeNotNull(J.getNAny() ?: J())
|
||||
|
||||
val x = <!UNRESOLVED_REFERENCE!>unresolved<!> ?: null
|
||||
<!UNREACHABLE_CODE!>val y =<!> <!UNRESOLVED_REFERENCE!>unresolved<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>foo<!> ?: return
|
||||
}
|
||||
|
||||
fun takeNotNull(s: J) {}
|
||||
|
||||
Reference in New Issue
Block a user