com.google.devtools.ksp.impl.symbol.kotlin.KSDefNonNullReferenceImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of symbol-processing-cmdline Show documentation
Show all versions of symbol-processing-cmdline Show documentation
Symbol processing for K/N and command line
package com.google.devtools.ksp.impl.symbol.kotlin
import com.google.devtools.ksp.common.IdKeyPair
import com.google.devtools.ksp.common.KSObjectCache
import com.google.devtools.ksp.symbol.*
import org.jetbrains.kotlin.analysis.api.types.KaDefinitelyNotNullType
class KSDefNonNullReferenceImpl private constructor(
private val ktDefinitelyNotNullType: KaDefinitelyNotNullType,
override val parent: KSTypeReference?
) : KSDefNonNullReference {
companion object : KSObjectCache, KSDefNonNullReference>() {
fun getCached(ktType: KaDefinitelyNotNullType, parent: KSTypeReference?) =
KSDefNonNullReferenceImpl.cache
.getOrPut(IdKeyPair(ktType, parent)) { KSDefNonNullReferenceImpl(ktType, parent) }
}
override val enclosedType: KSClassifierReference by lazy {
ktDefinitelyNotNullType.original.toClassifierReference(parent) as KSClassifierReference
}
override val typeArguments: List
get() = emptyList()
override val origin: Origin = Origin.KOTLIN
override val location: Location
get() = parent?.location ?: NonExistLocation
override fun toString() = "${enclosedType.referencedName()} & Any"
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy