Skip to content

Commit

Permalink
Add super types to type hash
Browse files Browse the repository at this point in the history
  • Loading branch information
IVIanuu committed Mar 2, 2024
1 parent 5b791fb commit 7317c15
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.ivianuu.injekt.compiler.*
import org.jetbrains.kotlin.utils.addToStdlib.*
import java.util.*

class InjektSymbolProcessor(private val environment: SymbolProcessorEnvironment) : SymbolProcessor {
@OptIn(UnsafeCastFunction::class) class InjektSymbolProcessor(private val environment: SymbolProcessorEnvironment) : SymbolProcessor {
override fun process(resolver: Resolver): List<KSAnnotated> {
resolver.getSymbolsWithAnnotation(InjektFqNames.Provide.asFqNameString(), false)
.filterIsInstance<KSDeclaration>()
Expand Down Expand Up @@ -72,7 +72,7 @@ class InjektSymbolProcessor(private val environment: SymbolProcessorEnvironment)
private fun KSDeclaration.declarationHash(): String = buildString {
modifiers.forEach { append(it) }
annotations.forEach { append(it.annotationType.typeHash()) }
append(simpleName)
append(simpleName.asString())

when (this@declarationHash) {
is KSClassDeclaration -> {
Expand Down Expand Up @@ -105,6 +105,9 @@ class InjektSymbolProcessor(private val environment: SymbolProcessorEnvironment)
append(argument.variance)
}
append(isMarkedNullable)
declaration.safeAs<KSClassDeclaration>()?.superTypes?.forEach {
it.resolve().append()
}
}

resolve().append()
Expand Down

0 comments on commit 7317c15

Please sign in to comment.