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
@@ -4,7 +4,7 @@ public interface TypeParamOfClass {
public interface Sub</*0*/ T : kotlin.Any!> : test.TypeParamOfClass.Super<T!> {
public abstract override /*1*/ /*fake_override*/ fun dummy(): kotlin.Unit
public abstract override /*1*/ fun foo(): T!
public abstract override /*1*/ fun foo(): T
}
public interface Super</*0*/ T : kotlin.Any!> {
@@ -4,7 +4,7 @@ public interface TypeParamOfClassSubstituted {
public interface Sub : test.TypeParamOfClassSubstituted.Super<kotlin.String!> {
public abstract override /*1*/ /*fake_override*/ fun dummy(): kotlin.Unit
public abstract override /*1*/ fun foo(): kotlin.String!
public abstract override /*1*/ fun foo(): kotlin.String
}
public interface Super</*0*/ T : kotlin.Any!> {