Make Closeable.use call addSuppressed

Call addSuppressed when it's provided by the supplementary artifact for jdk7, and only when targeting apiVersion > 1.1

#KT-18961 Fixed
This commit is contained in:
Ilya Gorbunov
2017-09-26 21:00:37 +03:00
parent 3ab7946c4d
commit cc150ca832
3 changed files with 14 additions and 14 deletions
@@ -60,7 +60,6 @@ class TryWithResourcesCloseableTest {
assertTrue(e.suppressed.isEmpty())
}
@Ignore
@Test fun opFailsCloseFails() {
val e = assertFails {
Resource(faultyClose = true).use { error("op fail") }
@@ -69,7 +68,6 @@ class TryWithResourcesCloseableTest {
assertTrue(e.suppressed.single() is IOException)
}
@Ignore
@Test fun opFailsCloseFailsTwice() {
val e = assertFails {
Resource(faultyClose = true).use { _ ->