[FE] Add ability to configure PublicDeclaration type approximation configuration

This configuration allows to choose what to do with local and anonymous types
This commit is contained in:
Dmitriy Novozhilov
2022-11-09 10:33:18 +02:00
committed by Space Team
parent 82c39187f6
commit 32f6b71525
7 changed files with 14 additions and 11 deletions
@@ -114,9 +114,9 @@ private fun ReceiverParameterDescriptor.substituteTopLevelType(newType: KotlinTy
private fun TypeApproximator.approximate(type: UnwrappedType, toSuper: Boolean): KotlinType? {
if (type.arguments.isEmpty() && type.constructor.isDenotable) return null
return if (toSuper)
approximateToSuperType(type, TypeApproximatorConfiguration.PublicDeclaration)
approximateToSuperType(type, TypeApproximatorConfiguration.PublicDeclaration.SaveAnonymousTypes)
else
approximateToSubType(type, TypeApproximatorConfiguration.PublicDeclaration)
approximateToSubType(type, TypeApproximatorConfiguration.PublicDeclaration.SaveAnonymousTypes)
}
/**