KT-13521 Warning right part of "expression ?: null" is useless
#KT-13521 Fixed
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
// FILE: J.java
|
||||
|
||||
import org.jetbrains.annotations.*;
|
||||
|
||||
public class J {
|
||||
@Nullable
|
||||
public static J staticN;
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
fun test() {
|
||||
val a = J.staticN <!USELESS_ELVIS_RIGHT_IS_NULL!>?: null<!>
|
||||
foo(a)
|
||||
}
|
||||
|
||||
fun foo(a: Any?) {
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ a: kotlin.Any?): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public open class J {
|
||||
public constructor J()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
@org.jetbrains.annotations.Nullable() public final var staticN: J?
|
||||
}
|
||||
Reference in New Issue
Block a user