IR: undeprecate IrUninitializedType

It's no longer a temporary hack, see the comment.
This commit is contained in:
Alexander Udalov
2020-08-20 21:24:38 +02:00
parent 5649cbc2e1
commit 9d81e50128
5 changed files with 18 additions and 9 deletions
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.ir.expressions.IrBody
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.impl.IrUninitializedType
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
@@ -70,10 +71,9 @@ internal class PersistentIrConstructor(
}
}
@Suppress("DEPRECATION")
override var returnType: IrType
get() = returnTypeField.let {
if (it !== org.jetbrains.kotlin.ir.types.impl.IrUninitializedType) it else error("Return type is not initialized")
if (it !== IrUninitializedType) it else error("Return type is not initialized")
}
set(c) {
returnTypeField = c
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.impl.IrUninitializedType
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
@@ -60,10 +61,9 @@ internal abstract class PersistentIrFunctionCommon(
}
}
@Suppress("DEPRECATION")
final override var returnType: IrType
get() = returnTypeField.let {
if (it !== org.jetbrains.kotlin.ir.types.impl.IrUninitializedType) it else error("Return type is not initialized")
if (it !== IrUninitializedType) it else error("Return type is not initialized")
}
set(c) {
returnTypeField = c