[Wasm] NFC refactor: eraseGenerics -> toWasmSignatureType

Use a more concrete name, make it private,
and split out:

 IrSimpleType.toWasmSignatureSimpleType

This does not change the behavior,
but helps to set the stage for the following bugfix
 (KT-58852)
This commit is contained in:
Svyatoslav Kuzmich
2023-12-12 13:35:59 +01:00
committed by Space Team
parent 5fcdd4a9f6
commit b5def88ff4
3 changed files with 18 additions and 18 deletions
@@ -13,13 +13,6 @@ import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.defaultType
fun IrType.eraseGenerics(irBuiltIns: IrBuiltIns): IrType {
if (this is IrDynamicType) return this
if (this is IrErrorType) return this
val defaultType = this.erasedUpperBound?.defaultType ?: irBuiltIns.anyType
if (!this.isNullable()) return defaultType
return defaultType.makeNullable()
}
// Return null if upper bound is Any
private val IrTypeParameter.erasedUpperBound: IrClass?