Do not annotate Kotlin members returning platform types as @Nullable

This leads to pointless warning in Java code
This commit is contained in:
Andrey Breslav
2014-11-04 10:36:29 +02:00
parent 19afb2fcb8
commit f16dcdd8a9
4 changed files with 36 additions and 0 deletions
@@ -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>()!!
}