org.jetbrains.kotlin.ir.types.IrType.kt Maven / Gradle / Ivy
/*
* Copyright 2010-2018 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.ir.types
import org.jetbrains.kotlin.ir.declarations.IrAnnotationContainer
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
import org.jetbrains.kotlin.ir.symbols.IrTypeAliasSymbol
import org.jetbrains.kotlin.types.Variance
import org.jetbrains.kotlin.types.model.*
interface IrType : KotlinTypeMarker, IrAnnotationContainer {
/**
* @return true if this type is equal to [other] symbolically. Note that this is NOT EQUIVALENT to the full type checking algorithm
* used in the compiler frontend. For example, this method will return `false` on the types `List<*>` and `List`,
* whereas the real type checker from the compiler frontend would return `true`.
*
* Classes are compared by FQ names, which means that even if two types refer to different symbols of the class with the same FQ name,
* such types will be considered equal. Type annotations do not have any effect on the behavior of this method.
*/
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
}
interface IrErrorType : IrType
interface IrDynamicType : IrType, DynamicTypeMarker
interface IrSimpleType : IrType, SimpleTypeMarker, TypeArgumentListMarker {
val classifier: IrClassifierSymbol
val hasQuestionMark: Boolean
val arguments: List
val abbreviation: IrTypeAbbreviation?
}
interface IrTypeArgument : TypeArgumentMarker {
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
}
interface IrStarProjection : IrTypeArgument
interface IrTypeProjection : IrTypeArgument {
val variance: Variance
val type: IrType
}
interface IrTypeAbbreviation : IrAnnotationContainer {
val typeAlias: IrTypeAliasSymbol
val hasQuestionMark: Boolean
val arguments: List
}