Minor, introduce IrType.classOrNull
This commit is contained in:
@@ -44,6 +44,9 @@ val IrType.classifierOrFail: IrClassifierSymbol
|
||||
val IrType.classifierOrNull: IrClassifierSymbol?
|
||||
get() = safeAs<IrSimpleType>()?.classifier
|
||||
|
||||
val IrType.classOrNull: IrClassSymbol?
|
||||
get() = classifierOrNull as? IrClassSymbol
|
||||
|
||||
fun IrType.makeNotNull() =
|
||||
if (this is IrSimpleType && this.hasQuestionMark) {
|
||||
IrSimpleTypeImpl(
|
||||
@@ -82,7 +85,7 @@ fun IrType.toKotlinType(): KotlinType {
|
||||
}
|
||||
|
||||
fun IrType.getClass(): IrClass? =
|
||||
(this.classifierOrNull as? IrClassSymbol)?.owner
|
||||
classOrNull?.owner
|
||||
|
||||
fun IrClassSymbol.createType(hasQuestionMark: Boolean, arguments: List<IrTypeArgument>): IrSimpleType =
|
||||
IrSimpleTypeImpl(
|
||||
|
||||
Reference in New Issue
Block a user