Tests: fix stdlib declarations in IR interpreter test data
Fix some unresolved supertypes. This is necessary to be able to enable IR fake override builder by default (KT-61514), because it traverses all supertypes and asserts that they're classes, so that it can build fake overrides for declarations from there. Without this change, for example `IrFakeOverrideBuilder.buildFakeOverridesForClass` would crash.
This commit is contained in:
committed by
Space Team
parent
10dbe73828
commit
cf425ffded
@@ -58,7 +58,7 @@ const val stringList = <!WAS_NOT_EVALUATED: `
|
|||||||
Exception java.lang.ClassCastException: kotlin.Int cannot be cast to kotlin.String
|
Exception java.lang.ClassCastException: kotlin.Int cannot be cast to kotlin.String
|
||||||
at ClassCastExceptionKt.stringList.<anonymous>(classCastException.kt:54)
|
at ClassCastExceptionKt.stringList.<anonymous>(classCastException.kt:54)
|
||||||
at ClassCastExceptionKt.stringList.Function$0.invoke(classCastException.kt:0)
|
at ClassCastExceptionKt.stringList.Function$0.invoke(classCastException.kt:0)
|
||||||
at StandardKt.kotlin.let(Standard.kt:32)
|
at StandardKt.kotlin.let(Standard.kt:36)
|
||||||
at ClassCastExceptionKt.<clinit>(classCastException.kt:53)`!>getIntList<List<String>>().let {
|
at ClassCastExceptionKt.<clinit>(classCastException.kt:53)`!>getIntList<List<String>>().let {
|
||||||
it[0].length
|
it[0].length
|
||||||
}<!>
|
}<!>
|
||||||
@@ -66,7 +66,7 @@ const val nullableStringList = <!WAS_NOT_EVALUATED: `
|
|||||||
Exception java.lang.NullPointerException
|
Exception java.lang.NullPointerException
|
||||||
at ClassCastExceptionKt.nullableStringList.<anonymous>(classCastException.kt)
|
at ClassCastExceptionKt.nullableStringList.<anonymous>(classCastException.kt)
|
||||||
at ClassCastExceptionKt.nullableStringList.Function$0.invoke(classCastException.kt:0)
|
at ClassCastExceptionKt.nullableStringList.Function$0.invoke(classCastException.kt:0)
|
||||||
at StandardKt.kotlin.let(Standard.kt:32)
|
at StandardKt.kotlin.let(Standard.kt:36)
|
||||||
at ClassCastExceptionKt.<clinit>(classCastException.kt:56)`!>getStringNullableList<List<String>>().let { it[0].length }<!>
|
at ClassCastExceptionKt.<clinit>(classCastException.kt:56)`!>getStringNullableList<List<String>>().let { it[0].length }<!>
|
||||||
const val nullableStringLength = <!WAS_NOT_EVALUATED: `
|
const val nullableStringLength = <!WAS_NOT_EVALUATED: `
|
||||||
Exception java.lang.IllegalArgumentException: Parameter specified as non-null is null: method ClassCastExceptionKt.getLength, parameter str
|
Exception java.lang.IllegalArgumentException: Parameter specified as non-null is null: method ClassCastExceptionKt.getLength, parameter str
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ internal object EmptyIterator : ListIterator<Nothing> {
|
|||||||
override fun previous(): Nothing = throw NoSuchElementException()
|
override fun previous(): Nothing = throw NoSuchElementException()
|
||||||
}
|
}
|
||||||
|
|
||||||
internal object EmptyList : List<Nothing>, Serializable, RandomAccess {
|
internal object EmptyList : List<Nothing>, java.io.Serializable, RandomAccess {
|
||||||
private const val serialVersionUID: Long = -7390468764508069838L
|
private const val serialVersionUID: Long = -7390468764508069838L
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean = other is List<*> && other.isEmpty()
|
override fun equals(other: Any?): Boolean = other is List<*> && other.isEmpty()
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ package kotlin.collections
|
|||||||
|
|
||||||
import kotlin.sequences.*
|
import kotlin.sequences.*
|
||||||
|
|
||||||
private object EmptyMap : Map<Any?, Nothing>, Serializable {
|
private object EmptyMap : Map<Any?, Nothing>, java.io.Serializable {
|
||||||
private const val serialVersionUID: Long = 8246714829545688274
|
private const val serialVersionUID: Long = 8246714829545688274
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean = other is Map<*, *> && other.isEmpty()
|
override fun equals(other: Any?): Boolean = other is Map<*, *> && other.isEmpty()
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package kotlin.text
|
||||||
|
|
||||||
|
public class Regex {
|
||||||
|
public constructor(pattern: String) = TODO()
|
||||||
|
|
||||||
|
public constructor(pattern: String, option: RegexOption) = TODO()
|
||||||
|
|
||||||
|
public constructor(pattern: String, options: Set<RegexOption>) = TODO()
|
||||||
|
|
||||||
|
public val pattern: String
|
||||||
|
get() = TODO()
|
||||||
|
|
||||||
|
public val options: Set<RegexOption>
|
||||||
|
get() = TODO()
|
||||||
|
|
||||||
|
public fun matchEntire(input: CharSequence): MatchResult? = TODO()
|
||||||
|
|
||||||
|
public infix fun matches(input: CharSequence): Boolean = TODO()
|
||||||
|
|
||||||
|
@SinceKotlin("1.7")
|
||||||
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
|
public fun matchAt(input: CharSequence, index: Int): MatchResult? = TODO()
|
||||||
|
|
||||||
|
@SinceKotlin("1.7")
|
||||||
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
|
public fun matchesAt(input: CharSequence, index: Int): Boolean = TODO()
|
||||||
|
|
||||||
|
public fun containsMatchIn(input: CharSequence): Boolean = TODO()
|
||||||
|
|
||||||
|
public fun replace(input: CharSequence, replacement: String): String = TODO()
|
||||||
|
|
||||||
|
public fun replace(input: CharSequence, transform: (MatchResult) -> CharSequence): String = TODO()
|
||||||
|
|
||||||
|
public fun replaceFirst(input: CharSequence, replacement: String): String = TODO()
|
||||||
|
|
||||||
|
public fun find(input: CharSequence, startIndex: Int = 0): MatchResult? = TODO()
|
||||||
|
|
||||||
|
public fun findAll(input: CharSequence, startIndex: Int = 0): Sequence<MatchResult> = TODO()
|
||||||
|
|
||||||
|
public fun split(input: CharSequence, limit: Int = 0): List<String> = TODO()
|
||||||
|
|
||||||
|
@SinceKotlin("1.6")
|
||||||
|
@WasExperimental(ExperimentalStdlibApi::class)
|
||||||
|
public fun splitToSequence(input: CharSequence, limit: Int = 0): Sequence<String> = TODO()
|
||||||
|
|
||||||
|
public companion object {
|
||||||
|
public fun fromLiteral(literal: String): Regex = TODO()
|
||||||
|
|
||||||
|
public fun escape(literal: String): String = TODO()
|
||||||
|
|
||||||
|
public fun escapeReplacement(literal: String): String = TODO()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MatchGroup {
|
||||||
|
public val value: String
|
||||||
|
get() = TODO()
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum class RegexOption {
|
||||||
|
IGNORE_CASE,
|
||||||
|
|
||||||
|
MULTILINE
|
||||||
|
}
|
||||||
@@ -19,6 +19,11 @@ private object EmptySequence : Sequence<Nothing>, DropTakeSequence<Nothing> {
|
|||||||
override fun take(n: Int) = EmptySequence
|
override fun take(n: Int) = EmptySequence
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal interface DropTakeSequence<T> : Sequence<T> {
|
||||||
|
fun drop(n: Int): Sequence<T>
|
||||||
|
fun take(n: Int): Sequence<T>
|
||||||
|
}
|
||||||
|
|
||||||
public inline fun <T> Sequence<T>?.orEmpty(): Sequence<T> = this ?: emptySequence()
|
public inline fun <T> Sequence<T>?.orEmpty(): Sequence<T> = this ?: emptySequence()
|
||||||
|
|
||||||
private class GeneratorSequence<T : Any>(private val getInitialValue: () -> T?, private val getNextValue: (T) -> T?) : Sequence<T> {
|
private class GeneratorSequence<T : Any>(private val getInitialValue: () -> T?, private val getNextValue: (T) -> T?) : Sequence<T> {
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
package kotlin.collections
|
package kotlin.collections
|
||||||
|
|
||||||
internal object EmptySet : Set<Nothing>, Serializable {
|
internal object EmptySet : Set<Nothing>, java.io.Serializable {
|
||||||
private const val serialVersionUID: Long = 3406603774387020532
|
private const val serialVersionUID: Long = 3406603774387020532
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean = other is Set<*> && other.isEmpty()
|
override fun equals(other: Any?): Boolean = other is Set<*> && other.isEmpty()
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package kotlin
|
|||||||
|
|
||||||
import kotlin.*
|
import kotlin.*
|
||||||
|
|
||||||
|
public class NotImplementedError(message: String = "An operation is not implemented.") : Error(message)
|
||||||
|
|
||||||
|
public inline fun TODO(): Nothing = throw NotImplementedError()
|
||||||
|
|
||||||
public inline fun <R> run(block: () -> R): R {
|
public inline fun <R> run(block: () -> R): R {
|
||||||
return block()
|
return block()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package kotlin.text
|
||||||
|
|
||||||
|
@SinceKotlin("1.2")
|
||||||
|
public actual inline fun Long.toString(radix: Int): String = TODO()
|
||||||
@@ -5,7 +5,7 @@ public inline val Char.code: Int get() = this.toInt()
|
|||||||
expect fun Double.isNaN(): Boolean
|
expect fun Double.isNaN(): Boolean
|
||||||
expect fun Float.isNaN(): Boolean
|
expect fun Float.isNaN(): Boolean
|
||||||
|
|
||||||
public data class Pair<out A, out B>(public val first: A, public val second: B) : Serializable {
|
public data class Pair<out A, out B>(public val first: A, public val second: B) : java.io.Serializable {
|
||||||
public override fun toString(): String = "($first, $second)"
|
public override fun toString(): String = "($first, $second)"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ public fun <T> Pair<T, T>.toList(): List<T> = listOf(first, second)
|
|||||||
|
|
||||||
public data class Triple<out A, out B, out C>(
|
public data class Triple<out A, out B, out C>(
|
||||||
public val first: A, public val second: B, public val third: C
|
public val first: A, public val second: B, public val third: C
|
||||||
) : Serializable {
|
) : java.io.Serializable {
|
||||||
public override fun toString(): String = "($first, $second, $third)"
|
public override fun toString(): String = "($first, $second, $third)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-1
@@ -28,7 +28,6 @@ class IrInterpreterHelpersSourceFilesProvider(testServices: TestServices) : Addi
|
|||||||
"./libraries/stdlib/jvm/runtime/kotlin/TypeAliases.kt",
|
"./libraries/stdlib/jvm/runtime/kotlin/TypeAliases.kt",
|
||||||
"./libraries/stdlib/jvm/runtime/kotlin/text/TypeAliases.kt",
|
"./libraries/stdlib/jvm/runtime/kotlin/text/TypeAliases.kt",
|
||||||
"./libraries/stdlib/jvm/src/kotlin/collections/TypeAliases.kt",
|
"./libraries/stdlib/jvm/src/kotlin/collections/TypeAliases.kt",
|
||||||
"./libraries/stdlib/common/src/kotlin/TextH.kt",
|
|
||||||
"./libraries/stdlib/src/kotlin/text/regex/MatchResult.kt",
|
"./libraries/stdlib/src/kotlin/text/regex/MatchResult.kt",
|
||||||
"./libraries/stdlib/src/kotlin/collections/Sequence.kt",
|
"./libraries/stdlib/src/kotlin/collections/Sequence.kt",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user