Migrate to Kotlin 1.3 coroutines, drop experimental from package

* Features based on version 0.30.0
* Uses Kotlin version 1.3.0-rc-57
* Uses Kotlin/Native version 0.9.2
* Uses AtomicFu 0.11.9-eap13
* Replace SuccessOrFailure with Result
* Replace buildSequence and buildIterator with sequence and iterator
* Apply @BuilderInference on all builders (including extension methods to workaround inference bug)
diff --git a/common/kotlinx-coroutines-core-common/test/AbstractCoroutineTest.kt b/common/kotlinx-coroutines-core-common/test/AbstractCoroutineTest.kt
index e9a141e..53b8fba 100644
--- a/common/kotlinx-coroutines-core-common/test/AbstractCoroutineTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/AbstractCoroutineTest.kt
@@ -2,8 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class AbstractCoroutineTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/AsyncLazyTest.kt b/common/kotlinx-coroutines-core-common/test/AsyncLazyTest.kt
index 79fea2c..1177348 100644
--- a/common/kotlinx-coroutines-core-common/test/AsyncLazyTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/AsyncLazyTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/AsyncTest.kt b/common/kotlinx-coroutines-core-common/test/AsyncTest.kt
index 3e59837..b3a2463 100644
--- a/common/kotlinx-coroutines-core-common/test/AsyncTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/AsyncTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/AtomicCancellationCommonTest.kt b/common/kotlinx-coroutines-core-common/test/AtomicCancellationCommonTest.kt
index a3a296e..1e6e836 100644
--- a/common/kotlinx-coroutines-core-common/test/AtomicCancellationCommonTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/AtomicCancellationCommonTest.kt
@@ -2,10 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
-import kotlinx.coroutines.experimental.selects.*
-import kotlinx.coroutines.experimental.sync.*
+import kotlinx.coroutines.selects.*
+import kotlinx.coroutines.sync.*
 import kotlin.test.*
 
 class AtomicCancellationCommonTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/AwaitTest.kt b/common/kotlinx-coroutines-core-common/test/AwaitTest.kt
