Add additional type arguments to stack from super types
This commit is contained in:
committed by
TeamCityServer
parent
a9d686b9f9
commit
903e883809
@@ -253,7 +253,7 @@ class IrInterpreter(private val irBuiltIns: IrBuiltIns, private val bodyMap: Map
|
||||
val valueParametersSymbols = receiverAsFirstArgument + irFunction.valueParameters.map { it.symbol }
|
||||
|
||||
val valueArguments = (0 until expression.valueArgumentsCount).map { expression.getValueArgument(it) }
|
||||
val defaultValues = expression.symbol.owner.valueParameters.map { it.defaultValue?.expression }
|
||||
val defaultValues = irFunction.valueParameters.map { it.defaultValue?.expression }
|
||||
|
||||
return stack.newFrame(asSubFrame = true, initPool = pool) {
|
||||
for (i in valueArguments.indices) {
|
||||
|
||||
@@ -181,6 +181,16 @@ internal fun getTypeArguments(
|
||||
?.let { typeArguments.add(Variable(it.symbol, expression.type.getState())) }
|
||||
}
|
||||
|
||||
fun IrSimpleType.getArgumentsRecursive() {
|
||||
val typeParameters = this.classOrNull?.owner?.typeParameters ?: return
|
||||
typeParameters.zip(this.arguments).forEach {
|
||||
it.second.typeOrNull?.classOrNull?.owner?.let { owner -> typeArguments.add(Variable(it.first.symbol, Common(owner))) }
|
||||
}
|
||||
this.classOrNull!!.superTypes().forEach { (it as? IrSimpleType)?.getArgumentsRecursive() }
|
||||
}
|
||||
|
||||
(container as? IrClass)?.superTypes?.forEach { (it as? IrSimpleType)?.getArgumentsRecursive() }
|
||||
|
||||
return typeArguments
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user