Support JvmSuppressWildcards and JvmWildcard annotations

#KT-9898 Fixed
This commit is contained in:
Denis Zharkov
2015-11-27 11:49:36 +03:00
parent 6292833a69
commit ddb67d6c9c
14 changed files with 279 additions and 5 deletions
@@ -0,0 +1,27 @@
class Out<out T>
class In<in R>
open class Open
@JvmSuppressWildcards(true)
fun deepOpen(x: Out<Out<Out<Open>>>) {}
// method: OnFunctionKt::deepOpen
// generic signature: (LOut<LOut<LOut<LOpen;>;>;>;)V
interface A<T> {
@JvmSuppressWildcards(true)
fun foo(): Out<T>
}
// method: A::foo
// generic signature: ()LOut<TT;>;
interface B {
@JvmSuppressWildcards(true)
fun foo(): In<Open>
}
// method: B::foo
// generic signature: ()LIn<LOpen;>;
@JvmSuppressWildcards(false)
fun bar(): Out<Open> = null!!
// method: OnFunctionKt::bar
// generic signature: ()LOut<+LOpen;>;
@@ -0,0 +1,22 @@
class OutPair<out T, out E>
class Out<out F>
class In<in H>
class X
fun simpleOut(x: Out<@JvmWildcard X>) {}
// method: OnTypesKt::simpleOut
// generic signature: (LOut<+LX;>;)V
fun simpleIn(x: In<@JvmWildcard Any?>) {}
// method: OnTypesKt::simpleIn
// generic signature: (LIn<-Ljava/lang/Object;>;)V
fun falseTrueFalse(): @JvmSuppressWildcards(false) OutPair<X, @JvmSuppressWildcards OutPair<Out<X>, Out<@JvmSuppressWildcards(false) X>>> = null!!
// method: OnTypesKt::falseTrueFalse
// generic signature: ()LOutPair<+LX;LOutPair<LOut<LX;>;LOut<+LX;>;>;>;
open class Open
fun combination(): @JvmSuppressWildcards OutPair< Open, @JvmWildcard OutPair<Open, @JvmWildcard Out<Open>>> = null!!
// method: OnTypesKt::combination
// generic signature: ()LOutPair<LOpen;+LOutPair<LOpen;+LOut<LOpen;>;>;>;
@@ -0,0 +1,12 @@
class Out<out T>
class In<in E>
@JvmSuppressWildcards(false)
fun foo(x: Boolean, y: Out<Int>): Int = 1
// method: PrimitiveTypesKt::foo
// generic signature: (ZLOut<+Ljava/lang/Integer;>;)I
@JvmSuppressWildcards(true)
fun bar(x: Boolean, y: In<Long>, z: @JvmSuppressWildcards(false) Long): Int = 1
// method: PrimitiveTypesKt::bar
// generic signature: (ZLIn<Ljava/lang/Long;>;J)I