Introduce not null type parameter capability

Java nullability annotations may generate types that currently are not denotable in Kotlin:
class Java {
  void <F> foo(@NotNull F f) {}
}

Type of given value parameter should be not nullable under any substitution:
String/String?/String! because of annotation contract.

NB: Currently there is no full analogues for such types in pure kotlin
This commit is contained in:
Denis Zharkov
2016-01-25 14:39:26 +03:00
parent 08dd675fcd
commit 11a96ee8c8
26 changed files with 451 additions and 45 deletions
+1 -1
View File
@@ -38,6 +38,6 @@ fun main(a: A<String>, a1: A<String?>) {
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNSAFE_CALL!>.<!>length
a1.baz("")!!.length
a1.baz(null)!!.length
a1.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)!!.length
}