Quick fix an infinite recursion with '*' under -Xobjc-generics

This commit is contained in:
Svyatoslav Scherbina
2020-01-22 11:33:27 +03:00
committed by SvyatoslavScherbina
parent 55452eab4d
commit 4787be95f5
2 changed files with 10 additions and 2 deletions
@@ -816,7 +816,11 @@ internal class ObjCExportTranslatorImpl(
} else {
val typeArgs = if (objcGenerics) {
kotlinType.arguments.map { typeProjection ->
mapReferenceTypeIgnoringNullability(typeProjection.type, objCExportScope)
if (typeProjection.isStarProjection) {
ObjCIdType // TODO: use Kotlin upper bound.
} else {
mapReferenceTypeIgnoringNullability(typeProjection.type, objCExportScope)
}
}
} else {
emptyList()
@@ -189,4 +189,8 @@ class SelfRef : GenBasic<SelfRef>()
open class GenBasic<T>()
//Extensions
fun <T:Any> GenNonNull<T>.foo(): T = arg
fun <T:Any> GenNonNull<T>.foo(): T = arg
class StarProjectionInfiniteRecursion<T : StarProjectionInfiniteRecursion<T>>
fun testStarProjectionInfiniteRecursion(x: StarProjectionInfiniteRecursion<*>) {}