Skip to content

Commit

Permalink
Fix incorrect filtering for `fixPrivateTypeParametersSymbolsFromOldKL…
Browse files Browse the repository at this point in the history
…ibs`.
  • Loading branch information
TadeasKriz committed Aug 27, 2024
1 parent c915a55 commit 5e6ad3f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package co.touchlab.skie.kir.irbuilder.impl

import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterPublicSymbolImpl

actual val IrTypeParameterSymbol.isPublicSymbol: Boolean
get() = this is IrTypeParameterPublicSymbolImpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package co.touchlab.skie.kir.irbuilder.impl

import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol

actual val IrTypeParameterSymbol.isPublicSymbol: Boolean
get() = signature != null
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
import org.jetbrains.kotlin.ir.declarations.IrTypeParametersContainer
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.DeserializedPackageFragment
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor
Expand Down Expand Up @@ -161,7 +160,7 @@ class DeclarationBuilderImpl(
*/
private fun fixPrivateTypeParametersSymbolsFromOldKLibs(skieSymbolTable: SkieSymbolTable) {
skieSymbolTable.allExposedTypeParameters(mutableDescriptorProvider)
.filter { it.symbol !is IrTypeParameterSymbol }
.filterNot { it.symbol.isPublicSymbol }
.forEach {
skieSymbolTable.declarePrivateTypeParameterAsPublic(it)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package co.touchlab.skie.kir.irbuilder.impl

import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol

expect val IrTypeParameterSymbol.isPublicSymbol: Boolean

0 comments on commit 5e6ad3f

Please sign in to comment.