diff options
Diffstat (limited to 'compiler-plugin')
4 files changed, 4 insertions, 20 deletions
diff --git a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeArgumentDescriptorImpl.kt b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeArgumentDescriptorImpl.kt index 3f50b60b..5b76e27a 100644 --- a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeArgumentDescriptorImpl.kt +++ b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeArgumentDescriptorImpl.kt @@ -17,6 +17,7 @@ package com.google.devtools.ksp.symbol.impl.binary +import com.google.devtools.ksp.IdKeyTriple import com.google.devtools.ksp.KSObjectCache import com.google.devtools.ksp.symbol.KSAnnotation import com.google.devtools.ksp.symbol.KSNode @@ -25,7 +26,6 @@ import com.google.devtools.ksp.symbol.Location import com.google.devtools.ksp.symbol.NonExistLocation import com.google.devtools.ksp.symbol.Origin import com.google.devtools.ksp.symbol.Variance -import com.google.devtools.ksp.symbol.impl.kotlin.IdKeyTriple import com.google.devtools.ksp.symbol.impl.kotlin.KSTypeArgumentImpl import org.jetbrains.kotlin.types.TypeProjection diff --git a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeReferenceDescriptorImpl.kt b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeReferenceDescriptorImpl.kt index b2260cf9..91f68fa4 100644 --- a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeReferenceDescriptorImpl.kt +++ b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/binary/KSTypeReferenceDescriptorImpl.kt @@ -17,6 +17,7 @@ package com.google.devtools.ksp.symbol.impl.binary +import com.google.devtools.ksp.IdKeyTriple import com.google.devtools.ksp.KSObjectCache import com.google.devtools.ksp.memoized import com.google.devtools.ksp.symbol.KSAnnotation @@ -29,7 +30,6 @@ import com.google.devtools.ksp.symbol.Location import com.google.devtools.ksp.symbol.Modifier import com.google.devtools.ksp.symbol.NonExistLocation import com.google.devtools.ksp.symbol.Origin -import com.google.devtools.ksp.symbol.impl.kotlin.IdKeyTriple import com.google.devtools.ksp.symbol.impl.kotlin.getKSTypeCached import org.jetbrains.kotlin.builtins.isSuspendFunctionTypeOrSubtype import org.jetbrains.kotlin.types.AbbreviatedType diff --git a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/kotlin/KSTypeImpl.kt b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/kotlin/KSTypeImpl.kt index 9704f229..9e8929a8 100644 --- a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/kotlin/KSTypeImpl.kt +++ b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/kotlin/KSTypeImpl.kt @@ -17,6 +17,7 @@ package com.google.devtools.ksp.symbol.impl.kotlin +import com.google.devtools.ksp.IdKey import com.google.devtools.ksp.KSObjectCache import com.google.devtools.ksp.processing.impl.ResolverImpl import com.google.devtools.ksp.symbol.KSAnnotation @@ -131,23 +132,6 @@ class KSTypeImpl private constructor( get() = kotlinType.isSuspendFunctionType || kotlinType.isKSuspendFunctionType } -class IdKey<T>(private val k: T) { - override fun equals(other: Any?): Boolean = if (other is IdKey<*>) k === other.k else false - override fun hashCode(): Int = k.hashCode() -} - -class IdKeyPair<T, P>(private val k1: T, private val k2: P) { - override fun equals(other: Any?): Boolean = if (other is IdKeyPair<*, *>) k1 === other.k1 && - k2 === other.k2 else false - override fun hashCode(): Int = k1.hashCode() * 31 + k2.hashCode() -} - -class IdKeyTriple<T, P, Q>(private val k1: T, private val k2: P, private val k3: Q) { - override fun equals(other: Any?): Boolean = if (other is IdKeyTriple<*, *, *>) k1 === other.k1 && - k2 === other.k2 && k3 === other.k3 else false - override fun hashCode(): Int = k1.hashCode() * 31 * 31 + k2.hashCode() * 31 + k3.hashCode() -} - fun getKSTypeCached( kotlinType: KotlinType, ksTypeArguments: List<KSTypeArgument>? = null, diff --git a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSTypeReferenceSyntheticImpl.kt b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSTypeReferenceSyntheticImpl.kt index fd7a6f6f..aa2631e4 100644 --- a/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSTypeReferenceSyntheticImpl.kt +++ b/compiler-plugin/src/main/kotlin/com/google/devtools/ksp/symbol/impl/synthetic/KSTypeReferenceSyntheticImpl.kt @@ -1,5 +1,6 @@ package com.google.devtools.ksp.symbol.impl.synthetic +import com.google.devtools.ksp.IdKey import com.google.devtools.ksp.KSObjectCache import com.google.devtools.ksp.symbol.KSAnnotation import com.google.devtools.ksp.symbol.KSNode @@ -11,7 +12,6 @@ import com.google.devtools.ksp.symbol.Location import com.google.devtools.ksp.symbol.Modifier import com.google.devtools.ksp.symbol.NonExistLocation import com.google.devtools.ksp.symbol.Origin -import com.google.devtools.ksp.symbol.impl.kotlin.IdKey class KSTypeReferenceSyntheticImpl(val ksType: KSType, override val parent: KSNode?) : KSTypeReference { companion object : KSObjectCache<Pair<IdKey<KSType>, KSNode?>, KSTypeReferenceSyntheticImpl>() { |