Do not enhance star projections for bounds of raw types

We have an invariant that their lower bound is always
SomeType<Any?> and their upper bound is SomeType<*>.
Ehancing the latter to SomeType<out Any> making
lower bound not being a subtype of upper bound that breaks contract
for flexible types (fails with exception)
This commit is contained in:
Denis Zharkov
2019-08-21 18:12:22 +03:00
committed by Victor Petukhov
parent 16b4a2c465
commit 6661814e40
3 changed files with 20 additions and 10 deletions
@@ -13,7 +13,7 @@ public open class B {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@jspecify.annotations.DefaultNotNull public open fun noBoundsNotNull(/*0*/ a: A<out @jspecify.annotations.NotNull kotlin.Any, out @jspecify.annotations.Nullable kotlin.Any, out @codeanalysis.annotations.NullnessUnknown kotlin.Any>): kotlin.Unit
@jspecify.annotations.DefaultNotNull public open fun noBoundsNotNull(/*0*/ a: A<out @jspecify.annotations.NotNull kotlin.Any, out @jspecify.annotations.Nullable kotlin.Any, out @jspecify.annotations.NullnessUnknown kotlin.Any>): kotlin.Unit
@jspecify.annotations.DefaultNullable public open fun noBoundsNullable(/*0*/ a: A<out @jspecify.annotations.NotNull kotlin.Any, *, *>?): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -2,9 +2,9 @@ package test
public open class A {
public constructor A()
public open fun bar(/*0*/ l: test.L<*, kotlin.Int>): kotlin.Unit
public open fun bar(/*0*/ l: test.L<out kotlin.collections.(Mutable)Map<kotlin.String!, *>, kotlin.Int>): kotlin.Unit
public open fun baz1(): test.L<kotlin.collections.(Mutable)Map<kotlin.String, kotlin.Int>, @spr.Nullable kotlin.Int?>
public open fun baz2(): test.L<*, kotlin.Int>
public open fun baz2(): test.L<out kotlin.collections.(Mutable)Map<kotlin.String!, *>, kotlin.Int>
public open fun baz3(): test.L<out kotlin.collections.(Mutable)Map<kotlin.String, kotlin.Int>, kotlin.Int>
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun foo(/*0*/ l: test.L<kotlin.collections.(Mutable)Map<kotlin.String, kotlin.Int>, @spr.Nullable kotlin.Int?>): kotlin.Unit
@@ -48,9 +48,9 @@ package test {
public open class A {
public constructor A()
public open fun bar(/*0*/ l: test.L<*, kotlin.Int>): kotlin.Unit
public open fun bar(/*0*/ l: test.L<out kotlin.collections.(Mutable)Map<kotlin.String!, *>, kotlin.Int>): kotlin.Unit
public open fun baz1(): test.L<kotlin.collections.(Mutable)Map<kotlin.String, kotlin.Int>, @spr.Nullable kotlin.Int?>
public open fun baz2(): test.L<*, kotlin.Int>
public open fun baz2(): test.L<out kotlin.collections.(Mutable)Map<kotlin.String!, *>, kotlin.Int>
public open fun baz3(): test.L<out kotlin.collections.(Mutable)Map<kotlin.String, kotlin.Int>, kotlin.Int>
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun foo(/*0*/ l: test.L<kotlin.collections.(Mutable)Map<kotlin.String, kotlin.Int>, @spr.Nullable kotlin.Int?>): kotlin.Unit