IR: add docs for IrTypeOperator's
This commit is contained in:
@@ -20,14 +20,30 @@ import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
|
|||||||
import org.jetbrains.kotlin.ir.types.IrType
|
import org.jetbrains.kotlin.ir.types.IrType
|
||||||
|
|
||||||
enum class IrTypeOperator {
|
enum class IrTypeOperator {
|
||||||
|
/** Explicit cast: `e as Type` */
|
||||||
CAST,
|
CAST,
|
||||||
|
/** Implicit cast: value of type `A` is used where a value of type `B` is expected */
|
||||||
IMPLICIT_CAST,
|
IMPLICIT_CAST,
|
||||||
|
/** Implicit cast from a value of nullability flexible type `A!` to non-null type `B`, `B :> A` */
|
||||||
IMPLICIT_NOTNULL,
|
IMPLICIT_NOTNULL,
|
||||||
|
/** Implicit coercion to Unit: expression of type `A, !(A <: kotlin.Unit)` is used where `kotlin.Unit` is expected */
|
||||||
IMPLICIT_COERCION_TO_UNIT,
|
IMPLICIT_COERCION_TO_UNIT,
|
||||||
|
/**
|
||||||
|
* Implicit integer coercion: expression of integer type `A` (`kotlin.Int`, `kotlin.Byte`, ...)
|
||||||
|
* is used where another integer type `B` (`kotlin.Int`, `kotlin.Byte`, ...) is expected.
|
||||||
|
* This mostly happens for constant expressions.
|
||||||
|
*/
|
||||||
IMPLICIT_INTEGER_COERCION,
|
IMPLICIT_INTEGER_COERCION,
|
||||||
|
/** Safe cast: `e as? Type` */
|
||||||
SAFE_CAST,
|
SAFE_CAST,
|
||||||
|
/** Instance-of check: `a is Type` */
|
||||||
INSTANCEOF,
|
INSTANCEOF,
|
||||||
NOT_INSTANCEOF,
|
/** Instance-of check: `a !is Type` */
|
||||||
|
NOT_INSTANCEOF, // TODO drop and replace with `INSTANCEOF<T>(x).not()`?
|
||||||
|
/**
|
||||||
|
* SAM conversion: value of functional type F is used where Single Abstract Method interface value is expected.
|
||||||
|
* Currently this is possible in Kotlin/JVM only, however, there's a big demand for SAM conversion for Kotlin interfaces.
|
||||||
|
*/
|
||||||
SAM_CONVERSION;
|
SAM_CONVERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,4 +53,3 @@ interface IrTypeOperatorCall : IrExpression {
|
|||||||
val typeOperand: IrType
|
val typeOperand: IrType
|
||||||
val typeOperandClassifier: IrClassifierSymbol
|
val typeOperandClassifier: IrClassifierSymbol
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user