[IR] Drop IrUninitializedType

#KT-66053 Fixed
This commit is contained in:
Wojciech Litewka
2024-03-05 12:42:07 +01:00
committed by Space Team
parent d1e8016ab2
commit a53ba8a47b
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2024 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.
*/
@@ -47,20 +47,6 @@ val IrType.originalKotlinType: KotlinType?
data object IrStarProjectionImpl : IrStarProjection
/**
* An instance which should be used when creating an IR element whose type cannot be determined at the moment of creation.
*
* Example: when translating generic functions in psi2ir, we're creating an IrFunction first, then adding IrTypeParameter instances to it,
* and only then translating the function's return type with respect to those created type parameters.
*
* Instead of using this special instance, we could just make IrFunction/IrConstructor constructors allow to accept no return type,
* however this could lead to a situation where we forget to set return type sometimes. This would result in crashes at unexpected moments,
* especially in Kotlin/JS where function return types are not present in the resulting binary files.
*/
data object IrUninitializedType : IrType() {
override val annotations: List<IrConstructorCall> = emptyList()
}
internal class ReturnTypeIsNotInitializedException(function: IrFunction) : IllegalStateException(
"Return type is not initialized for function '${function.name}'"
)