KT-11733 Cannot infer type parameter in SAM with nullability annotations

#KT-11733 Fixed
This commit is contained in:
Stanislav Erokhin
2016-04-01 20:55:59 +03:00
parent c6fe1b715d
commit 832f468b13
6 changed files with 68 additions and 1 deletions
@@ -0,0 +1,16 @@
// !CHECK_TYPE
// FILE: Predicate.java
import org.jetbrains.annotations.NotNull
public interface Predicate<T extends CharSequence> {
// Same effect with @Nullable here
boolean invoke(@NotNull T t);
}
// FILE: Main.kt
fun process(<!UNUSED_PARAMETER!>x<!>: Predicate<String>) {}
fun main(args: Array<String>) {
process(Predicate { x -> x checkType { _<String>() }
true
})
}