Generate SuspendFunction marker interface if supertype is suspend

Otherwise, is/as checks will not work.
 #KT-18707
This commit is contained in:
Ilmir Usmanov
2021-04-28 00:01:25 +02:00
committed by TeamCityServer
parent 5d296a01c2
commit cb89bd0e13
6 changed files with 77 additions and 1 deletions
@@ -279,8 +279,12 @@ internal fun IrTypeMapper.mapClassSignature(irClass: IrClass, type: Type): JvmCl
}
sw.writeSuperclassEnd()
val superInterfaces = LinkedHashSet<String>()
val kotlinMarkerInterfaces = LinkedHashSet<String>()
if (irClass.superTypes.any { it.isSuspendFunction() || it.isKSuspendFunction() }) {
kotlinMarkerInterfaces.add("kotlin/coroutines/jvm/internal/SuspendFunction")
}
val superInterfaces = LinkedHashSet<String>()
for (superType in irClass.superTypes) {
val superClass = superType.safeAs<IrSimpleType>()?.classifier?.safeAs<IrClassSymbol>()?.owner ?: continue
if (superClass.isJvmInterface) {