index 810f00b..6cd961d 100644
--- a/common/kotlinx-coroutines-core-common/test/AwaitTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/AwaitTest.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
@@ -36,13 +36,13 @@
     @Test
     fun testAwaitAllLazy() = runTest {
         expect(1)
-        val d = async(start = CoroutineStart.LAZY) { 
-            expect(2); 
-            1 
+        val d = async(start = CoroutineStart.LAZY) {
+            expect(2);
+            1
         }
-        val d2 = async(start = CoroutineStart.LAZY) { 
-            expect(3); 
-            2 
+        val d2 = async(start = CoroutineStart.LAZY) {
+            expect(3);
+            2
         }
         assertEquals(listOf(1, 2), awaitAll(d, d2))
         finish(4)
diff --git a/common/kotlinx-coroutines-core-common/test/CancellableContinuationHandlersTest.kt b/common/kotlinx-coroutines-core-common/test/CancellableContinuationHandlersTest.kt
index 8dfbaf4..d177ead 100644
--- a/common/kotlinx-coroutines-core-common/test/CancellableContinuationHandlersTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/CancellableContinuationHandlersTest.kt
@@ -2,8 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class CancellableContinuationHandlersTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/CancellableContinuationTest.kt b/common/kotlinx-coroutines-core-common/test/CancellableContinuationTest.kt
index c56cc17..7edf655 100644
--- a/common/kotlinx-coroutines-core-common/test/CancellableContinuationTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/CancellableContinuationTest.kt
@@ -3,9 +3,9 @@
  */
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
-import kotlin.coroutines.experimental.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class CancellableContinuationTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/CompletableDeferredTest.kt b/common/kotlinx-coroutines-core-common/test/CompletableDeferredTest.kt
index b7cc7ab..9d824dd 100644
--- a/common/kotlinx-coroutines-core-common/test/CompletableDeferredTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/CompletableDeferredTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED", "DEPRECATION") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/CoroutineExceptionHandlerTest.kt b/common/kotlinx-coroutines-core-common/test/CoroutineExceptionHandlerTest.kt
index 80ddd46..86a96d2 100644
--- a/common/kotlinx-coroutines-core-common/test/CoroutineExceptionHandlerTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/CoroutineExceptionHandlerTest.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/CoroutineScopeTest.kt b/common/kotlinx-coroutines-core-common/test/CoroutineScopeTest.kt
index b3d9125..b0e4ba2 100644
--- a/common/kotlinx-coroutines-core-common/test/CoroutineScopeTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/CoroutineScopeTest.kt
@@ -2,10 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
-import kotlinx.coroutines.experimental.internal.*
-import kotlin.coroutines.experimental.*
+import kotlinx.coroutines.internal.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class CoroutineScopeTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/CoroutinesTest.kt b/common/kotlinx-coroutines-core-common/test/CoroutinesTest.kt
index 05da2d2..281e750 100644
--- a/common/kotlinx-coroutines-core-common/test/CoroutinesTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/CoroutinesTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/CurrentScopeTest.kt b/common/kotlinx-coroutines-core-common/test/CurrentScopeTest.kt
index db17064..ab7fe73 100644
--- a/common/kotlinx-coroutines-core-common/test/CurrentScopeTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/CurrentScopeTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/DelayTest.kt b/common/kotlinx-coroutines-core-common/test/DelayTest.kt
index 69cb52e..df4a3ea 100644
--- a/common/kotlinx-coroutines-core-common/test/DelayTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/DelayTest.kt
@@ -5,9 +5,9 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED", "DEPRECATION") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
-import kotlinx.coroutines.experimental.timeunit.*
+import kotlinx.coroutines.timeunit.*
 import kotlin.test.*
 
 class DelayTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/ExperimentalDispatchModeTest.kt b/common/kotlinx-coroutines-core-common/test/ExperimentalDispatchModeTest.kt
index fc93628..37e6182 100644
--- a/common/kotlinx-coroutines-core-common/test/ExperimentalDispatchModeTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/ExperimentalDispatchModeTest.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/FailedJobTest.kt b/common/kotlinx-coroutines-core-common/test/FailedJobTest.kt
index 975e376..57a5e46 100644
--- a/common/kotlinx-coroutines-core-common/test/FailedJobTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/FailedJobTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/JobStatesTest.kt b/common/kotlinx-coroutines-core-common/test/JobStatesTest.kt
index 9306157..3e1a4e2 100644
--- a/common/kotlinx-coroutines-core-common/test/JobStatesTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/JobStatesTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/JobTest.kt b/common/kotlinx-coroutines-core-common/test/JobTest.kt
index 9e02419..61c8850 100644
--- a/common/kotlinx-coroutines-core-common/test/JobTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/JobTest.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/LaunchLazyTest.kt b/common/kotlinx-coroutines-core-common/test/LaunchLazyTest.kt
index fd1ef7a..1ed466d 100644
--- a/common/kotlinx-coroutines-core-common/test/LaunchLazyTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/LaunchLazyTest.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/NonCancellableTest.kt b/common/kotlinx-coroutines-core-common/test/NonCancellableTest.kt
index 3c16194..f8d96e1 100644
--- a/common/kotlinx-coroutines-core-common/test/NonCancellableTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/NonCancellableTest.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/ParentCancellationTest.kt b/common/kotlinx-coroutines-core-common/test/ParentCancellationTest.kt
index 17e8356..fdf0ac7 100644
--- a/common/kotlinx-coroutines-core-common/test/ParentCancellationTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/ParentCancellationTest.kt
@@ -4,10 +4,10 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
-import kotlinx.coroutines.experimental.channels.*
-import kotlin.coroutines.experimental.*
+import kotlinx.coroutines.channels.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 /**
diff --git a/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt b/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt
index c9aaacb..978112f 100644
--- a/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/SupervisorTest.kt
@@ -4,7 +4,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/TestBase.common.kt b/common/kotlinx-coroutines-core-common/test/TestBase.common.kt
index eea4b63..691f159 100644
--- a/common/kotlinx-coroutines-core-common/test/TestBase.common.kt
+++ b/common/kotlinx-coroutines-core-common/test/TestBase.common.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 public expect open class TestBase constructor() {
     public val isStressTest: Boolean
diff --git a/common/kotlinx-coroutines-core-common/test/Try.kt b/common/kotlinx-coroutines-core-common/test/Try.kt
index 3a9fd75..194ea4b 100644
--- a/common/kotlinx-coroutines-core-common/test/Try.kt
+++ b/common/kotlinx-coroutines-core-common/test/Try.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 public class Try<out T> private constructor(private val _value: Any?) {
     private class Fail(val exception: Throwable) {
diff --git a/common/kotlinx-coroutines-core-common/test/WithContextTest.kt b/common/kotlinx-coroutines-core-common/test/WithContextTest.kt
index d56391c..6fa47ff 100644
--- a/common/kotlinx-coroutines-core-common/test/WithContextTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/WithContextTest.kt
@@ -5,9 +5,9 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
-import kotlin.coroutines.experimental.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class WithContextTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/WithTimeoutOrNullTest.kt b/common/kotlinx-coroutines-core-common/test/WithTimeoutOrNullTest.kt
index f7760b8..8b88d0a 100644
--- a/common/kotlinx-coroutines-core-common/test/WithTimeoutOrNullTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/WithTimeoutOrNullTest.kt
@@ -5,9 +5,9 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
-import kotlinx.coroutines.experimental.channels.*
+import kotlinx.coroutines.channels.*
 import kotlin.test.*
 
 class WithTimeoutOrNullTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/WithTimeoutTest.kt b/common/kotlinx-coroutines-core-common/test/WithTimeoutTest.kt
index 639672c..95da378 100644
--- a/common/kotlinx-coroutines-core-common/test/WithTimeoutTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/WithTimeoutTest.kt
@@ -5,7 +5,7 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental
+package kotlinx.coroutines
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ArrayBroadcastChannelTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ArrayBroadcastChannelTest.kt
index eeed553..0e695d9 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ArrayBroadcastChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ArrayBroadcastChannelTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class ArrayBroadcastChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ArrayChannelTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ArrayChannelTest.kt
index dc6b047..bcb0b40 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ArrayChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ArrayChannelTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class ArrayChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/BasicOperationsTest.kt b/common/kotlinx-coroutines-core-common/test/channels/BasicOperationsTest.kt
index ad78940..be2fad3 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/BasicOperationsTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/BasicOperationsTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class BasicOperationsTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/BroadcastChannelFactoryTest.kt b/common/kotlinx-coroutines-core-common/test/channels/BroadcastChannelFactoryTest.kt
index 04a73ce..1d172b3 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/BroadcastChannelFactoryTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/BroadcastChannelFactoryTest.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/channels/BroadcastTest.kt b/common/kotlinx-coroutines-core-common/test/channels/BroadcastTest.kt
index 74bdb44..878437b 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/BroadcastTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/BroadcastTest.kt
@@ -2,10 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
-import kotlin.coroutines.experimental.*
+import kotlinx.coroutines.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class BroadcastTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ChannelFactoryTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ChannelFactoryTest.kt
index ac75f2d..825cbb3 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ChannelFactoryTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ChannelFactoryTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ChannelsTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ChannelsTest.kt
index bf15962..042adbf 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ChannelsTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ChannelsTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.math.*
 import kotlin.test.*
 
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ConflatedBroadcastChannelTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ConflatedBroadcastChannelTest.kt
index 87af3e5..49e531a 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ConflatedBroadcastChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ConflatedBroadcastChannelTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class ConflatedBroadcastChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ConflatedChannelTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ConflatedChannelTest.kt
index c6968db..8c1959f 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ConflatedChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ConflatedChannelTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class ConflatedChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/LinkedListChannelTest.kt b/common/kotlinx-coroutines-core-common/test/channels/LinkedListChannelTest.kt
index 4db28ab..788449b 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/LinkedListChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/LinkedListChannelTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class LinkedListChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ProduceConsumeTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ProduceConsumeTest.kt
index 2774088..5df0c7d 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ProduceConsumeTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ProduceConsumeTest.kt
@@ -2,10 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
-import kotlin.coroutines.experimental.*
+import kotlinx.coroutines.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class ProduceConsumeTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/ProduceTest.kt b/common/kotlinx-coroutines-core-common/test/channels/ProduceTest.kt
index 4c05409..946f2b5 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/ProduceTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/ProduceTest.kt
@@ -2,10 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
-import kotlin.coroutines.experimental.*
+import kotlinx.coroutines.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class ProduceTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/RendezvousChannelTest.kt b/common/kotlinx-coroutines-core-common/test/channels/RendezvousChannelTest.kt
index 3f422c9..12c14c0 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/RendezvousChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/RendezvousChannelTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class RendezvousChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/SendReceiveStressTest.kt b/common/kotlinx-coroutines-core-common/test/channels/SendReceiveStressTest.kt
index b48bf13..b9aa999 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/SendReceiveStressTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/SendReceiveStressTest.kt
@@ -2,9 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
+import kotlin.coroutines.*
 import kotlin.test.*
 
 class SendReceiveStressTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/TestBroadcastChannelKind.kt b/common/kotlinx-coroutines-core-common/test/channels/TestBroadcastChannelKind.kt
index 5c41f6f..d58c05d 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/TestBroadcastChannelKind.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/TestBroadcastChannelKind.kt
@@ -2,7 +2,7 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
 enum class TestBroadcastChannelKind {
     ARRAY_1 {
diff --git a/common/kotlinx-coroutines-core-common/test/channels/TestChannelKind.kt b/common/kotlinx-coroutines-core-common/test/channels/TestChannelKind.kt
index e783120..1e9c829 100644
--- a/common/kotlinx-coroutines-core-common/test/channels/TestChannelKind.kt
+++ b/common/kotlinx-coroutines-core-common/test/channels/TestChannelKind.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.channels
+package kotlinx.coroutines.channels
 
-import kotlinx.coroutines.experimental.selects.*
+import kotlinx.coroutines.selects.*
 
 enum class TestChannelKind {
     RENDEZVOUS {
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectArrayChannelTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectArrayChannelTest.kt
index a20ce30..f8c3439 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectArrayChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectArrayChannelTest.kt
@@ -2,11 +2,11 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlinx.coroutines.experimental.*
-import kotlinx.coroutines.experimental.channels.*
-import kotlinx.coroutines.experimental.intrinsics.*
+import kotlinx.coroutines.*
+import kotlinx.coroutines.channels.*
+import kotlinx.coroutines.intrinsics.*
 import kotlin.test.*
 
 class SelectArrayChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectBiasTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectBiasTest.kt
index b61604d..ec88fb5 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectBiasTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectBiasTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class SelectBiasTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectBuilderImplTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectBuilderImplTest.kt
index a715fd0..e8bccc4 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectBuilderImplTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectBuilderImplTest.kt
@@ -2,10 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlin.coroutines.experimental.*
-import kotlin.coroutines.experimental.intrinsics.*
+import kotlin.coroutines.*
+import kotlin.coroutines.intrinsics.*
 import kotlin.test.*
 
 class SelectBuilderImplTest {
@@ -14,11 +14,10 @@
         var resumed = false
         val delegate = object : Continuation<String> {
             override val context: CoroutineContext get() = EmptyCoroutineContext
-            override fun resume(value: String) {
-                check(value === "OK")
+            override fun resumeWith(result: Result<String>) {
+                check(result.getOrNull() == "OK")
                 resumed = true
             }
-            override fun resumeWithException(exception: Throwable) { error("Should not happen") }
         }
         val c = SelectBuilderImpl(delegate)
         // still running builder
@@ -40,11 +39,10 @@
         var resumed = false
         val delegate = object : Continuation<String> {
             override val context: CoroutineContext get() = EmptyCoroutineContext
-            override fun resume(value: String) {
-                check(value === "OK")
+            override fun resumeWith(result: Result<String>) {
+                check(result.getOrNull() == "OK")
                 resumed = true
             }
-            override fun resumeWithException(exception: Throwable) { error("Should not happen") }
         }
         val c = SelectBuilderImpl(delegate)
         check(c.getResult() === COROUTINE_SUSPENDED) // suspend first
@@ -66,9 +64,8 @@
         var resumed = false
         val delegate = object : Continuation<String> {
             override val context: CoroutineContext get() = EmptyCoroutineContext
-            override fun resume(value: String) { error("Should not happen") }
-            override fun resumeWithException(exception: Throwable) {
-                check(exception is TestException)
+            override fun resumeWith(result: Result<String>) {
+                check(result.exceptionOrNull() is TestException)
                 resumed = true
             }
         }
@@ -97,9 +94,8 @@
         var resumed = false
         val delegate = object : Continuation<String> {
             override val context: CoroutineContext get() = EmptyCoroutineContext
-            override fun resume(value: String) { error("Should not happen") }
-            override fun resumeWithException(exception: Throwable) {
-                check(exception is TestException)
+            override fun resumeWith(result: Result<String>) {
+                check(result.exceptionOrNull() is TestException)
                 resumed = true
             }
         }
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectDeferredTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectDeferredTest.kt
index c2e202c..45b7c9d 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectDeferredTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectDeferredTest.kt
@@ -4,9 +4,9 @@
 
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class SelectDeferredTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectJobTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectJobTest.kt
index 8a53c6f..099a874 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectJobTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectJobTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class SelectJobTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectMutexTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectMutexTest.kt
index 20ba8ec..6f4c9e1 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectMutexTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectMutexTest.kt
@@ -2,10 +2,10 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlinx.coroutines.experimental.*
-import kotlinx.coroutines.experimental.sync.*
+import kotlinx.coroutines.*
+import kotlinx.coroutines.sync.*
 import kotlin.test.*
 
 class SelectMutexTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectRendezvousChannelTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectRendezvousChannelTest.kt
index 5aa5a3f..0c1f9f6 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectRendezvousChannelTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectRendezvousChannelTest.kt
@@ -3,11 +3,11 @@
  */
 @file:Suppress("NAMED_ARGUMENTS_NOT_ALLOWED") // KT-21913
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlinx.coroutines.experimental.*
-import kotlinx.coroutines.experimental.channels.*
-import kotlinx.coroutines.experimental.intrinsics.*
+import kotlinx.coroutines.*
+import kotlinx.coroutines.channels.*
+import kotlinx.coroutines.intrinsics.*
 import kotlin.test.*
 
 class SelectRendezvousChannelTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/selects/SelectTimeoutTest.kt b/common/kotlinx-coroutines-core-common/test/selects/SelectTimeoutTest.kt
index 2ce7886..fbfb9c0 100644
--- a/common/kotlinx-coroutines-core-common/test/selects/SelectTimeoutTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/selects/SelectTimeoutTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.selects
+package kotlinx.coroutines.selects
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class SelectTimeoutTest : TestBase() {
diff --git a/common/kotlinx-coroutines-core-common/test/sync/MutexTest.kt b/common/kotlinx-coroutines-core-common/test/sync/MutexTest.kt
index b9d18de..c5d0ccf 100644
--- a/common/kotlinx-coroutines-core-common/test/sync/MutexTest.kt
+++ b/common/kotlinx-coroutines-core-common/test/sync/MutexTest.kt
@@ -2,9 +2,9 @@
  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
  */
 
-package kotlinx.coroutines.experimental.sync
+package kotlinx.coroutines.sync
 
-import kotlinx.coroutines.experimental.*
+import kotlinx.coroutines.*
 import kotlin.test.*
 
 class MutexTest : TestBase() {