Commit b5bd36fb authored by Him188's avatar Him188

Avoid self-suppression

parent e022e81c
...@@ -7,6 +7,9 @@ private var isAddSuppressedSupported: Boolean = true ...@@ -7,6 +7,9 @@ private var isAddSuppressedSupported: Boolean = true
@MiraiInternalAPI @MiraiInternalAPI
@Suppress("EXTENSION_SHADOWED_BY_MEMBER") @Suppress("EXTENSION_SHADOWED_BY_MEMBER")
actual fun Throwable.addSuppressed(e: Throwable) { actual fun Throwable.addSuppressed(e: Throwable) {
if (this === e) {
return
}
if (!isAddSuppressedSupported) { if (!isAddSuppressedSupported) {
return return
} }
......
...@@ -5,6 +5,9 @@ private var isAddSuppressedSupported: Boolean = true ...@@ -5,6 +5,9 @@ private var isAddSuppressedSupported: Boolean = true
@MiraiInternalAPI @MiraiInternalAPI
@Suppress("EXTENSION_SHADOWED_BY_MEMBER") @Suppress("EXTENSION_SHADOWED_BY_MEMBER")
actual fun Throwable.addSuppressed(e: Throwable) { actual fun Throwable.addSuppressed(e: Throwable) {
if (this === e) {
return
}
if (!isAddSuppressedSupported) { if (!isAddSuppressedSupported) {
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment