From 0259adaa8f9d865bec8c0b02bf9e89c077876db8 Mon Sep 17 00:00:00 2001 From: SerVB Date: Fri, 18 Mar 2022 15:37:03 +0100 Subject: [PATCH 1/4] [#73] Introduce stdlib-py (used in some tests) --- .../kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml | 6 + libraries/stdlib/py/build.gradle.kts | 169 ++ libraries/stdlib/py/builtins/Arrays.kt | 224 ++ libraries/stdlib/py/builtins/Boolean.kt | 48 + libraries/stdlib/py/builtins/Char.kt | 152 ++ libraries/stdlib/py/builtins/Collections.kt | 435 ++++ libraries/stdlib/py/builtins/Enum.kt | 19 + libraries/stdlib/py/builtins/Library.kt | 88 + libraries/stdlib/py/builtins/Primitives.kt | 1310 ++++++++++ libraries/stdlib/py/builtins/String.kt | 41 + libraries/stdlib/py/builtins/Throwable.kt | 28 + .../py/runtime/DefaultConstructorMarker.kt | 8 + libraries/stdlib/py/runtime/JsError.kt | 7 + libraries/stdlib/py/runtime/arrays.kt | 98 + libraries/stdlib/py/runtime/bitUtils.kt | 63 + .../py/runtime/booleanInExternalHelpers.kt | 23 + libraries/stdlib/py/runtime/charSequence.kt | 41 + .../stdlib/py/runtime/collectionsHacks.kt | 67 + libraries/stdlib/py/runtime/compareTo.kt | 61 + .../stdlib/py/runtime/constructFunction.kt | 13 + libraries/stdlib/py/runtime/coreRuntime.kt | 141 ++ .../stdlib/py/runtime/coroutineInternalJS.kt | 39 + libraries/stdlib/py/runtime/dceUtils.kt | 16 + libraries/stdlib/py/runtime/hacks.kt | 34 + libraries/stdlib/py/runtime/jsIntrinsics.kt | 207 ++ libraries/stdlib/py/runtime/kotlinHacks.kt | 73 + libraries/stdlib/py/runtime/kotlinJsHacks.kt | 41 + libraries/stdlib/py/runtime/long.kt | 291 +++ libraries/stdlib/py/runtime/longjs.kt | 388 +++ libraries/stdlib/py/runtime/misc.kt | 13 + libraries/stdlib/py/runtime/noPackageHacks.kt | 58 + .../stdlib/py/runtime/numberConversion.kt | 30 + libraries/stdlib/py/runtime/rangeTo.kt | 15 + libraries/stdlib/py/runtime/reflectRuntime.kt | 45 + libraries/stdlib/py/runtime/typeCheckUtils.kt | 189 ++ .../stdlib/py/src/generated/.gitattributes | 1 + .../stdlib/py/src/generated/_ArraysJs.kt | 2188 +++++++++++++++++ .../py/src/generated/_CharCategories.kt | 84 + .../stdlib/py/src/generated/_CollectionsJs.kt | 27 + .../stdlib/py/src/generated/_ComparisonsJs.kt | 436 ++++ .../stdlib/py/src/generated/_DigitChars.kt | 59 + .../stdlib/py/src/generated/_LetterChars.kt | 114 + .../py/src/generated/_OtherLowercaseChars.kt | 25 + .../py/src/generated/_OtherUppercaseChars.kt | 16 + .../stdlib/py/src/generated/_StringsJs.kt | 21 + .../py/src/generated/_TitlecaseMappings.kt | 25 + .../stdlib/py/src/generated/_UArraysJs.kt | 164 ++ .../py/src/generated/_WhitespaceChars.kt | 31 + .../src/kotlin/coroutines_13/CoroutineImpl.kt | 104 + .../src/kotlin/coroutines_13/IntrinsicsJs.kt | 185 ++ libraries/stdlib/py/src/kotlin/exceptions.kt | 110 + .../stdlib/py/src/kotlin/jsClass_js-ir.kt | 11 + libraries/stdlib/py/src/kotlin/jsOperators.kt | 35 + libraries/stdlib/py/src/kotlin/math_js-ir.kt | 17 + .../stdlib/py/src/kotlin/numbers_js-ir.kt | 62 + .../stdlib/py/src/kotlin/reflection_js-ir.kt | 19 + .../kotlin/text/numberConversions_js-ir.kt | 15 + python/box.tests/build.gradle.kts | 4 +- settings.gradle | 4 +- 59 files changed, 8235 insertions(+), 3 deletions(-) create mode 100644 .idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml create mode 100644 libraries/stdlib/py/build.gradle.kts create mode 100644 libraries/stdlib/py/builtins/Arrays.kt create mode 100644 libraries/stdlib/py/builtins/Boolean.kt create mode 100644 libraries/stdlib/py/builtins/Char.kt create mode 100644 libraries/stdlib/py/builtins/Collections.kt create mode 100644 libraries/stdlib/py/builtins/Enum.kt create mode 100644 libraries/stdlib/py/builtins/Library.kt create mode 100644 libraries/stdlib/py/builtins/Primitives.kt create mode 100644 libraries/stdlib/py/builtins/String.kt create mode 100644 libraries/stdlib/py/builtins/Throwable.kt create mode 100644 libraries/stdlib/py/runtime/DefaultConstructorMarker.kt create mode 100644 libraries/stdlib/py/runtime/JsError.kt create mode 100644 libraries/stdlib/py/runtime/arrays.kt create mode 100644 libraries/stdlib/py/runtime/bitUtils.kt create mode 100644 libraries/stdlib/py/runtime/booleanInExternalHelpers.kt create mode 100644 libraries/stdlib/py/runtime/charSequence.kt create mode 100644 libraries/stdlib/py/runtime/collectionsHacks.kt create mode 100644 libraries/stdlib/py/runtime/compareTo.kt create mode 100644 libraries/stdlib/py/runtime/constructFunction.kt create mode 100644 libraries/stdlib/py/runtime/coreRuntime.kt create mode 100644 libraries/stdlib/py/runtime/coroutineInternalJS.kt create mode 100644 libraries/stdlib/py/runtime/dceUtils.kt create mode 100644 libraries/stdlib/py/runtime/hacks.kt create mode 100644 libraries/stdlib/py/runtime/jsIntrinsics.kt create mode 100644 libraries/stdlib/py/runtime/kotlinHacks.kt create mode 100644 libraries/stdlib/py/runtime/kotlinJsHacks.kt create mode 100644 libraries/stdlib/py/runtime/long.kt create mode 100644 libraries/stdlib/py/runtime/longjs.kt create mode 100644 libraries/stdlib/py/runtime/misc.kt create mode 100644 libraries/stdlib/py/runtime/noPackageHacks.kt create mode 100644 libraries/stdlib/py/runtime/numberConversion.kt create mode 100644 libraries/stdlib/py/runtime/rangeTo.kt create mode 100644 libraries/stdlib/py/runtime/reflectRuntime.kt create mode 100644 libraries/stdlib/py/runtime/typeCheckUtils.kt create mode 100644 libraries/stdlib/py/src/generated/.gitattributes create mode 100644 libraries/stdlib/py/src/generated/_ArraysJs.kt create mode 100644 libraries/stdlib/py/src/generated/_CharCategories.kt create mode 100644 libraries/stdlib/py/src/generated/_CollectionsJs.kt create mode 100644 libraries/stdlib/py/src/generated/_ComparisonsJs.kt create mode 100644 libraries/stdlib/py/src/generated/_DigitChars.kt create mode 100644 libraries/stdlib/py/src/generated/_LetterChars.kt create mode 100644 libraries/stdlib/py/src/generated/_OtherLowercaseChars.kt create mode 100644 libraries/stdlib/py/src/generated/_OtherUppercaseChars.kt create mode 100644 libraries/stdlib/py/src/generated/_StringsJs.kt create mode 100644 libraries/stdlib/py/src/generated/_TitlecaseMappings.kt create mode 100644 libraries/stdlib/py/src/generated/_UArraysJs.kt create mode 100644 libraries/stdlib/py/src/generated/_WhitespaceChars.kt create mode 100644 libraries/stdlib/py/src/kotlin/coroutines_13/CoroutineImpl.kt create mode 100644 libraries/stdlib/py/src/kotlin/coroutines_13/IntrinsicsJs.kt create mode 100644 libraries/stdlib/py/src/kotlin/exceptions.kt create mode 100644 libraries/stdlib/py/src/kotlin/jsClass_js-ir.kt create mode 100644 libraries/stdlib/py/src/kotlin/jsOperators.kt create mode 100644 libraries/stdlib/py/src/kotlin/math_js-ir.kt create mode 100644 libraries/stdlib/py/src/kotlin/numbers_js-ir.kt create mode 100644 libraries/stdlib/py/src/kotlin/reflection_js-ir.kt create mode 100644 libraries/stdlib/py/src/kotlin/text/numberConversions_js-ir.kt diff --git a/.idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml b/.idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml new file mode 100644 index 0000000000000..4369008741334 --- /dev/null +++ b/.idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml @@ -0,0 +1,6 @@ + + + $PROJECT_DIR$/libraries/stdlib/py/build/libs + + + \ No newline at end of file diff --git a/libraries/stdlib/py/build.gradle.kts b/libraries/stdlib/py/build.gradle.kts new file mode 100644 index 0000000000000..9f42393baa87e --- /dev/null +++ b/libraries/stdlib/py/build.gradle.kts @@ -0,0 +1,169 @@ +import org.jetbrains.kotlin.gradle.dsl.KotlinCompile + +plugins { + kotlin("multiplatform") +} + +kotlin { + js(IR) { + nodejs { + testTask { + useMocha { + timeout = "10s" + } + } + } + } +} + +val unimplementedNativeBuiltIns = + (file("$rootDir/core/builtins/native/kotlin/").list().toSortedSet() - file("$rootDir/libraries/stdlib/py/builtins/").list()) + .map { "core/builtins/native/kotlin/$it" } + +// Required to compile native builtins with the rest of runtime +val builtInsHeader = """@file:Suppress( + "NON_ABSTRACT_FUNCTION_WITH_NO_BODY", + "MUST_BE_INITIALIZED_OR_BE_ABSTRACT", + "EXTERNAL_TYPE_EXTENDS_NON_EXTERNAL_TYPE", + "PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED", + "WRONG_MODIFIER_TARGET", + "UNUSED_PARAMETER" +) +""" + +val commonMainSources by task { + dependsOn(":prepare:build.version:writeStdlibVersion") + + val sources = listOf( + "libraries/stdlib/common/src/", + "libraries/stdlib/src/kotlin/", + "libraries/stdlib/unsigned/" + ) + + sources.forEach { path -> + from("$rootDir/$path") { + into(path.dropLastWhile { it != '/' }) + } + } + + into("$buildDir/commonMainSources") +} + +val jsMainSources by task { + val sources = listOf( + "core/builtins/src/kotlin/", + "libraries/stdlib/js/src/", + "libraries/stdlib/js/runtime/" + ) + unimplementedNativeBuiltIns + + val excluded = listOf( + // stdlib/js/src/generated is used exclusively for current `js-v1` backend. + "libraries/stdlib/js/src/generated/**", + + // JS-specific optimized version of emptyArray() already defined + "core/builtins/src/kotlin/ArrayIntrinsics.kt" + ) + + sources.forEach { path -> + from("$rootDir/$path") { + into(path.dropLastWhile { it != '/' }) + excluded.filter { it.startsWith(path) }.forEach { + exclude(it.substring(path.length)) + } + } + } + + into("$buildDir/jsMainSources") + + val unimplementedNativeBuiltIns = unimplementedNativeBuiltIns + val buildDir = buildDir + val builtInsHeader = builtInsHeader + doLast { + unimplementedNativeBuiltIns.forEach { path -> + val file = File("$buildDir/jsMainSources/$path") + val sourceCode = builtInsHeader + file.readText() + file.writeText(sourceCode) + } + } +} + +val commonTestSources by task { + val sources = listOf( + "libraries/stdlib/test/", + "libraries/stdlib/common/test/" + ) + + sources.forEach { path -> + from("$rootDir/$path") { + into(path.dropLastWhile { it != '/' }) + } + } + + into("$buildDir/commonTestSources") +} + +val jsTestSources by task { + from("$rootDir/libraries/stdlib/js/test/") + into("$buildDir/jsTestSources") +} + +kotlin { + sourceSets { + val commonMain by getting { + kotlin.srcDir(files(commonMainSources.map { it.destinationDir })) + } + val jsMain by getting { + kotlin.srcDir(files(jsMainSources.map { it.destinationDir })) + kotlin.srcDir("builtins") + kotlin.srcDir("runtime") + kotlin.srcDir("src") + } + val commonTest by getting { + dependencies { + api(project(":kotlin-test:kotlin-test-js-ir")) + } + kotlin.srcDir(files(commonTestSources.map { it.destinationDir })) + } + val jsTest by getting { + dependencies { + api(project(":kotlin-test:kotlin-test-js-ir")) + } + kotlin.srcDir(files(jsTestSources.map { it.destinationDir })) + } + } +} + +tasks.withType>().configureEach { + kotlinOptions.freeCompilerArgs += listOf( + "-Xallow-kotlin-package", + "-Xopt-in=kotlin.ExperimentalMultiplatform", + "-Xopt-in=kotlin.contracts.ExperimentalContracts", + "-Xopt-in=kotlin.RequiresOptIn", + "-Xopt-in=kotlin.ExperimentalUnsignedTypes", + "-Xopt-in=kotlin.ExperimentalStdlibApi" + ) +} + +val compileKotlinJs by tasks.existing(KotlinCompile::class) { + kotlinOptions.freeCompilerArgs += "-Xir-module-name=kotlin" + + if (!kotlinBuildProperties.disableWerror) { + kotlinOptions.allWarningsAsErrors = true + } +} + +val compileTestKotlinJs by tasks.existing(KotlinCompile::class) { + val sources: FileCollection = kotlin.sourceSets["commonTest"].kotlin + doFirst { + // Note: common test sources are copied to the actual source directory by commonMainSources task, + // so can't do this at configuration time: + kotlinOptions.freeCompilerArgs += "-Xcommon-sources=${sources.joinToString(",")}" + } +} + +val packFullRuntimeKLib by tasks.registering(Jar::class) { + dependsOn(compileKotlinJs) + from(buildDir.resolve("classes/kotlin/js/main")) + destinationDirectory.set(rootProject.buildDir.resolve("js-ir-runtime")) + archiveFileName.set("full-runtime.klib") +} diff --git a/libraries/stdlib/py/builtins/Arrays.kt b/libraries/stdlib/py/builtins/Arrays.kt new file mode 100644 index 0000000000000..4b8df504cfa25 --- /dev/null +++ b/libraries/stdlib/py/builtins/Arrays.kt @@ -0,0 +1,224 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress( + "NON_ABSTRACT_FUNCTION_WITH_NO_BODY", + "MUST_BE_INITIALIZED_OR_BE_ABSTRACT", + "EXTERNAL_TYPE_EXTENDS_NON_EXTERNAL_TYPE", + "PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED", + "WRONG_MODIFIER_TARGET", + "UNUSED_PARAMETER" +) + +package kotlin + +/** + * An array of bytes. When targeting the JVM, instances of this class are represented as `byte[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to zero. + */ +class ByteArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Byte) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Byte + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Byte): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): ByteIterator +} + +/** + * An array of chars. When targeting the JVM, instances of this class are represented as `char[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to null char (`\u0000'). + */ +class CharArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Char) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Char + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Char): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): CharIterator +} + +/** + * An array of shorts. When targeting the JVM, instances of this class are represented as `short[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to zero. + */ +class ShortArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Short) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Short + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Short): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): ShortIterator +} + +/** + * An array of ints. When targeting the JVM, instances of this class are represented as `int[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to zero. + */ +class IntArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Int) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Int + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Int): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): IntIterator +} + +/** + * An array of longs. When targeting the JVM, instances of this class are represented as `long[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to zero. + */ +class LongArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Long) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Long + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Long): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): LongIterator +} + +/** + * An array of floats. When targeting the JVM, instances of this class are represented as `float[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to zero. + */ +class FloatArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Float) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Float + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Float): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): FloatIterator +} + +/** + * An array of doubles. When targeting the JVM, instances of this class are represented as `double[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to zero. + */ +class DoubleArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Double) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Double + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Double): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): DoubleIterator +} + +/** + * An array of booleans. When targeting the JVM, instances of this class are represented as `boolean[]`. + * @constructor Creates a new array of the specified [size], with all elements initialized to `false`. + */ +class BooleanArray(size: Int) { + /** + * Creates a new array of the specified [size], where each element is calculated by calling the specified + * [init] function. + * + * The function [init] is called for each array element sequentially starting from the first one. + * It should return the value for an array element given its index. + */ + inline constructor(size: Int, init: (Int) -> Boolean) + + /** Returns the array element at the given [index]. This method can be called using the index operator. */ + operator fun get(index: Int): Boolean + /** Sets the element at the given [index] to the given [value]. This method can be called using the index operator. */ + operator fun set(index: Int, value: Boolean): Unit + + /** Returns the number of elements in the array. */ + val size: Int + + /** Creates an iterator over the elements of the array. */ + operator fun iterator(): BooleanIterator +} + diff --git a/libraries/stdlib/py/builtins/Boolean.kt b/libraries/stdlib/py/builtins/Boolean.kt new file mode 100644 index 0000000000000..2778cb74a7f39 --- /dev/null +++ b/libraries/stdlib/py/builtins/Boolean.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("NON_ABSTRACT_FUNCTION_WITH_NO_BODY", "UNUSED_PARAMETER") + +package kotlin + +/** + * Represents a value which is either `true` or `false`. On the JVM, non-nullable values of this type are + * represented as values of the primitive type `boolean`. + */ +class Boolean private constructor() : Comparable { + /** + * Returns the inverse of this boolean. + */ + operator fun not(): Boolean + + /** + * Performs a logical `and` operation between this Boolean and the [other] one. Unlike the `&&` operator, + * this function does not perform short-circuit evaluation. Both `this` and [other] will always be evaluated. + */ + infix fun and(other: Boolean): Boolean + + /** + * Performs a logical `or` operation between this Boolean and the [other] one. Unlike the `||` operator, + * this function does not perform short-circuit evaluation. Both `this` and [other] will always be evaluated. + */ + infix fun or(other: Boolean): Boolean + + /** + * Performs a logical `xor` operation between this Boolean and the [other] one. + */ + infix fun xor(other: Boolean): Boolean + + override fun compareTo(other: Boolean): Int + + + override fun equals(other: Any?): Boolean + + override fun hashCode(): Int + + override fun toString(): String + + @SinceKotlin("1.3") + companion object +} diff --git a/libraries/stdlib/py/builtins/Char.kt b/libraries/stdlib/py/builtins/Char.kt new file mode 100644 index 0000000000000..8a9602a40a4ba --- /dev/null +++ b/libraries/stdlib/py/builtins/Char.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin + +/** + * Represents a 16-bit Unicode character. + * On the JVM, non-nullable values of this type are represented as values of the primitive type `char`. + */ +// TODO: KT-35100 +//public inline class Char internal constructor (val value: Int) : Comparable { +class Char +@SinceKotlin("1.5") +@WasExperimental(ExperimentalStdlibApi::class) +constructor(code: UShort) : Comparable { + private val value: Int = code.toInt() + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + override fun compareTo(other: Char): Int = value - other.value + + /** Adds the other Int value to this value resulting a Char. */ + operator fun plus(other: Int): Char = (value + other).toChar() + + /** Subtracts the other Char value from this value resulting an Int. */ + operator fun minus(other: Char): Int = value - other.value + /** Subtracts the other Int value from this value resulting a Char. */ + operator fun minus(other: Int): Char = (value - other).toChar() + + /** + * Returns this value incremented by one. + * + * @sample samples.misc.Builtins.inc + */ + operator fun inc(): Char = (value + 1).toChar() + + /** + * Returns this value decremented by one. + * + * @sample samples.misc.Builtins.dec + */ + operator fun dec(): Char = (value - 1).toChar() + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Char): CharRange = CharRange(this, other) + + /** Returns the value of this character as a `Byte`. */ + @Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toByte()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + fun toByte(): Byte = value.toByte() + /** Returns the value of this character as a `Char`. */ + fun toChar(): Char = this + /** Returns the value of this character as a `Short`. */ + @Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toShort()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + fun toShort(): Short = value.toShort() + /** Returns the value of this character as a `Int`. */ + @Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code")) + @DeprecatedSinceKotlin(warningSince = "1.5") + fun toInt(): Int = value + /** Returns the value of this character as a `Long`. */ + @Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toLong()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + fun toLong(): Long = value.toLong() + /** Returns the value of this character as a `Float`. */ + @Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toFloat()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + fun toFloat(): Float = value.toFloat() + /** Returns the value of this character as a `Double`. */ + @Deprecated("Conversion of Char to Number is deprecated. Use Char.code property instead.", ReplaceWith("this.code.toDouble()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + fun toDouble(): Double = value.toDouble() + + override fun equals(other: Any?): Boolean { + @Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS") + if (other === this) return true + if (other !is Char) return false + + return this.value == other.value + } + + override fun hashCode(): Int = value + + // TODO implicit usages of toString and valueOf must be covered in DCE + @Suppress("JS_NAME_PROHIBITED_FOR_OVERRIDE") + @JsName("toString") + override fun toString(): String { + return js("String").fromCharCode(value).unsafeCast() + } + + companion object { + /** + * The minimum value of a character code unit. + */ + @SinceKotlin("1.3") + const val MIN_VALUE: Char = '\u0000' + + /** + * The maximum value of a character code unit. + */ + @SinceKotlin("1.3") + const val MAX_VALUE: Char = '\uFFFF' + + /** + * The minimum value of a Unicode high-surrogate code unit. + */ + const val MIN_HIGH_SURROGATE: Char = '\uD800' + + /** + * The maximum value of a Unicode high-surrogate code unit. + */ + const val MAX_HIGH_SURROGATE: Char = '\uDBFF' + + /** + * The minimum value of a Unicode low-surrogate code unit. + */ + const val MIN_LOW_SURROGATE: Char = '\uDC00' + + /** + * The maximum value of a Unicode low-surrogate code unit. + */ + const val MAX_LOW_SURROGATE: Char = '\uDFFF' + + /** + * The minimum value of a Unicode surrogate code unit. + */ + const val MIN_SURROGATE: Char = MIN_HIGH_SURROGATE + + /** + * The maximum value of a Unicode surrogate code unit. + */ + const val MAX_SURROGATE: Char = MAX_LOW_SURROGATE + + /** + * The number of bytes used to represent a Char in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BYTES: Int = 2 + + /** + * The number of bits used to represent a Char in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BITS: Int = 16 + } + +} \ No newline at end of file diff --git a/libraries/stdlib/py/builtins/Collections.kt b/libraries/stdlib/py/builtins/Collections.kt new file mode 100644 index 0000000000000..afcb73205d4ec --- /dev/null +++ b/libraries/stdlib/py/builtins/Collections.kt @@ -0,0 +1,435 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress( + "NON_ABSTRACT_FUNCTION_WITH_NO_BODY", + "MUST_BE_INITIALIZED_OR_BE_ABSTRACT", + "EXTERNAL_TYPE_EXTENDS_NON_EXTERNAL_TYPE", + "PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED", + "WRONG_MODIFIER_TARGET" +) +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin.collections + +/** + * Classes that inherit from this interface can be represented as a sequence of elements that can + * be iterated over. + * @param T the type of element being iterated over. The iterator is covariant in its element type. + */ +interface Iterable { + /** + * Returns an iterator over the elements of this object. + */ + operator fun iterator(): Iterator +} + +/** + * Classes that inherit from this interface can be represented as a sequence of elements that can + * be iterated over and that supports removing elements during iteration. + * @param T the type of element being iterated over. The mutable iterator is invariant in its element type. + */ +interface MutableIterable : Iterable { + /** + * Returns an iterator over the elements of this sequence that supports removing elements during iteration. + */ + override fun iterator(): MutableIterator +} + +/** + * A generic collection of elements. Methods in this interface support only read-only access to the collection; + * read/write access is supported through the [MutableCollection] interface. + * @param E the type of elements contained in the collection. The collection is covariant in its element type. + */ +interface Collection : Iterable { + // Query Operations + /** + * Returns the size of the collection. + */ + val size: Int + + /** + * Returns `true` if the collection is empty (contains no elements), `false` otherwise. + */ + fun isEmpty(): Boolean + + /** + * Checks if the specified element is contained in this collection. + */ + operator fun contains(element: @UnsafeVariance E): Boolean + + override fun iterator(): Iterator + + // Bulk Operations + /** + * Checks if all elements in the specified collection are contained in this collection. + */ + fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean +} + +/** + * A generic collection of elements that supports adding and removing elements. + * + * @param E the type of elements contained in the collection. The mutable collection is invariant in its element type. + */ +interface MutableCollection : Collection, MutableIterable { + // Query Operations + override fun iterator(): MutableIterator + + // Modification Operations + /** + * Adds the specified element to the collection. + * + * @return `true` if the element has been added, `false` if the collection does not support duplicates + * and the element is already contained in the collection. + */ + fun add(element: E): Boolean + + /** + * Removes a single instance of the specified element from this + * collection, if it is present. + * + * @return `true` if the element has been successfully removed; `false` if it was not present in the collection. + */ + fun remove(element: E): Boolean + + // Bulk Modification Operations + /** + * Adds all of the elements of the specified collection to this collection. + * + * @return `true` if any of the specified elements was added to the collection, `false` if the collection was not modified. + */ + fun addAll(elements: Collection): Boolean + + /** + * Removes all of this collection's elements that are also contained in the specified collection. + * + * @return `true` if any of the specified elements was removed from the collection, `false` if the collection was not modified. + */ + fun removeAll(elements: Collection): Boolean + + /** + * Retains only the elements in this collection that are contained in the specified collection. + * + * @return `true` if any element was removed from the collection, `false` if the collection was not modified. + */ + fun retainAll(elements: Collection): Boolean + + /** + * Removes all elements from this collection. + */ + fun clear(): Unit +} + +/** + * A generic ordered collection of elements. Methods in this interface support only read-only access to the list; + * read/write access is supported through the [MutableList] interface. + * @param E the type of elements contained in the list. The list is covariant in its element type. + */ +interface List : Collection { + // Query Operations + + override val size: Int + override fun isEmpty(): Boolean + override fun contains(element: @UnsafeVariance E): Boolean + override fun iterator(): Iterator + + // Bulk Operations + override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean + + // Positional Access Operations + /** + * Returns the element at the specified index in the list. + */ + operator fun get(index: Int): E + + // Search Operations + /** + * Returns the index of the first occurrence of the specified element in the list, or -1 if the specified + * element is not contained in the list. + */ + fun indexOf(element: @UnsafeVariance E): Int + + /** + * Returns the index of the last occurrence of the specified element in the list, or -1 if the specified + * element is not contained in the list. + */ + fun lastIndexOf(element: @UnsafeVariance E): Int + + // List Iterators + /** + * Returns a list iterator over the elements in this list (in proper sequence). + */ + fun listIterator(): ListIterator + + /** + * Returns a list iterator over the elements in this list (in proper sequence), starting at the specified [index]. + */ + fun listIterator(index: Int): ListIterator + + // View + /** + * Returns a view of the portion of this list between the specified [fromIndex] (inclusive) and [toIndex] (exclusive). + * The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. + * + * Structural changes in the base list make the behavior of the view undefined. + */ + fun subList(fromIndex: Int, toIndex: Int): List +} + +/** + * A generic ordered collection of elements that supports adding and removing elements. + * @param E the type of elements contained in the list. The mutable list is invariant in its element type. + */ +interface MutableList : List, MutableCollection { + // Modification Operations + /** + * Adds the specified element to the end of this list. + * + * @return `true` because the list is always modified as the result of this operation. + */ + override fun add(element: E): Boolean + + override fun remove(element: E): Boolean + + // Bulk Modification Operations + /** + * Adds all of the elements of the specified collection to the end of this list. + * + * The elements are appended in the order they appear in the [elements] collection. + * + * @return `true` if the list was changed as the result of the operation. + */ + override fun addAll(elements: Collection): Boolean + + /** + * Inserts all of the elements of the specified collection [elements] into this list at the specified [index]. + * + * @return `true` if the list was changed as the result of the operation. + */ + fun addAll(index: Int, elements: Collection): Boolean + + override fun removeAll(elements: Collection): Boolean + override fun retainAll(elements: Collection): Boolean + override fun clear(): Unit + + // Positional Access Operations + /** + * Replaces the element at the specified position in this list with the specified element. + * + * @return the element previously at the specified position. + */ + operator fun set(index: Int, element: E): E + + /** + * Inserts an element into the list at the specified [index]. + */ + fun add(index: Int, element: E): Unit + + /** + * Removes an element at the specified [index] from the list. + * + * @return the element that has been removed. + */ + fun removeAt(index: Int): E + + // List Iterators + override fun listIterator(): MutableListIterator + + override fun listIterator(index: Int): MutableListIterator + + // View + override fun subList(fromIndex: Int, toIndex: Int): MutableList +} + +/** + * A generic unordered collection of elements that does not support duplicate elements. + * Methods in this interface support only read-only access to the set; + * read/write access is supported through the [MutableSet] interface. + * @param E the type of elements contained in the set. The set is covariant in its element type. + */ +interface Set : Collection { + // Query Operations + + override val size: Int + override fun isEmpty(): Boolean + override fun contains(element: @UnsafeVariance E): Boolean + override fun iterator(): Iterator + + // Bulk Operations + override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean +} + +/** + * A generic unordered collection of elements that does not support duplicate elements, and supports + * adding and removing elements. + * @param E the type of elements contained in the set. The mutable set is invariant in its element type. + */ +interface MutableSet : Set, MutableCollection { + // Query Operations + override fun iterator(): MutableIterator + + // Modification Operations + + /** + * Adds the specified element to the set. + * + * @return `true` if the element has been added, `false` if the element is already contained in the set. + */ + override fun add(element: E): Boolean + + override fun remove(element: E): Boolean + + // Bulk Modification Operations + + override fun addAll(elements: Collection): Boolean + override fun removeAll(elements: Collection): Boolean + override fun retainAll(elements: Collection): Boolean + override fun clear(): Unit +} + +/** + * A collection that holds pairs of objects (keys and values) and supports efficiently retrieving + * the value corresponding to each key. Map keys are unique; the map holds only one value for each key. + * Methods in this interface support only read-only access to the map; read-write access is supported through + * the [MutableMap] interface. + * @param K the type of map keys. The map is invariant in its key type, as it + * can accept key as a parameter (of [containsKey] for example) and return it in [keys] set. + * @param V the type of map values. The map is covariant in its value type. + */ +interface Map { + // Query Operations + /** + * Returns the number of key/value pairs in the map. + */ + val size: Int + + /** + * Returns `true` if the map is empty (contains no elements), `false` otherwise. + */ + fun isEmpty(): Boolean + + /** + * Returns `true` if the map contains the specified [key]. + */ + fun containsKey(key: K): Boolean + + /** + * Returns `true` if the map maps one or more keys to the specified [value]. + */ + fun containsValue(value: @UnsafeVariance V): Boolean + + /** + * Returns the value corresponding to the given [key], or `null` if such a key is not present in the map. + */ + operator fun get(key: K): V? + + // Views + /** + * Returns a read-only [Set] of all keys in this map. + */ + val keys: Set + + /** + * Returns a read-only [Collection] of all values in this map. Note that this collection may contain duplicate values. + */ + val values: Collection + + /** + * Returns a read-only [Set] of all key/value pairs in this map. + */ + val entries: Set> + + /** + * Represents a key/value pair held by a [Map]. + */ + interface Entry { + /** + * Returns the key of this key/value pair. + */ + val key: K + + /** + * Returns the value of this key/value pair. + */ + val value: V + } +} + +/** + * A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving + * the value corresponding to each key. Map keys are unique; the map holds only one value for each key. + * @param K the type of map keys. The map is invariant in its key type. + * @param V the type of map values. The mutable map is invariant in its value type. + */ +interface MutableMap : Map { + // Modification Operations + /** + * Associates the specified [value] with the specified [key] in the map. + * + * @return the previous value associated with the key, or `null` if the key was not present in the map. + */ + fun put(key: K, value: V): V? + + /** + * Removes the specified key and its corresponding value from this map. + * + * @return the previous value associated with the key, or `null` if the key was not present in the map. + */ + fun remove(key: K): V? + + // Bulk Modification Operations + /** + * Updates this map with key/value pairs from the specified map [from]. + */ + fun putAll(from: Map): Unit + + /** + * Removes all elements from this map. + */ + fun clear(): Unit + + // Views + /** + * Returns a [MutableSet] of all keys in this map. + */ + override val keys: MutableSet + + /** + * Returns a [MutableCollection] of all values in this map. Note that this collection may contain duplicate values. + */ + override val values: MutableCollection + + /** + * Returns a [MutableSet] of all key/value pairs in this map. + */ + override val entries: MutableSet> + + /** + * Represents a key/value pair held by a [MutableMap]. + */ + interface MutableEntry : Map.Entry { + /** + * Changes the value associated with the key of this entry. + * + * @return the previous value corresponding to the key. + */ + fun setValue(newValue: V): V + } +} diff --git a/libraries/stdlib/py/builtins/Enum.kt b/libraries/stdlib/py/builtins/Enum.kt new file mode 100644 index 0000000000000..823df9fdfeac2 --- /dev/null +++ b/libraries/stdlib/py/builtins/Enum.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin + +abstract class Enum>(val name: String, val ordinal: Int) : Comparable { + + final override fun compareTo(other: E) = ordinal.compareTo(other.ordinal) + + final override fun equals(other: Any?) = this === other + + final override fun hashCode(): Int = identityHashCode(this) + + override fun toString() = name + + companion object +} \ No newline at end of file diff --git a/libraries/stdlib/py/builtins/Library.kt b/libraries/stdlib/py/builtins/Library.kt new file mode 100644 index 0000000000000..4bfa628a50576 --- /dev/null +++ b/libraries/stdlib/py/builtins/Library.kt @@ -0,0 +1,88 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("NOTHING_TO_INLINE") + +package kotlin + +/** + * Returns a string representation of the object. Can be called with a null receiver, in which case + * it returns the string "null". + */ +fun Any?.toString(): String = this?.toString() ?: "null" + + +/** + * Concatenates this string with the string representation of the given [other] object. If either the receiver + * or the [other] object are null, they are represented as the string "null". + */ +operator fun String?.plus(other: Any?): String = + (this?.toString() ?: "null").plus(other?.toString() ?: "null") + +/** + * Returns an array of objects of the given type with the given [size], initialized with null values. + */ +inline fun arrayOfNulls(size: Int): Array = fillArrayVal(Array(size), null) + +/** + * Returns an array containing the specified elements. + */ +inline fun arrayOf(vararg elements: T): Array = elements.unsafeCast>() + +/** + * Returns an array containing the specified [Double] numbers. + */ +inline fun doubleArrayOf(vararg elements: Double): DoubleArray = elements + +/** + * Returns an array containing the specified [Float] numbers. + */ +inline fun floatArrayOf(vararg elements: Float): FloatArray = elements + +/** + * Returns an array containing the specified [Long] numbers. + */ +inline fun longArrayOf(vararg elements: Long): LongArray = elements + +/** + * Returns an array containing the specified [Int] numbers. + */ +inline fun intArrayOf(vararg elements: Int): IntArray = elements + +/** + * Returns an array containing the specified characters. + */ +inline fun charArrayOf(vararg elements: Char): CharArray = elements + +/** + * Returns an array containing the specified [Short] numbers. + */ +inline fun shortArrayOf(vararg elements: Short): ShortArray = elements + +/** + * Returns an array containing the specified [Byte] numbers. + */ +inline fun byteArrayOf(vararg elements: Byte): ByteArray = elements + +/** + * Returns an array containing the specified boolean values. + */ +inline fun booleanArrayOf(vararg elements: Boolean): BooleanArray = elements + +// Use non-inline calls to enumValuesIntrinsic and enumValueOfIntrinsic calls in order +// for compiler to replace them with method calls of concrete enum classes after inlining. +// TODO: Figure out better solution (Inline hacks? Dynamic calls to stable mangled names?) + +/** + * Returns an array containing enum T entries. + */ +@SinceKotlin("1.1") +inline fun > enumValues(): Array = enumValuesIntrinsic() + +/** + * Returns an enum entry with specified name. + */ +@SinceKotlin("1.1") +inline fun > enumValueOf(name: String): T = enumValueOfIntrinsic(name) \ No newline at end of file diff --git a/libraries/stdlib/py/builtins/Primitives.kt b/libraries/stdlib/py/builtins/Primitives.kt new file mode 100644 index 0000000000000..7ef495bbd2340 --- /dev/null +++ b/libraries/stdlib/py/builtins/Primitives.kt @@ -0,0 +1,1310 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +// Auto-generated file. DO NOT EDIT! +@file:Suppress("NON_ABSTRACT_FUNCTION_WITH_NO_BODY", "UNUSED_PARAMETER") + +package kotlin + +/** + * Represents a 8-bit signed integer. + * On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`. + */ +class Byte private constructor() : Number(), Comparable { + companion object { + /** + * A constant holding the minimum value an instance of Byte can have. + */ + const val MIN_VALUE: Byte = -128 + + /** + * A constant holding the maximum value an instance of Byte can have. + */ + const val MAX_VALUE: Byte = 127 + + /** + * The number of bytes used to represent an instance of Byte in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BYTES: Int = 1 + + /** + * The number of bits used to represent an instance of Byte in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BITS: Int = 8 + } + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + override operator fun compareTo(other: Byte): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Short): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Int): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Long): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Float): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Double): Int + + /** Adds the other value to this value. */ + operator fun plus(other: Byte): Int + /** Adds the other value to this value. */ + operator fun plus(other: Short): Int + /** Adds the other value to this value. */ + operator fun plus(other: Int): Int + /** Adds the other value to this value. */ + operator fun plus(other: Long): Long + /** Adds the other value to this value. */ + operator fun plus(other: Float): Float + /** Adds the other value to this value. */ + operator fun plus(other: Double): Double + + /** Subtracts the other value from this value. */ + operator fun minus(other: Byte): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Short): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Int): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Long): Long + /** Subtracts the other value from this value. */ + operator fun minus(other: Float): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Double): Double + + /** Multiplies this value by the other value. */ + operator fun times(other: Byte): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Short): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Int): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Long): Long + /** Multiplies this value by the other value. */ + operator fun times(other: Float): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Double): Double + + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Byte): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Short): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Int): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Long): Long + /** Divides this value by the other value. */ + operator fun div(other: Float): Float + /** Divides this value by the other value. */ + operator fun div(other: Double): Double + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Byte): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Short): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Int): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Long): Long + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Float): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Double): Double + + /** + * Returns this value incremented by one. + * + * @sample samples.misc.Builtins.inc + */ + operator fun inc(): Byte + + /** + * Returns this value decremented by one. + * + * @sample samples.misc.Builtins.dec + */ + operator fun dec(): Byte + + /** Returns this value. */ + operator fun unaryPlus(): Int + /** Returns the negative of this value. */ + operator fun unaryMinus(): Int + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Byte): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Short): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Int): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Long): LongRange + + /** Returns this value. */ + override fun toByte(): Byte + /** + * Converts this [Byte] value to [Char]. + * + * If this value is non-negative, the resulting `Char` code is equal to this value. + * + * The least significant 8 bits of the resulting `Char` code are the same as the bits of this `Byte` value, + * whereas the most significant 8 bits are filled with the sign bit of this value. + */ + @Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + override fun toChar(): Char + /** + * Converts this [Byte] value to [Short]. + * + * The resulting `Short` value represents the same numerical value as this `Byte`. + * + * The least significant 8 bits of the resulting `Short` value are the same as the bits of this `Byte` value, + * whereas the most significant 8 bits are filled with the sign bit of this value. + */ + override fun toShort(): Short + /** + * Converts this [Byte] value to [Int]. + * + * The resulting `Int` value represents the same numerical value as this `Byte`. + * + * The least significant 8 bits of the resulting `Int` value are the same as the bits of this `Byte` value, + * whereas the most significant 24 bits are filled with the sign bit of this value. + */ + override fun toInt(): Int + /** + * Converts this [Byte] value to [Long]. + * + * The resulting `Long` value represents the same numerical value as this `Byte`. + * + * The least significant 8 bits of the resulting `Long` value are the same as the bits of this `Byte` value, + * whereas the most significant 56 bits are filled with the sign bit of this value. + */ + override fun toLong(): Long + /** + * Converts this [Byte] value to [Float]. + * + * The resulting `Float` value represents the same numerical value as this `Byte`. + */ + override fun toFloat(): Float + /** + * Converts this [Byte] value to [Double]. + * + * The resulting `Double` value represents the same numerical value as this `Byte`. + */ + override fun toDouble(): Double + + override fun equals(other: Any?): Boolean + override fun hashCode(): Int + override fun toString(): String +} + +/** + * Represents a 16-bit signed integer. + * On the JVM, non-nullable values of this type are represented as values of the primitive type `short`. + */ +class Short private constructor() : Number(), Comparable { + companion object { + /** + * A constant holding the minimum value an instance of Short can have. + */ + const val MIN_VALUE: Short = -32768 + + /** + * A constant holding the maximum value an instance of Short can have. + */ + const val MAX_VALUE: Short = 32767 + + /** + * The number of bytes used to represent an instance of Short in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BYTES: Int = 2 + + /** + * The number of bits used to represent an instance of Short in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BITS: Int = 16 + } + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Byte): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + override operator fun compareTo(other: Short): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Int): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Long): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Float): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Double): Int + + /** Adds the other value to this value. */ + operator fun plus(other: Byte): Int + /** Adds the other value to this value. */ + operator fun plus(other: Short): Int + /** Adds the other value to this value. */ + operator fun plus(other: Int): Int + /** Adds the other value to this value. */ + operator fun plus(other: Long): Long + /** Adds the other value to this value. */ + operator fun plus(other: Float): Float + /** Adds the other value to this value. */ + operator fun plus(other: Double): Double + + /** Subtracts the other value from this value. */ + operator fun minus(other: Byte): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Short): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Int): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Long): Long + /** Subtracts the other value from this value. */ + operator fun minus(other: Float): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Double): Double + + /** Multiplies this value by the other value. */ + operator fun times(other: Byte): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Short): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Int): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Long): Long + /** Multiplies this value by the other value. */ + operator fun times(other: Float): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Double): Double + + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Byte): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Short): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Int): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Long): Long + /** Divides this value by the other value. */ + operator fun div(other: Float): Float + /** Divides this value by the other value. */ + operator fun div(other: Double): Double + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Byte): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Short): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Int): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Long): Long + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Float): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Double): Double + + /** + * Returns this value incremented by one. + * + * @sample samples.misc.Builtins.inc + */ + operator fun inc(): Short + + /** + * Returns this value decremented by one. + * + * @sample samples.misc.Builtins.dec + */ + operator fun dec(): Short + + /** Returns this value. */ + operator fun unaryPlus(): Int + /** Returns the negative of this value. */ + operator fun unaryMinus(): Int + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Byte): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Short): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Int): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Long): LongRange + + /** + * Converts this [Short] value to [Byte]. + * + * If this value is in [Byte.MIN_VALUE]..[Byte.MAX_VALUE], the resulting `Byte` value represents + * the same numerical value as this `Short`. + * + * The resulting `Byte` value is represented by the least significant 8 bits of this `Short` value. + */ + override fun toByte(): Byte + /** + * Converts this [Short] value to [Char]. + * + * The resulting `Char` code is equal to this value reinterpreted as an unsigned number, + * i.e. it has the same binary representation as this `Short`. + */ + @Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()")) + override fun toChar(): Char + /** Returns this value. */ + override fun toShort(): Short + /** + * Converts this [Short] value to [Int]. + * + * The resulting `Int` value represents the same numerical value as this `Short`. + * + * The least significant 16 bits of the resulting `Int` value are the same as the bits of this `Short` value, + * whereas the most significant 16 bits are filled with the sign bit of this value. + */ + override fun toInt(): Int + /** + * Converts this [Short] value to [Long]. + * + * The resulting `Long` value represents the same numerical value as this `Short`. + * + * The least significant 16 bits of the resulting `Long` value are the same as the bits of this `Short` value, + * whereas the most significant 48 bits are filled with the sign bit of this value. + */ + override fun toLong(): Long + /** + * Converts this [Short] value to [Float]. + * + * The resulting `Float` value represents the same numerical value as this `Short`. + */ + override fun toFloat(): Float + /** + * Converts this [Short] value to [Double]. + * + * The resulting `Double` value represents the same numerical value as this `Short`. + */ + override fun toDouble(): Double + + override fun equals(other: Any?): Boolean + override fun hashCode(): Int + override fun toString(): String +} + +/** + * Represents a 32-bit signed integer. + * On the JVM, non-nullable values of this type are represented as values of the primitive type `int`. + */ +class Int private constructor() : Number(), Comparable { + companion object { + /** + * A constant holding the minimum value an instance of Int can have. + */ + const val MIN_VALUE: Int = -2147483648 + + /** + * A constant holding the maximum value an instance of Int can have. + */ + const val MAX_VALUE: Int = 2147483647 + + /** + * The number of bytes used to represent an instance of Int in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BYTES: Int = 4 + + /** + * The number of bits used to represent an instance of Int in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BITS: Int = 32 + } + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Byte): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Short): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + override operator fun compareTo(other: Int): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Long): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Float): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Double): Int + + /** Adds the other value to this value. */ + operator fun plus(other: Byte): Int + /** Adds the other value to this value. */ + operator fun plus(other: Short): Int + /** Adds the other value to this value. */ + operator fun plus(other: Int): Int + /** Adds the other value to this value. */ + operator fun plus(other: Long): Long + /** Adds the other value to this value. */ + operator fun plus(other: Float): Float + /** Adds the other value to this value. */ + operator fun plus(other: Double): Double + + /** Subtracts the other value from this value. */ + operator fun minus(other: Byte): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Short): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Int): Int + /** Subtracts the other value from this value. */ + operator fun minus(other: Long): Long + /** Subtracts the other value from this value. */ + operator fun minus(other: Float): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Double): Double + + /** Multiplies this value by the other value. */ + operator fun times(other: Byte): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Short): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Int): Int + /** Multiplies this value by the other value. */ + operator fun times(other: Long): Long + /** Multiplies this value by the other value. */ + operator fun times(other: Float): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Double): Double + + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Byte): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Short): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Int): Int + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Long): Long + /** Divides this value by the other value. */ + operator fun div(other: Float): Float + /** Divides this value by the other value. */ + operator fun div(other: Double): Double + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Byte): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Short): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Int): Int + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Long): Long + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Float): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Double): Double + + /** + * Returns this value incremented by one. + * + * @sample samples.misc.Builtins.inc + */ + operator fun inc(): Int + + /** + * Returns this value decremented by one. + * + * @sample samples.misc.Builtins.dec + */ + operator fun dec(): Int + + /** Returns this value. */ + operator fun unaryPlus(): Int + /** Returns the negative of this value. */ + operator fun unaryMinus(): Int + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Byte): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Short): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Int): IntRange + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Long): LongRange + + /** + * Shifts this value left by the [bitCount] number of bits. + * + * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance. + * The shift distance actually used is therefore always in the range `0..31`. + */ + infix fun shl(bitCount: Int): Int + + /** + * Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with copies of the sign bit. + * + * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance. + * The shift distance actually used is therefore always in the range `0..31`. + */ + infix fun shr(bitCount: Int): Int + + /** + * Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros. + * + * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance. + * The shift distance actually used is therefore always in the range `0..31`. + */ + infix fun ushr(bitCount: Int): Int + + /** Performs a bitwise AND operation between the two values. */ + infix fun and(other: Int): Int + /** Performs a bitwise OR operation between the two values. */ + infix fun or(other: Int): Int + /** Performs a bitwise XOR operation between the two values. */ + infix fun xor(other: Int): Int + /** Inverts the bits in this value. */ + fun inv(): Int + + /** + * Converts this [Int] value to [Byte]. + * + * If this value is in [Byte.MIN_VALUE]..[Byte.MAX_VALUE], the resulting `Byte` value represents + * the same numerical value as this `Int`. + * + * The resulting `Byte` value is represented by the least significant 8 bits of this `Int` value. + */ + override fun toByte(): Byte + /** + * Converts this [Int] value to [Char]. + * + * If this value is in the range of `Char` codes `Char.MIN_VALUE..Char.MAX_VALUE`, + * the resulting `Char` code is equal to this value. + * + * The resulting `Char` code is represented by the least significant 16 bits of this `Int` value. + */ + override fun toChar(): Char + /** + * Converts this [Int] value to [Short]. + * + * If this value is in [Short.MIN_VALUE]..[Short.MAX_VALUE], the resulting `Short` value represents + * the same numerical value as this `Int`. + * + * The resulting `Short` value is represented by the least significant 16 bits of this `Int` value. + */ + override fun toShort(): Short + /** Returns this value. */ + override fun toInt(): Int + /** + * Converts this [Int] value to [Long]. + * + * The resulting `Long` value represents the same numerical value as this `Int`. + * + * The least significant 32 bits of the resulting `Long` value are the same as the bits of this `Int` value, + * whereas the most significant 32 bits are filled with the sign bit of this value. + */ + override fun toLong(): Long + /** + * Converts this [Int] value to [Float]. + * + * The resulting value is the closest `Float` to this `Int` value. + * In case when this `Int` value is exactly between two `Float`s, + * the one with zero at least significant bit of mantissa is selected. + */ + override fun toFloat(): Float + /** + * Converts this [Int] value to [Double]. + * + * The resulting `Double` value represents the same numerical value as this `Int`. + */ + override fun toDouble(): Double + + override fun equals(other: Any?): Boolean + override fun hashCode(): Int + override fun toString(): String +} + +/** + * Represents a single-precision 32-bit IEEE 754 floating point number. + * On the JVM, non-nullable values of this type are represented as values of the primitive type `float`. + */ +class Float private constructor() : Number(), Comparable { + @Suppress("DIVISION_BY_ZERO") + companion object { + /** + * A constant holding the smallest *positive* nonzero value of Float. + */ + const val MIN_VALUE: Float = 1.4E-45F + + /** + * A constant holding the largest positive finite value of Float. + */ + const val MAX_VALUE: Float = 3.4028235E38F + + /** + * A constant holding the positive infinity value of Float. + */ + const val POSITIVE_INFINITY: Float = 1.0F/0.0F + + /** + * A constant holding the negative infinity value of Float. + */ + const val NEGATIVE_INFINITY: Float = -1.0F/0.0F + + /** + * A constant holding the "not a number" value of Float. + */ + const val NaN: Float = -(0.0F/0.0F) + + /** + * The number of bytes used to represent an instance of Float in a binary form. + */ + @SinceKotlin("1.4") + const val SIZE_BYTES: Int = 4 + + /** + * The number of bits used to represent an instance of Float in a binary form. + */ + @SinceKotlin("1.4") + const val SIZE_BITS: Int = 32 + } + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Byte): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Short): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Int): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Long): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + override operator fun compareTo(other: Float): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Double): Int + + /** Adds the other value to this value. */ + operator fun plus(other: Byte): Float + /** Adds the other value to this value. */ + operator fun plus(other: Short): Float + /** Adds the other value to this value. */ + operator fun plus(other: Int): Float + /** Adds the other value to this value. */ + operator fun plus(other: Long): Float + /** Adds the other value to this value. */ + operator fun plus(other: Float): Float + /** Adds the other value to this value. */ + operator fun plus(other: Double): Double + + /** Subtracts the other value from this value. */ + operator fun minus(other: Byte): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Short): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Int): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Long): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Float): Float + /** Subtracts the other value from this value. */ + operator fun minus(other: Double): Double + + /** Multiplies this value by the other value. */ + operator fun times(other: Byte): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Short): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Int): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Long): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Float): Float + /** Multiplies this value by the other value. */ + operator fun times(other: Double): Double + + /** Divides this value by the other value. */ + operator fun div(other: Byte): Float + /** Divides this value by the other value. */ + operator fun div(other: Short): Float + /** Divides this value by the other value. */ + operator fun div(other: Int): Float + /** Divides this value by the other value. */ + operator fun div(other: Long): Float + /** Divides this value by the other value. */ + operator fun div(other: Float): Float + /** Divides this value by the other value. */ + operator fun div(other: Double): Double + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Byte): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Short): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Int): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Long): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Float): Float + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Double): Double + + /** + * Returns this value incremented by one. + * + * @sample samples.misc.Builtins.inc + */ + operator fun inc(): Float + + /** + * Returns this value decremented by one. + * + * @sample samples.misc.Builtins.dec + */ + operator fun dec(): Float + + /** Returns this value. */ + operator fun unaryPlus(): Float + /** Returns the negative of this value. */ + operator fun unaryMinus(): Float + + + /** + * Converts this [Float] value to [Byte]. + * + * The resulting `Byte` value is equal to `this.toInt().toByte()`. + */ + @Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", ReplaceWith("toInt().toByte()")) + @DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5") + override fun toByte(): Byte + /** + * Converts this [Float] value to [Char]. + * + * The resulting `Char` value is equal to `this.toInt().toChar()`. + */ + @Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + override fun toChar(): Char + /** + * Converts this [Float] value to [Short]. + * + * The resulting `Short` value is equal to `this.toInt().toShort()`. + */ + @Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", ReplaceWith("toInt().toShort()")) + @DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5") + override fun toShort(): Short + /** + * Converts this [Float] value to [Int]. + * + * The fractional part, if any, is rounded down towards zero. + * Returns zero if this `Float` value is `NaN`, [Int.MIN_VALUE] if it's less than `Int.MIN_VALUE`, + * [Int.MAX_VALUE] if it's bigger than `Int.MAX_VALUE`. + */ + override fun toInt(): Int + /** + * Converts this [Float] value to [Long]. + * + * The fractional part, if any, is rounded down towards zero. + * Returns zero if this `Float` value is `NaN`, [Long.MIN_VALUE] if it's less than `Long.MIN_VALUE`, + * [Long.MAX_VALUE] if it's bigger than `Long.MAX_VALUE`. + */ + override fun toLong(): Long + /** Returns this value. */ + override fun toFloat(): Float + /** + * Converts this [Float] value to [Double]. + * + * The resulting `Double` value represents the same numerical value as this `Float`. + */ + override fun toDouble(): Double + + override fun equals(other: Any?): Boolean + override fun hashCode(): Int + override fun toString(): String +} + +/** + * Represents a double-precision 64-bit IEEE 754 floating point number. + * On the JVM, non-nullable values of this type are represented as values of the primitive type `double`. + */ +class Double private constructor() : Number(), Comparable { + @Suppress("DIVISION_BY_ZERO") + companion object { + /** + * A constant holding the smallest *positive* nonzero value of Double. + */ + const val MIN_VALUE: Double = 4.9E-324 + + /** + * A constant holding the largest positive finite value of Double. + */ + const val MAX_VALUE: Double = 1.7976931348623157E308 + + /** + * A constant holding the positive infinity value of Double. + */ + const val POSITIVE_INFINITY: Double = 1.0/0.0 + + /** + * A constant holding the negative infinity value of Double. + */ + const val NEGATIVE_INFINITY: Double = -1.0/0.0 + + /** + * A constant holding the "not a number" value of Double. + */ + const val NaN: Double = -(0.0/0.0) + + /** + * The number of bytes used to represent an instance of Double in a binary form. + */ + @SinceKotlin("1.4") + const val SIZE_BYTES: Int = 8 + + /** + * The number of bits used to represent an instance of Double in a binary form. + */ + @SinceKotlin("1.4") + const val SIZE_BITS: Int = 64 + } + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Byte): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Short): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Int): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Long): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + operator fun compareTo(other: Float): Int + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + override operator fun compareTo(other: Double): Int + + /** Adds the other value to this value. */ + operator fun plus(other: Byte): Double + /** Adds the other value to this value. */ + operator fun plus(other: Short): Double + /** Adds the other value to this value. */ + operator fun plus(other: Int): Double + /** Adds the other value to this value. */ + operator fun plus(other: Long): Double + /** Adds the other value to this value. */ + operator fun plus(other: Float): Double + /** Adds the other value to this value. */ + operator fun plus(other: Double): Double + + /** Subtracts the other value from this value. */ + operator fun minus(other: Byte): Double + /** Subtracts the other value from this value. */ + operator fun minus(other: Short): Double + /** Subtracts the other value from this value. */ + operator fun minus(other: Int): Double + /** Subtracts the other value from this value. */ + operator fun minus(other: Long): Double + /** Subtracts the other value from this value. */ + operator fun minus(other: Float): Double + /** Subtracts the other value from this value. */ + operator fun minus(other: Double): Double + + /** Multiplies this value by the other value. */ + operator fun times(other: Byte): Double + /** Multiplies this value by the other value. */ + operator fun times(other: Short): Double + /** Multiplies this value by the other value. */ + operator fun times(other: Int): Double + /** Multiplies this value by the other value. */ + operator fun times(other: Long): Double + /** Multiplies this value by the other value. */ + operator fun times(other: Float): Double + /** Multiplies this value by the other value. */ + operator fun times(other: Double): Double + + /** Divides this value by the other value. */ + operator fun div(other: Byte): Double + /** Divides this value by the other value. */ + operator fun div(other: Short): Double + /** Divides this value by the other value. */ + operator fun div(other: Int): Double + /** Divides this value by the other value. */ + operator fun div(other: Long): Double + /** Divides this value by the other value. */ + operator fun div(other: Float): Double + /** Divides this value by the other value. */ + operator fun div(other: Double): Double + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Byte): Double + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Short): Double + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Int): Double + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Long): Double + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Float): Double + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Double): Double + + /** + * Returns this value incremented by one. + * + * @sample samples.misc.Builtins.inc + */ + operator fun inc(): Double + + /** + * Returns this value decremented by one. + * + * @sample samples.misc.Builtins.dec + */ + operator fun dec(): Double + + /** Returns this value. */ + operator fun unaryPlus(): Double + /** Returns the negative of this value. */ + operator fun unaryMinus(): Double + + + /** + * Converts this [Double] value to [Byte]. + * + * The resulting `Byte` value is equal to `this.toInt().toByte()`. + */ + @Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Byte.", ReplaceWith("toInt().toByte()")) + @DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5") + override fun toByte(): Byte + /** + * Converts this [Double] value to [Char]. + * + * The resulting `Char` value is equal to `this.toInt().toChar()`. + */ + @Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + override fun toChar(): Char + /** + * Converts this [Double] value to [Short]. + * + * The resulting `Short` value is equal to `this.toInt().toShort()`. + */ + @Deprecated("Unclear conversion. To achieve the same result convert to Int explicitly and then to Short.", ReplaceWith("toInt().toShort()")) + @DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5") + override fun toShort(): Short + /** + * Converts this [Double] value to [Int]. + * + * The fractional part, if any, is rounded down towards zero. + * Returns zero if this `Double` value is `NaN`, [Int.MIN_VALUE] if it's less than `Int.MIN_VALUE`, + * [Int.MAX_VALUE] if it's bigger than `Int.MAX_VALUE`. + */ + override fun toInt(): Int + /** + * Converts this [Double] value to [Long]. + * + * The fractional part, if any, is rounded down towards zero. + * Returns zero if this `Double` value is `NaN`, [Long.MIN_VALUE] if it's less than `Long.MIN_VALUE`, + * [Long.MAX_VALUE] if it's bigger than `Long.MAX_VALUE`. + */ + override fun toLong(): Long + /** + * Converts this [Double] value to [Float]. + * + * The resulting value is the closest `Float` to this `Double` value. + * In case when this `Double` value is exactly between two `Float`s, + * the one with zero at least significant bit of mantissa is selected. + */ + override fun toFloat(): Float + /** Returns this value. */ + override fun toDouble(): Double + + override fun equals(other: Any?): Boolean + override fun hashCode(): Int + override fun toString(): String +} + diff --git a/libraries/stdlib/py/builtins/String.kt b/libraries/stdlib/py/builtins/String.kt new file mode 100644 index 0000000000000..b552e8d972960 --- /dev/null +++ b/libraries/stdlib/py/builtins/String.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("NON_ABSTRACT_FUNCTION_WITH_NO_BODY", "MUST_BE_INITIALIZED_OR_BE_ABSTRACT", "UNUSED_PARAMETER") + +package kotlin + +/** + * The `String` class represents character strings. All string literals in Kotlin programs, such as `"abc"`, are + * implemented as instances of this class. + */ +class String : Comparable, CharSequence { + companion object; + + /** + * Returns a string obtained by concatenating this string with the string representation of the given [other] object. + */ + operator fun plus(other: Any?): String + + override val length: Int + + /** + * Returns the character of this string at the specified [index]. + * + * If the [index] is out of bounds of this string, throws an [IndexOutOfBoundsException] except in Kotlin/JS + * where the behavior is unspecified. + */ + override fun get(index: Int): Char + + override fun subSequence(startIndex: Int, endIndex: Int): CharSequence + + override fun compareTo(other: String): Int + + override fun equals(other: Any?): Boolean + + override fun hashCode(): Int + + override fun toString(): String +} diff --git a/libraries/stdlib/py/builtins/Throwable.kt b/libraries/stdlib/py/builtins/Throwable.kt new file mode 100644 index 0000000000000..a5341b5e121a3 --- /dev/null +++ b/libraries/stdlib/py/builtins/Throwable.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin + +/** + * The base class for all errors and exceptions. Only instances of this class can be thrown or caught. + * + * @param message the detail message string. + * @param cause the cause of this throwable. + */ +@JsName("Error") +open external class Throwable { + open val message: String? + open val cause: Throwable? + + constructor(message: String?, cause: Throwable?) + constructor(message: String?) + constructor(cause: Throwable?) + constructor() + + // TODO: add specialized version to runtime +// public override fun equals(other: Any?): Boolean +// public override fun hashCode(): Int + override fun toString(): String +} \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/DefaultConstructorMarker.kt b/libraries/stdlib/py/runtime/DefaultConstructorMarker.kt new file mode 100644 index 0000000000000..85d6e3483bed6 --- /dev/null +++ b/libraries/stdlib/py/runtime/DefaultConstructorMarker.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +internal object DefaultConstructorMarker \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/JsError.kt b/libraries/stdlib/py/runtime/JsError.kt new file mode 100644 index 0000000000000..e3e516decc15f --- /dev/null +++ b/libraries/stdlib/py/runtime/JsError.kt @@ -0,0 +1,7 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@JsName("Error") +internal open external class JsError(message: String) : Throwable \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/arrays.kt b/libraries/stdlib/py/runtime/arrays.kt new file mode 100644 index 0000000000000..11f2ac129e42c --- /dev/null +++ b/libraries/stdlib/py/runtime/arrays.kt @@ -0,0 +1,98 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +import withType + +@PublishedApi +internal external fun Array(size: Int): Array + +@PublishedApi +internal fun fillArrayVal(array: Array, initValue: T): Array { + for (i in 0..array.size - 1) { + array[i] = initValue + } + return array +} + +internal inline fun arrayWithFun(size: Int, init: (Int) -> T) = fillArrayFun(Array(size), init) + +internal inline fun fillArrayFun(array: dynamic, init: (Int) -> T): Array { + val result = array.unsafeCast>() + var i = 0 + while (i != result.size) { + result[i] = init(i) + ++i + } + return result +} + +internal fun booleanArray(size: Int): BooleanArray = withType("BooleanArray", fillArrayVal(Array(size), false)).unsafeCast() + +internal fun booleanArrayOf(arr: Array): BooleanArray = withType("BooleanArray", arr.asDynamic().slice()).unsafeCast() + +//internal fun charArray(size: Int): CharArray = withType("CharArray", fillArrayVal(Array(size), 0)).unsafeCast() +internal fun charArray(size: Int): CharArray = withType("CharArray", fillArrayVal(Array(size), Char(0))).unsafeCast() + +internal fun charArrayOf(arr: Array): CharArray = withType("CharArray", arr.asDynamic().slice()).unsafeCast() + +internal fun longArray(size: Int): LongArray = withType("LongArray", fillArrayVal(Array(size), 0L)).unsafeCast() + +internal fun longArrayOf(arr: Array): LongArray = withType("LongArray", arr.asDynamic().slice()).unsafeCast() + +internal fun arrayIterator(array: Array) = object : Iterator { + var index = 0 + override fun hasNext() = index != array.size + override fun next() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun booleanArrayIterator(array: BooleanArray) = object : BooleanIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextBoolean() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun byteArrayIterator(array: ByteArray) = object : ByteIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextByte() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun shortArrayIterator(array: ShortArray) = object : ShortIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextShort() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun charArrayIterator(array: CharArray) = object : CharIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextChar() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun intArrayIterator(array: IntArray) = object : IntIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextInt() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun floatArrayIterator(array: FloatArray) = object : FloatIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextFloat() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun doubleArrayIterator(array: DoubleArray) = object : DoubleIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextDouble() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} + +internal fun longArrayIterator(array: LongArray) = object : LongIterator() { + var index = 0 + override fun hasNext() = index != array.size + override fun nextLong() = if (index != array.size) array[index++] else throw NoSuchElementException("$index") +} diff --git a/libraries/stdlib/py/runtime/bitUtils.kt b/libraries/stdlib/py/runtime/bitUtils.kt new file mode 100644 index 0000000000000..25af2ae812bee --- /dev/null +++ b/libraries/stdlib/py/runtime/bitUtils.kt @@ -0,0 +1,63 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +// TODO use declarations from stdlib +private external class ArrayBuffer(size: Int) +private external class Float64Array(buffer: ArrayBuffer) +private external class Float32Array(buffer: ArrayBuffer) +private external class Int32Array(buffer: ArrayBuffer) + +private val buf = ArrayBuffer(8) +// TODO use one DataView instead of bunch of typed views. +private val bufFloat64 = Float64Array(buf).unsafeCast() +private val bufFloat32 = Float32Array(buf).unsafeCast() +private val bufInt32 = Int32Array(buf).unsafeCast() + +private val lowIndex = run { + bufFloat64[0] = -1.0 // bff00000_00000000 + if (bufInt32[0] != 0) 1 else 0 +} +private val highIndex = 1 - lowIndex + +internal fun doubleToRawBits(value: Double): Long { + bufFloat64[0] = value + return Long(bufInt32[lowIndex], bufInt32[highIndex]) +} + +@PublishedApi +internal fun doubleFromBits(value: Long): Double { + bufInt32[lowIndex] = value.low + bufInt32[highIndex] = value.high + return bufFloat64[0] +} + +internal fun floatToRawBits(value: Float): Int { + bufFloat32[0] = value + return bufInt32[0] +} + +@PublishedApi +internal fun floatFromBits(value: Int): Float { + bufInt32[0] = value + return bufFloat32[0] +} + +// returns zero value for number with positive sign bit and non-zero value for number with negative sign bit. +internal fun doubleSignBit(value: Double): Int { + bufFloat64[0] = value + return bufInt32[highIndex] and Int.MIN_VALUE +} + +internal fun getNumberHashCode(obj: Double): Int { + @Suppress("DEPRECATED_IDENTITY_EQUALS") + if (jsBitwiseOr(obj, 0).unsafeCast() === obj) { + return obj.toInt() + } + + bufFloat64[0] = obj + return bufInt32[highIndex] * 31 + bufInt32[lowIndex] +} diff --git a/libraries/stdlib/py/runtime/booleanInExternalHelpers.kt b/libraries/stdlib/py/runtime/booleanInExternalHelpers.kt new file mode 100644 index 0000000000000..0877025e6537c --- /dev/null +++ b/libraries/stdlib/py/runtime/booleanInExternalHelpers.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +import JsError + +@JsName("Boolean") +internal external fun nativeBoolean(obj: Any?): Boolean + +internal fun booleanInExternalLog(name: String, obj: dynamic) { + if (jsTypeOf(obj) != "boolean") { + console.asDynamic().error("Boolean expected for '$name', but actual:", obj) + } +} + +internal fun booleanInExternalException(name: String, obj: dynamic) { + if (jsTypeOf(obj) != "boolean") { + throw JsError("Boolean expected for '$name', but actual: $obj") + } +} \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/charSequence.kt b/libraries/stdlib/py/runtime/charSequence.kt new file mode 100644 index 0000000000000..f0766e33e1b1d --- /dev/null +++ b/libraries/stdlib/py/runtime/charSequence.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +internal annotation class DoNotIntrinsify + +@PublishedApi +@DoNotIntrinsify +internal fun charSequenceGet(a: CharSequence, index: Int): Char { + return if (isString(a)) { + Char(a.asDynamic().charCodeAt(index).unsafeCast()) + } else { + a[index] + } +} + +@PublishedApi +@DoNotIntrinsify +internal fun charSequenceLength(a: CharSequence): Int { + return if (isString(a)) { + a.asDynamic().length.unsafeCast() + } else { + a.length + } +} + +@PublishedApi +@DoNotIntrinsify +internal fun charSequenceSubSequence(a: CharSequence, startIndex: Int, endIndex: Int): CharSequence { + return if (isString(a)) { + a.asDynamic().substring(startIndex, endIndex).unsafeCast() + } else { + a.subSequence(startIndex, endIndex) + } +} + +// Keeping this function as separate non-inline to intrincify `is` operator +internal fun isString(a: CharSequence) = a is String diff --git a/libraries/stdlib/py/runtime/collectionsHacks.kt b/libraries/stdlib/py/runtime/collectionsHacks.kt new file mode 100644 index 0000000000000..4b1310ffac8d5 --- /dev/null +++ b/libraries/stdlib/py/runtime/collectionsHacks.kt @@ -0,0 +1,67 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.collections + +import kotlin.Array +import kotlin.Boolean +import kotlin.Int +import kotlin.UByteArray +import kotlin.UIntArray +import kotlin.ULongArray +import kotlin.UShortArray +import kotlin.js.* + +internal fun arrayToString(array: Array<*>) = array.joinToString(", ", "[", "]") { toString(it) } + +internal fun Array?.contentDeepHashCodeInternal(): Int { + if (this == null) return 0 + var result = 1 + for (element in this) { + val elementHash = when { + element == null -> 0 + isArrayish(element) -> (element.unsafeCast>()).contentDeepHashCodeInternal() + + element is UByteArray -> element.contentHashCode() + element is UShortArray -> element.contentHashCode() + element is UIntArray -> element.contentHashCode() + element is ULongArray -> element.contentHashCode() + + else -> element.hashCode() + } + + result = 31 * result + elementHash + } + return result +} + +internal fun T.contentEqualsInternal(other: T): Boolean { + val a = this.asDynamic() + val b = other.asDynamic() + + if (a === b) return true + + if (a == null || b == null || !isArrayish(b) || a.length != b.length) return false + + for (i in 0 until a.length) { + if (!equals(a[i], b[i])) { + return false + } + } + return true +} + +internal fun T.contentHashCodeInternal(): Int { + val a = this.asDynamic() + if (a == null) return 0 + + var result = 1 + + for (i in 0 until a.length) { + result = result * 31 + hashCode(a[i]) + } + + return result +} \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/compareTo.kt b/libraries/stdlib/py/runtime/compareTo.kt new file mode 100644 index 0000000000000..7a6aa4ced3b98 --- /dev/null +++ b/libraries/stdlib/py/runtime/compareTo.kt @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + + +// Adopted from misc.js + +internal fun compareTo(a: dynamic, b: dynamic): Int = when (jsTypeOf(a)) { + "number" -> when { + jsTypeOf(b) == "number" -> + doubleCompareTo(a, b) + b is Long -> + doubleCompareTo(a, b.toDouble()) + else -> + primitiveCompareTo(a, b) + } + + "string", "boolean" -> primitiveCompareTo(a, b) + + else -> compareToDoNotIntrinsicify(a, b) +} + +@DoNotIntrinsify +private fun > compareToDoNotIntrinsicify(a: Comparable, b: T) = + a.compareTo(b) + +internal fun primitiveCompareTo(a: dynamic, b: dynamic): Int = + when { + a < b -> -1 + a > b -> 1 + else -> 0 + } + +internal fun doubleCompareTo(a: dynamic, b: dynamic): Int = + when { + a < b -> -1 + a > b -> 1 + + a === b -> { + if (a !== 0) + 0 + else { + val ia = 1.asDynamic() / a + if (ia === 1.asDynamic() / b) { + 0 + } else if (ia < 0) { + -1 + } else { + 1 + } + } + } + + a !== a -> + if (b !== b) 0 else 1 + + else -> -1 + } \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/constructFunction.kt b/libraries/stdlib/py/runtime/constructFunction.kt new file mode 100644 index 0000000000000..2cc0c373257f7 --- /dev/null +++ b/libraries/stdlib/py/runtime/constructFunction.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +/** + * @param CT is return type of calling constructor (uses in DCE) + */ +internal fun construct(constructorType: dynamic, resultType: dynamic, vararg args: Any?): Any { + return js("Reflect").construct(constructorType, args, resultType) +} diff --git a/libraries/stdlib/py/runtime/coreRuntime.kt b/libraries/stdlib/py/runtime/coreRuntime.kt new file mode 100644 index 0000000000000..d1684c9074bf1 --- /dev/null +++ b/libraries/stdlib/py/runtime/coreRuntime.kt @@ -0,0 +1,141 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +internal fun equals(obj1: dynamic, obj2: dynamic): Boolean { + if (obj1 == null) { + return obj2 == null + } + if (obj2 == null) { + return false + } + + if (jsTypeOf(obj1) == "object" && jsTypeOf(obj1.equals) == "function") { + return (obj1.equals)(obj2) + } + + if (obj1 !== obj1) { + return obj2 !== obj2 + } + + if (jsTypeOf(obj1) == "number" && jsTypeOf(obj2) == "number") { + return obj1 === obj2 && (obj1 !== 0 || 1.asDynamic() / obj1 === 1.asDynamic() / obj2) + } + return obj1 === obj2 +} + +internal fun toString(o: dynamic): String = when { + o == null -> "null" + isArrayish(o) -> "[...]" + + else -> (o.toString)().unsafeCast() +} + +internal fun anyToString(o: dynamic): String = js("Object").prototype.toString.call(o) + +private fun hasOwnPrototypeProperty(o: Any, name: String): Boolean { + return JsObject.getPrototypeOf(o).hasOwnProperty(name).unsafeCast() +} + +internal fun hashCode(obj: dynamic): Int { + if (obj == null) + return 0 + + return when (jsTypeOf(obj)) { + "object" -> if ("function" === jsTypeOf(obj.hashCode)) (obj.hashCode)() else getObjectHashCode(obj) + "function" -> getObjectHashCode(obj) + "number" -> getNumberHashCode(obj) + "boolean" -> if(obj.unsafeCast()) 1 else 0 + else -> getStringHashCode(js("String")(obj)) + } +} + +private const val POW_2_32 = 4294967296.0 +private const val OBJECT_HASH_CODE_PROPERTY_NAME = "kotlinHashCodeValue$" + +internal fun getObjectHashCode(obj: dynamic): Int { + if (!jsIn(OBJECT_HASH_CODE_PROPERTY_NAME, obj)) { + var hash = jsBitwiseOr(js("Math").random() * POW_2_32, 0) // Make 32-bit singed integer. + var descriptor = js("new Object()") + descriptor.value = hash + descriptor.enumerable = false + js("Object").defineProperty(obj, OBJECT_HASH_CODE_PROPERTY_NAME, descriptor) + } + return obj[OBJECT_HASH_CODE_PROPERTY_NAME].unsafeCast() +} + +internal fun getStringHashCode(str: String): Int { + var hash = 0 + val length: Int = str.length // TODO: Implement WString.length + for (i in 0..length-1) { + val code: Int = str.asDynamic().charCodeAt(i) + hash = hash * 31 + code + } + return hash +} + +internal fun identityHashCode(obj: Any?): Int = getObjectHashCode(obj) + +internal fun captureStack(instance: Throwable, constructorFunction: Any) { + if (js("Error").captureStackTrace != null) { + js("Error").captureStackTrace(instance, constructorFunction) + } else { + instance.asDynamic().stack = js("new Error()").stack + } +} + +internal fun newThrowable(message: String?, cause: Throwable?): Throwable { + val throwable = js("new Error()") + throwable.message = if (isUndefined(message)) { + if (isUndefined(cause)) message else cause?.toString() ?: undefined + } else message ?: undefined + throwable.cause = cause + throwable.name = "Throwable" + return throwable.unsafeCast() +} + +internal fun extendThrowable(this_: dynamic, message: String?, cause: Throwable?) { + js("Error").call(this_) + setPropertiesToThrowableInstance(this_, message, cause) +} + +internal fun setPropertiesToThrowableInstance(this_: dynamic, message: String?, cause: Throwable?) { + if (!hasOwnPrototypeProperty(this_, "message")) { + @Suppress("IfThenToElvis") + this_.message = if (message == null) { + @Suppress("SENSELESS_COMPARISON") + if (message !== null) { + // undefined + cause?.toString() ?: undefined + } else { + // real null + undefined + } + } else message + } + if (!hasOwnPrototypeProperty(this_, "cause")) { + this_.cause = cause + } + this_.name = JsObject.getPrototypeOf(this_).constructor.name +} + +@JsName("Object") +internal external class JsObject { + companion object { + fun getPrototypeOf(obj: Any?): dynamic + } +} + +// Note: once some error-compilation design happened consider to distinguish a special exception for error-code. +internal fun errorCode(description: String): Nothing { + throw IllegalStateException(description) +} + +@Suppress("SENSELESS_COMPARISON") +internal fun isUndefined(value: dynamic): Boolean = value === undefined + +internal fun boxIntrinsic(@Suppress("UNUSED_PARAMETER") x: T): R = error("Should be lowered") +internal fun unboxIntrinsic(@Suppress("UNUSED_PARAMETER") x: T): R = error("Should be lowered") diff --git a/libraries/stdlib/py/runtime/coroutineInternalJS.kt b/libraries/stdlib/py/runtime/coroutineInternalJS.kt new file mode 100644 index 0000000000000..48bb3af52336f --- /dev/null +++ b/libraries/stdlib/py/runtime/coroutineInternalJS.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + + +package kotlin.js + +import kotlin.coroutines.Continuation +import kotlin.coroutines.ContinuationInterceptor +import kotlin.coroutines.CoroutineContext + + +@PublishedApi +internal fun getContinuation(): Continuation { throw Exception("Implemented as intrinsic") } +// Do we really need this intrinsic in JS? + +@PublishedApi +internal suspend fun returnIfSuspended(@Suppress("UNUSED_PARAMETER") argument: Any?): T { + throw Exception("Implemented as intrinsic") +} + +@PublishedApi +internal fun interceptContinuationIfNeeded( + context: CoroutineContext, + continuation: Continuation +) = context[ContinuationInterceptor]?.interceptContinuation(continuation) ?: continuation + + +@SinceKotlin("1.2") +@PublishedApi +internal suspend fun getCoroutineContext(): CoroutineContext = getContinuation().context + +// TODO: remove `JS` suffix oncec `NameGenerator` is implemented +@PublishedApi +internal suspend fun suspendCoroutineUninterceptedOrReturnJS(block: (Continuation) -> Any?): T = + returnIfSuspended(block(getContinuation())) + + diff --git a/libraries/stdlib/py/runtime/dceUtils.kt b/libraries/stdlib/py/runtime/dceUtils.kt new file mode 100644 index 0000000000000..70e29301ffa65 --- /dev/null +++ b/libraries/stdlib/py/runtime/dceUtils.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +import JsError + +internal fun unreachableDeclarationLog() { + console.asDynamic().trace("Unreachable declaration") +} + +internal fun unreachableDeclarationException() { + throw JsError("Unreachable declaration") +} \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/hacks.kt b/libraries/stdlib/py/runtime/hacks.kt new file mode 100644 index 0000000000000..48272f514d750 --- /dev/null +++ b/libraries/stdlib/py/runtime/hacks.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin + +@PublishedApi +internal fun throwUninitializedPropertyAccessException(name: String): Nothing = + throw UninitializedPropertyAccessException("lateinit property $name has not been initialized") + +@PublishedApi +internal fun throwKotlinNothingValueException(): Nothing = + throw KotlinNothingValueException() + +internal fun noWhenBranchMatchedException(): Nothing = throw NoWhenBranchMatchedException() + +internal fun THROW_ISE(): Nothing { + throw IllegalStateException() +} + +internal fun THROW_CCE(): Nothing { + throw ClassCastException() +} + +internal fun THROW_NPE(): Nothing { + throw NullPointerException() +} + +internal fun THROW_IAE(msg: String): Nothing { + throw IllegalArgumentException(msg) +} + +internal fun ensureNotNull(v: T?): T = if (v == null) THROW_NPE() else v \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/jsIntrinsics.kt b/libraries/stdlib/py/runtime/jsIntrinsics.kt new file mode 100644 index 0000000000000..62937340ad5bb --- /dev/null +++ b/libraries/stdlib/py/runtime/jsIntrinsics.kt @@ -0,0 +1,207 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("NON_MEMBER_FUNCTION_NO_BODY", "UNUSED_PARAMETER", "unused") + +package kotlin.js + +@RequiresOptIn(message = "Here be dragons! This is a compiler intrinsic, proceed with care!") +@Retention(AnnotationRetention.BINARY) +@Target(AnnotationTarget.FUNCTION) +internal annotation class JsIntrinsic + +@JsIntrinsic +internal fun jsEqeq(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsNotEq(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsEqeqeq(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsNotEqeq(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsGt(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsGtEq(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsLt(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsLtEq(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsNot(a: Any?): Boolean + +@JsIntrinsic +internal fun jsUnaryPlus(a: Any?): Any? + +@JsIntrinsic +internal fun jsUnaryMinus(a: Any?): Any? + +@JsIntrinsic +internal fun jsPrefixInc(a: Any?): Any? + +@JsIntrinsic +internal fun jsPostfixInc(a: Any?): Any? + +@JsIntrinsic +internal fun jsPrefixDec(a: Any?): Any? + +@JsIntrinsic +internal fun jsPostfixDec(a: Any?): Any? + +@JsIntrinsic +internal fun jsPlus(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsMinus(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsMult(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsDiv(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsMod(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsPlusAssign(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsMinusAssign(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsMultAssign(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsDivAssign(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsModAssign(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsAnd(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsOr(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsBitAnd(a: Any?, b: Any?): Int + +@JsIntrinsic +internal fun jsBitOr(a: Any?, b: Any?): Int + +@JsIntrinsic +internal fun jsBitXor(a: Any?, b: Any?): Int + +@JsIntrinsic +internal fun jsBitNot(a: Any?): Int + +@JsIntrinsic +internal fun jsBitShiftR(a: Any?, b: Any?): Int + +@JsIntrinsic +internal fun jsBitShiftRU(a: Any?, b: Any?): Int + +@JsIntrinsic +internal fun jsBitShiftL(a: Any?, b: Any?): Int + +@JsIntrinsic +internal fun jsInstanceOfIntrinsic(a: Any?, b: Any?): Boolean + +@JsIntrinsic +internal fun jsNewTarget(a: Any?): Any? + +@JsIntrinsic +internal fun emptyObject(a: Any?): Any? + +@JsIntrinsic +internal fun openInitializerBox(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsArrayLength(a: Any?): Any? + +@JsIntrinsic +internal fun jsArrayGet(a: Any?, b: Any?): Any? + +@JsIntrinsic +internal fun jsArraySet(a: Any?, b: Any?, c: Any?): Any? + +@JsIntrinsic +internal fun arrayLiteral(a: Any?): Any? + +@JsIntrinsic +internal fun int8Array(a: Any?): Any? + +@JsIntrinsic +internal fun int16Array(a: Any?): Any? + +@JsIntrinsic +internal fun int32Array(a: Any?): Any? + +@JsIntrinsic +internal fun float32Array(a: Any?): Any? + +@JsIntrinsic +internal fun float64Array(a: Any?): Any? + +@JsIntrinsic +internal fun int8ArrayOf(a: Any?): Any? + +@JsIntrinsic +internal fun int16ArrayOf(a: Any?): Any? + +@JsIntrinsic +internal fun int32ArrayOf(a: Any?): Any? + +@JsIntrinsic +internal fun float32ArrayOf(a: Any?): Any? + +@JsIntrinsic +internal fun float64ArrayOf(a: Any?): Any? + +@JsIntrinsic +internal fun objectCreate(): T + +@JsIntrinsic +internal fun sharedBoxCreate(v: T?): dynamic + +@JsIntrinsic +internal fun sharedBoxRead(box: dynamic): T? + +@JsIntrinsic +internal fun sharedBoxWrite(box: dynamic, nv: T?) + +@JsIntrinsic +internal fun jsUndefined(): Nothing? + +@JsIntrinsic +internal fun DefaultType(): T + +@JsIntrinsic +internal fun jsBind(receiver: Any?, target: Any?): Any? + +@JsIntrinsic +internal fun slice(a: A): A + +@JsIntrinsic +internal fun unreachable(): Nothing + +@JsIntrinsic +@Suppress("REIFIED_TYPE_PARAMETER_NO_INLINE") // TODO: mark `inline` and skip in inliner +internal fun jsClassIntrinsic(): JsClass + +// Returns true if the specified property is in the specified object or its prototype chain. +@JsIntrinsic +internal fun jsInIntrinsic(lhs: Any?, rhs: Any): Boolean + +@JsIntrinsic +internal fun jsDelete(e: Any?) \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/kotlinHacks.kt b/libraries/stdlib/py/runtime/kotlinHacks.kt new file mode 100644 index 0000000000000..ceb39f289373b --- /dev/null +++ b/libraries/stdlib/py/runtime/kotlinHacks.kt @@ -0,0 +1,73 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + + +// File is a copy of stdlib/js/src/kotlin/kotlin.kt +// TODO: Compile arrayPlusCollection +// TODO: implement a copy of jsIsType for both JS backends + +@file:Suppress("UNUSED_PARAMETER", "NOTHING_TO_INLINE") + +package kotlin + +/** + * Returns an empty array of the specified type [T]. + */ +inline fun emptyArray(): Array = js("[]") + +/** + * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer]. + */ +actual fun lazy(initializer: () -> T): Lazy = UnsafeLazyImpl(initializer) + +/** + * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer]. + * + * The [mode] parameter is ignored. */ +actual fun lazy(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy = UnsafeLazyImpl(initializer) + +/** + * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer]. + * + * The [lock] parameter is ignored. + */ +actual fun lazy(lock: Any?, initializer: () -> T): Lazy = UnsafeLazyImpl(initializer) + + +internal fun fillFrom(src: dynamic, dst: dynamic): dynamic { + val srcLen: Int = src.length + val dstLen: Int = dst.length + var index: Int = 0 + val arr = dst.unsafeCast>() + while (index < srcLen && index < dstLen) arr[index] = src[index++] + return dst +} + + +internal fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): dynamic { + val result = source.slice(0, newSize).unsafeCast>() + copyArrayType(source, result) + var index: Int = source.length + if (newSize > index) { + result.asDynamic().length = newSize + while (index < newSize) result[index++] = defaultValue + } + return result +} + +internal fun arrayPlusCollection(array: dynamic, collection: Collection): dynamic { + val result = array.slice().unsafeCast>() + result.asDynamic().length = result.size + collection.size + copyArrayType(array, result) + var index: Int = array.length + for (element in collection) result[index++] = element + return result +} + +internal inline fun copyArrayType(from: dynamic, to: dynamic) { + if (from.`$type$` !== undefined) { + to.`$type$` = from.`$type$` + } +} diff --git a/libraries/stdlib/py/runtime/kotlinJsHacks.kt b/libraries/stdlib/py/runtime/kotlinJsHacks.kt new file mode 100644 index 0000000000000..c4d6699ffb6c7 --- /dev/null +++ b/libraries/stdlib/py/runtime/kotlinJsHacks.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +@PublishedApi +internal fun > enumValuesIntrinsic(): Array = + throw IllegalStateException("Should be replaced by compiler") + +@PublishedApi +internal fun > enumValueOfIntrinsic(@Suppress("UNUSED_PARAMETER") name: String): T = + throw IllegalStateException("Should be replaced by compiler") + +@PublishedApi +internal fun safePropertyGet(self: dynamic, getterName: String, propName: String): dynamic { + val getter = self[getterName] + return if (getter != null) getter.call(self) else self[propName] +} + +@PublishedApi +internal fun safePropertySet(self: dynamic, setterName: String, propName: String, value: dynamic) { + val setter = self[setterName] + if (setter != null) setter.call(self, value) else self[propName] = value +} + +/** + * Implements annotated function in JavaScript. + * [code] string must contain JS expression that evaluates to JS function with signature that matches annotated kotlin function + * + * For example, a function that adds two Doubles: + * + * @JsFun("(x, y) => x + y") + * fun jsAdd(x: Double, y: Double): Double = + * error("...") + * + * Code gets inserted as is without syntax verification. + */ +@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER) +internal annotation class JsFun(val code: String) \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/long.kt b/libraries/stdlib/py/runtime/long.kt new file mode 100644 index 0000000000000..0f4f45c891747 --- /dev/null +++ b/libraries/stdlib/py/runtime/long.kt @@ -0,0 +1,291 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("NOTHING_TO_INLINE") + +package kotlin + +/** + * Represents a 64-bit signed integer. + */ +class Long internal constructor( + internal val low: Int, + internal val high: Int +) : Number(), Comparable { + + companion object { + /** + * A constant holding the minimum value an instance of Long can have. + */ + const val MIN_VALUE: Long = -9223372036854775807L - 1L + + /** + * A constant holding the maximum value an instance of Long can have. + */ + const val MAX_VALUE: Long = 9223372036854775807L + + /** + * The number of bytes used to represent an instance of Long in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BYTES: Int = 8 + + /** + * The number of bits used to represent an instance of Long in a binary form. + */ + @SinceKotlin("1.3") + const val SIZE_BITS: Int = 64 + } + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + inline operator fun compareTo(other: Byte): Int = compareTo(other.toLong()) + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + inline operator fun compareTo(other: Short): Int = compareTo(other.toLong()) + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + inline operator fun compareTo(other: Int): Int = compareTo(other.toLong()) + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + override operator fun compareTo(other: Long): Int = compare(other) + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + inline operator fun compareTo(other: Float): Int = toFloat().compareTo(other) + + /** + * Compares this value with the specified value for order. + * Returns zero if this value is equal to the specified other value, a negative number if it's less than other, + * or a positive number if it's greater than other. + */ + inline operator fun compareTo(other: Double): Int = toDouble().compareTo(other) + + /** Adds the other value to this value. */ + inline operator fun plus(other: Byte): Long = plus(other.toLong()) + + /** Adds the other value to this value. */ + inline operator fun plus(other: Short): Long = plus(other.toLong()) + + /** Adds the other value to this value. */ + inline operator fun plus(other: Int): Long = plus(other.toLong()) + + /** Adds the other value to this value. */ + operator fun plus(other: Long): Long = add(other) + + /** Adds the other value to this value. */ + inline operator fun plus(other: Float): Float = toFloat() + other + + /** Adds the other value to this value. */ + inline operator fun plus(other: Double): Double = toDouble() + other + + /** Subtracts the other value from this value. */ + inline operator fun minus(other: Byte): Long = minus(other.toLong()) + + /** Subtracts the other value from this value. */ + inline operator fun minus(other: Short): Long = minus(other.toLong()) + + /** Subtracts the other value from this value. */ + inline operator fun minus(other: Int): Long = minus(other.toLong()) + + /** Subtracts the other value from this value. */ + operator fun minus(other: Long): Long = subtract(other) + + /** Subtracts the other value from this value. */ + inline operator fun minus(other: Float): Float = toFloat() - other + + /** Subtracts the other value from this value. */ + inline operator fun minus(other: Double): Double = toDouble() - other + + /** Multiplies this value by the other value. */ + inline operator fun times(other: Byte): Long = times(other.toLong()) + + /** Multiplies this value by the other value. */ + inline operator fun times(other: Short): Long = times(other.toLong()) + + /** Multiplies this value by the other value. */ + inline operator fun times(other: Int): Long = times(other.toLong()) + + /** Multiplies this value by the other value. */ + operator fun times(other: Long): Long = multiply(other) + + /** Multiplies this value by the other value. */ + inline operator fun times(other: Float): Float = toFloat() * other + + /** Multiplies this value by the other value. */ + inline operator fun times(other: Double): Double = toDouble() * other + + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + inline operator fun div(other: Byte): Long = div(other.toLong()) + + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + inline operator fun div(other: Short): Long = div(other.toLong()) + + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + inline operator fun div(other: Int): Long = div(other.toLong()) + + /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */ + operator fun div(other: Long): Long = divide(other) + + /** Divides this value by the other value. */ + inline operator fun div(other: Float): Float = toFloat() / other + + /** Divides this value by the other value. */ + inline operator fun div(other: Double): Double = toDouble() / other + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + inline operator fun rem(other: Byte): Long = rem(other.toLong()) + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + inline operator fun rem(other: Short): Long = rem(other.toLong()) + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + inline operator fun rem(other: Int): Long = rem(other.toLong()) + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + operator fun rem(other: Long): Long = modulo(other) + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + inline operator fun rem(other: Float): Float = toFloat() % other + + /** + * Calculates the remainder of truncating division of this value by the other value. + * + * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor. + */ + @SinceKotlin("1.1") + inline operator fun rem(other: Double): Double = toDouble() % other + + /** + * Returns this value incremented by one. + * + * @sample samples.misc.Builtins.inc + */ + operator fun inc(): Long = this + 1L + + /** + * Returns this value decremented by one. + * + * @sample samples.misc.Builtins.dec + */ + operator fun dec(): Long = this - 1L + + /** Returns this value. */ + inline operator fun unaryPlus(): Long = this + + /** Returns the negative of this value. */ + operator fun unaryMinus(): Long = inv() + 1L + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Byte): LongRange = rangeTo(other.toLong()) + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Short): LongRange = rangeTo(other.toLong()) + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Int): LongRange = rangeTo(other.toLong()) + + /** Creates a range from this value to the specified [other] value. */ + operator fun rangeTo(other: Long): LongRange = LongRange(this, other) + + /** + * Shifts this value left by the [bitCount] number of bits. + * + * Note that only the six lowest-order bits of the [bitCount] are used as the shift distance. + * The shift distance actually used is therefore always in the range `0..63`. + */ + infix fun shl(bitCount: Int): Long = shiftLeft(bitCount) + + /** + * Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with copies of the sign bit. + * + * Note that only the six lowest-order bits of the [bitCount] are used as the shift distance. + * The shift distance actually used is therefore always in the range `0..63`. + */ + infix fun shr(bitCount: Int): Long = shiftRight(bitCount) + + /** + * Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros. + * + * Note that only the six lowest-order bits of the [bitCount] are used as the shift distance. + * The shift distance actually used is therefore always in the range `0..63`. + */ + infix fun ushr(bitCount: Int): Long = shiftRightUnsigned(bitCount) + + /** Performs a bitwise AND operation between the two values. */ + infix fun and(other: Long): Long = Long(low and other.low, high and other.high) + + /** Performs a bitwise OR operation between the two values. */ + infix fun or(other: Long): Long = Long(low or other.low, high or other.high) + + /** Performs a bitwise XOR operation between the two values. */ + infix fun xor(other: Long): Long = Long(low xor other.low, high xor other.high) + + /** Inverts the bits in this value. */ + fun inv(): Long = Long(low.inv(), high.inv()) + + override fun toByte(): Byte = low.toByte() + @Deprecated("Direct conversion to Char is deprecated. Use toInt().toChar() or Char constructor instead.", ReplaceWith("this.toInt().toChar()")) + @DeprecatedSinceKotlin(warningSince = "1.5") + override fun toChar(): Char = low.toChar() + override fun toShort(): Short = low.toShort() + override fun toInt(): Int = low + override fun toLong(): Long = this + override fun toFloat(): Float = toDouble().toFloat() + override fun toDouble(): Double = toNumber() + + // This method is used by `toString()` + @JsName("valueOf") + internal fun valueOf() = toDouble() + + override fun equals(other: Any?): Boolean = other is Long && equalsLong(other) + + override fun hashCode(): Int = hashCode(this) + + override fun toString(): String = this.toStringImpl(radix = 10) +} \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/longjs.kt b/libraries/stdlib/py/runtime/longjs.kt new file mode 100644 index 0000000000000..7d251e6cdee78 --- /dev/null +++ b/libraries/stdlib/py/runtime/longjs.kt @@ -0,0 +1,388 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +// Copyright 2009 The Closure Library Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +package kotlin + +internal fun Long.toNumber() = high * TWO_PWR_32_DBL_ + getLowBitsUnsigned() + +internal fun Long.getLowBitsUnsigned() = if (low >= 0) low.toDouble() else TWO_PWR_32_DBL_ + low + +internal fun hashCode(l: Long) = l.low xor l.high + +internal fun Long.toStringImpl(radix: Int): String { + if (radix < 2 || 36 < radix) { + throw Exception("radix out of range: $radix") + } + + if (isZero()) { + return "0" + } + + if (isNegative()) { + if (equalsLong(MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + val radixLong = fromInt(radix) + val div = div(radixLong) + val rem = div.multiply(radixLong).subtract(this).toInt() + // Using rem.asDynamic() to break dependency on "kotlin.text" package + return div.toStringImpl(radix) + rem.asDynamic().toString(radix).unsafeCast() + } else { + return "-${negate().toStringImpl(radix)}" + } + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + val radixToPower = fromNumber(JsMath.pow(radix.toDouble(), 6.0)) + + var rem = this + var result = "" + while (true) { + val remDiv = rem.div(radixToPower) + val intval = rem.subtract(remDiv.multiply(radixToPower)).toInt() + var digits = intval.asDynamic().toString(radix).unsafeCast() + + rem = remDiv + if (rem.isZero()) { + return digits + result + } else { + while (digits.length < 6) { + digits = "0" + digits + } + result = digits + result + } + } +} + +internal fun Long.negate() = unaryMinus() + +internal fun Long.isZero() = high == 0 && low == 0 + +internal fun Long.isNegative() = high < 0 + +internal fun Long.isOdd() = low and 1 == 1 + +internal fun Long.equalsLong(other: Long) = high == other.high && low == other.low + +internal fun Long.lessThan(other: Long) = compare(other) < 0 + +internal fun Long.lessThanOrEqual(other: Long) = compare(other) <= 0 + +internal fun Long.greaterThan(other: Long) = compare(other) > 0 + +internal fun Long.greaterThanOrEqual(other: Long) = compare(other) >= 0 + +internal fun Long.compare(other: Long): Int { + if (equalsLong(other)) { + return 0 + } + + val thisNeg = isNegative() + val otherNeg = other.isNegative() + + return when { + thisNeg && !otherNeg -> -1 + !thisNeg && otherNeg -> 1 + // at this point, the signs are the same, so subtraction will not overflow + subtract(other).isNegative() -> -1 + else -> 1 + } +} + +internal fun Long.add(other: Long): Long { + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + val a48 = high ushr 16 + val a32 = high and 0xFFFF + val a16 = low ushr 16 + val a00 = low and 0xFFFF + + val b48 = other.high ushr 16 + val b32 = other.high and 0xFFFF + val b16 = other.low ushr 16 + val b00 = other.low and 0xFFFF + + var c48 = 0 + var c32 = 0 + var c16 = 0 + var c00 = 0 + c00 += a00 + b00 + c16 += c00 ushr 16 + c00 = c00 and 0xFFFF + c16 += a16 + b16 + c32 += c16 ushr 16 + c16 = c16 and 0xFFFF + c32 += a32 + b32 + c48 += c32 ushr 16 + c32 = c32 and 0xFFFF + c48 += a48 + b48 + c48 = c48 and 0xFFFF + return Long((c16 shl 16) or c00, (c48 shl 16) or c32) +} + +internal fun Long.subtract(other: Long) = add(other.unaryMinus()) + +internal fun Long.multiply(other: Long): Long { + if (isZero()) { + return ZERO + } else if (other.isZero()) { + return ZERO + } + + if (equalsLong(MIN_VALUE)) { + return if (other.isOdd()) MIN_VALUE else ZERO + } else if (other.equalsLong(MIN_VALUE)) { + return if (isOdd()) MIN_VALUE else ZERO + } + + if (isNegative()) { + return if (other.isNegative()) { + negate().multiply(other.negate()) + } else { + negate().multiply(other).negate() + } + } else if (other.isNegative()) { + return multiply(other.negate()).negate() + } + + // If both longs are small, use float multiplication + if (lessThan(TWO_PWR_24_) && other.lessThan(TWO_PWR_24_)) { + return fromNumber(toNumber() * other.toNumber()) + } + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + val a48 = high ushr 16 + val a32 = high and 0xFFFF + val a16 = low ushr 16 + val a00 = low and 0xFFFF + + val b48 = other.high ushr 16 + val b32 = other.high and 0xFFFF + val b16 = other.low ushr 16 + val b00 = other.low and 0xFFFF + + var c48 = 0 + var c32 = 0 + var c16 = 0 + var c00 = 0 + c00 += a00 * b00 + c16 += c00 ushr 16 + c00 = c00 and 0xFFFF + c16 += a16 * b00 + c32 += c16 ushr 16 + c16 = c16 and 0xFFFF + c16 += a00 * b16 + c32 += c16 ushr 16 + c16 = c16 and 0xFFFF + c32 += a32 * b00 + c48 += c32 ushr 16 + c32 = c32 and 0xFFFF + c32 += a16 * b16 + c48 += c32 ushr 16 + c32 = c32 and 0xFFFF + c32 += a00 * b32 + c48 += c32 ushr 16 + c32 = c32 and 0xFFFF + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48 + c48 = c48 and 0xFFFF + return Long(c16 shl 16 or c00, c48 shl 16 or c32) +} + +internal fun Long.divide(other: Long): Long { + if (other.isZero()) { + throw Exception("division by zero") + } else if (isZero()) { + return ZERO + } + + if (equalsLong(MIN_VALUE)) { + if (other.equalsLong(ONE) || other.equalsLong(NEG_ONE)) { + return MIN_VALUE // recall that -MIN_VALUE == MIN_VALUE + } else if (other.equalsLong(MIN_VALUE)) { + return ONE + } else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + val halfThis = shiftRight(1) + val approx = halfThis.div(other).shiftLeft(1) + if (approx.equalsLong(ZERO)) { + return if (other.isNegative()) ONE else NEG_ONE + } else { + val rem = subtract(other.multiply(approx)) + return approx.add(rem.div(other)) + } + } + } else if (other.equalsLong(MIN_VALUE)) { + return ZERO + } + + if (isNegative()) { + return if (other.isNegative()) { + negate().div(other.negate()) + } else { + negate().div(other).negate() + } + } else if (other.isNegative()) { + return div(other.negate()).negate() + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + var res = ZERO + var rem = this + while (rem.greaterThanOrEqual(other)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + val approxDouble = rem.toNumber() / other.toNumber() + var approx2 = JsMath.max(1.0, JsMath.floor(approxDouble)) + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + val log2 = JsMath.ceil(JsMath.log(approx2) / JsMath.LN2) + val delta = if (log2 <= 48) 1.0 else JsMath.pow(2.0, log2 - 48) + + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = fromNumber(approx2) + var approxRem = approxRes.multiply(other) + while (approxRem.isNegative() || approxRem.greaterThan(rem)) { + approx2 -= delta + approxRes = fromNumber(approx2) + approxRem = approxRes.multiply(other) + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) { + approxRes = ONE + } + + res = res.add(approxRes) + rem = rem.subtract(approxRem) + } + return res +} + +internal fun Long.modulo(other: Long) = subtract(div(other).multiply(other)) + +internal fun Long.shiftLeft(numBits: Int): Long { + @Suppress("NAME_SHADOWING") + val numBits = numBits and 63 + if (numBits == 0) { + return this + } else { + if (numBits < 32) { + return Long(low shl numBits, (high shl numBits) or (low ushr (32 - numBits))) + } else { + return Long(0, low shl (numBits - 32)) + } + } +} + +internal fun Long.shiftRight(numBits: Int): Long { + @Suppress("NAME_SHADOWING") + val numBits = numBits and 63 + if (numBits == 0) { + return this + } else { + if (numBits < 32) { + return Long((low ushr numBits) or (high shl (32 - numBits)), high shr numBits) + } else { + return Long(high shr (numBits - 32), if (high >= 0) 0 else -1) + } + } +} + +internal fun Long.shiftRightUnsigned(numBits: Int): Long { + @Suppress("NAME_SHADOWING") + val numBits = numBits and 63 + if (numBits == 0) { + return this + } else { + if (numBits < 32) { + return Long((low ushr numBits) or (high shl (32 - numBits)), high ushr numBits) + } else return if (numBits == 32) { + Long(high, 0) + } else { + Long(high ushr (numBits - 32), 0) + } + } +} + +/** + * Returns a Long representing the given (32-bit) integer value. + * @param {number} value The 32-bit integer in question. + * @return {!Kotlin.Long} The corresponding Long value. + */ +// TODO: cache +internal fun fromInt(value: Int) = Long(value, if (value < 0) -1 else 0) + +/** + * Converts this [Double] value to [Long]. + * The fractional part, if any, is rounded down towards zero. + * Returns zero if this `Double` value is `NaN`, [Long.MIN_VALUE] if it's less than `Long.MIN_VALUE`, + * [Long.MAX_VALUE] if it's bigger than `Long.MAX_VALUE`. + */ +internal fun fromNumber(value: Double): Long { + if (value.isNaN()) { + return ZERO + } else if (value <= -TWO_PWR_63_DBL_) { + return MIN_VALUE + } else if (value + 1 >= TWO_PWR_63_DBL_) { + return MAX_VALUE + } else if (value < 0) { + return fromNumber(-value).negate() + } else { + val twoPwr32 = TWO_PWR_32_DBL_ + return Long( + jsBitwiseOr(value.rem(twoPwr32), 0), + jsBitwiseOr(value / twoPwr32, 0) + ) + } +} + +private const val TWO_PWR_16_DBL_ = (1 shl 16).toDouble() + +private const val TWO_PWR_24_DBL_ = (1 shl 24).toDouble() + +//private val TWO_PWR_32_DBL_ = TWO_PWR_16_DBL_ * TWO_PWR_16_DBL_ +private const val TWO_PWR_32_DBL_ = (1 shl 16).toDouble() * (1 shl 16).toDouble() + +//private val TWO_PWR_64_DBL_ = TWO_PWR_32_DBL_ * TWO_PWR_32_DBL_ +private const val TWO_PWR_64_DBL_ = ((1 shl 16).toDouble() * (1 shl 16).toDouble()) * ((1 shl 16).toDouble() * (1 shl 16).toDouble()) + +//private val TWO_PWR_63_DBL_ = TWO_PWR_64_DBL_ / 2 +private const val TWO_PWR_63_DBL_ = (((1 shl 16).toDouble() * (1 shl 16).toDouble()) * ((1 shl 16).toDouble() * (1 shl 16).toDouble())) / 2 + +private val ZERO = fromInt(0) + +private val ONE = fromInt(1) + +private val NEG_ONE = fromInt(-1) + +private val MAX_VALUE = Long(-1, -1 ushr 1) + +private val MIN_VALUE = Long(0, 1 shl 31) + +private val TWO_PWR_24_ = fromInt(1 shl 24) + + diff --git a/libraries/stdlib/py/runtime/misc.kt b/libraries/stdlib/py/runtime/misc.kt new file mode 100644 index 0000000000000..3eb9122d156e7 --- /dev/null +++ b/libraries/stdlib/py/runtime/misc.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +// TODO: Polyfill +internal fun imul(a_local: Int, b_local: Int): Int { + val lhs = jsBitwiseAnd(a_local, js("0xffff0000")).toDouble() * jsBitwiseAnd(b_local, 0xffff).toDouble() + val rhs = jsBitwiseAnd(a_local, 0xffff).toDouble() * b_local.toDouble() + return jsBitwiseOr(lhs + rhs, 0) +} diff --git a/libraries/stdlib/py/runtime/noPackageHacks.kt b/libraries/stdlib/py/runtime/noPackageHacks.kt new file mode 100644 index 0000000000000..b89e5f180a273 --- /dev/null +++ b/libraries/stdlib/py/runtime/noPackageHacks.kt @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +/** Concat regular Array's and TypedArray's into an Array. + */ +@PublishedApi +internal fun arrayConcat(vararg args: T): T { + val len = args.size + val typed = js("Array(len)").unsafeCast>() + for (i in 0 .. (len - 1)) { + val arr = args[i] + if (arr !is Array<*>) { + typed[i] = js("[]").slice.call(arr) + } else { + typed[i] = arr + } + } + return js("[]").concat.apply(js("[]"), typed) +} + +/** Concat primitive arrays. Main use: prepare vararg arguments. + */ +@PublishedApi +internal fun primitiveArrayConcat(vararg args: T): T { + var size_local = 0 + for (i in 0 .. (args.size - 1)) { + size_local += args[i].unsafeCast>().size + } + val a = args[0] + val result = js("new a.constructor(size_local)").unsafeCast>() + if (a.asDynamic().`$type$` != null) { + withType(a.asDynamic().`$type$`, result) + } + + size_local = 0 + for (i in 0 .. (args.size - 1)) { + val arr = args[i].unsafeCast>() + for (j in 0 .. (arr.size - 1)) { + result[size_local++] = arr[j] + } + } + return result.unsafeCast() +} + +internal fun taggedArrayCopy(array: dynamic): T { + val res = array.slice() + res.`$type$` = array.`$type$` + return res.unsafeCast() +} + +@PublishedApi +@Suppress("NOTHING_TO_INLINE") +internal inline fun withType(type: String, array: dynamic): dynamic { + array.`$type$` = type + return array +} diff --git a/libraries/stdlib/py/runtime/numberConversion.kt b/libraries/stdlib/py/runtime/numberConversion.kt new file mode 100644 index 0000000000000..6d8878684b6eb --- /dev/null +++ b/libraries/stdlib/py/runtime/numberConversion.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +internal fun numberToByte(a: dynamic): Byte = toByte(numberToInt(a)) + +internal fun numberToDouble(@Suppress("UNUSED_PARAMETER") a: dynamic): Double = js("+a").unsafeCast() + +internal fun numberToInt(a: dynamic): Int = if (a is Long) a.toInt() else doubleToInt(a) + +internal fun numberToShort(a: dynamic): Short = toShort(numberToInt(a)) + +// << and >> shifts are used to preserve sign of the number +internal fun toByte(@Suppress("UNUSED_PARAMETER") a: dynamic): Byte = js("a << 24 >> 24").unsafeCast() +internal fun toShort(@Suppress("UNUSED_PARAMETER") a: dynamic): Short = js("a << 16 >> 16").unsafeCast() + +internal fun numberToLong(a: dynamic): Long = if (a is Long) a else fromNumber(a) + +internal fun toLong(a: dynamic): Long = fromInt(a) + +internal fun doubleToInt(a: Double): Int = when { + a > 2147483647 -> 2147483647 + a < -2147483648 -> -2147483648 + else -> jsBitwiseOr(a, 0) +} + +internal fun numberToChar(a: dynamic) = Char(numberToInt(a).toUShort()) \ No newline at end of file diff --git a/libraries/stdlib/py/runtime/rangeTo.kt b/libraries/stdlib/py/runtime/rangeTo.kt new file mode 100644 index 0000000000000..e197fdb36d8db --- /dev/null +++ b/libraries/stdlib/py/runtime/rangeTo.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +// Creates IntRange for {Byte, Short, Int}.rangeTo(x: {Byte, Short, Int}) +internal fun numberRangeToNumber(start: dynamic, endInclusive: dynamic) = + IntRange(start, endInclusive) + +// Create LongRange for {Byte, Short, Int}.rangeTo(x: Long) +// Long.rangeTo(x: *) should be implemented in Long class +internal fun numberRangeToLong(start: dynamic, endInclusive: dynamic) = + LongRange(numberToLong(start), endInclusive) diff --git a/libraries/stdlib/py/runtime/reflectRuntime.kt b/libraries/stdlib/py/runtime/reflectRuntime.kt new file mode 100644 index 0000000000000..9b8fb4b76f96e --- /dev/null +++ b/libraries/stdlib/py/runtime/reflectRuntime.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +import kotlin.reflect.KProperty + +internal fun getPropertyCallableRef(name: String, paramCount: Int, type: dynamic, getter: dynamic, setter: dynamic): KProperty<*> { + getter.get = getter + getter.set = setter + getter.callableName = name + return getPropertyRefClass(getter, getKPropMetadata(paramCount, setter, type)).unsafeCast>() +} + +internal fun getLocalDelegateReference(name: String, type: dynamic, mutable: Boolean, lambda: dynamic): KProperty<*> { + return getPropertyCallableRef(name, 0, type, lambda, if (mutable) lambda else null) +} + +private fun getPropertyRefClass(obj: dynamic, metadata: dynamic): dynamic { + obj.`$metadata$` = metadata + obj.constructor = obj + return obj +} + +private fun getKPropMetadata(paramCount: Int, setter: Any?, type: dynamic): dynamic { + val mdata = propertyRefClassMetadataCache[paramCount][if (setter == null) 0 else 1] + if (mdata.interfaces.length == 0) { + mdata.interfaces.push(type) + } + + return mdata +} + +@Suppress("NOTHING_TO_INLINE") +private inline fun metadataObject(): dynamic = js("{ kind: 'class', interfaces: [] }") + +private val propertyRefClassMetadataCache: Array> = arrayOf>( + // immutable , mutable + arrayOf(metadataObject(), metadataObject()), // 0 + arrayOf(metadataObject(), metadataObject()), // 1 + arrayOf(metadataObject(), metadataObject()) // 2 +) + diff --git a/libraries/stdlib/py/runtime/typeCheckUtils.kt b/libraries/stdlib/py/runtime/typeCheckUtils.kt new file mode 100644 index 0000000000000..614e2fdb5c896 --- /dev/null +++ b/libraries/stdlib/py/runtime/typeCheckUtils.kt @@ -0,0 +1,189 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +private external interface Metadata { + val interfaces: Array + val suspendArity: Array? +} + +private external interface Ctor { + val `$metadata$`: Metadata? + val prototype: Ctor? +} + +private fun isInterfaceImpl(ctor: Ctor, iface: dynamic): Boolean { + if (ctor === iface) return true + + val metadata = ctor.`$metadata$` + if (metadata != null) { + val interfaces = metadata.interfaces + for (i in interfaces) { + if (isInterfaceImpl(i, iface)) { + return true + } + } + } + + val superPrototype = if (ctor.prototype != null) js("Object").getPrototypeOf(ctor.prototype) else null + val superConstructor: Ctor? = if (superPrototype != null) superPrototype.constructor else null + return superConstructor != null && isInterfaceImpl(superConstructor, iface) +} + +internal fun isInterface(obj: dynamic, iface: dynamic): Boolean { + val ctor = obj.constructor ?: return false + + return isInterfaceImpl(ctor, iface) +} + +/* + +internal interface ClassMetadata { + val simpleName: String + val interfaces: Array +} + +// TODO: replace `isInterface` with the following +public fun isInterface(ctor: dynamic, IType: dynamic): Boolean { + if (ctor === IType) return true + + val metadata = ctor.`$metadata$`.unsafeCast() + + if (metadata !== null) { + val interfaces = metadata.interfaces + for (i in interfaces) { + if (isInterface(i, IType)) { + return true + } + } + } + + var superPrototype = ctor.prototype + if (superPrototype !== null) { + superPrototype = js("Object.getPrototypeOf(superPrototype)") + } + + val superConstructor = if (superPrototype !== null) { + superPrototype.constructor + } else null + + return superConstructor != null && isInterface(superConstructor, IType) +} +*/ + +internal fun isSuspendFunction(obj: dynamic, arity: Int): Boolean { + if (jsTypeOf(obj) == "function") { + @Suppress("DEPRECATED_IDENTITY_EQUALS") + return obj.`$arity`.unsafeCast() === arity + } + + if (jsTypeOf(obj) == "object" && jsIn("${'$'}metadata${'$'}", obj.constructor)) { + @Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS") + return obj.constructor.unsafeCast().`$metadata$`?.suspendArity?.let { + var result = false + for (item in it) { + if (arity == item) { + result = true + break + } + } + return result + } ?: false + } + + return false +} + +internal fun isObject(obj: dynamic): Boolean { + val objTypeOf = jsTypeOf(obj) + + return when (objTypeOf) { + "string" -> true + "number" -> true + "boolean" -> true + "function" -> true + else -> jsInstanceOf(obj, js("Object")) + } +} + +private fun isJsArray(obj: Any): Boolean { + return js("Array").isArray(obj).unsafeCast() +} + +internal fun isArray(obj: Any): Boolean { + return isJsArray(obj) && !(obj.asDynamic().`$type$`) +} + +internal fun isArrayish(o: dynamic) = + isJsArray(o) || js("ArrayBuffer").isView(o).unsafeCast() + + +internal fun isChar(@Suppress("UNUSED_PARAMETER") c: Any): Boolean { + error("isChar is not implemented") +} + +// TODO: Distinguish Boolean/Byte and Short/Char +internal fun isBooleanArray(a: dynamic): Boolean = isJsArray(a) && a.`$type$` === "BooleanArray" +internal fun isByteArray(a: dynamic): Boolean = jsInstanceOf(a, js("Int8Array")) +internal fun isShortArray(a: dynamic): Boolean = jsInstanceOf(a, js("Int16Array")) +internal fun isCharArray(a: dynamic): Boolean = isJsArray(a) && a.`$type$` === "CharArray" +internal fun isIntArray(a: dynamic): Boolean = jsInstanceOf(a, js("Int32Array")) +internal fun isFloatArray(a: dynamic): Boolean = jsInstanceOf(a, js("Float32Array")) +internal fun isDoubleArray(a: dynamic): Boolean = jsInstanceOf(a, js("Float64Array")) +internal fun isLongArray(a: dynamic): Boolean = isJsArray(a) && a.`$type$` === "LongArray" + + +internal fun jsGetPrototypeOf(jsClass: dynamic) = js("Object").getPrototypeOf(jsClass) + +internal fun jsIsType(obj: dynamic, jsClass: dynamic): Boolean { + if (jsClass === js("Object")) { + return isObject(obj) + } + + if (obj == null || jsClass == null || (jsTypeOf(obj) != "object" && jsTypeOf(obj) != "function")) { + return false + } + + if (jsTypeOf(jsClass) == "function" && jsInstanceOf(obj, jsClass)) { + return true + } + + var proto = jsGetPrototypeOf(jsClass) + var constructor = proto?.constructor + if (constructor != null && jsIn("${'$'}metadata${'$'}", constructor)) { + var metadata = constructor.`$metadata$` + if (metadata.kind === "object") { + return obj === jsClass + } + } + + var klassMetadata = jsClass.`$metadata$` + + // In WebKit (JavaScriptCore) for some interfaces from DOM typeof returns "object", nevertheless they can be used in RHS of instanceof + if (klassMetadata == null) { + return jsInstanceOf(obj, jsClass) + } + + if (klassMetadata.kind === "interface" && obj.constructor != null) { + return isInterfaceImpl(obj.constructor, jsClass) + } + + return false +} + +internal fun isNumber(a: dynamic) = jsTypeOf(a) == "number" || a is Long + +internal fun isComparable(value: dynamic): Boolean { + var type = jsTypeOf(value) + + return type == "string" || + type == "boolean" || + isNumber(value) || + isInterface(value, Comparable::class.js) +} + +internal fun isCharSequence(value: dynamic): Boolean = + jsTypeOf(value) == "string" || isInterface(value, CharSequence::class.js) diff --git a/libraries/stdlib/py/src/generated/.gitattributes b/libraries/stdlib/py/src/generated/.gitattributes new file mode 100644 index 0000000000000..d0496f1a2665d --- /dev/null +++ b/libraries/stdlib/py/src/generated/.gitattributes @@ -0,0 +1 @@ +*.kt eol=lf diff --git a/libraries/stdlib/py/src/generated/_ArraysJs.kt b/libraries/stdlib/py/src/generated/_ArraysJs.kt new file mode 100644 index 0000000000000..c76f0f6b00223 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_ArraysJs.kt @@ -0,0 +1,2188 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.collections + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import primitiveArrayConcat +import withType + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun Array.elementAt(index: Int): T { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun ByteArray.elementAt(index: Int): Byte { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun ShortArray.elementAt(index: Int): Short { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun IntArray.elementAt(index: Int): Int { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun LongArray.elementAt(index: Int): Long { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun FloatArray.elementAt(index: Int): Float { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun DoubleArray.elementAt(index: Int): Double { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun BooleanArray.elementAt(index: Int): Boolean { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun CharArray.elementAt(index: Int): Char { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns a [List] that wraps the original array. + */ +actual fun Array.asList(): List { + return ArrayList(this.unsafeCast>()) +} + +/** + * Returns a [List] that wraps the original array. + */ +@kotlin.internal.InlineOnly +actual inline fun ByteArray.asList(): List { + return this.unsafeCast>().asList() +} + +/** + * Returns a [List] that wraps the original array. + */ +@kotlin.internal.InlineOnly +actual inline fun ShortArray.asList(): List { + return this.unsafeCast>().asList() +} + +/** + * Returns a [List] that wraps the original array. + */ +@kotlin.internal.InlineOnly +actual inline fun IntArray.asList(): List { + return this.unsafeCast>().asList() +} + +/** + * Returns a [List] that wraps the original array. + */ +@kotlin.internal.InlineOnly +actual inline fun LongArray.asList(): List { + return this.unsafeCast>().asList() +} + +/** + * Returns a [List] that wraps the original array. + */ +@kotlin.internal.InlineOnly +actual inline fun FloatArray.asList(): List { + return this.unsafeCast>().asList() +} + +/** + * Returns a [List] that wraps the original array. + */ +@kotlin.internal.InlineOnly +actual inline fun DoubleArray.asList(): List { + return this.unsafeCast>().asList() +} + +/** + * Returns a [List] that wraps the original array. + */ +@kotlin.internal.InlineOnly +actual inline fun BooleanArray.asList(): List { + return this.unsafeCast>().asList() +} + +/** + * Returns a [List] that wraps the original array. + */ +actual fun CharArray.asList(): List { + return object : AbstractList(), RandomAccess { + override val size: Int get() = this@asList.size + override fun isEmpty(): Boolean = this@asList.isEmpty() + override fun contains(element: Char): Boolean = this@asList.contains(element) + override fun get(index: Int): Char { + AbstractList.checkElementIndex(index, size) + return this@asList[index] + } + override fun indexOf(element: Char): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is Char) return -1 + return this@asList.indexOf(element) + } + override fun lastIndexOf(element: Char): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is Char) return -1 + return this@asList.lastIndexOf(element) + } + } +} + +/** + * Returns `true` if the two specified arrays are *deeply* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * If two corresponding elements are nested arrays, they are also compared deeply. + * If any of arrays contains itself on any nesting level the behavior is undefined. + * + * The elements of other types are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution +actual infix fun Array.contentDeepEquals(other: Array): Boolean { + return this.contentDeepEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *deeply* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The specified arrays are also considered deeply equal if both are `null`. + * + * If two corresponding elements are nested arrays, they are also compared deeply. + * If any of arrays contains itself on any nesting level the behavior is undefined. + * + * The elements of other types are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun Array?.contentDeepEquals(other: Array?): Boolean { + return contentDeepEqualsImpl(other) +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + * Nested arrays are treated as lists too. + * + * If any of arrays contains itself on any nesting level the behavior is undefined. + */ +@SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution +actual fun Array.contentDeepHashCode(): Int { + return this.contentDeepHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + * Nested arrays are treated as lists too. + * + * If any of arrays contains itself on any nesting level the behavior is undefined. + */ +@SinceKotlin("1.4") +actual fun Array?.contentDeepHashCode(): Int { + return contentDeepHashCodeInternal() +} + +/** + * Returns a string representation of the contents of this array as if it is a [List]. + * Nested arrays are treated as lists too. + * + * If any of arrays contains itself on any nesting level that reference + * is rendered as `"[...]"` to prevent recursion. + * + * @sample samples.collections.Arrays.ContentOperations.contentDeepToString + */ +@SinceKotlin("1.1") +@kotlin.internal.LowPriorityInOverloadResolution +actual fun Array.contentDeepToString(): String { + return this.contentDeepToString() +} + +/** + * Returns a string representation of the contents of this array as if it is a [List]. + * Nested arrays are treated as lists too. + * + * If any of arrays contains itself on any nesting level that reference + * is rendered as `"[...]"` to prevent recursion. + * + * @sample samples.collections.Arrays.ContentOperations.contentDeepToString + */ +@SinceKotlin("1.4") +actual fun Array?.contentDeepToString(): String { + return contentDeepToStringImpl() +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun Array.contentEquals(other: Array): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun ByteArray.contentEquals(other: ByteArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun ShortArray.contentEquals(other: ShortArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun IntArray.contentEquals(other: IntArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun LongArray.contentEquals(other: LongArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun FloatArray.contentEquals(other: FloatArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual infix fun CharArray.contentEquals(other: CharArray): Boolean { + return this.contentEquals(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun Array?.contentEquals(other: Array?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns `true` if the two specified arrays are *structurally* equal to one another, + * i.e. contain the same number of the same elements in the same order. + * + * The elements are compared for equality with the [equals][Any.equals] function. + * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`. + */ +@SinceKotlin("1.4") +actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean { + return contentEqualsInternal(other) +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun Array.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun ByteArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun ShortArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun IntArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun LongArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun FloatArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun DoubleArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun BooleanArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun CharArray.contentHashCode(): Int { + return this.contentHashCode() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun Array?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun ByteArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun ShortArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun IntArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun LongArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun FloatArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun DoubleArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun BooleanArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a hash code based on the contents of this array as if it is [List]. + */ +@SinceKotlin("1.4") +actual fun CharArray?.contentHashCode(): Int { + return contentHashCodeInternal() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun Array.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun ByteArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun ShortArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun IntArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun LongArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun FloatArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun DoubleArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun BooleanArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.") +@SinceKotlin("1.1") +@DeprecatedSinceKotlin(hiddenSince = "1.4") +actual fun CharArray.contentToString(): String { + return this.contentToString() +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun Array?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun ByteArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun ShortArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun IntArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun LongArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun FloatArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun DoubleArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun BooleanArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Returns a string representation of the contents of the specified array as if it is [List]. + * + * @sample samples.collections.Arrays.ContentOperations.contentToString + */ +@SinceKotlin("1.4") +actual fun CharArray?.contentToString(): String { + return this?.joinToString(", ", "[", "]") ?: "null" +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun Array.copyInto(destination: Array, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array { + arrayCopy(this, destination, destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Copies this array or its subrange into the [destination] array and returns that array. + * + * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range. + * + * @param destination the array to copy to. + * @param destinationOffset the position in the [destination] array to copy to, 0 by default. + * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default. + * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default. + * + * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`. + * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset], + * or when that index is out of the [destination] array indices range. + * + * @return the [destination] array. + */ +@SinceKotlin("1.3") +@kotlin.internal.InlineOnly +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual inline fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray { + arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex) + return destination +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +@Suppress("ACTUAL_WITHOUT_EXPECT", "NOTHING_TO_INLINE") +actual inline fun Array.copyOf(): Array { + return this.asDynamic().slice() +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +@Suppress("NOTHING_TO_INLINE") +actual inline fun ByteArray.copyOf(): ByteArray { + return this.asDynamic().slice() +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +@Suppress("NOTHING_TO_INLINE") +actual inline fun ShortArray.copyOf(): ShortArray { + return this.asDynamic().slice() +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +@Suppress("NOTHING_TO_INLINE") +actual inline fun IntArray.copyOf(): IntArray { + return this.asDynamic().slice() +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +actual fun LongArray.copyOf(): LongArray { + return withType("LongArray", this.asDynamic().slice()) +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +@Suppress("NOTHING_TO_INLINE") +actual inline fun FloatArray.copyOf(): FloatArray { + return this.asDynamic().slice() +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +@Suppress("NOTHING_TO_INLINE") +actual inline fun DoubleArray.copyOf(): DoubleArray { + return this.asDynamic().slice() +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +actual fun BooleanArray.copyOf(): BooleanArray { + return withType("BooleanArray", this.asDynamic().slice()) +} + +/** + * Returns new array which is a copy of the original array. + * + * @sample samples.collections.Arrays.CopyOfOperations.copyOf + */ +actual fun CharArray.copyOf(): CharArray { + return withType("CharArray", this.asDynamic().slice()) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with zero values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun ByteArray.copyOf(newSize: Int): ByteArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return fillFrom(this, ByteArray(newSize)) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with zero values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun ShortArray.copyOf(newSize: Int): ShortArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return fillFrom(this, ShortArray(newSize)) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with zero values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun IntArray.copyOf(newSize: Int): IntArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return fillFrom(this, IntArray(newSize)) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with zero values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun LongArray.copyOf(newSize: Int): LongArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return withType("LongArray", arrayCopyResize(this, newSize, 0L)) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with zero values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun FloatArray.copyOf(newSize: Int): FloatArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return fillFrom(this, FloatArray(newSize)) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with zero values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun DoubleArray.copyOf(newSize: Int): DoubleArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return fillFrom(this, DoubleArray(newSize)) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with `false` values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `false` values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun BooleanArray.copyOf(newSize: Int): BooleanArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return withType("BooleanArray", arrayCopyResize(this, newSize, false)) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with null char (`\u0000`) values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with null char (`\u0000`) values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf + */ +actual fun CharArray.copyOf(newSize: Int): CharArray { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return withType("CharArray", fillFrom(this, CharArray(newSize))) +} + +/** + * Returns new array which is a copy of the original array, resized to the given [newSize]. + * The copy is either truncated or padded at the end with `null` values if necessary. + * + * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize]. + * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `null` values. + * + * @sample samples.collections.Arrays.CopyOfOperations.resizingCopyOf + */ +@Suppress("ACTUAL_WITHOUT_EXPECT") +actual fun Array.copyOf(newSize: Int): Array { + require(newSize >= 0) { "Invalid new array size: $newSize." } + return arrayCopyResize(this, newSize, null) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@Suppress("ACTUAL_WITHOUT_EXPECT") +actual fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return this.asDynamic().slice(fromIndex, toIndex) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return this.asDynamic().slice(fromIndex, toIndex) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return this.asDynamic().slice(fromIndex, toIndex) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return this.asDynamic().slice(fromIndex, toIndex) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return withType("LongArray", this.asDynamic().slice(fromIndex, toIndex)) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return this.asDynamic().slice(fromIndex, toIndex) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return this.asDynamic().slice(fromIndex, toIndex) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return withType("BooleanArray", this.asDynamic().slice(fromIndex, toIndex)) +} + +/** + * Returns a new array which is a copy of the specified range of the original array. + * + * @param fromIndex the start of the range (inclusive) to copy. + * @param toIndex the end of the range (exclusive) to copy. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +actual fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + return withType("CharArray", this.asDynamic().slice(fromIndex, toIndex)) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Fills this array or its subrange with the specified [element] value. + * + * @param fromIndex the start of the range (inclusive) to fill, 0 by default. + * @param toIndex the end of the range (exclusive) to fill, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.3") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun CharArray.fill(element: Char, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + this.asDynamic().fill(element, fromIndex, toIndex) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("ACTUAL_WITHOUT_EXPECT", "NOTHING_TO_INLINE") +actual inline operator fun Array.plus(element: T): Array { + return this.asDynamic().concat(arrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun ByteArray.plus(element: Byte): ByteArray { + return plus(byteArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun ShortArray.plus(element: Short): ShortArray { + return plus(shortArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun IntArray.plus(element: Int): IntArray { + return plus(intArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun LongArray.plus(element: Long): LongArray { + return plus(longArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun FloatArray.plus(element: Float): FloatArray { + return plus(floatArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun DoubleArray.plus(element: Double): DoubleArray { + return plus(doubleArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun BooleanArray.plus(element: Boolean): BooleanArray { + return plus(booleanArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun CharArray.plus(element: Char): CharArray { + return plus(charArrayOf(element)) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +@Suppress("ACTUAL_WITHOUT_EXPECT") +actual operator fun Array.plus(elements: Collection): Array { + return arrayPlusCollection(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun ByteArray.plus(elements: Collection): ByteArray { + var index = size + val result = this.copyOf(size + elements.size) + for (element in elements) result[index++] = element + return result +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun ShortArray.plus(elements: Collection): ShortArray { + var index = size + val result = this.copyOf(size + elements.size) + for (element in elements) result[index++] = element + return result +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun IntArray.plus(elements: Collection): IntArray { + var index = size + val result = this.copyOf(size + elements.size) + for (element in elements) result[index++] = element + return result +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun LongArray.plus(elements: Collection): LongArray { + return arrayPlusCollection(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun FloatArray.plus(elements: Collection): FloatArray { + var index = size + val result = this.copyOf(size + elements.size) + for (element in elements) result[index++] = element + return result +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun DoubleArray.plus(elements: Collection): DoubleArray { + var index = size + val result = this.copyOf(size + elements.size) + for (element in elements) result[index++] = element + return result +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun BooleanArray.plus(elements: Collection): BooleanArray { + return arrayPlusCollection(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] collection. + */ +actual operator fun CharArray.plus(elements: Collection): CharArray { + var index = size + val result = this.copyOf(size + elements.size) + for (element in elements) result[index++] = element + return result +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("ACTUAL_WITHOUT_EXPECT", "NOTHING_TO_INLINE") +actual inline operator fun Array.plus(elements: Array): Array { + return this.asDynamic().concat(elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun ByteArray.plus(elements: ByteArray): ByteArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun ShortArray.plus(elements: ShortArray): ShortArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun IntArray.plus(elements: IntArray): IntArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun LongArray.plus(elements: LongArray): LongArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun FloatArray.plus(elements: FloatArray): FloatArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then all elements of the given [elements] array. + */ +@Suppress("NOTHING_TO_INLINE") +actual inline operator fun CharArray.plus(elements: CharArray): CharArray { + return primitiveArrayConcat(this, elements) +} + +/** + * Returns an array containing all elements of the original array and then the given [element]. + */ +@Suppress("ACTUAL_WITHOUT_EXPECT", "NOTHING_TO_INLINE") +actual inline fun Array.plusElement(element: T): Array { + return this.asDynamic().concat(arrayOf(element)) +} + +/** + * Sorts the array in-place. + * + * @sample samples.collections.Arrays.Sorting.sortArray + */ +actual fun IntArray.sort(): Unit { + this.asDynamic().sort() +} + +/** + * Sorts the array in-place. + * + * @sample samples.collections.Arrays.Sorting.sortArray + */ +actual fun LongArray.sort(): Unit { + @Suppress("DEPRECATION") + if (size > 1) sort { a: Long, b: Long -> a.compareTo(b) } +} + +/** + * Sorts the array in-place. + * + * @sample samples.collections.Arrays.Sorting.sortArray + */ +actual fun ByteArray.sort(): Unit { + this.asDynamic().sort() +} + +/** + * Sorts the array in-place. + * + * @sample samples.collections.Arrays.Sorting.sortArray + */ +actual fun ShortArray.sort(): Unit { + this.asDynamic().sort() +} + +/** + * Sorts the array in-place. + * + * @sample samples.collections.Arrays.Sorting.sortArray + */ +actual fun DoubleArray.sort(): Unit { + this.asDynamic().sort() +} + +/** + * Sorts the array in-place. + * + * @sample samples.collections.Arrays.Sorting.sortArray + */ +actual fun FloatArray.sort(): Unit { + this.asDynamic().sort() +} + +/** + * Sorts the array in-place. + * + * @sample samples.collections.Arrays.Sorting.sortArray + */ +actual fun CharArray.sort(): Unit { + this.asDynamic().sort(::primitiveCompareTo) +} + +/** + * Sorts the array in-place according to the natural order of its elements. + * + * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + * + * @sample samples.collections.Arrays.Sorting.sortArrayOfComparable + */ +actual fun > Array.sort(): Unit { + if (size > 1) sortArray(this) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + * + * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + */ +@Deprecated("Use sortWith instead", ReplaceWith("this.sortWith(Comparator(comparison))")) +@DeprecatedSinceKotlin(warningSince = "1.6") +fun Array.sort(comparison: (a: T, b: T) -> Int): Unit { + if (size > 1) sortArrayWith(this, comparison) +} + +/** + * Sorts a range in the array in-place. + * + * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArrayOfComparable + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun > Array.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + sortArrayWith(this, fromIndex, toIndex, naturalOrder()) +} + +/** + * Sorts a range in the array in-place. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArray + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun ByteArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast() + subarray.sort() +} + +/** + * Sorts a range in the array in-place. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArray + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast() + subarray.sort() +} + +/** + * Sorts a range in the array in-place. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArray + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun IntArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast() + subarray.sort() +} + +/** + * Sorts a range in the array in-place. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArray + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun LongArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + sortArrayWith(this.unsafeCast>(), fromIndex, toIndex, naturalOrder()) +} + +/** + * Sorts a range in the array in-place. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArray + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun FloatArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast() + subarray.sort() +} + +/** + * Sorts a range in the array in-place. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArray + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun DoubleArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast() + subarray.sort() +} + +/** + * Sorts a range in the array in-place. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + * + * @sample samples.collections.Arrays.Sorting.sortRangeOfArray + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + sortArrayWith(this.unsafeCast>(), fromIndex, toIndex, naturalOrder()) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +@Deprecated("Use other sorting functions from the Standard Library") +@DeprecatedSinceKotlin(warningSince = "1.6") +@kotlin.internal.InlineOnly +inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int): Unit { + asDynamic().sort(comparison) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +@Deprecated("Use other sorting functions from the Standard Library") +@DeprecatedSinceKotlin(warningSince = "1.6") +@kotlin.internal.InlineOnly +inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> Int): Unit { + asDynamic().sort(comparison) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +@Deprecated("Use other sorting functions from the Standard Library") +@DeprecatedSinceKotlin(warningSince = "1.6") +@kotlin.internal.InlineOnly +inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int): Unit { + asDynamic().sort(comparison) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +@Deprecated("Use other sorting functions from the Standard Library") +@DeprecatedSinceKotlin(warningSince = "1.6") +@kotlin.internal.InlineOnly +inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int): Unit { + asDynamic().sort(comparison) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +@Deprecated("Use other sorting functions from the Standard Library") +@DeprecatedSinceKotlin(warningSince = "1.6") +@kotlin.internal.InlineOnly +inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> Int): Unit { + asDynamic().sort(comparison) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +@Deprecated("Use other sorting functions from the Standard Library") +@DeprecatedSinceKotlin(warningSince = "1.6") +@kotlin.internal.InlineOnly +inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int): Unit { + asDynamic().sort(comparison) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparison] function. + */ +@Deprecated("Use other sorting functions from the Standard Library") +@DeprecatedSinceKotlin(warningSince = "1.6") +@kotlin.internal.InlineOnly +inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit { + asDynamic().sort(comparison) +} + +/** + * Sorts the array in-place according to the order specified by the given [comparator]. + * + * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + */ +actual fun Array.sortWith(comparator: Comparator): Unit { + if (size > 1) sortArrayWith(this, comparator) +} + +/** + * Sorts a range in the array in-place with the given [comparator]. + * + * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting. + * + * @param fromIndex the start of the range (inclusive) to sort, 0 by default. + * @param toIndex the end of the range (exclusive) to sort, size of this array by default. + * + * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array. + * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex]. + */ +@SinceKotlin("1.4") +@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") +actual fun Array.sortWith(comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size): Unit { + AbstractList.checkRangeIndexes(fromIndex, toIndex, size) + sortArrayWith(this, fromIndex, toIndex, comparator) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun ByteArray.toTypedArray(): Array { + return js("[]").slice.call(this) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun ShortArray.toTypedArray(): Array { + return js("[]").slice.call(this) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun IntArray.toTypedArray(): Array { + return js("[]").slice.call(this) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun LongArray.toTypedArray(): Array { + return js("[]").slice.call(this) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun FloatArray.toTypedArray(): Array { + return js("[]").slice.call(this) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun DoubleArray.toTypedArray(): Array { + return js("[]").slice.call(this) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun BooleanArray.toTypedArray(): Array { + return js("[]").slice.call(this) +} + +/** + * Returns a *typed* object array containing all of the elements of this primitive array. + */ +actual fun CharArray.toTypedArray(): Array { + return Array(size) { index -> this[index] } +} + diff --git a/libraries/stdlib/py/src/generated/_CharCategories.kt b/libraries/stdlib/py/src/generated/_CharCategories.kt new file mode 100644 index 0000000000000..6e6bb647a0720 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_CharCategories.kt @@ -0,0 +1,84 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 1343 ranges totally +private object Category { + val decodedRangeStart: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].code] = i + } + + // rangeStartDiff.length = 1482 + val rangeStartDiff = "gBCFEDCKCDCaDDaDBhBCEEDDDDDEDXBHYBH5BRwBGDCHDCIDFHDCHFDCDEIRTEE7BGHDDJlCBbSEMOFGERwDEDDDDECEFCRBJhBFDCYFFCCzBvBjBBFC3BOhDBmBDGpBDDCtBBJIbEECLGDFCLDCgBBKVKEDiDDHCFECECKCEODBebC5CLBOKhBJDDDDWEBHFCFCPBZDEL1BVBSLPBgBB2BDBDICFBHKCCKCPDBHEDWBHEDDDDEDEDIBDGDCKCCGDDDCGECCWBFMDDCDEDDCHDDHKDDBKDBHFCWBFGFDBDDFEDBPDDKCHBGDCHEDWBFGFDCEDEDBHDDGDCKCGJEGDBFDDFDDDDDMEFDBFDCGBOKDFDFDCGFCXBQDDDDDBEGEDFDDKHBHDDGFCXBKBFCEFCFCHCHECCKDNCCHFCoBEDECFDDDDHDCCKJBGDCSDYBJEHBFDDEBIGKDCMuBFHEBGBIBKCkBFBFBXEIFJDFDGCKCEgBBDPEDGKKGECIBkBEOBDFFLBkBBIBEFFEClBrBCEBEGDBKGGDDDDDCHDENDCFEKDDlBDDFrBCDpKBECGEECpBBEChBBECGEECPB5BBECjCCDJUDQKG2CCGDsTCRBaCDrCDDIHNBEDLSDCJSCMLFCCM0BDHGFLBFDDKGKGEFDDBKGjBB1BHFChBDFmCKfDDDDDDCGDCFDKeCFLsBEaGKBDiBXDDD1BDGDEIGJEKGKGHBGCMF/BEBvBCEDDFHEKHKJJDDeDDGDKsBFEDCIEkBIICCDFKDDKeGCJHrBCDIIDBNBHEBEFDBFsB/BNBiBlB6BBF1EIiDJIGCGCIIIIGCGCIIIIOCIIIIIIDFEDDBFEDDDDEBDIFDDFEDBLFGCEEICFBJCDEDCLDKBFBKCCGDDKDDNDgBQNEBDMPFFDEDEBFFHECEBEEDFBEDDQjBCEDEFFCCJHBeEEfsIIEUCHCxCBeZoBGlCZLV8BuCW3FBJB2BIvDB4HOesBFCfKQgIjEW/BEgBCiIwBVCGnBCgBBpDvBBuBEDBHEFGCCjDCGEDCFCFlBDDF4BHCOBXJHBHBHBHBHBHBHBHBgBCECGHGEDIFBKCEDMEtBaB5CM2GaMEDDCKCGFCJEDFDDDC2CDDDB6CDCFrBB+CDEKgBkBMQfBKeIBPgBKnBPgKguGgC9vUDVB3jBD3BJoBGCsIBDQKCUuBDDKCcCCmCKCGIXJCNC/BBHGKDECEVFBEMCEEBqBDDGDFDXDCEBDGEG0BEICyBQCICKGSGDEBKcICXLCLBdDDBvBDECCDNCKECFCJKFBpBFEDCJDBICCKCEQBGDDByBEDCEFBYDCLEDDCKGCGCGJHBHBrBBEJDEwCjBIDCKGk9KMXExBEggCgoGuLCqDmBHMFFCKBNBFBIsDQRrLCQgCC2BoBMCCQGEGQDCQDDDDFDGDECEEFBnEEBFEDCKCDCaDDaDBFCKBtBCfDGCGCFEDDDDCECKDC" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, 1342) + val start = IntArray(diff.size + 1) + for (i in diff.indices) { + start[i + 1] = start[i] + diff[i] + } + decodedRangeStart = start + + // rangeCategory.length = 2033 + val rangeCategory = "PsY44a41W54UYJYZYB14W7XC15WZPsYa84bl9Zw8b85Lr7C44brlerrYBZBCZCiBiBiBhCiiBhChiBhiCBhhChiCihBhChCChiBhChiClBCFhjCiBiBihDhiBhCCihBiBBhCCFCEbEbEb7EbGhCk7BixRkiCi4BRbh4BhRhCBRBCiiBBCiBChiZBCBCiBcGHhChCiBRBxxEYC40Rx8c6RGUm4GRFRFYRQZ44acG4wRYFEFGJYllGFlYGwcGmkEmcGFJFl8cYxwFGFGRFGFRJFGkkcYkxRm6aFGEGmmEmEGRYRFGxxYFRFRFRGQGIFmIFIGIooGFGFGYJ4EFmoIRFlxRlxRFRFxlRxlFllRxmFIGxxIoxRomFRIRxlFlmGRJFaL86F4mRxmGoRFRFRFRFllRxGIGRxmGxmGmxRxGRFlRRJmmFllGYRmmIRFllRlRFRFllRFxxGFIGmmRoxImxRFRllGmxRJ4aRFGxmIoRFlxRlxRFRFllRFxxGlImoGmmRxoIxoIGRmmIRxlFlmGRJ8FLRxmFFRFllRllRxxFlRlxRxlFRFRFRooGRIooRomRxFRIRJLc8aRmoIoGFllRlRFRFRlmGmoIooRGRGRxmGFRllGmxRJRYL8lGooYFllRlRFRFRFRmlIIxGooRGRIRlxFGRJxlFRGIFllRlRFlmGIGxIooRomF8xRxxFllILFGRJLcFxmIoRFRFRFxlRFRxxGxxIooGmmRRIRJxxIoYRFllGGRaFEGYJYRxlFRFRFlRFllGGlxRFxEGRJRFRFcY84c8mGcJL8G1WIFRFRGIGmmYFGRGRcGc88RYcYRFIGIGmmIomGFJYFooGmlFllGmmFIFIFGFmoIGIomFJIm8cBhRRxxBC4ECFRFRFlRFRFRFRFRFRFlRFRFRFRFRFRGYLRFcRBRCxxUF8YFMF1WRFYKFRFRFGRFGYRFGRFllRlRGRFmmIGIooGGY44E46FmxRJRLRY44U44GmmQRJRFEFRFGFlGRFRFxmGmoIooGmoIoxRxxIoGIGRxxcx4YJFRFRFRFRJLRcFmmIomRx4YFoGGmRomIGIGmxRJRJRYEYRGmmHRGIFmIGmIIooGFRJYcGcRmmIFomGmmIomGmlFJFmoGooGGIRYFIGIGRYJRFJFEYCRBRBYRGYGIGFGFllGomGFRCECECEGRGhCCiBCBCRBRCBCBCRBRCxBCBCRCDCDCDCiiRBj7CbCiiRBj7b7iCiiRxiCBRbCBbxxCiiRBj7bRMQUY9+V9+VYtOQMY9eY43X44Z1WY54XYMQRQrERLZ12ELZ12RERaRGHGHGR88B88BihBhiChhC8hcZBc8BB8CBCFi8cihBZBC8Z8CLKhCKr8cRZcZc88ZcZc85Z8ZcZc1WcZc1WcZcZcZcRcRLcLcZcZcZcZc1WLcZ1WZ1WZcZ1WZ1WZ1WZcZcZcRcRcBRCixBBCiBBihCCEBhCCchCGhCRY44LCiRRxxCFRkYRGFRFRFRFRFRFRFRFRFRGY9eY49eY44U49e49e1WYEYUY04VY48cRcRcRcRcRs4Y48ElK1Wc1W12U2cKGooUE88KqqEl4c8RFxxGm7bkkFUF4kEkFRFRFx8cLcFcRFcRLcLcLcLcLcFcFRFEFRcRFEYFEYFJFRhClmHnnYG4EhCEGFKGYRbEbhCCiBECiBhCk7bhClBihCiBBCBhCRhiBhhCCRhiFkkCFlGllGllGFooGmIcGRL88aRFYRIFIGRYJRGFYl4FGJFGYFGIRYFRGIFmoIGIGIYxEJRYFmEFJFRFGmoImoIGRFGFmIRJRYFEFcloGIFmlGmlFGFlmGFRllEYFomGo4YlkEoGRFRFRFRFRFRCbECk7bRCFooG4oGRJRFRFRFRTSFRFRCRCRlGFZFRFRlxFFbRF2VRFRFRF6cRGY41WRG40UX1W44V24Y44X33Y44R44U1WY50Z5R46YRFRFxxQY44a41W54UYJYZYB14W7XC15WZ12YYFEFEFRFRFRFlxRllRxxa65b86axcZcRQcR" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, 1343) + } +} + +private fun categoryValueFrom(code: Int, ch: Int): Int { + return when { + code < 0x20 -> code + code < 0x400 -> if ((ch and 1) == 1) code shr 5 else code and 0x1f + else -> + when (ch % 3) { + 2 -> code shr 10 + 1 -> (code shr 5) and 0x1f + else -> code and 0x1f + } + } +} + +/** + * Returns the Unicode general category of this character as an Int. + */ +internal fun Char.getCategoryValue(): Int { + val ch = this.code + + val index = binarySearchRange(Category.decodedRangeStart, ch) + val start = Category.decodedRangeStart[index] + val code = Category.decodedRangeCategory[index] + val value = categoryValueFrom(code, ch - start) + + return if (value == 17) CharCategory.UNASSIGNED.value else value +} + +internal fun decodeVarLenBase64(base64: String, fromBase64: IntArray, resultLength: Int): IntArray { + val result = IntArray(resultLength) + var index = 0 + var int = 0 + var shift = 0 + for (char in base64) { + val sixBit = fromBase64[char.code] + int = int or ((sixBit and 0x1f) shl shift) + if (sixBit < 0x20) { + result[index++] = int + int = 0 + shift = 0 + } else { + shift += 5 + } + } + return result +} diff --git a/libraries/stdlib/py/src/generated/_CollectionsJs.kt b/libraries/stdlib/py/src/generated/_CollectionsJs.kt new file mode 100644 index 0000000000000..7b634cd1a5e37 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_CollectionsJs.kt @@ -0,0 +1,27 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.collections + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +/** + * Reverses elements in the list in-place. + */ +actual fun MutableList.reverse(): Unit { + val midPoint = (size / 2) - 1 + if (midPoint < 0) return + var reverseIndex = lastIndex + for (index in 0..midPoint) { + val tmp = this[index] + this[index] = this[reverseIndex] + this[reverseIndex] = tmp + reverseIndex-- + } +} + diff --git a/libraries/stdlib/py/src/generated/_ComparisonsJs.kt b/libraries/stdlib/py/src/generated/_ComparisonsJs.kt new file mode 100644 index 0000000000000..ab07c4fef74a4 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_ComparisonsJs.kt @@ -0,0 +1,436 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.comparisons + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +/** + * Returns the greater of two values. + * + * If values are equal, returns the first one. + */ +@SinceKotlin("1.1") +actual fun > maxOf(a: T, b: T): T { + return if (a >= b) a else b +} + +/** + * Returns the greater of two values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Byte, b: Byte): Byte { + return maxOf(a.toInt(), b.toInt()).unsafeCast() +} + +/** + * Returns the greater of two values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Short, b: Short): Short { + return maxOf(a.toInt(), b.toInt()).unsafeCast() +} + +/** + * Returns the greater of two values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Int, b: Int): Int { + return JsMath.max(a, b) +} + +/** + * Returns the greater of two values. + */ +@SinceKotlin("1.1") +@Suppress("NOTHING_TO_INLINE") +actual inline fun maxOf(a: Long, b: Long): Long { + return if (a >= b) a else b +} + +/** + * Returns the greater of two values. + * + * If either value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Float, b: Float): Float { + return JsMath.max(a, b) +} + +/** + * Returns the greater of two values. + * + * If either value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Double, b: Double): Double { + return JsMath.max(a, b) +} + +/** + * Returns the greater of three values. + * + * If there are multiple equal maximal values, returns the first of them. + */ +@SinceKotlin("1.1") +actual fun > maxOf(a: T, b: T, c: T): T { + return maxOf(a, maxOf(b, c)) +} + +/** + * Returns the greater of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte { + return JsMath.max(a.toInt(), b.toInt(), c.toInt()).unsafeCast() +} + +/** + * Returns the greater of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Short, b: Short, c: Short): Short { + return JsMath.max(a.toInt(), b.toInt(), c.toInt()).unsafeCast() +} + +/** + * Returns the greater of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Int, b: Int, c: Int): Int { + return JsMath.max(a, b, c) +} + +/** + * Returns the greater of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Long, b: Long, c: Long): Long { + return maxOf(a, maxOf(b, c)) +} + +/** + * Returns the greater of three values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Float, b: Float, c: Float): Float { + return JsMath.max(a, b, c) +} + +/** + * Returns the greater of three values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun maxOf(a: Double, b: Double, c: Double): Double { + return JsMath.max(a, b, c) +} + +/** + * Returns the greater of the given values. + * + * If there are multiple equal maximal values, returns the first of them. + */ +@SinceKotlin("1.4") +actual fun > maxOf(a: T, vararg other: T): T { + var max = a + for (e in other) max = maxOf(max, e) + return max +} + +/** + * Returns the greater of the given values. + */ +@SinceKotlin("1.4") +actual fun maxOf(a: Byte, vararg other: Byte): Byte { + var max = a + for (e in other) max = maxOf(max, e) + return max +} + +/** + * Returns the greater of the given values. + */ +@SinceKotlin("1.4") +actual fun maxOf(a: Short, vararg other: Short): Short { + var max = a + for (e in other) max = maxOf(max, e) + return max +} + +/** + * Returns the greater of the given values. + */ +@SinceKotlin("1.4") +actual fun maxOf(a: Int, vararg other: Int): Int { + var max = a + for (e in other) max = maxOf(max, e) + return max +} + +/** + * Returns the greater of the given values. + */ +@SinceKotlin("1.4") +actual fun maxOf(a: Long, vararg other: Long): Long { + var max = a + for (e in other) max = maxOf(max, e) + return max +} + +/** + * Returns the greater of the given values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.4") +actual fun maxOf(a: Float, vararg other: Float): Float { + var max = a + for (e in other) max = maxOf(max, e) + return max +} + +/** + * Returns the greater of the given values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.4") +actual fun maxOf(a: Double, vararg other: Double): Double { + var max = a + for (e in other) max = maxOf(max, e) + return max +} + +/** + * Returns the smaller of two values. + * + * If values are equal, returns the first one. + */ +@SinceKotlin("1.1") +actual fun > minOf(a: T, b: T): T { + return if (a <= b) a else b +} + +/** + * Returns the smaller of two values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Byte, b: Byte): Byte { + return minOf(a.toInt(), b.toInt()).unsafeCast() +} + +/** + * Returns the smaller of two values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Short, b: Short): Short { + return minOf(a.toInt(), b.toInt()).unsafeCast() +} + +/** + * Returns the smaller of two values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Int, b: Int): Int { + return JsMath.min(a, b) +} + +/** + * Returns the smaller of two values. + */ +@SinceKotlin("1.1") +@Suppress("NOTHING_TO_INLINE") +actual inline fun minOf(a: Long, b: Long): Long { + return if (a <= b) a else b +} + +/** + * Returns the smaller of two values. + * + * If either value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Float, b: Float): Float { + return JsMath.min(a, b) +} + +/** + * Returns the smaller of two values. + * + * If either value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Double, b: Double): Double { + return JsMath.min(a, b) +} + +/** + * Returns the smaller of three values. + * + * If there are multiple equal minimal values, returns the first of them. + */ +@SinceKotlin("1.1") +actual fun > minOf(a: T, b: T, c: T): T { + return minOf(a, minOf(b, c)) +} + +/** + * Returns the smaller of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Byte, b: Byte, c: Byte): Byte { + return JsMath.min(a.toInt(), b.toInt(), c.toInt()).unsafeCast() +} + +/** + * Returns the smaller of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Short, b: Short, c: Short): Short { + return JsMath.min(a.toInt(), b.toInt(), c.toInt()).unsafeCast() +} + +/** + * Returns the smaller of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Int, b: Int, c: Int): Int { + return JsMath.min(a, b, c) +} + +/** + * Returns the smaller of three values. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Long, b: Long, c: Long): Long { + return minOf(a, minOf(b, c)) +} + +/** + * Returns the smaller of three values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Float, b: Float, c: Float): Float { + return JsMath.min(a, b, c) +} + +/** + * Returns the smaller of three values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.1") +@kotlin.internal.InlineOnly +actual inline fun minOf(a: Double, b: Double, c: Double): Double { + return JsMath.min(a, b, c) +} + +/** + * Returns the smaller of the given values. + * + * If there are multiple equal minimal values, returns the first of them. + */ +@SinceKotlin("1.4") +actual fun > minOf(a: T, vararg other: T): T { + var min = a + for (e in other) min = minOf(min, e) + return min +} + +/** + * Returns the smaller of the given values. + */ +@SinceKotlin("1.4") +actual fun minOf(a: Byte, vararg other: Byte): Byte { + var min = a + for (e in other) min = minOf(min, e) + return min +} + +/** + * Returns the smaller of the given values. + */ +@SinceKotlin("1.4") +actual fun minOf(a: Short, vararg other: Short): Short { + var min = a + for (e in other) min = minOf(min, e) + return min +} + +/** + * Returns the smaller of the given values. + */ +@SinceKotlin("1.4") +actual fun minOf(a: Int, vararg other: Int): Int { + var min = a + for (e in other) min = minOf(min, e) + return min +} + +/** + * Returns the smaller of the given values. + */ +@SinceKotlin("1.4") +actual fun minOf(a: Long, vararg other: Long): Long { + var min = a + for (e in other) min = minOf(min, e) + return min +} + +/** + * Returns the smaller of the given values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.4") +actual fun minOf(a: Float, vararg other: Float): Float { + var min = a + for (e in other) min = minOf(min, e) + return min +} + +/** + * Returns the smaller of the given values. + * + * If any value is `NaN`, returns `NaN`. + */ +@SinceKotlin("1.4") +actual fun minOf(a: Double, vararg other: Double): Double { + var min = a + for (e in other) min = minOf(min, e) + return min +} + diff --git a/libraries/stdlib/py/src/generated/_DigitChars.kt b/libraries/stdlib/py/src/generated/_DigitChars.kt new file mode 100644 index 0000000000000..f52885662da90 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_DigitChars.kt @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 37 ranges totally +private object Digit { + val rangeStart = intArrayOf( + 0x0030, 0x0660, 0x06f0, 0x07c0, 0x0966, 0x09e6, 0x0a66, 0x0ae6, 0x0b66, 0x0be6, 0x0c66, 0x0ce6, 0x0d66, 0x0de6, 0x0e50, 0x0ed0, 0x0f20, 0x1040, 0x1090, 0x17e0, + 0x1810, 0x1946, 0x19d0, 0x1a80, 0x1a90, 0x1b50, 0x1bb0, 0x1c40, 0x1c50, 0xa620, 0xa8d0, 0xa900, 0xa9d0, 0xa9f0, 0xaa50, 0xabf0, 0xff10, + ) +} + +/** + * Returns the index of the largest element in [array] smaller or equal to the specified [needle], + * or -1 if [needle] is smaller than the smallest element in [array]. + */ +internal fun binarySearchRange(array: IntArray, needle: Int): Int { + var bottom = 0 + var top = array.size - 1 + var middle = -1 + var value = 0 + while (bottom <= top) { + middle = (bottom + top) / 2 + value = array[middle] + if (needle > value) + bottom = middle + 1 + else if (needle == value) + return middle + else + top = middle - 1 + } + return middle - (if (needle < value) 1 else 0) +} + +/** + * Returns an integer from 0..9 indicating the digit this character represents, + * or -1 if this character is not a digit. + */ +internal fun Char.digitToIntImpl(): Int { + val ch = this.code + val index = binarySearchRange(Digit.rangeStart, ch) + val diff = ch - Digit.rangeStart[index] + return if (diff < 10) diff else -1 +} + +/** + * Returns `true` if this character is a digit. + */ +internal fun Char.isDigitImpl(): Boolean { + return digitToIntImpl() >= 0 +} diff --git a/libraries/stdlib/py/src/generated/_LetterChars.kt b/libraries/stdlib/py/src/generated/_LetterChars.kt new file mode 100644 index 0000000000000..1fc593c5ec841 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_LetterChars.kt @@ -0,0 +1,114 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 222 ranges totally +private object Letter { + val decodedRangeStart: IntArray + val decodedRangeLength: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].code] = i + } + + // rangeStartDiff.length = 356 + val rangeStartDiff = "hCgBpCQGYHZH5BRpBPPPPPPRMP5BPPlCPP6BkEPPPPcPXPzBvBrB3BOiDoBHwD+E3DauCnFmBmB2D6E1BlBTiBmBlBP5BhBiBrBvBjBqBnBPRtBiCmCtBlB0BmB5BiB7BmBgEmChBZgCoEoGVpBSfRhBPqKQ2BwBYoFgB4CJuTiEvBuCuDrF5DgEgFlJ1DgFmBQtBsBRGsB+BPiBlD1EIjDPRPPPQPPPPPGQSQS/DxENVNU+B9zCwBwBPPCkDPNnBPqDYY1R8B7FkFgTgwGgwUwmBgKwBuBScmEP/BPPPPPPrBP8B7F1B/ErBqC6B7BiBmBfQsBUwCw/KwqIwLwETPcPjQgJxFgBlBsD" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, 222) + val start = IntArray(diff.size) + for (i in diff.indices) { + if (i == 0) start[i] = diff[i] + else start[i] = start[i - 1] + diff[i] + } + decodedRangeStart = start + + // rangeLength.length = 328 + val rangeLength = "aaMBXHYH5BRpBPPPPPPRMP5BPPlCPPzBDOOPPcPXPzBvBjB3BOhDmBBpB7DoDYxB+EiBP1DoExBkBQhBekBPmBgBhBctBiBMWOOXhCsBpBkBUV3Ba4BkB0DlCgBXgBtD4FSdBfPhBPpKP0BvBXjEQ2CGsT8DhBtCqDpFvD1D3E0IrD2EkBJrBDOBsB+BPiBlB1EIjDPPPPPPPPPPPGPPMNLsBNPNPKCvBvBPPCkDPBmBPhDXXgD4B6FzEgDguG9vUtkB9JcuBSckEP/BPPPPPPBPf4FrBjEhBpC3B5BKaWPrBOwCk/KsCuLqDHPbPxPsFtEaaqDL" + decodedRangeLength = decodeVarLenBase64(rangeLength, fromBase64, 222) + + // rangeCategory.length = 959 + val rangeCategory = "GFjgggUHGGFFZZZmzpz5qB6s6020B60ptltB6smt2sB60mz22B1+vv+8BZZ5s2850BW5q1ymtB506smzBF3q1q1qB1q1q1+Bgii4wDTm74g3KiggxqM60q1q1Bq1o1q1BF1qlrqrBZ2q5wprBGFZWWZGHFsjiooLowgmOowjkwCkgoiIk7ligGogiioBkwkiYkzj2oNoi+sbkwj04DghhkQ8wgiYkgoioDsgnkwC4gikQ//v+85BkwvoIsgoyI4yguI0whiwEowri4CoghsJowgqYowgm4DkwgsY/nwnzPowhmYkg6wI8yggZswikwHgxgmIoxgqYkwgk4DkxgmIkgoioBsgssoBgzgyI8g9gL8g9kI0wgwJoxgkoC0wgioFkw/wI0w53iF4gioYowjmgBHGq1qkgwBF1q1q8qBHwghuIwghyKk0goQkwgoQk3goQHGFHkyg0pBgxj6IoinkxDswno7Ikwhz9Bo0gioB8z48Rwli0xN0mpjoX8w78pDwltoqKHFGGwwgsIHFH3q1q16BFHWFZ1q10q1B2qlwq1B1q10q1B2q1yq1B6q1gq1Biq1qhxBir1qp1Bqt1q1qB1g1q1+B//3q16B///q1qBH/qlqq9Bholqq9B1i00a1q10qD1op1HkwmigEigiy6Cptogq1Bixo1kDq7/j00B2qgoBWGFm1lz50B6s5q1+BGWhggzhwBFFhgk4//Bo2jigE8wguI8wguI8wgugUog1qoB4qjmIwwi2KgkYHHH4lBgiFWkgIWoghssMmz5smrBZ3q1y50B5sm7gzBtz1smzB5smz50BqzqtmzB5sgzqzBF2/9//5BowgoIwmnkzPkwgk4C8ys65BkgoqI0wgy6FghquZo2giY0ghiIsgh24B4ghsQ8QF/v1q1OFs0O8iCHHF1qggz/B8wg6Iznv+//B08QgohsjK0QGFk7hsQ4gB" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, 222) + } +} + +/** + * Returns `true` if this character is a letter. + */ +internal fun Char.isLetterImpl(): Boolean { + return getLetterType() != 0 +} + +/** + * Returns `true` if this character is a lower case letter, or it has contributory property Other_Lowercase. + */ +internal fun Char.isLowerCaseImpl(): Boolean { + return getLetterType() == 1 || code.isOtherLowercase() +} + +/** + * Returns `true` if this character is an upper case letter, or it has contributory property Other_Uppercase. + */ +internal fun Char.isUpperCaseImpl(): Boolean { + return getLetterType() == 2 || code.isOtherUppercase() +} + +/** + * Returns + * - `1` if the character is a lower case letter, + * - `2` if the character is an upper case letter, + * - `3` if the character is a letter but not a lower or upper case letter, + * - `0` otherwise. + */ +private fun Char.getLetterType(): Int { + val ch = this.code + val index = binarySearchRange(Letter.decodedRangeStart, ch) + + val rangeStart = Letter.decodedRangeStart[index] + val rangeEnd = rangeStart + Letter.decodedRangeLength[index] - 1 + val code = Letter.decodedRangeCategory[index] + + if (ch > rangeEnd) { + return 0 + } + + val lastTwoBits = code and 0x3 + + if (lastTwoBits == 0) { // gap pattern + var shift = 2 + var threshold = rangeStart + for (i in 0..1) { + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 3 + } + shift += 7 + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 0 + } + shift += 7 + } + return 3 + } + + if (code <= 0x7) { + return lastTwoBits + } + + val distance = (ch - rangeStart) + val shift = if (code <= 0x1F) distance % 2 else distance + return (code shr (2 * shift)) and 0x3 +} + diff --git a/libraries/stdlib/py/src/generated/_OtherLowercaseChars.kt b/libraries/stdlib/py/src/generated/_OtherLowercaseChars.kt new file mode 100644 index 0000000000000..ae77703d9dba1 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_OtherLowercaseChars.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +private object OtherLowercase { + val otherLowerStart = intArrayOf( + 0x00aa, 0x00ba, 0x02b0, 0x02c0, 0x02e0, 0x0345, 0x037a, 0x1d2c, 0x1d78, 0x1d9b, 0x2071, 0x207f, 0x2090, 0x2170, 0x24d0, 0x2c7c, 0xa69c, 0xa770, 0xa7f8, 0xab5c, + ) + val otherLowerLength = intArrayOf( + 1, 1, 9, 2, 5, 1, 1, 63, 1, 37, 1, 1, 13, 16, 26, 2, 2, 1, 2, 4, + ) +} + +internal fun Int.isOtherLowercase(): Boolean { + val index = binarySearchRange(OtherLowercase.otherLowerStart, this) + return index >= 0 && this < OtherLowercase.otherLowerStart[index] + OtherLowercase.otherLowerLength[index] +} diff --git a/libraries/stdlib/py/src/generated/_OtherUppercaseChars.kt b/libraries/stdlib/py/src/generated/_OtherUppercaseChars.kt new file mode 100644 index 0000000000000..d26518cb20781 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_OtherUppercaseChars.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +internal fun Int.isOtherUppercase(): Boolean { + return this in 0x2160..0x216f + || this in 0x24b6..0x24cf +} diff --git a/libraries/stdlib/py/src/generated/_StringsJs.kt b/libraries/stdlib/py/src/generated/_StringsJs.kt new file mode 100644 index 0000000000000..c408cc44373e0 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_StringsJs.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +/** + * Returns a character at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this char sequence. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +actual fun CharSequence.elementAt(index: Int): Char { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, length: $length}") } +} + diff --git a/libraries/stdlib/py/src/generated/_TitlecaseMappings.kt b/libraries/stdlib/py/src/generated/_TitlecaseMappings.kt new file mode 100644 index 0000000000000..281a620ec0e1b --- /dev/null +++ b/libraries/stdlib/py/src/generated/_TitlecaseMappings.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 4 ranges totally +internal fun Char.titlecaseCharImpl(): Char { + val code = this.code + // Letters repeating sequence and code of the Lt is a multiple of 3, e.g. <DŽ, Dž, dž> + if (code in 0x01c4..0x01cc || code in 0x01f1..0x01f3) { + return (3 * ((code + 1) / 3)).toChar() + } + // Lower case letters whose title case mapping equivalent is equal to the original letter + if (code in 0x10d0..0x10fa || code in 0x10fd..0x10ff) { + return this + } + return uppercaseChar() +} \ No newline at end of file diff --git a/libraries/stdlib/py/src/generated/_UArraysJs.kt b/libraries/stdlib/py/src/generated/_UArraysJs.kt new file mode 100644 index 0000000000000..482d26d647975 --- /dev/null +++ b/libraries/stdlib/py/src/generated/_UArraysJs.kt @@ -0,0 +1,164 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.collections + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun UIntArray.elementAt(index: Int): UInt { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun ULongArray.elementAt(index: Int): ULong { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun UByteArray.elementAt(index: Int): UByte { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array. + * + * @sample samples.collections.Collections.Elements.elementAt + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun UShortArray.elementAt(index: Int): UShort { + return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") } +} + +/** + * Returns a [List] that wraps the original array. + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun UIntArray.asList(): List { + return object : AbstractList(), RandomAccess { + override val size: Int get() = this@asList.size + override fun isEmpty(): Boolean = this@asList.isEmpty() + override fun contains(element: UInt): Boolean = this@asList.contains(element) + override fun get(index: Int): UInt { + AbstractList.checkElementIndex(index, size) + return this@asList[index] + } + override fun indexOf(element: UInt): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is UInt) return -1 + return this@asList.indexOf(element) + } + override fun lastIndexOf(element: UInt): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is UInt) return -1 + return this@asList.lastIndexOf(element) + } + } +} + +/** + * Returns a [List] that wraps the original array. + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun ULongArray.asList(): List { + return object : AbstractList(), RandomAccess { + override val size: Int get() = this@asList.size + override fun isEmpty(): Boolean = this@asList.isEmpty() + override fun contains(element: ULong): Boolean = this@asList.contains(element) + override fun get(index: Int): ULong { + AbstractList.checkElementIndex(index, size) + return this@asList[index] + } + override fun indexOf(element: ULong): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is ULong) return -1 + return this@asList.indexOf(element) + } + override fun lastIndexOf(element: ULong): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is ULong) return -1 + return this@asList.lastIndexOf(element) + } + } +} + +/** + * Returns a [List] that wraps the original array. + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun UByteArray.asList(): List { + return object : AbstractList(), RandomAccess { + override val size: Int get() = this@asList.size + override fun isEmpty(): Boolean = this@asList.isEmpty() + override fun contains(element: UByte): Boolean = this@asList.contains(element) + override fun get(index: Int): UByte { + AbstractList.checkElementIndex(index, size) + return this@asList[index] + } + override fun indexOf(element: UByte): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is UByte) return -1 + return this@asList.indexOf(element) + } + override fun lastIndexOf(element: UByte): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is UByte) return -1 + return this@asList.lastIndexOf(element) + } + } +} + +/** + * Returns a [List] that wraps the original array. + */ +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +actual fun UShortArray.asList(): List { + return object : AbstractList(), RandomAccess { + override val size: Int get() = this@asList.size + override fun isEmpty(): Boolean = this@asList.isEmpty() + override fun contains(element: UShort): Boolean = this@asList.contains(element) + override fun get(index: Int): UShort { + AbstractList.checkElementIndex(index, size) + return this@asList[index] + } + override fun indexOf(element: UShort): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is UShort) return -1 + return this@asList.indexOf(element) + } + override fun lastIndexOf(element: UShort): Int { + @Suppress("USELESS_CAST") + if ((element as Any?) !is UShort) return -1 + return this@asList.lastIndexOf(element) + } + } +} + diff --git a/libraries/stdlib/py/src/generated/_WhitespaceChars.kt b/libraries/stdlib/py/src/generated/_WhitespaceChars.kt new file mode 100644 index 0000000000000..5ab0a1420d09e --- /dev/null +++ b/libraries/stdlib/py/src/generated/_WhitespaceChars.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 9 ranges totally +/** + * Returns `true` if this character is a whitespace. + */ +internal fun Char.isWhitespaceImpl(): Boolean { + val ch = this.code + return ch in 0x0009..0x000d + || ch in 0x001c..0x0020 + || ch == 0x00a0 + || ch > 0x1000 && ( + ch == 0x1680 + || ch in 0x2000..0x200a + || ch == 0x2028 + || ch == 0x2029 + || ch == 0x202f + || ch == 0x205f + || ch == 0x3000 + ) +} diff --git a/libraries/stdlib/py/src/kotlin/coroutines_13/CoroutineImpl.kt b/libraries/stdlib/py/src/kotlin/coroutines_13/CoroutineImpl.kt new file mode 100644 index 0000000000000..08e69c71c0255 --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/coroutines_13/CoroutineImpl.kt @@ -0,0 +1,104 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.coroutines + +import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED + +@SinceKotlin("1.3") +@JsName("CoroutineImpl") +internal abstract class CoroutineImpl(private val resultContinuation: Continuation?) : Continuation { + protected var state = 0 + protected var exceptionState = 0 + protected var result: dynamic = null + protected var exception: dynamic = null + protected var finallyPath: Array? = null + + private val _context: CoroutineContext? = resultContinuation?.context + + override val context: CoroutineContext get() = _context!! + + private var intercepted_: Continuation? = null + + fun intercepted(): Continuation = + intercepted_ + ?: (context[ContinuationInterceptor]?.interceptContinuation(this) ?: this) + .also { intercepted_ = it } + + override fun resumeWith(result: Result) { + var current = this + var currentResult: Any? = result.getOrNull() + var currentException: Throwable? = result.exceptionOrNull() + + // This loop unrolls recursion in current.resumeWith(param) to make saner and shorter stack traces on resume + while (true) { + with(current) { + // Set result and exception fields in the current continuation + if (currentException == null) { + this.result = currentResult + } else { + state = exceptionState + exception = currentException + } + + try { + val outcome = doResume() + if (outcome === COROUTINE_SUSPENDED) return + currentResult = outcome + currentException = null + } catch (exception: dynamic) { // Catch all exceptions + currentResult = null + currentException = exception.unsafeCast() + } + + releaseIntercepted() // this state machine instance is terminating + + val completion = resultContinuation!! + + if (completion is CoroutineImpl) { + // unrolling recursion via loop + current = completion + } else { + // top-level completion reached -- invoke and return + if (currentException != null) { + completion.resumeWithException(currentException!!) + } else { + completion.resume(currentResult) + } + return + } + } + } + } + + private fun releaseIntercepted() { + val intercepted = intercepted_ + if (intercepted != null && intercepted !== this) { + context[ContinuationInterceptor]!!.releaseInterceptedContinuation(intercepted) + } + this.intercepted_ = CompletedContinuation // just in case + } + + protected abstract fun doResume(): Any? + + open fun create(completion: Continuation<*>): Continuation { + throw UnsupportedOperationException("create(Continuation) has not been overridden") + } + + open fun create(value: Any?, completion: Continuation<*>): Continuation { + throw UnsupportedOperationException("create(Any?;Continuation) has not been overridden") + } +} + +internal object CompletedContinuation : Continuation { + override val context: CoroutineContext + get() = error("This continuation is already complete") + + override fun resumeWith(result: Result) { + error("This continuation is already complete") + } + + override fun toString(): String = "This continuation is already complete" +} diff --git a/libraries/stdlib/py/src/kotlin/coroutines_13/IntrinsicsJs.kt b/libraries/stdlib/py/src/kotlin/coroutines_13/IntrinsicsJs.kt new file mode 100644 index 0000000000000..67deadf5f6bf1 --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/coroutines_13/IntrinsicsJs.kt @@ -0,0 +1,185 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "UNCHECKED_CAST") + +package kotlin.coroutines.intrinsics + +import kotlin.coroutines.Continuation +import kotlin.coroutines.ContinuationInterceptor +import kotlin.coroutines.CoroutineContext +import kotlin.coroutines.CoroutineImpl +import kotlin.internal.InlineOnly + +/** + * Invoke 'invoke' method of suspend super type + * Because callable references translated with local classes, + * necessary to call it in special way, not in synamic way + */ +@Suppress("UNUSED_PARAMETER", "unused") +@PublishedApi +internal fun (suspend () -> T).invokeSuspendSuperType( + completion: Continuation +): Any? { + throw NotImplementedError("It is intrinsic method") +} + +/** + * Invoke 'invoke' method of suspend super type with receiver + * Because callable references translated with local classes, + * necessary to call it in special way, not in synamic way + */ +@Suppress("UNUSED_PARAMETER", "unused") +@PublishedApi +internal fun (suspend R.() -> T).invokeSuspendSuperTypeWithReceiver( + receiver: R, + completion: Continuation +): Any? { + throw NotImplementedError("It is intrinsic method") +} + +/** + * Invoke 'invoke' method of suspend super type with receiver and param + * Because callable references translated with local classes, + * necessary to call it in special way, not in synamic way + */ +@Suppress("UNUSED_PARAMETER", "unused") +@PublishedApi +internal fun (suspend R.(P) -> T).invokeSuspendSuperTypeWithReceiverAndParam( + receiver: R, + param: P, + completion: Continuation +): Any? { + throw NotImplementedError("It is intrinsic method") +} + +/** + * Starts unintercepted coroutine without receiver and with result type [T] and executes it until its first suspension. + * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. + * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. + * + * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might + * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation + * context is established. + * + * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of a suspended + * coroutine using a reference to the suspending function. + */ +@SinceKotlin("1.3") +@InlineOnly +actual inline fun (suspend () -> T).startCoroutineUninterceptedOrReturn( + completion: Continuation +): Any? { + val a = this.asDynamic() + return if (jsTypeOf(a) == "function") a(completion) + else this.invokeSuspendSuperType(completion) +} + +/** + * Starts unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. + * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. + * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. + * + * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might + * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation + * context is established. + * + * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of a suspended + * coroutine using a reference to the suspending function. + */ +@SinceKotlin("1.3") +@InlineOnly +actual inline fun (suspend R.() -> T).startCoroutineUninterceptedOrReturn( + receiver: R, + completion: Continuation +): Any? { + val a = this.asDynamic() + return if (jsTypeOf(a) == "function") a(receiver, completion) + else this.invokeSuspendSuperTypeWithReceiver(receiver, completion) +} + +@InlineOnly +internal actual inline fun (suspend R.(P) -> T).startCoroutineUninterceptedOrReturn( + receiver: R, + param: P, + completion: Continuation +): Any? { + val a = this.asDynamic() + return if (jsTypeOf(a) == "function") a(receiver, param, completion) + else this.invokeSuspendSuperTypeWithReceiverAndParam(receiver, param, completion) +} + +/** + * Creates unintercepted coroutine without receiver and with result type [T]. + * This function creates a new, fresh instance of suspendable computation every time it is invoked. + * + * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance. + * The [completion] continuation is invoked when coroutine completes with result or exception. + * + * This function returns unintercepted continuation. + * Invocation of `resume(Unit)` starts coroutine directly in the invoker's thread without going through the + * [ContinuationInterceptor] that might be present in the completion's [CoroutineContext]. + * It is the invoker's responsibility to ensure that a proper invocation context is established. + * [Continuation.intercepted] can be used to acquire the intercepted continuation. + * + * Repeated invocation of any resume function on the resulting continuation corrupts the + * state machine of the coroutine and may result in arbitrary behaviour or exception. + */ +@SinceKotlin("1.3") +actual fun (suspend () -> T).createCoroutineUnintercepted( + completion: Continuation +): Continuation = + createCoroutineFromSuspendFunction(completion) { + val a = this.asDynamic() + if (jsTypeOf(a) == "function") a(completion) + else this.invokeSuspendSuperType(completion) + } + +/** + * Creates unintercepted coroutine with receiver type [R] and result type [T]. + * This function creates a new, fresh instance of suspendable computation every time it is invoked. + * + * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance. + * The [completion] continuation is invoked when coroutine completes with result or exception. + * + * This function returns unintercepted continuation. + * Invocation of `resume(Unit)` starts coroutine directly in the invoker's thread without going through the + * [ContinuationInterceptor] that might be present in the completion's [CoroutineContext]. + * It is the invoker's responsibility to ensure that a proper invocation context is established. + * [Continuation.intercepted] can be used to acquire the intercepted continuation. + * + * Repeated invocation of any resume function on the resulting continuation corrupts the + * state machine of the coroutine and may result in arbitrary behaviour or exception. + */ +@SinceKotlin("1.3") +actual fun (suspend R.() -> T).createCoroutineUnintercepted( + receiver: R, + completion: Continuation +): Continuation = + createCoroutineFromSuspendFunction(completion) { + val a = this.asDynamic() + if (jsTypeOf(a) == "function") a(receiver, completion) + else this.invokeSuspendSuperTypeWithReceiver(receiver, completion) + } + +/** + * Intercepts this continuation with [ContinuationInterceptor]. + */ +@SinceKotlin("1.3") +actual fun Continuation.intercepted(): Continuation = + (this as? CoroutineImpl)?.intercepted() ?: this + + +private inline fun createCoroutineFromSuspendFunction( + completion: Continuation, + crossinline block: () -> Any? +): Continuation { + return object : CoroutineImpl(completion as Continuation) { + override fun doResume(): Any? { + if (exception != null) throw exception + return block() + } + } +} diff --git a/libraries/stdlib/py/src/kotlin/exceptions.kt b/libraries/stdlib/py/src/kotlin/exceptions.kt new file mode 100644 index 0000000000000..af3e384d633be --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/exceptions.kt @@ -0,0 +1,110 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin + +actual open class Error : Throwable { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + +actual open class Exception : Throwable { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + +actual open class RuntimeException : Exception { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + +actual open class IllegalArgumentException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + +actual open class IllegalStateException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + +actual open class IndexOutOfBoundsException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) +} + +actual open class ConcurrentModificationException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + +actual open class UnsupportedOperationException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + + +actual open class NumberFormatException : IllegalArgumentException { + actual constructor() : super() + actual constructor(message: String?) : super(message) +} + + +actual open class NullPointerException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) +} + +actual open class ClassCastException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) +} + +actual open class AssertionError : Error { + actual constructor() : super() + constructor(message: String?) : super(message) + actual constructor(message: Any?) : super(message?.toString(), message as? Throwable) + @SinceKotlin("1.4") + constructor(message: String?, cause: Throwable?) : super(message, cause) +} + +actual open class NoSuchElementException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) +} + +@SinceKotlin("1.3") +actual open class ArithmeticException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) +} + +actual open class NoWhenBranchMatchedException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} + +actual open class UninitializedPropertyAccessException : RuntimeException { + actual constructor() : super() + actual constructor(message: String?) : super(message) + actual constructor(message: String?, cause: Throwable?) : super(message, cause) + actual constructor(cause: Throwable?) : super(cause) +} diff --git a/libraries/stdlib/py/src/kotlin/jsClass_js-ir.kt b/libraries/stdlib/py/src/kotlin/jsClass_js-ir.kt new file mode 100644 index 0000000000000..ae2312e1f1fc7 --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/jsClass_js-ir.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.js + +// DON'T USE! Use `K::class.js` instead. +// The declaration kept only for backward compatibility with older compilers +// TODO remove, but when? +internal external fun jsClass(): JsClass diff --git a/libraries/stdlib/py/src/kotlin/jsOperators.kt b/libraries/stdlib/py/src/kotlin/jsOperators.kt new file mode 100644 index 0000000000000..7e8119c07e1e3 --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/jsOperators.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("UNUSED_PARAMETER") + +package kotlin.js + +// Parameters are suffixed with `_hack` as a workaround for Namer. +// TODO: Implemet as compiler intrinsics + +/** + * Function corresponding to JavaScript's `typeof` operator + */ +fun jsTypeOf(value_hack: Any?): String = + js("typeof value_hack").unsafeCast() + +internal fun jsDeleteProperty(obj_hack: Any, property_hack: Any) { + js("delete obj_hack[property_hack]") +} + +internal fun jsBitwiseOr(lhs_hack: Any?, rhs_hack: Any?): Int = + js("lhs_hack | rhs_hack").unsafeCast() + +internal fun jsBitwiseAnd(lhs_hack: Any?, rhs_hack: Any?): Int = + js("lhs_hack & rhs_hack").unsafeCast() + +internal fun jsInstanceOf(obj_hack: Any?, jsClass_hack: Any?): Boolean = + js("obj_hack instanceof jsClass_hack").unsafeCast() + +// Returns true if the specified property is in the specified object or its prototype chain. +internal fun jsIn(lhs_hack: Any?, rhs_hack: Any): Boolean = + js("lhs_hack in rhs_hack").unsafeCast() + diff --git a/libraries/stdlib/py/src/kotlin/math_js-ir.kt b/libraries/stdlib/py/src/kotlin/math_js-ir.kt new file mode 100644 index 0000000000000..5ac027266a4c0 --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/math_js-ir.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ +package kotlin.math + +/** + * Returns this value with the sign bit same as of the [sign] value. + * + * If [sign] is `NaN` the sign of the result is undefined. + */ +@SinceKotlin("1.2") +actual fun Double.withSign(sign: Double): Double { + val thisSignBit = doubleSignBit(this) + val newSignBit = doubleSignBit(sign) + return if (thisSignBit == newSignBit) this else -this +} \ No newline at end of file diff --git a/libraries/stdlib/py/src/kotlin/numbers_js-ir.kt b/libraries/stdlib/py/src/kotlin/numbers_js-ir.kt new file mode 100644 index 0000000000000..f4785f1946f0c --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/numbers_js-ir.kt @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin + +/** + * Returns a bit representation of the specified floating-point value as [Long] + * according to the IEEE 754 floating-point "double format" bit layout. + */ +@SinceKotlin("1.2") +actual fun Double.toBits(): Long = + doubleToRawBits(if (this.isNaN()) Double.NaN else this) + +/** + * Returns a bit representation of the specified floating-point value as [Long] + * according to the IEEE 754 floating-point "double format" bit layout, + * preserving `NaN` values exact layout. + */ +@SinceKotlin("1.2") +actual fun Double.toRawBits(): Long = + doubleToRawBits(this) + +/** + * Returns the [Double] value corresponding to a given bit representation. + */ +@SinceKotlin("1.2") +@kotlin.internal.InlineOnly +actual inline fun Double.Companion.fromBits(bits: Long): Double = + doubleFromBits(bits) + +/** + * Returns a bit representation of the specified floating-point value as [Int] + * according to the IEEE 754 floating-point "single format" bit layout. + * + * Note that in Kotlin/JS [Float] range is wider than "single format" bit layout can represent, + * so some [Float] values may overflow, underflow or loose their accuracy after conversion to bits and back. + */ +@SinceKotlin("1.2") +actual fun Float.toBits(): Int = + floatToRawBits(if (this.isNaN()) Float.NaN else this) + +/** + * Returns a bit representation of the specified floating-point value as [Int] + * according to the IEEE 754 floating-point "single format" bit layout, + * preserving `NaN` values exact layout. + * + * Note that in Kotlin/JS [Float] range is wider than "single format" bit layout can represent, + * so some [Float] values may overflow, underflow or loose their accuracy after conversion to bits and back. + */ +@SinceKotlin("1.2") +actual fun Float.toRawBits(): Int = + floatToRawBits(this) + +/** + * Returns the [Float] value corresponding to a given bit representation. + */ +@SinceKotlin("1.2") +@kotlin.internal.InlineOnly +actual inline fun Float.Companion.fromBits(bits: Int): Float = + floatFromBits(bits) \ No newline at end of file diff --git a/libraries/stdlib/py/src/kotlin/reflection_js-ir.kt b/libraries/stdlib/py/src/kotlin/reflection_js-ir.kt new file mode 100644 index 0000000000000..72708b0da19d5 --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/reflection_js-ir.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +import kotlin.reflect.KClass +import kotlin.reflect.js.internal.KClassImpl + +@PublishedApi +internal fun KClass<*>.findAssociatedObject(annotationClass: KClass): Any? { + return if (this is KClassImpl<*> && annotationClass is KClassImpl) { + val key = annotationClass.jClass.asDynamic().`$metadata$`?.associatedObjectKey?.unsafeCast() ?: return null + val map = this.jClass.asDynamic().`$metadata$`?.associatedObjects ?: return null + val factory = map[key] ?: return null + return factory() + } else { + null + } +} \ No newline at end of file diff --git a/libraries/stdlib/py/src/kotlin/text/numberConversions_js-ir.kt b/libraries/stdlib/py/src/kotlin/text/numberConversions_js-ir.kt new file mode 100644 index 0000000000000..dd5d019c8424b --- /dev/null +++ b/libraries/stdlib/py/src/kotlin/text/numberConversions_js-ir.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +/** + * Returns a string representation of this [Long] value in the specified [radix]. + * + * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion. + */ +@SinceKotlin("1.2") +actual fun Long.toString(radix: Int): String = + this.toStringImpl(checkRadix(radix)) \ No newline at end of file diff --git a/python/box.tests/build.gradle.kts b/python/box.tests/build.gradle.kts index 2584ff77d3dfd..a866464f57785 100644 --- a/python/box.tests/build.gradle.kts +++ b/python/box.tests/build.gradle.kts @@ -67,8 +67,8 @@ fun Test.definePythonTestTask(interpreterBinary: String) { systemProperty("kotlin.py.interpreter.binary", interpreterBinary) - dependsOn(":kotlin-stdlib-js-ir:compileKotlinJs") // todo: remove js stuff - systemProperty("kotlin.js.full.stdlib.path", "libraries/stdlib/js-ir/build/classes/kotlin/js/main") // todo: remove js stuff + dependsOn(":kotlin-stdlib-py:compileKotlinJs") // todo: change to compileKotlinPy + systemProperty("kotlin.js.full.stdlib.path", "libraries/stdlib/py/build/classes/kotlin/js/main") dependsOn(":kotlin-stdlib-js-ir-minimal-for-test:compileKotlinJs") // todo: remove js stuff systemProperty("kotlin.js.reduced.stdlib.path", "libraries/stdlib/js-ir-minimal-for-test/build/classes/kotlin/js/main") // todo: remove js stuff dependsOn(":kotlin-test:kotlin-test-js-ir:compileKotlinJs") // todo: remove js stuff diff --git a/settings.gradle b/settings.gradle index 911daee571480..819e0c2ca0d95 100644 --- a/settings.gradle +++ b/settings.gradle @@ -268,10 +268,12 @@ include ":compiler:backend.py", ":python:ast", ":python:ast:generator", ":python:box.tests", - ":python:py.translator" + ":python:py.translator", + ":kotlin-stdlib-py" project(':compiler:cli-py').projectDir = "$rootDir/compiler/cli/cli-py" as File project(':compiler:backend.py').projectDir = "$rootDir/compiler/ir/backend.py" as File +project(':kotlin-stdlib-py').projectDir = "$rootDir/libraries/stdlib/py" as File include ":compiler:fir", From 5bf6ed3e0f81051fd8914e2fc76a8786be2333bc Mon Sep 17 00:00:00 2001 From: SerVB Date: Fri, 18 Mar 2022 17:49:21 +0100 Subject: [PATCH 2/4] [#73] Introduce stdlib-py-minimal-for-test (used in most tests) --- .../kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml | 4 +- ...y_minimal_for_test_js_1_6_255_SNAPSHOT.xml | 6 + .../py-minimal-for-test/build.gradle.kts | 140 ++++++++++++++++++ .../src/smallRuntimeCollections.kt | 12 ++ .../src/smallRuntimeMissingDeclarations.kt | 54 +++++++ .../stdlib/py-minimal-for-test/src/tests.kt | 27 ++++ python/box.tests/build.gradle.kts | 4 +- settings.gradle | 4 +- 8 files changed, 247 insertions(+), 4 deletions(-) create mode 100644 .idea/artifacts/kotlin_stdlib_py_minimal_for_test_js_1_6_255_SNAPSHOT.xml create mode 100644 libraries/stdlib/py-minimal-for-test/build.gradle.kts create mode 100644 libraries/stdlib/py-minimal-for-test/src/smallRuntimeCollections.kt create mode 100644 libraries/stdlib/py-minimal-for-test/src/smallRuntimeMissingDeclarations.kt create mode 100644 libraries/stdlib/py-minimal-for-test/src/tests.kt diff --git a/.idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml b/.idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml index 4369008741334..e5b30548d8f8a 100644 --- a/.idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml +++ b/.idea/artifacts/kotlin_stdlib_py_js_1_6_255_SNAPSHOT.xml @@ -1,6 +1,8 @@ $PROJECT_DIR$/libraries/stdlib/py/build/libs - + + + \ No newline at end of file diff --git a/.idea/artifacts/kotlin_stdlib_py_minimal_for_test_js_1_6_255_SNAPSHOT.xml b/.idea/artifacts/kotlin_stdlib_py_minimal_for_test_js_1_6_255_SNAPSHOT.xml new file mode 100644 index 0000000000000..e3fa53cb1955b --- /dev/null +++ b/.idea/artifacts/kotlin_stdlib_py_minimal_for_test_js_1_6_255_SNAPSHOT.xml @@ -0,0 +1,6 @@ + + + $PROJECT_DIR$/libraries/stdlib/py-minimal-for-test/build/libs + + + \ No newline at end of file diff --git a/libraries/stdlib/py-minimal-for-test/build.gradle.kts b/libraries/stdlib/py-minimal-for-test/build.gradle.kts new file mode 100644 index 0000000000000..7a8435a005231 --- /dev/null +++ b/libraries/stdlib/py-minimal-for-test/build.gradle.kts @@ -0,0 +1,140 @@ +import org.jetbrains.kotlin.gradle.dsl.KotlinCompile + +plugins { + kotlin("multiplatform") +} + +kotlin { + js(IR) { + nodejs() + } +} + +val commonMainSources by task { + dependsOn(":kotlin-stdlib-py:commonMainSources") + from { + val fullCommonMainSources = tasks.getByPath(":kotlin-stdlib-py:commonMainSources") + exclude( + listOf( + "libraries/stdlib/unsigned/src/kotlin/UByteArray.kt", + "libraries/stdlib/unsigned/src/kotlin/UIntArray.kt", + "libraries/stdlib/unsigned/src/kotlin/ULongArray.kt", + "libraries/stdlib/unsigned/src/kotlin/UMath.kt", + "libraries/stdlib/unsigned/src/kotlin/UNumbers.kt", + "libraries/stdlib/unsigned/src/kotlin/UShortArray.kt", + "libraries/stdlib/unsigned/src/kotlin/UStrings.kt", + "libraries/stdlib/common/src/generated/_Arrays.kt", + "libraries/stdlib/common/src/generated/_Collections.kt", + "libraries/stdlib/common/src/generated/_Comparisons.kt", + "libraries/stdlib/common/src/generated/_Maps.kt", + "libraries/stdlib/common/src/generated/_OneToManyTitlecaseMappings.kt", + "libraries/stdlib/common/src/generated/_Sequences.kt", + "libraries/stdlib/common/src/generated/_Sets.kt", + "libraries/stdlib/common/src/generated/_Strings.kt", + "libraries/stdlib/common/src/generated/_UArrays.kt", + "libraries/stdlib/common/src/generated/_URanges.kt", + "libraries/stdlib/common/src/generated/_UCollections.kt", + "libraries/stdlib/common/src/generated/_UComparisons.kt", + "libraries/stdlib/common/src/generated/_USequences.kt", + "libraries/stdlib/common/src/kotlin/SequencesH.kt", + "libraries/stdlib/common/src/kotlin/TextH.kt", + "libraries/stdlib/common/src/kotlin/UMath.kt", + "libraries/stdlib/common/src/kotlin/collections/**", + "libraries/stdlib/common/src/kotlin/ioH.kt", + "libraries/stdlib/src/kotlin/collections/**", + "libraries/stdlib/src/kotlin/properties/Delegates.kt", + "libraries/stdlib/src/kotlin/random/URandom.kt", + "libraries/stdlib/src/kotlin/text/**", + "libraries/stdlib/src/kotlin/time/**", + "libraries/stdlib/src/kotlin/util/KotlinVersion.kt", + "libraries/stdlib/src/kotlin/util/Tuples.kt" + ) + ) + fullCommonMainSources.outputs.files.singleFile + } + + into("$buildDir/commonMainSources") +} + +val jsMainSources by task { + dependsOn(":kotlin-stdlib-py:jsMainSources") + + from { + val fullJsMainSources = tasks.getByPath(":kotlin-stdlib-py:jsMainSources") + exclude( + listOf( + "libraries/stdlib/js/src/org.w3c/**", + "libraries/stdlib/js/src/kotlin/char.kt", + "libraries/stdlib/js/src/kotlin/collections.kt", + "libraries/stdlib/js/src/kotlin/collections/**", + "libraries/stdlib/js/src/kotlin/time/**", + "libraries/stdlib/js/src/kotlin/console.kt", + "libraries/stdlib/js/src/kotlin/coreDeprecated.kt", + "libraries/stdlib/js/src/kotlin/date.kt", + "libraries/stdlib/js/src/kotlin/grouping.kt", + "libraries/stdlib/js/src/kotlin/json.kt", + "libraries/stdlib/js/src/kotlin/promise.kt", + "libraries/stdlib/js/src/kotlin/regexp.kt", + "libraries/stdlib/js/src/kotlin/sequence.kt", + "libraries/stdlib/js/src/kotlin/throwableExtensions.kt", + "libraries/stdlib/js/src/kotlin/text/**", + "libraries/stdlib/js/src/kotlin/reflect/KTypeHelpers.kt", + "libraries/stdlib/js/src/kotlin/reflect/KTypeParameterImpl.kt", + "libraries/stdlib/js/src/kotlin/reflect/KTypeImpl.kt", + "libraries/stdlib/js/src/kotlin/dom/**", + "libraries/stdlib/js/src/kotlin/browser/**", + "libraries/stdlib/js/src/kotlinx/dom/**", + "libraries/stdlib/js/src/kotlinx/browser/**" + ) + ) + fullJsMainSources.outputs.files.singleFile + } + + for (jsIrSrcDir in listOf("builtins", "runtime", "src")) { + from("$rootDir/libraries/stdlib/py/$jsIrSrcDir") { + exclude( + listOf( + "collectionsHacks.kt", + "generated/**", + "kotlin/text/**" + ) + ) + into("libraries/stdlib/py/$jsIrSrcDir") + } + } + + from("$rootDir/libraries/stdlib/py-minimal-for-test/src") + into("$buildDir/jsMainSources") +} + +kotlin { + sourceSets { + val commonMain by getting { + kotlin.srcDir(files(commonMainSources.map { it.destinationDir })) + } + val jsMain by getting { + kotlin.srcDir(files(jsMainSources.map { it.destinationDir })) + } + } +} + +tasks.withType> { + kotlinOptions.freeCompilerArgs += listOf( + "-Xallow-kotlin-package", + "-Xopt-in=kotlin.ExperimentalMultiplatform", + "-Xopt-in=kotlin.contracts.ExperimentalContracts", + "-Xopt-in=kotlin.RequiresOptIn", + "-Xopt-in=kotlin.ExperimentalUnsignedTypes", + "-Xopt-in=kotlin.ExperimentalStdlibApi" + ) +} + +tasks { + compileKotlinMetadata { + enabled = false + } + + named("compileKotlinJs", KotlinCompile::class) { + kotlinOptions.freeCompilerArgs += "-Xir-module-name=kotlin" + } +} diff --git a/libraries/stdlib/py-minimal-for-test/src/smallRuntimeCollections.kt b/libraries/stdlib/py-minimal-for-test/src/smallRuntimeCollections.kt new file mode 100644 index 0000000000000..0c8a43cac63f9 --- /dev/null +++ b/libraries/stdlib/py-minimal-for-test/src/smallRuntimeCollections.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.collections + +@SinceKotlin("1.4") +@library("arrayEquals") +public infix fun Array?.contentEquals(other: Array?): Boolean { + definedExternally +} \ No newline at end of file diff --git a/libraries/stdlib/py-minimal-for-test/src/smallRuntimeMissingDeclarations.kt b/libraries/stdlib/py-minimal-for-test/src/smallRuntimeMissingDeclarations.kt new file mode 100644 index 0000000000000..dc796d2dc964c --- /dev/null +++ b/libraries/stdlib/py-minimal-for-test/src/smallRuntimeMissingDeclarations.kt @@ -0,0 +1,54 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin + +/** + * Returns `true` if this char sequence is empty (contains no characters). + */ +@kotlin.internal.InlineOnly +public inline fun CharSequence.isEmpty(): Boolean = length == 0 + +/** + * Accumulates value starting with [initial] value and applying [operation] from left to right to current accumulator value and each element. + */ +public inline fun Array.fold(initial: R, operation: (acc: R, T) -> R): R { + var accumulator = initial + for (element in this) accumulator = operation(accumulator, element) + return accumulator +} + + +public actual fun Throwable.stackTraceToString(): String = toString() + +public actual fun Throwable.printStackTrace() { + TODO("Not implemented in reduced runtime") +} + +public actual fun Throwable.addSuppressed(exception: Throwable) { + TODO("Not implemented in reduced runtime") +} + +public actual val Throwable.suppressedExceptions: List + get() = TODO("Not implemented in reduced runtime") + +/** + * Returns a string representation of this [Long] value in the specified [radix]. + * + * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion. + */ +@SinceKotlin("1.2") +public fun Long.toString(radix: Int): String = + this.toStringImpl(checkRadix(radix)) + +/** + * Checks whether the given [radix] is valid radix for string to number and number to string conversion. + */ +internal fun checkRadix(radix: Int): Int { + if (radix !in 2..36) { + throw IllegalArgumentException("radix $radix was not in valid range 2..36") + } + return radix +} \ No newline at end of file diff --git a/libraries/stdlib/py-minimal-for-test/src/tests.kt b/libraries/stdlib/py-minimal-for-test/src/tests.kt new file mode 100644 index 0000000000000..b4845b65ba941 --- /dev/null +++ b/libraries/stdlib/py-minimal-for-test/src/tests.kt @@ -0,0 +1,27 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.test + +// This file plugs some declaration from "kotlin.test" library used in tests. + +fun assertEquals(a: T, b: T) { + if (a != b) throw Exception("") +} + +fun assertTrue(x: Boolean) { + if (!x) throw Exception("") +} + +fun assertFalse(x: Boolean) { + if (x) throw Exception("") +} + +fun assertNotNull(actual: T?, message: String? = null): T { + if (actual == null) throw Exception("") + return actual +} + + diff --git a/python/box.tests/build.gradle.kts b/python/box.tests/build.gradle.kts index a866464f57785..164c4ab719f57 100644 --- a/python/box.tests/build.gradle.kts +++ b/python/box.tests/build.gradle.kts @@ -69,8 +69,8 @@ fun Test.definePythonTestTask(interpreterBinary: String) { dependsOn(":kotlin-stdlib-py:compileKotlinJs") // todo: change to compileKotlinPy systemProperty("kotlin.js.full.stdlib.path", "libraries/stdlib/py/build/classes/kotlin/js/main") - dependsOn(":kotlin-stdlib-js-ir-minimal-for-test:compileKotlinJs") // todo: remove js stuff - systemProperty("kotlin.js.reduced.stdlib.path", "libraries/stdlib/js-ir-minimal-for-test/build/classes/kotlin/js/main") // todo: remove js stuff + dependsOn(":kotlin-stdlib-py-minimal-for-test:compileKotlinJs") // todo: change to compileKotlinPy + systemProperty("kotlin.js.reduced.stdlib.path", "libraries/stdlib/py-minimal-for-test/build/classes/kotlin/js/main") dependsOn(":kotlin-test:kotlin-test-js-ir:compileKotlinJs") // todo: remove js stuff systemProperty("kotlin.js.kotlin.test.path", "libraries/kotlin.test/js-ir/build/classes/kotlin/js/main") // todo: remove js stuff diff --git a/settings.gradle b/settings.gradle index 819e0c2ca0d95..6d82808cd3a16 100644 --- a/settings.gradle +++ b/settings.gradle @@ -269,11 +269,13 @@ include ":compiler:backend.py", ":python:ast:generator", ":python:box.tests", ":python:py.translator", - ":kotlin-stdlib-py" + ":kotlin-stdlib-py", + ":kotlin-stdlib-py-minimal-for-test" project(':compiler:cli-py').projectDir = "$rootDir/compiler/cli/cli-py" as File project(':compiler:backend.py').projectDir = "$rootDir/compiler/ir/backend.py" as File project(':kotlin-stdlib-py').projectDir = "$rootDir/libraries/stdlib/py" as File +project(':kotlin-stdlib-py-minimal-for-test').projectDir = "$rootDir/libraries/stdlib/py-minimal-for-test" as File include ":compiler:fir", From 94f16335a689d0f70d40d10cf6700b5d35c8bf20 Mon Sep 17 00:00:00 2001 From: SerVB Date: Fri, 18 Mar 2022 17:57:06 +0100 Subject: [PATCH 3/4] Update reports (no sure why naming of generated code is changed but doesn't look critical) --- .../reports/pythonTest/box-tests-report.tsv | 200 +++++++++--------- .../reports/pythonTest/failure-count.tsv | 20 +- 2 files changed, 110 insertions(+), 110 deletions(-) diff --git a/python/box.tests/reports/pythonTest/box-tests-report.tsv b/python/box.tests/reports/pythonTest/box-tests-report.tsv index f3f639125d3cb..5dd0b72412d38 100644 --- a/python/box.tests/reports/pythonTest/box-tests-report.tsv +++ b/python/box.tests/reports/pythonTest/box-tests-report.tsv @@ -510,7 +510,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Ca org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testDontCreateInconsistentTypeDuringStarProjectionSubstitution Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeMultipleBounds Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeMultipleBoundsImplicitReceiver Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeSmartcast Failed PythonExecution AttributeError: '_no_name_provided__9' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeSmartcast Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeWithMultipleBoundsAsReceiver Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeWithoutGenericsAsReceiver Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIs Succeeded @@ -1154,7 +1154,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testAsyncIteratorToList_1_3 Failed PythonExecution AttributeError: 'Companion_23' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testAsyncIterator_1_3 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testAwait Failed PythonExecution SyntaxError: invalid syntax -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBeginWithException Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBeginWithException Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBeginWithExceptionNoHandleException Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBuilderInferenceAndGenericArrayAcessCall Failed PythonExecution NameError: name 'kotlin_Float' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCaptureInfixFun Failed PythonExecution NameError: name 'Object' is not defined @@ -1163,12 +1163,12 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCapturedVarInSuspendLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCastWithSuspend Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCatchWithInlineInsideSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCoercionToUnit Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCoercionToUnit Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testControllerAccessFromInnerLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCoroutineContextInInlinedLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCreateCoroutineSafe Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCreateCoroutinesOnManualInstances Failed PythonExecution NameError: name 'js' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCrossInlineWithCapturedOuterReceiver Failed PythonExecution AttributeError: '_no_name_provided__19' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCrossInlineWithCapturedOuterReceiver Failed PythonExecution AttributeError: '_no_name_provided__20' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testDefaultParametersInSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testDelegatedSuspendMember Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testDispatchResume Failed PythonExecution AttributeError: 'EmptyContinuation_0' object has no attribute 'constructor' @@ -1179,10 +1179,10 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testFalseUnitCoercion Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testGenerate Failed PythonExecution NameError: name 'kotlin_CharSequence' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleException Failed PythonExecution NameError: name 'kotlin_Array_kotlin_Any__' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultCallEmptyBody Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultNonUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultSuspended Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testIndirectInlineUsedAsNonInline Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultCallEmptyBody Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultNonUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultSuspended Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testIndirectInlineUsedAsNonInline Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInlineFunInGenericClass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInlineGenericFunCalledFromSubclass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInlineSuspendFunction Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1191,7 +1191,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInnerSuspensionCalls Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInstanceOfContinuation Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testIterateOverArray Failed PythonExecution NameError: name 'Array' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt12958 Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt12958 Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt15016 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt15017 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt15930 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1204,18 +1204,18 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt31784 Failed PythonExecution NameError: name 'js' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt35967 Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt42028 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt42554 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt42554 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44221 Failed PythonExecution AttributeError: 'int' object has no attribute 'data' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44710 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44781 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt45377 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt46813 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastExpressionIsLoop Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStatementInc Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStementAssignment Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44781 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt45377 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt46813 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastExpressionIsLoop Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStatementInc Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStementAssignment Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLocalCallableRef Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLocalDelegate Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLocalDelegate Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLongRangeInSuspendCall Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLongRangeInSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testMergeNullAndString Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1224,19 +1224,19 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testMultipleInvokeCallsInsideInlineLambda2 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testMultipleInvokeCallsInsideInlineLambda3 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNestedTryCatch Failed PythonExecution NameError: name 'kotlin_Array_kotlin_Any__' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNoSuspensionPoints Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNoSuspensionPoints Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambda Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambdaDeep Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambda Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambdaDeep Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNullableSuspendFunctionType Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testOverrideDefaultArgument Failed PythonExecution SyntaxError: invalid syntax -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testRecursiveSuspend Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testReturnByLabel Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testRecursiveSuspend Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testReturnByLabel Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimple Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleException Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleSuspendCallableReference Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testStatementLikeLastExpression Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testStatementLikeLastExpression Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testStopAfter Failed PythonExecution NameError: name 'kotlin_Any_' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSuspendCallsInArguments Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSuspendCoroutineFromStateMachine Failed PythonExecution SyntaxError: invalid syntax @@ -1275,22 +1275,22 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testComplexChainSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoWhileStatement Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoWhileWithInline Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoubleBreak Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoubleBreak Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testFinallyCatch Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testForContinue Failed PythonExecution AttributeError: 'Companion_23' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testForStatement Failed PythonExecution AttributeError: 'Companion_23' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testForWithStep Failed PythonExecution AttributeError: 'Companion_23' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testIfStatement Failed PythonExecution AttributeError: 'Companion_23' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testKt22694_1_3 Failed PythonExecution AttributeError: 'ArrayAsCollection' object has no attribute 'toArray' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testLabeledWhile Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testLabeledWhile Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testMultipleCatchBlocksSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnFromFinally Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnWithFinally Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnFromFinally Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnWithFinally Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testSuspendInStringTemplate Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testSwitchLikeWhen Failed PythonExecution AttributeError: 'Companion_23' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromCatch Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromFinally Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowInTryWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromCatch Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromFinally Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowInTryWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testWhenWithSuspensions Failed PythonExecution TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testWhileStatement Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$Debug.testAllFilesPresentInDebug Succeeded @@ -1304,7 +1304,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testInterfaceMethodWithBody Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[None]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testInterfaceMethodWithBodyGeneric Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[None]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testOverrideInInlineClass Failed PythonExecution NameError: name 'js' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testOverrideInInnerClass Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testOverrideInInnerClass Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testSafeCallOnTwoReceivers Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testSafeCallOnTwoReceiversLong Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testSuspendDestructuringInLambdas Failed PythonExecution NameError: name 'js' is not defined @@ -1320,7 +1320,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference.testLongArgs Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Bound.testAllFilesPresentInBound Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Bound.testEmptyLHS Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testAdapted Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testAdapted Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testAllFilesPresentInFunction Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testGenericCallableReferencesWithNullableTypes Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function$Local.testAllFilesPresentInLocal Succeeded @@ -1343,13 +1343,13 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$Tailrec.testWhenWithIs Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testAllFilesPresentInInlineClasses Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testGenericParameterResult Failed Unknown java.lang.IllegalStateException: UNRESOLVED_REFERENCE: Unresolved reference: listOf (8,9) in -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testKt47129 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testKt47129 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testNonLocalReturn Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testAllFilesPresentInDirect Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1373,7 +1373,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCreateOverride Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testDefaultStub Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1385,7 +1385,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testGenericOverrideSuspendFun_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1396,8 +1396,8 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testAllFilesPresentInResume Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1421,7 +1421,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCreateOverride Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testDefaultStub Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1433,7 +1433,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testGenericOverrideSuspendFun_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1442,47 +1442,47 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testReturnResult Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testSyntheticAccessor Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testAllFilesPresentInResumeWithException Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineInt Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Long Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_NAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_nonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_suspendFunType Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationCrossinline Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationNonInline Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClassSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny_null Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineInt Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Long Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_NAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_nonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_suspendFunType Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationCrossinline Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationNonInline Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClassSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny_null Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCreateOverride Failed PythonExecution AttributeError: '_no_name_provided__21' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any_NullableInlineClassUpperBound Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_this Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any_NullableInlineClassUpperBound Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_this Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testReturnResult Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testAllFilesPresentInIntLikeVarSpilling Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testComplicatedMerge Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1496,12 +1496,12 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testUsedInMethodCall Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testUsedInVarStore Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testAllFilesPresentInIntrinsicSemantics Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContext Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiver Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiverNotIntrinsic Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContext Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiver Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiverNotIntrinsic Failed PythonExecution AttributeError: '_no_name_provided__14' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testIntercepted Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testResultExceptionOrNullInLambda Failed PythonExecution NameError: name 'js' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutine Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutine Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutineUninterceptedOrReturn Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutineUninterceptedOrReturnInterception Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testSuspendCoroutineUninterceptedOrReturn Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' is not defined @@ -1520,7 +1520,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testNestedLocals Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testSimple Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testSimpleSuspensionPoint Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testStateMachine Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testStateMachine Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testWithArguments Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$MultiModule.testAllFilesPresentInMultiModule Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$MultiModule.testInlineCrossModule Succeeded @@ -1582,13 +1582,13 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$TailOperations.testSuspendWithWhen Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$TailOperations.testTailInlining Failed PythonExecution SyntaxError: invalid syntax org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testAllFilesPresentInUnitTypeReturn Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineNonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineReturn Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineNonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineReturn Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testInlineUnitFunction Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testInterfaceDelegation Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testSuspendNonLocalReturn Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testSuspendReturn Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testUnitSafeCall Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testUnitSafeCall Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testAllFilesPresentInVarSpilling Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testFakeInlinerVariables Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testKt19475 Failed PythonExecution NameError: name 'kotlin_Array_kotlin_Any__' is not defined @@ -1596,7 +1596,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testLvtWithInlineOnly Failed Unknown java.lang.IllegalStateException: UNRESOLVED_REFERENCE: Unresolved reference: println (29,5) in org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testNullSpilling Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testRefinedIntTypesAnalysis Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testSafeCallElvis Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testSafeCallElvis Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DataClasses.testAllFilesPresentInDataClasses Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DataClasses.testArrayParams Failed PythonExecution NameError: name 'Array' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DataClasses.testChangingVarParam Succeeded @@ -1655,7 +1655,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$De org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DeadCodeElimination.testKt14357 Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testAllFilesPresentInDefaultArguments Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testCallDefaultFromInitializer Failed PythonExecution NameError: name 'visitExpression_other__inToPyStatementTransformer_org_jetbrains_kotlin_ir_expressions_impl_IrSetFieldImpl' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testComplexInheritance Failed PythonExecution AttributeError: '_no_name_provided__9' object has no attribute 'foo_default_nmiqce_k_' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testComplexInheritance Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'foo_default_nmiqce_k_' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testImplementedByFake Failed PythonExecution NameError: name 'kotlin_String' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testImplementedByFake2 Failed PythonExecution NameError: name 'kotlin_String' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testImplementedByFake3 Failed PythonExecution NameError: name 'kotlin_String' is not defined @@ -2572,7 +2572,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$In org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUIntSafeAsInt Failed PythonExecution NameError: name 'kotlin_UInt' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxNullableValueOfInlineClassWithNonNullUnderlyingType Failed PythonExecution NameError: name 'js' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType Failed PythonExecution NameError: name 'js' is not defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxParameterOfSuspendLambdaBeforeInvoke Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxParameterOfSuspendLambdaBeforeInvoke Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxReceiverOnCallingMethodFromInlineClass Failed PythonExecution NameError: name 'js' is not defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxResultParameterWhenCapturingToCrossinlineLambda Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxValueFromPlatformType Failed PythonExecution NameError: name 'js' is not defined @@ -3261,7 +3261,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Ob org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testSubstitutionFunctionFromSuper Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[Fail]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testThisInConstructor Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testThisRefToObjectInNestedClassConstructorCall Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[None]> -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseAnonymousObjectAsIterator Failed PythonExecution TypeError: '_no_name_provided__9' object is not callable +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseAnonymousObjectAsIterator Failed PythonExecution TypeError: '_no_name_provided__10' object is not callable org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseAnonymousObjectFunction Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[Fail1]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseImportedMember Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[8]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseImportedMemberFromCompanion Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[8]> @@ -5785,7 +5785,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testAssertion Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testClassCycle Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testClassFromDefaultPackage Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testCrossroutines Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testCrossroutines Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testDefaultFunction Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testDefaultFunctionWithInlineCall Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testForInline Succeeded @@ -5874,7 +5874,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testInlineSuspendOfNoinlineSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testInlineSuspendOfOrdinary Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testInlineSuspendOfSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testKt26658 Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testKt26658 Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testMaxStackWithCrossinline Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testMultipleLocals Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testMultipleSuspensionPoints Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -5889,7 +5889,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testIsAsReified Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testIsAsReified2 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testNonTailCall Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testSimple Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testSimple Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testUnitReturn Failed PythonExecution SyntaxError: invalid syntax org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$DefaultParameter.testAllFilesPresentInDefaultParameter Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$DefaultParameter.testDefaultInlineLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -5904,8 +5904,8 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineClass.testReturnUnboxedFromLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineClass.testReturnUnboxedResume Failed PythonExecution AttributeError: 'CheckStateMachineContinuation' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testAllFilesPresentInInlineUsedAsNoinline Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testInlineOnly Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testSimpleNamed Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testInlineOnly Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testSimpleNamed Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$Receiver.testAllFilesPresentInReceiver Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$Receiver.testInlineOrdinaryOfCrossinlineSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$Receiver.testInlineOrdinaryOfNoinlineSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' diff --git a/python/box.tests/reports/pythonTest/failure-count.tsv b/python/box.tests/reports/pythonTest/failure-count.tsv index f547d16fa1250..3603b8c631ccb 100644 --- a/python/box.tests/reports/pythonTest/failure-count.tsv +++ b/python/box.tests/reports/pythonTest/failure-count.tsv @@ -16,15 +16,14 @@ 45 NameError: name 'kotlin_Any' is not defined 43 NameError: name 'kotlin_UInt' is not defined 42 TypeError: 'NoneType' object is not callable -39 AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +39 AttributeError: '_no_name_provided__12' object has no attribute 'constructor' 36 AttributeError: 'int' object has no attribute 'compareTo_wiekkq_k_' 36 NameError: name 'kotlin_Double' is not defined 36 SyntaxError: invalid syntax 31 AttributeError: 'NoneType' object has no attribute 'append_uch40_k_' -28 AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' 28 org.junit.ComparisonFailure: expected:<[OK]> but was:<[fail]> 26 AttributeError: 'ArrayAsCollection' object has no attribute 'toArray' -24 AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +24 AttributeError: '_no_name_provided__11' object has no attribute 'constructor' 23 AttributeError: 'CheckStateMachineContinuation' object has no attribute 'constructor' 23 kotlin.NotImplementedError: An operation is not implemented: IrSpreadElementImpl is not supported yet here 21 AttributeError: 'Companion_23' object has no attribute 'constructor' @@ -35,16 +34,18 @@ 19 RecursionError: maximum recursion depth exceeded 19 There was a problem when extracting the contents of STDERR. Details: java.io.IOException: Stream closed 19 UnboundLocalError: local variable 'test1' referenced before assignment +18 AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' 18 TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType' 17 AttributeError: 'int' object has no attribute 'toString' 16 TypeError: object of type 'NoneType' has no len() 15 TypeError: can only concatenate str (not "int") to str 15 org.junit.ComparisonFailure: expected:<[OK]> but was:<[Fail 0]> -14 AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +14 AttributeError: '_no_name_provided__13' object has no attribute 'constructor' 12 NameError: name 'visitExpression_other__inToPyStatementTransformer_org_jetbrains_kotlin_ir_expressions_impl_IrCallImpl' is not defined 12 TypeError: __init__() takes 1 positional argument but 2 were given 12 UnboundLocalError: local variable 'test0' referenced before assignment 10 AttributeError: 'NoneType' object has no attribute '__setitem__' +10 AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' 10 ImportError: cannot import name 'box' from 'compiled_module' ) 10 NameError: name 'kotlin_Float' is not defined 9 AttributeError: 'NoneType' object has no attribute 'invoke_0_k_' @@ -117,6 +118,7 @@ 2 AttributeError: 'NoneType' object has no attribute '_get_first__sv9k7v_k_' 2 AttributeError: 'NoneType' object has no attribute 'get_ha5a7z_k_' 2 AttributeError: 'NotEmptyMap' object has no attribute 'constructor' +2 AttributeError: '_no_name_provided__20' object has no attribute 'constructor' 2 AttributeError: '_no_name_provided__2_8_0' object has no attribute 'constructor' 2 AttributeError: 'tuple' object has no attribute '__setitem__' 2 NameError: name 'Value_' is not defined @@ -215,12 +217,10 @@ 1 AttributeError: 'Y' object has no attribute 'constructor' 1 AttributeError: 'Z' object has no attribute 'constructor' 1 AttributeError: 'Z2' object has no attribute 'p' -1 AttributeError: '_no_name_provided__13' object has no attribute 'constructor' -1 AttributeError: '_no_name_provided__19' object has no attribute 'constructor' -1 AttributeError: '_no_name_provided__20' object has no attribute 'constructor' +1 AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +1 AttributeError: '_no_name_provided__10' object has no attribute 'foo_default_nmiqce_k_' +1 AttributeError: '_no_name_provided__14' object has no attribute 'constructor' 1 AttributeError: '_no_name_provided__21' object has no attribute 'constructor' -1 AttributeError: '_no_name_provided__9' object has no attribute 'constructor' -1 AttributeError: '_no_name_provided__9' object has no attribute 'foo_default_nmiqce_k_' 1 AttributeError: 'bool' object has no attribute 'toString' 1 AttributeError: 'int' object has no attribute 'hashCode' 1 AttributeError: 'int' object has no attribute 's' @@ -269,7 +269,7 @@ 1 SyntaxError: name 'result' is assigned to before global declaration 1 SyntaxError: name 'result' is used prior to global declaration 1 TypeError: '<=' not supported between instances of 'int' and 'NoneType' -1 TypeError: '_no_name_provided__9' object is not callable +1 TypeError: '_no_name_provided__10' object is not callable 1 TypeError: () takes 1 positional argument but 2 were given 1 TypeError: _Props___init__impl_() takes 1 positional argument but 3 were given 1 TypeError: _UIntArray___init__impl_() takes 1 positional argument but 3 were given From 814653a3ab01ca367ae76e36f794a44a3b8cf7bf Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot <> Date: Sat, 19 Mar 2022 00:31:51 +0000 Subject: [PATCH 4/4] Generate reports for 94f16335a689d0f70d40d10cf6700b5d35c8bf20 --- .../microPythonTest/box-tests-report.tsv | 200 +++++++++--------- .../reports/microPythonTest/failure-count.tsv | 18 +- 2 files changed, 109 insertions(+), 109 deletions(-) diff --git a/python/box.tests/reports/microPythonTest/box-tests-report.tsv b/python/box.tests/reports/microPythonTest/box-tests-report.tsv index 39a47934968a5..63ccc041ad472 100644 --- a/python/box.tests/reports/microPythonTest/box-tests-report.tsv +++ b/python/box.tests/reports/microPythonTest/box-tests-report.tsv @@ -510,7 +510,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Ca org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testDontCreateInconsistentTypeDuringStarProjectionSubstitution Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeMultipleBounds Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeMultipleBoundsImplicitReceiver Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeSmartcast Failed PythonExecution AttributeError: '_no_name_provided__9' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeSmartcast Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeWithMultipleBoundsAsReceiver Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIntersectionTypeWithoutGenericsAsReceiver Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Casts.testIs Succeeded @@ -1154,7 +1154,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testAsyncIteratorToList_1_3 Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testAsyncIterator_1_3 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testAwait Failed PythonExecution SyntaxError: invalid syntax -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBeginWithException Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBeginWithException Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBeginWithExceptionNoHandleException Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testBuilderInferenceAndGenericArrayAcessCall Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCaptureInfixFun Failed PythonExecution NameError: name 'Object' isn't defined @@ -1163,12 +1163,12 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCapturedVarInSuspendLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCastWithSuspend Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCatchWithInlineInsideSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCoercionToUnit Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCoercionToUnit Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testControllerAccessFromInnerLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCoroutineContextInInlinedLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCreateCoroutineSafe Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCreateCoroutinesOnManualInstances Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCrossInlineWithCapturedOuterReceiver Failed PythonExecution AttributeError: '_no_name_provided__19' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testCrossInlineWithCapturedOuterReceiver Failed PythonExecution AttributeError: '_no_name_provided__20' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testDefaultParametersInSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testDelegatedSuspendMember Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testDispatchResume Failed PythonExecution AttributeError: 'EmptyContinuation_0' object has no attribute 'constructor' @@ -1179,10 +1179,10 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testFalseUnitCoercion Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testGenerate Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleException Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultCallEmptyBody Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultNonUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultSuspended Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testIndirectInlineUsedAsNonInline Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultCallEmptyBody Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultNonUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testHandleResultSuspended Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testIndirectInlineUsedAsNonInline Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInlineFunInGenericClass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInlineGenericFunCalledFromSubclass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInlineSuspendFunction Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1191,7 +1191,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInnerSuspensionCalls Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testInstanceOfContinuation Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testIterateOverArray Failed PythonExecution NameError: name 'Array' isn't defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt12958 Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt12958 Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt15016 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt15017 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt15930 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1204,18 +1204,18 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt31784 Failed PythonExecution NameError: name 'js' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt35967 Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt42028 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt42554 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt42554 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44221 Failed PythonExecution AttributeError: 'int' object has no attribute 'data' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44710 Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44781 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt45377 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt46813 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastExpressionIsLoop Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStatementInc Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStementAssignment Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt44781 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt45377 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testKt46813 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastExpressionIsLoop Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStatementInc Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastStementAssignment Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLastUnitExpression Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLocalCallableRef Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLocalDelegate Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLocalDelegate Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLongRangeInSuspendCall Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testLongRangeInSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testMergeNullAndString Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1224,19 +1224,19 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testMultipleInvokeCallsInsideInlineLambda2 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testMultipleInvokeCallsInsideInlineLambda3 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNestedTryCatch Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNoSuspensionPoints Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNoSuspensionPoints Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturn Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambda Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambdaDeep Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambda Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNonLocalReturnFromInlineLambdaDeep Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testNullableSuspendFunctionType Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testOverrideDefaultArgument Failed PythonExecution SyntaxError: invalid syntax -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testRecursiveSuspend Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testReturnByLabel Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testRecursiveSuspend Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testReturnByLabel Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimple Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleException Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleSuspendCallableReference Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testStatementLikeLastExpression Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSimpleWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testStatementLikeLastExpression Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testStopAfter Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSuspendCallsInArguments Failed PythonExecution RuntimeError: name too long org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines.testSuspendCoroutineFromStateMachine Failed PythonExecution SyntaxError: invalid syntax @@ -1275,22 +1275,22 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testComplexChainSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoWhileStatement Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoWhileWithInline Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoubleBreak Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testDoubleBreak Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testFinallyCatch Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testForContinue Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testForStatement Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testForWithStep Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testIfStatement Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testKt22694_1_3 Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testLabeledWhile Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testLabeledWhile Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testMultipleCatchBlocksSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnFromFinally Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnWithFinally Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnFromFinally Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testReturnWithFinally Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testSuspendInStringTemplate Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testSwitchLikeWhen Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromCatch Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromFinally Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowInTryWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromCatch Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowFromFinally Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testThrowInTryWithHandleResult Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testWhenWithSuspensions Failed PythonExecution TypeError: can't convert 'NoneType' object to str implicitly org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$ControlFlow.testWhileStatement Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$Debug.testAllFilesPresentInDebug Succeeded @@ -1304,7 +1304,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testInterfaceMethodWithBody Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[None]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testInterfaceMethodWithBodyGeneric Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[None]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testOverrideInInlineClass Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testOverrideInInnerClass Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testOverrideInInnerClass Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testSafeCallOnTwoReceivers Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testSafeCallOnTwoReceiversLong Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection.testSuspendDestructuringInLambdas Failed PythonExecution NameError: name 'js' isn't defined @@ -1320,7 +1320,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference.testLongArgs Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Bound.testAllFilesPresentInBound Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Bound.testEmptyLHS Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testAdapted Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testAdapted Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testAllFilesPresentInFunction Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function.testGenericCallableReferencesWithNullableTypes Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$CallableReference$Function$Local.testAllFilesPresentInLocal Succeeded @@ -1343,13 +1343,13 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$FeatureIntersection$Tailrec.testWhenWithIs Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testAllFilesPresentInInlineClasses Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testGenericParameterResult Failed Unknown java.lang.IllegalStateException: UNRESOLVED_REFERENCE: Unresolved reference: listOf (8,9) in -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testKt47129 Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testKt47129 Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses.testNonLocalReturn Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testAllFilesPresentInDirect Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1373,7 +1373,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testCreateOverride Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testDefaultStub Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1385,7 +1385,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testGenericOverrideSuspendFun_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Direct.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1396,8 +1396,8 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testAllFilesPresentInResume Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1421,7 +1421,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testCreateOverride Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testDefaultStub Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1433,7 +1433,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testGenericOverrideSuspendFun_NullableInt_null Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testOverrideSuspendFun Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1442,47 +1442,47 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testReturnResult Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$Resume.testSyntheticAccessor Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testAllFilesPresentInResumeWithException Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineInt Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Long Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_NAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_nonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_suspendFunType Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationCrossinline Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationNonInline Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClassSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny_null Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendFunctionReference Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxReturnValueOfSuspendLambda Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperType Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxTypeParameterOfSuperTypeResult Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_InlineInt Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_Long Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_NAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_nonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBoxUnboxInsideCoroutine_suspendFunType Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationCrossinline Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testBridgeGenerationNonInline Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClassSameJvmType Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableAny_null Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFunWithNullableInlineClass_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCovariantOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCreateMangling Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testCreateOverride Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any_NullableInlineClassUpperBound Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_this Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Any_NullableInlineClassUpperBound Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableAny Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testGenericOverrideSuspendFun_NullableInt Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInterfaceDelegateWithInlineClass Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testInvokeOperator Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_itf Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Any_this Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testOverrideSuspendFun_Int Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$InlineClasses$ResumeWithException.testReturnResult Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testAllFilesPresentInIntLikeVarSpilling Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testComplicatedMerge Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -1496,12 +1496,12 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testUsedInMethodCall Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntLikeVarSpilling.testUsedInVarStore Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testAllFilesPresentInIntrinsicSemantics Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContext Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiver Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiverNotIntrinsic Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContext Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiver Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testCoroutineContextReceiverNotIntrinsic Failed PythonExecution AttributeError: '_no_name_provided__14' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testIntercepted Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testResultExceptionOrNullInLambda Failed PythonExecution NameError: name 'js' isn't defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutine Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutine Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutineUninterceptedOrReturn Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testStartCoroutineUninterceptedOrReturnInterception Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$IntrinsicSemantics.testSuspendCoroutineUninterceptedOrReturn Failed PythonExecution NameError: name 'visitTry_org_jetbrains_kotlin_ir_expressions_impl_IrTryImpl' isn't defined @@ -1520,7 +1520,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testNestedLocals Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testSimple Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testSimpleSuspensionPoint Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testStateMachine Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testStateMachine Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$LocalFunctions$Named.testWithArguments Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$MultiModule.testAllFilesPresentInMultiModule Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$MultiModule.testInlineCrossModule Succeeded @@ -1582,13 +1582,13 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$TailOperations.testSuspendWithWhen Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$TailOperations.testTailInlining Failed PythonExecution SyntaxError: invalid syntax org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testAllFilesPresentInUnitTypeReturn Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineNonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineReturn Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineNonLocalReturn Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testCoroutineReturn Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testInlineUnitFunction Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testInterfaceDelegation Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testSuspendNonLocalReturn Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testSuspendReturn Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testUnitSafeCall Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$UnitTypeReturn.testUnitSafeCall Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testAllFilesPresentInVarSpilling Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testFakeInlinerVariables Failed PythonExecution RuntimeError: name too long org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testKt19475 Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes @@ -1596,7 +1596,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Co org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testLvtWithInlineOnly Failed Unknown java.lang.IllegalStateException: UNRESOLVED_REFERENCE: Unresolved reference: println (29,5) in org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testNullSpilling Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testRefinedIntTypesAnalysis Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testSafeCallElvis Failed PythonExecution AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Coroutines$VarSpilling.testSafeCallElvis Failed PythonExecution AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DataClasses.testAllFilesPresentInDataClasses Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DataClasses.testArrayParams Failed PythonExecution NameError: name 'Array' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DataClasses.testChangingVarParam Succeeded @@ -1655,7 +1655,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$De org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DeadCodeElimination.testKt14357 Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testAllFilesPresentInDefaultArguments Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testCallDefaultFromInitializer Failed PythonExecution NameError: name 'visitExpression_other__inToPyStatementTransformer_org_jetbrains_kotlin_ir_expressions_impl_IrSetFieldImpl' isn't defined -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testComplexInheritance Failed PythonExecution AttributeError: '_no_name_provided__9' object has no attribute 'foo_default_nmiqce_k_' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testComplexInheritance Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'foo_default_nmiqce_k_' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testImplementedByFake Failed PythonExecution NameError: name 'kotlin_String' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testImplementedByFake2 Failed PythonExecution NameError: name 'kotlin_String' isn't defined org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$DefaultArguments.testImplementedByFake3 Failed PythonExecution NameError: name 'kotlin_String' isn't defined @@ -2572,7 +2572,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$In org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUIntSafeAsInt Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxNullableValueOfInlineClassWithNonNullUnderlyingType Failed PythonExecution AttributeError: type object 'AssertionError' has no attribute '__new__' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType Failed PythonExecution AttributeError: type object 'AssertionError' has no attribute '__new__' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxParameterOfSuspendLambdaBeforeInvoke Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxParameterOfSuspendLambdaBeforeInvoke Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxReceiverOnCallingMethodFromInlineClass Failed PythonExecution AttributeError: type object 'IllegalStateException' has no attribute '__new__' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxResultParameterWhenCapturingToCrossinlineLambda Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$InlineClasses.testUnboxValueFromPlatformType Failed PythonExecution MemoryError: memory allocation failed, allocating XXX bytes @@ -3261,7 +3261,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Ob org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testSubstitutionFunctionFromSuper Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[Fail]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testThisInConstructor Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testThisRefToObjectInNestedClassConstructorCall Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[None]> -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseAnonymousObjectAsIterator Failed PythonExecution TypeError: '_no_name_provided__9' object isn't callable +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseAnonymousObjectAsIterator Failed PythonExecution TypeError: '_no_name_provided__10' object isn't callable org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseAnonymousObjectFunction Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[Fail1]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseImportedMember Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[8]> org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenBoxTestGenerated$Objects.testUseImportedMemberFromCompanion Failed AssertionFailed org.junit.ComparisonFailure: expected:<[OK]> but was:<[8]> @@ -5785,7 +5785,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testAssertion Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testClassCycle Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testClassFromDefaultPackage Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testCrossroutines Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testCrossroutines Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testDefaultFunction Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testDefaultFunctionWithInlineCall Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Smap.testForInline Succeeded @@ -5874,7 +5874,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testInlineSuspendOfNoinlineSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testInlineSuspendOfOrdinary Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testInlineSuspendOfSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testKt26658 Failed PythonExecution AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testKt26658 Failed PythonExecution AttributeError: '_no_name_provided__11' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testMaxStackWithCrossinline Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testMultipleLocals Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend.testMultipleSuspensionPoints Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -5889,7 +5889,7 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testIsAsReified Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testIsAsReified2 Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testNonTailCall Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testSimple Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testSimple Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$CallableReference.testUnitReturn Failed PythonExecution SyntaxError: invalid syntax org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$DefaultParameter.testAllFilesPresentInDefaultParameter Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$DefaultParameter.testDefaultInlineLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' @@ -5904,8 +5904,8 @@ org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineClass.testReturnUnboxedFromLambda Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineClass.testReturnUnboxedResume Failed PythonExecution AttributeError: 'CheckStateMachineContinuation' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testAllFilesPresentInInlineUsedAsNoinline Succeeded -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testInlineOnly Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' -org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testSimpleNamed Failed PythonExecution AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testInlineOnly Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' +org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$InlineUsedAsNoinline.testSimpleNamed Failed PythonExecution AttributeError: '_no_name_provided__13' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$Receiver.testAllFilesPresentInReceiver Succeeded org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$Receiver.testInlineOrdinaryOfCrossinlineSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' org.jetbrains.kotlin.python.test.ir.semantics.IrPythonCodegenInlineTestGenerated$Suspend$Receiver.testInlineOrdinaryOfNoinlineSuspend Failed PythonExecution AttributeError: 'Companion_19' object has no attribute 'constructor' diff --git a/python/box.tests/reports/microPythonTest/failure-count.tsv b/python/box.tests/reports/microPythonTest/failure-count.tsv index 14dbd71d83c9c..dbcf9be4188e2 100644 --- a/python/box.tests/reports/microPythonTest/failure-count.tsv +++ b/python/box.tests/reports/microPythonTest/failure-count.tsv @@ -14,7 +14,7 @@ 41 NameError: local variable referenced before assignment 41 TypeError: 'NoneType' object isn't callable 40 SyntaxError: invalid syntax -39 AttributeError: '_no_name_provided__11' object has no attribute 'constructor' +39 AttributeError: '_no_name_provided__12' object has no attribute 'constructor' 36 AttributeError: 'int' object has no attribute 'compareTo_wiekkq_k_' 34 NameError: name 'kotlin_Double' isn't defined 32 AttributeError: type object 'A' has no attribute '__new__' @@ -22,19 +22,19 @@ 30 NameError: name 'kotlin_Int' isn't defined 27 AttributeError: type object 'AssertionError' has no attribute '__new__' 27 org.junit.ComparisonFailure: expected:<[OK]> but was:<[fail]> -24 AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +24 AttributeError: '_no_name_provided__11' object has no attribute 'constructor' 23 AttributeError: 'CheckStateMachineContinuation' object has no attribute 'constructor' 23 kotlin.NotImplementedError: An operation is not implemented: IrSpreadElementImpl is not supported yet here 22 TypeError: unsupported types for __add__: 'NoneType', 'int' 21 RuntimeError: maximum recursion depth exceeded 20 NameError: name '_init_' isn't defined 20 NameError: name 'foo' isn't defined -18 AttributeError: '_no_name_provided__1_2' object has no attribute 'constructor' +18 AttributeError: '_no_name_provided__1_1' object has no attribute 'constructor' 18 TypeError: unsupported types for __add__: 'NoneType', 'NoneType' 16 There was a problem when extracting the contents of STDERR. Details: java.io.IOException: Stream closed 16 TypeError: can't convert 'int' object to str implicitly 15 org.junit.ComparisonFailure: expected:<[OK]> but was:<[Fail 0]> -14 AttributeError: '_no_name_provided__12' object has no attribute 'constructor' +14 AttributeError: '_no_name_provided__13' object has no attribute 'constructor' 14 NameError: name 'kotlin_Result_T_' isn't defined 13 AttributeError: type object 'Exception' has no attribute '__new__' 13 SyntaxError: non-keyword arg after */** @@ -198,10 +198,10 @@ 1 AttributeError: 'Y' object has no attribute 'constructor' 1 AttributeError: 'Z' object has no attribute 'constructor' 1 AttributeError: 'Z2' object has no attribute 'p' -1 AttributeError: '_no_name_provided__13' object has no attribute 'constructor' -1 AttributeError: '_no_name_provided__19' object has no attribute 'constructor' -1 AttributeError: '_no_name_provided__9' object has no attribute 'constructor' -1 AttributeError: '_no_name_provided__9' object has no attribute 'foo_default_nmiqce_k_' +1 AttributeError: '_no_name_provided__10' object has no attribute 'constructor' +1 AttributeError: '_no_name_provided__10' object has no attribute 'foo_default_nmiqce_k_' +1 AttributeError: '_no_name_provided__14' object has no attribute 'constructor' +1 AttributeError: '_no_name_provided__20' object has no attribute 'constructor' 1 AttributeError: 'bool' object has no attribute 'toString' 1 AttributeError: 'int' object has no attribute 'hashCode' 1 AttributeError: 'int' object has no attribute 's' @@ -266,7 +266,7 @@ 1 SyntaxError: argument name reused 1 SyntaxError: identifier redefined as global 1 TypeError: 'NoneType' object isn't subscriptable -1 TypeError: '_no_name_provided__9' object isn't callable +1 TypeError: '_no_name_provided__10' object isn't callable 1 TypeError: () takes 1 positional arguments but 2 were given 1 TypeError: _Props___init__impl_() takes 1 positional arguments but 3 were given 1 TypeError: _UIntArray___init__impl_() takes 1 positional arguments but 3 were given