Substitute all generic types into function trap IDs and signatures, and ensure the subbed types are never primitive

The solution for ensuring they are primitive (making the range of the substitution always nullable) will need replacing once we export Kotlin types.
This commit is contained in:
Chris Smowton
2022-01-13 14:24:48 +00:00
committed by Ian Lynagh
parent 3365f3972e
commit f4314c1f3d
3 changed files with 26 additions and 5 deletions

View File

@@ -203,7 +203,7 @@ open class KotlinFileExtractor(
when (argsIncludingOuterClasses) {
null -> { x: IrType, _: TypeContext, _: IrPluginContext -> x.toRawType() }
else -> {
getTypeParametersInScope(c).map({ it.symbol }).zip(argsIncludingOuterClasses).toMap().let {
makeTypeGenericSubstitutionMap(c, argsIncludingOuterClasses).let {
{ x: IrType, useContext: TypeContext, pluginContext: IrPluginContext ->
x.substituteTypeAndArguments(
it,