Add missing exception constructors to common and JS declarations
Add test to validate exception properties after calling various constructors. Make NumberFormatException a descendant of IllegalArgumentException in all platforms. #KT-21861 Fixed #KT-21191 Fixed
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package kotlin
|
||||
|
||||
|
||||
public expect open class Error : Throwable {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class Exception : Throwable {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class RuntimeException : Exception {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class IllegalArgumentException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class IllegalStateException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class IndexOutOfBoundsException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
}
|
||||
|
||||
public expect open class ConcurrentModificationException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class UnsupportedOperationException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class NumberFormatException : IllegalArgumentException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
}
|
||||
|
||||
public expect open class NullPointerException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
}
|
||||
|
||||
public expect open class ClassCastException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
}
|
||||
|
||||
public expect open class AssertionError : Error {
|
||||
constructor()
|
||||
constructor(message: Any?)
|
||||
}
|
||||
|
||||
public expect open class NoSuchElementException : Exception {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
}
|
||||
|
||||
public expect open class NoWhenBranchMatchedException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
|
||||
public expect open class UninitializedPropertyAccessException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String?)
|
||||
constructor(message: String?, cause: Throwable?)
|
||||
constructor(cause: Throwable?)
|
||||
}
|
||||
@@ -19,51 +19,6 @@ package kotlin
|
||||
import kotlin.annotation.AnnotationTarget.FIELD
|
||||
import kotlin.annotation.AnnotationTarget.PROPERTY
|
||||
|
||||
open expect class Error : Throwable {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
open expect class Exception : Throwable {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
open expect class IllegalArgumentException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
open expect class IllegalStateException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
open expect class IndexOutOfBoundsException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
open expect class NoSuchElementException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
open expect class RuntimeException : Exception {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
open expect class UnsupportedOperationException : RuntimeException {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
// TODO: Provide typealias impl in stdlib-jvm
|
||||
open expect class AssertionError : Error {
|
||||
constructor()
|
||||
constructor(message: String)
|
||||
}
|
||||
|
||||
|
||||
expect interface Comparator<T> {
|
||||
|
||||
Reference in New Issue
Block a user