Substitute type arguments to return type of inlined function references

Such substitution is crucial on codegen stage if the return type is
reified (e.g. for `Array`)

^KT-59507: Fixed
^KT-59281: Fixed
This commit is contained in:
vladislav.grechko
2023-06-19 20:56:31 +02:00
committed by Space Team
parent f5a00c788a
commit e5763a692f
19 changed files with 113 additions and 4 deletions
@@ -111,6 +111,12 @@ val IrType.classFqName: FqName?
val IrTypeArgument.typeOrNull: IrType? get() = (this as? IrTypeProjection)?.type
val IrTypeArgument.typeOrFail: IrType
get() {
require(this is IrTypeProjection) { "Type argument should be of type `IrTypeProjection`, but was `${this::class}` instead" }
return this.type
}
fun IrType.makeNotNull() = withNullability(false)
fun IrType.makeNullable() = withNullability(true)