FIR: relax simple type requirement in AbstractTypeMapper

The counterparts in old FE don't have such restriction, so it can
map a type that has a flexible type as a type argument to JVM type,
e.g., Stream<String..String?>
This commit is contained in:
Jinseong Jeon
2021-06-07 23:16:47 -07:00
committed by TeamCityServer
parent 08e486d1a7
commit 4ec745abd7
5 changed files with 21 additions and 23 deletions
@@ -133,8 +133,8 @@ class IrTypeMapper(private val context: JvmBackendContext) : KotlinTypeMapperBas
sw: JvmSignatureWriter? = null
): Type = AbstractTypeMapper.mapType(this, type, mode, sw)
override fun JvmSignatureWriter.writeGenericType(type: SimpleTypeMarker, asmType: Type, mode: TypeMappingMode) {
require(type is IrSimpleType)
override fun JvmSignatureWriter.writeGenericType(type: KotlinTypeMarker, asmType: Type, mode: TypeMappingMode) {
if (type !is IrSimpleType) return
if (skipGenericSignature() || hasNothingInNonContravariantPosition(type) || type.arguments.isEmpty() || type.isRawTypeImpl()) {
writeAsmType(asmType)
return