Do not annotate Kotlin members returning platform types as @Nullable
This leads to pointless warning in Java code
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
public final class PlatformTypes implements kotlin.jvm.internal.KObject {
|
||||
public final java.lang.String simplyPlatform() { /* compiled code */ }
|
||||
|
||||
@org.jetbrains.annotations.Nullable
|
||||
public final java.util.List<java.lang.String> bothNullable() { /* compiled code */ }
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final java.util.List<java.lang.String> bothNotNull() { /* compiled code */ }
|
||||
|
||||
public PlatformTypes() { /* compiled code */ }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// PlatformTypes
|
||||
|
||||
import java.util.Collections
|
||||
|
||||
class PlatformTypes {
|
||||
fun simplyPlatform() = Collections.singletonList("")[0]
|
||||
fun bothNullable() = Collections.emptyList<String>() ?: null
|
||||
fun bothNotNull() = Collections.emptyList<String>()!!
|
||||
}
|
||||
Reference in New Issue
Block a user