Make Throwable.addSuppressed extension work without kotlin-stdlib-jdk7*
*given that it runs on JDK7 and higher. The addSuppressed member is called with reflection when it's available. kotlin-stdlib-jdk7 extension still overrides that and calls addSuppressed member statically as before. #KT-30560 Fixed
This commit is contained in:
@@ -65,4 +65,11 @@ class ExceptionJVMTest {
|
||||
exception.stackTrace = stackTrace
|
||||
assertArrayNotSameButEquals(stackTrace, exception.stackTrace)
|
||||
}
|
||||
|
||||
@Test fun addSuppressedDoesNotThrow() {
|
||||
val e1 = Throwable()
|
||||
val e2 = Exception("Suppressed")
|
||||
|
||||
e1.addSuppressed(e2)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user