All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.devtools.ksp.impl.symbol.kotlin.KSFunctionErrorImpl.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC2-1.0.28
Show newest version
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