From 0164f9b7304dbf2dee9bb3aced0069e99f68aac7 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 25 Jan 2018 07:59:37 +0300 Subject: [PATCH] stdlib-common: correct common exception type declarations --- libraries/stdlib/common/src/kotlin/ExceptionsH.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/stdlib/common/src/kotlin/ExceptionsH.kt b/libraries/stdlib/common/src/kotlin/ExceptionsH.kt index fbcc0ea4fb7..5d3b8de6668 100644 --- a/libraries/stdlib/common/src/kotlin/ExceptionsH.kt +++ b/libraries/stdlib/common/src/kotlin/ExceptionsH.kt @@ -41,10 +41,13 @@ public expect open class IndexOutOfBoundsException : RuntimeException { constructor(message: String?) } +@Suppress("NO_ACTUAL_FOR_EXPECT") // TODO: Introduce typealias in JVM public expect open class ConcurrentModificationException : RuntimeException { constructor() constructor(message: String?) + @Deprecated("The constructor is not supported on all platforms and will be removed from kotlin-stdlib-common soon.") constructor(message: String?, cause: Throwable?) + @Deprecated("The constructor is not supported on all platforms and will be removed from kotlin-stdlib-common soon.") constructor(cause: Throwable?) } @@ -75,11 +78,12 @@ public expect open class AssertionError : Error { constructor(message: Any?) } -public expect open class NoSuchElementException : Exception { +public expect open class NoSuchElementException : RuntimeException { constructor() constructor(message: String?) } +@Deprecated("This exception type is not supposed to be thrown or caught in common code and will be removed from kotlin-stdlib-common soon.") public expect open class NoWhenBranchMatchedException : RuntimeException { constructor() constructor(message: String?) @@ -87,7 +91,8 @@ public expect open class NoWhenBranchMatchedException : RuntimeException { constructor(cause: Throwable?) } -public expect open class UninitializedPropertyAccessException : RuntimeException { +@Deprecated("This exception type is not supposed to be thrown or caught in common code and will be removed from kotlin-stdlib-common soon.") +public expect class UninitializedPropertyAccessException : RuntimeException { constructor() constructor(message: String?) constructor(message: String?, cause: Throwable?)