Minor. Add tests and comment about copying generic parameters to

constructor, but not function reference to the constructor.

 #KT-32162
This commit is contained in:
Ilmir Usmanov
2022-01-31 06:21:59 +01:00
parent 84ccf412cb
commit 00a08fc6a4
16 changed files with 364 additions and 0 deletions
@@ -302,6 +302,9 @@ private class JvmInlineClassLowering(private val context: JvmBackendContext) : F
val replacement = context.inlineClassReplacements.getReplacementFunction(function)
?: return super.visitFunctionReference(expression)
// In case of callable reference to inline class constructor,
// type parameters of the replacement include class's type parameters,
// however, expression does not. Thus, we should not include them either.
return IrFunctionReferenceImpl(
expression.startOffset, expression.endOffset, expression.type,
replacement.symbol, function.typeParameters.size,