org.jetbrains.kotlin.fir.types.CompilerConeAttributes.kt Maven / Gradle / Ivy
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.fir.types
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.utils.addToStdlib.runIf
import kotlin.reflect.KClass
object CompilerConeAttributes {
object Exact : ConeAttribute() {
val ANNOTATION_CLASS_ID = ClassId(FqName("kotlin.internal"), Name.identifier("Exact"))
override fun union(other: Exact?): Exact? = null
override fun intersect(other: Exact?): Exact? = null
override fun isSubtypeOf(other: Exact?): Boolean = true
override val key: KClass = Exact::class
}
object NoInfer : ConeAttribute() {
val ANNOTATION_CLASS_ID = ClassId(FqName("kotlin.internal"), Name.identifier("NoInfer"))
override fun union(other: NoInfer?): NoInfer? = null
override fun intersect(other: NoInfer?): NoInfer? = null
override fun isSubtypeOf(other: NoInfer?): Boolean = true
override val key: KClass = NoInfer::class
}
object ExtensionFunctionType : ConeAttribute() {
val ANNOTATION_CLASS_ID = ClassId(FqName("kotlin"), Name.identifier("ExtensionFunctionType"))
override fun union(other: ExtensionFunctionType?): ExtensionFunctionType? = other
override fun intersect(other: ExtensionFunctionType?): ExtensionFunctionType? = this
override fun isSubtypeOf(other: ExtensionFunctionType?): Boolean = true
override val key: KClass = ExtensionFunctionType::class
}
}
val ConeAttributes.exact: CompilerConeAttributes.Exact? by ConeAttributes.attributeAccessor()
val ConeAttributes.noInfer: CompilerConeAttributes.NoInfer? by ConeAttributes.attributeAccessor()
val ConeAttributes.extensionFunctionType: CompilerConeAttributes.ExtensionFunctionType? by ConeAttributes.attributeAccessor()