Use ISE instead of NPE in serialization

This commit is contained in:
Dmitry Petrov
2019-08-13 09:56:59 +03:00
parent a9c961931c
commit e4f9314f94
3 changed files with 14 additions and 3 deletions
@@ -392,3 +392,15 @@ inline fun IrBuilderWithScope.irBlockBody(
startOffset,
endOffset
).blockBody(body)
fun IrBuilderWithScope.irThrowIse(origin: IrStatementOrigin? = null) =
IrCallImpl(
startOffset, endOffset,
context.irBuiltIns.nothingType,
context.irBuiltIns.throwIseSymbol,
context.irBuiltIns.throwIseSymbol.descriptor,
typeArgumentsCount = 0,
valueArgumentsCount = 0,
origin = origin
)
@@ -295,7 +295,6 @@ class IrBuiltIns(
const val EQEQ = "EQEQ"
const val EQEQEQ = "EQEQEQ"
const val IEEE754_EQUALS = "ieee754equals"
const val THROW_NPE = "THROW_NPE"
const val THROW_CCE = "THROW_CCE"
const val THROW_ISE = "THROW_ISE"
const val NO_WHEN_BRANCH_MATCHED_EXCEPTION = "noWhenBranchMatchedException"