diff --git a/gradle.properties b/gradle.properties index dc6d76a256d..7c5b2429c69 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,8 +19,8 @@ buildKotlinVersion=1.3-M1-eap-77 buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_13M1_Compiler),number:1.3-M1-eap-77,branch:default:any/artifacts/content/maven remoteRoot=konan_tests testDataVersion=1226829:id -kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_13M2_CompilerAllPlugins),number:1.3-M2-eap-82,tag:kotlin-native,pinned:true/artifacts/content/maven -kotlinVersion=1.3-M2-eap-82 +kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_13M2_CompilerAllPlugins),number:1.3-M2-eap-105,tag:kotlin-native,pinned:true/artifacts/content/maven +kotlinVersion=1.3-M2-eap-105 testKotlinVersion=1.3-M2-eap-33 konanVersion=0.9 org.gradle.jvmargs='-Dfile.encoding=UTF-8' diff --git a/runtime/src/main/kotlin/kotlin/collections/Arrays.kt b/runtime/src/main/kotlin/kotlin/collections/Arrays.kt index 76a03b88518..68405b0907d 100644 --- a/runtime/src/main/kotlin/kotlin/collections/Arrays.kt +++ b/runtime/src/main/kotlin/kotlin/collections/Arrays.kt @@ -514,94 +514,6 @@ public actual fun LongArray.contentToString(): String { } } -/** - * Returns a string representation of the contents of the specified array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun UByteArray.contentToString(): String { - if (size == 0) - return "[]" - val iMax = size - 1 - - val b = StringBuilder() - b.append('[') - var i = 0 - while (true) { - b.append(this[i]) - if (i == iMax) - return b.append(']').toString() - b.append(", ") - i++ - } -} - -/** - * Returns a string representation of the contents of the specified array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun UShortArray.contentToString(): String { - if (size == 0) - return "[]" - val iMax = size - 1 - - val b = StringBuilder() - b.append('[') - var i = 0 - while (true) { - b.append(this[i]) - if (i == iMax) - return b.append(']').toString() - b.append(", ") - i++ - } -} - -/** - * Returns a string representation of the contents of the specified array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun UIntArray.contentToString(): String { - if (size == 0) - return "[]" - val iMax = size - 1 - - val b = StringBuilder() - b.append('[') - var i = 0 - while (true) { - b.append(this[i]) - if (i == iMax) - return b.append(']').toString() - b.append(", ") - i++ - } -} - -/** - * Returns a string representation of the contents of the specified array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun ULongArray.contentToString(): String { - if (size == 0) - return "[]" - val iMax = size - 1 - - val b = StringBuilder() - b.append('[') - var i = 0 - while (true) { - b.append(this[i]) - if (i == iMax) - return b.append(']').toString() - b.append(", ") - i++ - } -} - /** * Returns a string representation of the contents of the specified array as if it is [List]. */ @@ -1060,54 +972,6 @@ public actual fun LongArray.contentHashCode(): Int { return result } -/** - * Returns a hash code based on the contents of this array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun UByteArray.contentHashCode(): Int { - var result = 1 - for (element in this) - result = 31 * result + element.hashCode() - return result -} - -/** - * Returns a hash code based on the contents of this array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun UShortArray.contentHashCode(): Int { - var result = 1 - for (element in this) - result = 31 * result + element.hashCode() - return result -} - -/** - * Returns a hash code based on the contents of this array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun UIntArray.contentHashCode(): Int { - var result = 1 - for (element in this) - result = 31 * result + element.hashCode() - return result -} - -/** - * Returns a hash code based on the contents of this array as if it is [List]. - */ -@SinceKotlin("1.3") -@ExperimentalUnsignedTypes -public fun ULongArray.contentHashCode(): Int { - var result = 1 - for (element in this) - result = 31 * result + element.hashCode() - return result -} - /** * Returns a hash code based on the contents of this array as if it is [List]. */ diff --git a/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt b/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt index 60234c47924..9d294df3c4e 100644 --- a/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt +++ b/runtime/src/main/kotlin/kotlin/coroutines/ContinuationImpl.kt @@ -18,6 +18,7 @@ package kotlin.coroutines.native.internal import kotlin.coroutines.* import kotlin.coroutines.intrinsics.CoroutineSingletons +import kotlin.coroutines.intrinsics.* @SinceKotlin("1.3") internal abstract class BaseContinuationImpl( @@ -38,7 +39,7 @@ internal abstract class BaseContinuationImpl( val outcome: SuccessOrFailure = try { val outcome = invokeSuspend(param) - if (outcome === CoroutineSingletons.COROUTINE_SUSPENDED) return + if (outcome === COROUTINE_SUSPENDED) return SuccessOrFailure.success(outcome) } catch (exception: Throwable) { SuccessOrFailure.failure(exception) diff --git a/runtime/src/main/kotlin/kotlin/coroutines/SafeContinuationNative.kt b/runtime/src/main/kotlin/kotlin/coroutines/SafeContinuationNative.kt index 876c95a550a..4896f67c614 100644 --- a/runtime/src/main/kotlin/kotlin/coroutines/SafeContinuationNative.kt +++ b/runtime/src/main/kotlin/kotlin/coroutines/SafeContinuationNative.kt @@ -18,6 +18,7 @@ package kotlin.coroutines import kotlin.* import kotlin.coroutines.intrinsics.CoroutineSingletons.* +import kotlin.coroutines.intrinsics.* @PublishedApi @SinceKotlin("1.3") diff --git a/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt b/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt index 76ae89ac29c..bf994fdd9dd 100644 --- a/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt +++ b/runtime/src/main/kotlin/kotlin/coroutines/experimental/Intrinsics.kt @@ -82,7 +82,14 @@ public actual inline fun (suspend R.() -> T).startCoroutineUninterceptedO * the execution was suspended and will not return any result immediately. */ @SinceKotlin("1.1") -public actual val COROUTINE_SUSPENDED: Any get() = errorExperimentalCoroutinesAreNoLongerSupported() +public actual val COROUTINE_SUSPENDED: Any get() = CoroutineSingletons.COROUTINE_SUSPENDED + +// Using enum here ensures two important properties: +// 1. It makes SafeContinuation serializable with all kinds of serialization frameworks (since all of them natively support enums) +// 2. It improves debugging experience, since you clearly see toString() value of those objects and what package they come from +private enum class CoroutineSingletons { + COROUTINE_SUSPENDED +} @PublishedApi internal fun errorExperimentalCoroutinesAreNoLongerSupported(): Nothing = diff --git a/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt b/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt index bc5d7416e30..42d9160f9d1 100644 --- a/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt +++ b/runtime/src/main/kotlin/kotlin/text/StringNumberConversions.kt @@ -160,3 +160,5 @@ public actual fun String.toDoubleOrNull(): Double? { return null } } + +internal fun numberFormatError(input: String): Nothing = throw NumberFormatException("Invalid number format: '$input'") \ No newline at end of file