JVM IR: Ignore class type parameters if function is static

Otherwise, it leads to type parameters duplication in case of
suspendImpls, since they inherit type parameters from containing class.

 #KT-56407: Fixed
This commit is contained in:
Ilmir Usmanov
2023-02-06 17:56:19 +01:00
committed by Space Team
parent c7bc439661
commit e42efe1ee6
15 changed files with 285 additions and 0 deletions
@@ -192,6 +192,10 @@ val IrClass.typeConstructorParameters: Sequence<IrTypeParameter>
// Ideally this should be fixed in FE.
null
}
current is IrSimpleFunction && current.isStatic -> {
// Static functions don't capture type parameters.
null
}
current.isAnonymousObject -> {
// Anonymous classes don't capture type parameters.
null