Renamed to fun CompletableDeferred.completeExceptionally
diff --git a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CompletableDeferred.kt b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CompletableDeferred.kt
index 817f476..111fc19 100644
--- a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CompletableDeferred.kt
+++ b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/CompletableDeferred.kt
@@ -20,7 +20,7 @@
/**
* Concrete implementation of [Deferred] that can be completed via public functions
- * [complete], [completeWithException], and [cancel].
+ * [complete], [completeExceptionally], and [cancel].
*
* Completion functions return `false` when this deferred value is already complete.
*/
@@ -57,7 +57,7 @@
*
* Repeated invocations of this function have no effect and always produce `false`.
*/
- public fun completeWithException(exception: Throwable): Boolean {
+ public fun completeExceptionally(exception: Throwable): Boolean {
while (true) { // lock-free loop on state
val state = this.state // atomic read
when (state) {
diff --git a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/CompletableDeferredTest.kt b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/CompletableDeferredTest.kt
index 2de3eb7..7f13262 100644
--- a/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/CompletableDeferredTest.kt
+++ b/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/CompletableDeferredTest.kt
@@ -55,9 +55,9 @@
@Test
fun testCompleteWithException() {
val c = CompletableDeferred<String>()
- assertThat(c.completeWithException(TestException()), IsEqual(true))
+ assertThat(c.completeExceptionally(TestException()), IsEqual(true))
checkCompleteTestException(c)
- assertThat(c.completeWithException(TestException()), IsEqual(false))
+ assertThat(c.completeExceptionally(TestException()), IsEqual(false))
checkCompleteTestException(c)
}