From 3a506a372b70693a8f9127dec012a7d1ec2b078f Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Sat, 4 May 2019 21:20:34 +0300 Subject: [PATCH] [JS IR] stdlib: Use Nothing in return type of THROW helpers Backend generated calls to those helpers inside expression which resuleted in invalid type casts in IR (in dead code). --- libraries/stdlib/js-ir/runtime/hacks.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/stdlib/js-ir/runtime/hacks.kt b/libraries/stdlib/js-ir/runtime/hacks.kt index 50d1e26ddd2..7ccef88974d 100644 --- a/libraries/stdlib/js-ir/runtime/hacks.kt +++ b/libraries/stdlib/js-ir/runtime/hacks.kt @@ -12,12 +12,12 @@ internal fun throwUninitializedPropertyAccessException(name: String): Nothing = internal fun noWhenBranchMatchedException(): Nothing = throw NoWhenBranchMatchedException() -fun THROW_ISE() { +fun THROW_ISE(): Nothing { throw IllegalStateException() } -fun THROW_CCE() { +fun THROW_CCE(): Nothing { throw ClassCastException() } -fun THROW_NPE() { +fun THROW_NPE(): Nothing { throw NullPointerException() } \ No newline at end of file