com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionErrorImpl.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.symbol.KSFunction
import com.google.devtools.ksp.symbol.KSFunctionDeclaration
import com.google.devtools.ksp.symbol.KSType
import com.google.devtools.ksp.symbol.KSTypeParameter
class KSFunctionErrorImpl(
private val declaration: KSFunctionDeclaration
) : KSFunction {
override val isError: Boolean = true
override val returnType: KSType
get() = KSErrorType.fromReferenceBestEffort(declaration.returnType)
override val parameterTypes: List
get() = declaration.parameters.map {
KSErrorType.fromReferenceBestEffort(it.type)
}
override val typeParameters: List
get() = emptyList()
override val extensionReceiverType: KSType?
get() = declaration.extensionReceiver?.let {
KSErrorType.fromReferenceBestEffort(it)
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as KSFunctionErrorImpl
if (declaration != other.declaration) return false
return true
}
override fun hashCode(): Int {
return declaration.hashCode()
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy