Nullability of error types is not known

#KT-6829 Fixed
This commit is contained in:
Andrey Breslav
2015-02-20 15:05:15 +03:00
parent f3919db592
commit d70d2ca146
4 changed files with 39 additions and 2 deletions
@@ -0,0 +1,27 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-6829 False warning on map to @Nullable
// FILE: p/J.java
package p;
import org.jetbrains.annotations.*;
public class J {
@Nullable
public String method() { return ""; }
}
// FILE: k.kt
import p.*
fun foo(collection: Collection<J>) {
val mapped = collection.map { it.method() }
<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>mapped[0]<!>.length()
}
public fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R> {
null!!
}
@@ -0,0 +1,4 @@
package
internal fun foo(/*0*/ collection: kotlin.Collection<p.J>): kotlin.Unit
public fun </*0*/ T, /*1*/ R> kotlin.Iterable<T>.map(/*0*/ transform: (T) -> R): kotlin.List<R>