Fix inline class recursion through type parameters

Note that inline class such as
  inline class Id<T>(val x: T)
is prohibited in 1.3.0.
This commit is contained in:
Dmitry Petrov
2018-09-18 17:31:44 +03:00
parent 66b5dd92d9
commit 7ff72e9d90
3 changed files with 46 additions and 11 deletions
@@ -13,4 +13,9 @@ inline class TestNullable(val x: <!INLINE_CLASS_CANNOT_BE_RECURSIVE!>TestNullabl
inline class TestRecursionInTypeArguments(val x: List<TestRecursionInTypeArguments>)
inline class TestRecursionInArray(val x: Array<TestRecursionInArray>)
inline class TestRecursionInArray(val x: Array<TestRecursionInArray>)
inline class TestRecursionInUpperBounds<T : TestRecursionInUpperBounds<T>>(val x: <!INLINE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE!>T<!>)
inline class Id<T>(val x: <!INLINE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE!>T<!>)
inline class TestRecursionThroughId(val x: Id<TestRecursionThroughId>)
@@ -1,5 +1,13 @@
package
public final inline class Id</*0*/ T> {
public constructor Id</*0*/ T>(/*0*/ x: T)
public final val x: T
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class Test1 {
public constructor Test1(/*0*/ x: Test1)
public final val x: Test1
@@ -71,3 +79,19 @@ public final inline class TestRecursionInTypeArguments {
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class TestRecursionInUpperBounds</*0*/ T : TestRecursionInUpperBounds<T>> {
public constructor TestRecursionInUpperBounds</*0*/ T : TestRecursionInUpperBounds<T>>(/*0*/ x: T)
public final val x: T
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}
public final inline class TestRecursionThroughId {
public constructor TestRecursionThroughId(/*0*/ x: Id<TestRecursionThroughId>)
public final val x: Id<TestRecursionThroughId>
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
}