KT-13521 Warning right part of "expression ?: null" is useless

#KT-13521 Fixed
This commit is contained in:
shiraji
2016-08-22 03:15:12 +09:00
parent a683c2b68d
commit a3f131d6c6
7 changed files with 47 additions and 0 deletions
@@ -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?) {
}
@@ -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?
}