Prompt:
kclassConstructor = symbols.jsRelatedSymbols.kExternalClassImpl.owner.constructors.first()
                    constructorArgument = getExternalKClassCtorArgument(type, builder)
                } else {
                    kclassConstructor = symbols.reflectionSymbols.kClassImpl.owner.constructors.first()
                    constructorArgument = getKClassCtorArgument(type, builder)
                }

Response:
return IrConstructorCallImpl(
                    startOffset = UNDEFINED_OFFSET,
                    endOffset = UNDEFINED_OFFSET,
                    type = kclassConstructor.returnType,
                    symbol = kclassConstructor.symbol,
                    typeArgumentsCount = 1,
                    valueArgumentsCount = 1,
                    constructorTypeArgumentsCount = 0
                ).also {<|endoftext|>


Prompt:
mainIrFragment = irModuleFragment
        } else {
            dependentIrFragments.add(irModuleFragment)
        }
    }

    val irActualizer = if (dependentIrFragments.isEmpty()) null else IrActualizer(
        KtDiagnosticReporterWithImplicitIrBasedContext(
            fir2IrConfiguration.diagnosticReporter,

Response:
fir2IrConfiguration.languageVersionSettings
        ),
        actualizerTypeContextProvider(mainIrFragment.irBuiltins),
        fir2IrConfiguration.expectActualTracker,
        fir2IrConfiguration.useFirBasedFakeOverrideGenerator,
        mainIrFragment,
        dependentIrFragments,
    )

    if (!fir2IrConfiguration.useFirBasedFakeOverrideGenerator) {<|endoftext|>


Prompt:
val sourceSetsBySourceSetTree = mutableMapOf<KotlinSourceSetTree?, MutableSet<KotlinSourceSet>>()
    for (sourceSet in sourceSets) {
        val trees = sourceSet.internal.compilations.map { KotlinSourceSetTree.orNull(it) }

Response:
trees.forEach { tree -> sourceSetsBySourceSetTree.getOrPut(tree) { mutableSetOf() }.add(sourceSet) }
    }

    for ((sourceSetTree, sourceSetsOfTree) in sourceSetsBySourceSetTree) {
        val configurationName = when(sourceSetTree) {
            null -> continue // for unknown trees there should be no relation between source sets, so just skip<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int) -> kotlin.Number")!>select(A4(), id { x: Number -> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number")!>x<!> })<!>

Response: <!DEBUG_INFO_EXPRESSION_TYPE("(kotlin.Int, kotlin.Int) -> {Comparable<*> & Number<|endoftext|>


Prompt:
var f3 = false
var f4 = false

class B {
    operator fun plusAssign(c: C) {
        f1 = true
        print("1")
    }

    operator fun plus(c: C): C {
        f2 = true
        print("2")
        return c
    }
}

operator fun B.plusAssign(c: C) {
    f3 = true

Response:
print("3")
}

operator fun B.plusAssign(c: Any) {
    f4 = true
    print("4")
}

class C<|endoftext|>


Prompt:
import org.jetbrains.kotlin.kapt3.base.stubs.KotlinPosition
import org.jetbrains.kotlin.kapt3.base.stubs.LineInfoMap
import java.io.ByteArrayOutputStream
import java.io.File
import java.io.ObjectOutputStream

abstract class KaptLineMappingCollectorBase {

Response:
protected val lineInfo: LineInfoMap = mutableMapOf()
    protected val signatureInfo = mutableMapOf<String, String>()
    private val filePaths = mutableMapOf<PsiFile, Pair<String, Boolean>>()

    protected fun register(fqName: String, psiElement: PsiElement) {
        val containingVirtualFile = psiElement.containingFile.virtualFile<|endoftext|>


Prompt:
MAP.put(
            ErrorsParcelize.PARCELABLE_CONSTRUCTOR_PARAMETER_SHOULD_BE_VAL_OR_VAR,
            "'Parcelable' constructor parameter should be 'val' or 'var'"
        )

        MAP.put(
            ErrorsParcelize.PROPERTY_WONT_BE_SERIALIZED,

Response:
"Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning"
        )

        MAP.put(
            ErrorsParcelize.OVERRIDING_WRITE_TO_PARCEL_IS_NOT_ALLOWED,
            "Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead"
        )<|endoftext|>


Prompt:
interface TypeParameterAsReifiedArrayError : KtFirDiagnostic<PsiElement> {
        override val diagnosticClass get() = TypeParameterAsReifiedArrayError::class
        val typeParameter: KtTypeParameterSymbol
    }

    interface TypeParameterAsReifiedArrayWarning : KtFirDiagnostic<PsiElement> {

Response:
override val diagnosticClass get() = TypeParameterAsReifiedArrayWarning::class
        val typeParameter: KtTypeParameterSymbol
    }

    interface ReifiedTypeForbiddenSubstitution : KtFirDiagnostic<PsiElement> {
        override val diagnosticClass get() = ReifiedTypeForbiddenSubstitution::class
        val type: KtType
    }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.native.interop.gen

import kotlinx.cinterop.usingJvmCInteropCallbacks
import org.jetbrains.kotlin.konan.util.DefFile
import org.jetbrains.kotlin.utils.usingNativeMemoryAllocator

Response:
import org.jetbrains.kotlin.native.interop.gen.jvm.KotlinPlatform
import org.jetbrains.kotlin.native.interop.gen.jvm.buildNativeLibrary
import org.jetbrains.kotlin.native.interop.gen.jvm.prepareTool
import org.jetbrains.kotlin.native.interop.indexer.NativeLibraryHeaders<|endoftext|>


Prompt:
abstract class FirNamedReference : FirReference() {
    abstract override val source: KtSourceElement?
    abstract val name: Name

    override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R =
        visitor.visitNamedReference(this, data)

    @Suppress("UNCHECKED_CAST")

Response:
override fun <E : FirElement, D> transform(transformer: FirTransformer<D>, data: D): E =
        transformer.transformNamedReference(this, data) as E
}<|endoftext|>


Prompt:
appendProperty(value::right, ::renderKtContractBooleanExpression)
                appendSimpleProperty(value::operation, endWithNewLine)
            }
            is KtContractIsInstancePredicateExpression -> {
                appendProperty(value::argument, ::renderKtContractParameterValue)
                appendProperty(value::type, renderer = { type, _ ->

Response:
appendLine(with(session) { symbolRenderer.renderType(analysisSession, type) })
                })
                appendSimpleProperty(value::isNegated, endWithNewLine)
            }
            is KtContractIsNullPredicateExpression -> {
                appendProperty(value::argument, ::renderKtContractParameterValue)
                appendSimpleProperty(value::isNegated, endWithNewLine)
            }<|endoftext|>


Prompt:
import java.io.ByteArrayOutputStream
import java.io.PrintStream
import java.nio.file.Files
import java.nio.file.Path
import java.util.stream.Stream
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue

data class ConsentConfiguration(
    val globalConsent: Boolean?,

Response:
val localConsent: Boolean?,
    val expected: Boolean?,
)

class ConsentManagerTest {
    @TempDir
    lateinit var workingDir: Path

    private val localPropertiesFile by lazy {
        workingDir.resolve("local.properties")
    }

    private val modifier by lazy {
        LocalPropertiesModifier(localPropertiesFile.toFile())
    }<|endoftext|>


Prompt:
@SinceKotlin("1.4")
public actual fun BooleanArray?.contentHashCode(): Int {
    if (this === null) return 0
    var result = 1
    for (element in this)
        result = 31 * result + element.hashCode()
    return result
}

/**
 * Returns a hash code based on the contents of this array as if it is [List].
 */

Response:
@SinceKotlin("1.4")
public actual fun CharArray?.contentHashCode(): Int {
    if (this === null) return 0
    var result = 1
    for (element in this)
        result = 31 * result + element.hashCode()
    return result
}

/**
 * Returns a string representation of the contents of the specified array as if it is [List].
 *<|endoftext|>


Prompt:
//    (DataClassMembersGenerator typically tries to access fields)
    // 3. Custom equals function should be used on properties
    fun generateEqualsUsingGetters(equalsFun: IrSimpleFunction, typeForEquals: IrType, properties: List<IrProperty>) = equalsFun.apply {

Response:
body = backendContext.createIrBuilder(symbol, SYNTHETIC_OFFSET, SYNTHETIC_OFFSET).irBlockBody {
            val irType = typeForEquals
            fun irOther() = irGet(valueParameters[0])
            fun irThis() = irGet(dispatchReceiverParameter!!)<|endoftext|>


Prompt:
if (y != null) this.y
        if (y != null || <!SENSELESS_COMPARISON!>this.y != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>y<!>.equals(null)

Response: if (y != null || <!SENSELESS_COMPARISON!>this.y != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>y<!>.propT<|endoftext|>


Prompt:
import org.jetbrains.kotlin.types.typeUtil.builtIns

open class ReplaceWithSupertypeAnonymousTypeTransformer : DeclarationSignatureAnonymousTypeTransformer {
    override fun transformAnonymousType(descriptor: DeclarationDescriptorWithVisibility, type: KotlinType): KotlinType? =
        if (!DescriptorUtils.isLocal(descriptor))

Response:
replaceAnonymousTypeWithSuperType(type)
        else type
}

fun replaceAnonymousTypeWithSuperType(type: KotlinType): KotlinType {
    val declaration = type.constructor.declarationDescriptor as? ClassDescriptor ?: return type

    if (KotlinBuiltIns.isArray(type)) {
        val elementTypeProjection = type.arguments.singleOrNull()<|endoftext|>


Prompt:
instance.doOnSuccess {}
    instance.doOnSuccess(::functionReference)
}

fun functionReference(x: Any) {}

class GenericHolder<T> {
    fun doOnSuccess(onSuccess: Consumer<in T>) {
        onSuccess.accept(object : BaseClass() {} as T)
    }
}

// FILE: Consumer.java

public interface Consumer<T> {

Response:
void accept(T t);
}<|endoftext|>


Prompt:
fun <U> use4(x: Sam4<U>) {}

// FILE: Sam1.java
public interface Sam1 {
    String get(String x, Object y);
}

// FILE: Sam2.java
public interface Sam2 {
    void run();
}

// FILE: Sam3.java
public interface Sam3 {
    int[] get(int[] s);
}

Response:
// FILE: Sam4.java
public interface Sam4<T> {
    T get();
}<|endoftext|>


Prompt:
// test.kt:12 foo
// test.kt:13 foo
// test.kt:7 alternate
// test.kt:8 alternate
// test.kt:13 foo
// test.kt:12 foo
// test.kt:13 foo
// test.kt:7 alternate
// test.kt:8 alternate
// test.kt:13 foo
// test.kt:14 foo
// test.kt:17 foo

Response:
// test.kt:21 box

// EXPECTATIONS JS_IR
// test.kt:20 box
// test.kt:7 alternate
// test.kt:8 alternate
// test.kt:7 alternate
// test.kt:8 alternate
// test.kt:17 foo
// test.kt:21 box

// EXPECTATIONS WASM
// test.kt:20 $box<|endoftext|>


Prompt:
return root
    }
}

internal fun ClassLoader.rawClassPathFromKeyResourcePath(keyResourcePath: String): Sequence<File> {
    val resourceRootCalc = ClassLoaderResourceRootFIlePathCalculator(keyResourcePath)
    return getResources(keyResourcePath).asSequence().mapNotNull { url ->
        if (url.protocol == "jar") {

Response:
(url.openConnection() as? JarURLConnection)?.jarFileURL?.toFileOrNull()
        } else {
            url.toFileOrNull()?.let { resourceRootCalc(it) }
        }
    }
}

fun ClassLoader.classPathFromTypicalResourceUrls(): Sequence<File> =
// roots without manifest cases are detected in some test scenarios<|endoftext|>


Prompt:
* on `:kotlin-native:dependencies` (that project must provide native dependencies by using [NativeDependenciesDownloaderPlugin])
 *
 * [llvmPath], [libffiPath] and [hostPlatform] are accessors that can be used during configuration
 * phase and do not anyhow force the actual dependencies to be downloaded. So, anytime these
 * accessors are used, make sure that execution of related tasks (or configurations resolving)

Response:
* depend on [llvmDependency], [libffiDependency] and [hostPlatformDependency] respectively.
 *
 * Apply [plugin][NativeDependenciesPlugin] to create this extension.
 * The extension name is `nativeDependencies`.
 *
 * @see NativeDependenciesPlugin
 */
abstract class NativeDependenciesExtension @Inject constructor(private val project: Project) {<|endoftext|>


Prompt:
val inv = try { ::bar3 } finally { ::foo3 }
        inv()
    }
}

fun poll43(): Flow<String> {
    return flow {
        val inv = try { ::bar4 } finally { ::foo4 }
        inv()
    }
}

fun poll44(): Flow<String> {
    return flow {

Response:
val inv = try { ::bar5 } finally { ::foo5 }
        inv()
    }
}

fun poll45(): Flow<String> {
    return flow {
        val inv = try { ::Foo6 } finally { ::Foo6 }
        inv()
    }
}

fun poll46(): Flow<String> {
    return flow {<|endoftext|>


Prompt:
to.typedArrays = from.typedArrays
    to.useEsClasses = from.useEsClasses
    to.useEsGenerators = from.useEsGenerators
    to.wasm = from.wasm
    to.wasmDebug = from.wasmDebug
    to.wasmEnableArrayRangeChecks = from.wasmEnableArrayRangeChecks

Response:
to.wasmEnableAsserts = from.wasmEnableAsserts
    to.wasmGenerateWat = from.wasmGenerateWat
    to.wasmKClassFqn = from.wasmKClassFqn
    to.wasmTarget = from.wasmTarget
    to.wasmUseNewExceptionProposal = from.wasmUseNewExceptionProposal<|endoftext|>


Prompt:
ProtoDynamicOperatorExpression.IrDynamicOperator.MINUSEQ -> IrDynamicOperator.MINUSEQ
            ProtoDynamicOperatorExpression.IrDynamicOperator.MULEQ -> IrDynamicOperator.MULEQ
            ProtoDynamicOperatorExpression.IrDynamicOperator.DIVEQ -> IrDynamicOperator.DIVEQ

Response:
ProtoDynamicOperatorExpression.IrDynamicOperator.MODEQ -> IrDynamicOperator.MODEQ

            ProtoDynamicOperatorExpression.IrDynamicOperator.ARRAY_ACCESS -> IrDynamicOperator.ARRAY_ACCESS

            ProtoDynamicOperatorExpression.IrDynamicOperator.INVOKE -> IrDynamicOperator.INVOKE
        }<|endoftext|>


Prompt:
*
 * The arrays are also considered structurally equal if both are `null`.
 *
 * If the arrays contain nested arrays, use [contentDeepEquals] to recursively compare their elements.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *

Response:
* @sample samples.collections.Arrays.ContentOperations.arrayContentEquals
 */
@SinceKotlin("1.4")
public expect infix fun <T> Array<out T>?.contentEquals(other: Array<out T>?): Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *<|endoftext|>


Prompt:
private fun KtParameter.reportIncorrectInline(modifierToken: KtModifierKeywordToken, diagnosticHolder: DiagnosticSink) {
        val modifier = modifierList?.getModifier(modifierToken)
        modifier?.let {
            diagnosticHolder.report(Errors.ILLEGAL_INLINE_PARAMETER_MODIFIER.on(modifier, modifierToken))
        }

Response:
}
}<|endoftext|>


Prompt:
override fun equals(other: Any?) =
        other is Open && (other.index == index || (other.index < 0 && index < 0))
    override fun hashCode(): Int = if (index < 0) -31 else index * 31
    override fun serializeTo(writer: SchemeStringSerializationWriter) { writer.writeNumber(index) }
}

/**

Response:
* A [Scheme] declares the applier the type expects and which appliers are expected of the
 * lambda parameters of a function or bound callable types of a generic type. The applier can be
 * open but all open appliers of the same non-negative index must be bound to the same applier.
 *
 * All non-composable lambda parameters of a function type are ignored and skipped when producing<|endoftext|>


Prompt:
<!UNSAFE_CALL!>--<!>b?.a
}

class Case1() {
    var a: A = A()
}

class A() {
    var i = 0

    operator fun dec(): A {
        this.i--
        return this
    }
}

// TESTCASE NUMBER: 2

fun case2() {

Response:
var b= Case2()
    --<!VAL_REASSIGNMENT!>b.a<!>
}

class Case2() {
    val a = A2()
}

class A2() {
    var i = 0

    operator fun dec(): A2 {
        this.i--
        return this
    }
}<|endoftext|>


Prompt:
val externRefToKotlinDoubleAdapter = getInternalFunction("externRefToKotlinDoubleAdapter")

        val externRefToKotlinUByteAdapter = getInternalFunction("externRefToKotlinUByteAdapter")
        val externRefToKotlinUShortAdapter = getInternalFunction("externRefToKotlinUShortAdapter")

Response:
val externRefToKotlinUIntAdapter = getInternalFunction("externRefToKotlinUIntAdapter")
        val externRefToKotlinULongAdapter = getInternalFunction("externRefToKotlinULongAdapter")

        val kotlinIntToExternRefAdapter = getInternalFunction("kotlinIntToExternRefAdapter")<|endoftext|>


Prompt:
// Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT!
// WITH_STDLIB

fun box(): String {
    val list1 = ArrayList<Int>()
    for (i in 10..5) {
        list1.add(i)
        if (list1.size > 23) break
    }

Response:
if (list1 != listOf<Int>()) {
        return "Wrong elements for 10..5: $list1"
    }

    val list2 = ArrayList<Int>()
    for (i in 10.toByte()..(-5).toByte()) {
        list2.add(i)
        if (list2.size > 23) break
    }<|endoftext|>


Prompt:
}
            else -> {}
        }
        LONG -> when (rightType) {
            LONG -> when (name) {
                "and" -> return left.and(right)
                "div" -> return left.divide(right)
                "minus" -> return left.subtract(right)
                "or" -> return left.or(right)
                "plus" -> return left.add(right)

Response:
"rem" -> return left.rem(right)
                "times" -> return left.multiply(right)
                "xor" -> return left.xor(right)
            }
            BYTE -> when (name) {
                "div" -> return left.divide(right)
                "minus" -> return left.subtract(right)
                "plus" -> return left.add(right)<|endoftext|>


Prompt:
appendLine(
                """
                    ${suspendModifier}fun main() {
                        $mainBody
                    }
                """.trimIndent()
            )
        }
        val file = testServices.temporaryDirectoryManager.getOrCreateTempDirectory("src").resolve(BOX_MAIN_FILE_NAME)
        file.writeText(code)

        return listOf(file.toTestFile())

Response:
}
}<|endoftext|>


Prompt:
environment = jdk11,
        )
        runProcess(
            "kotlin", "-cp", tmpdir.path, "test.JdkModuleUsageKt",
            expectedStdout = "interface java.sql.Driver\n",
            environment = jdk11,
        )
    }

    fun testKotlinUseJdkModuleFromJar() {

Response:
val jdk11 = mapOf("JAVA_HOME" to KtTestUtil.getJdk11Home().absolutePath)
        val output = tmpdir.resolve("out.jar")
        runProcess(
            "kotlinc", "$testDataDirectory/jdkModuleUsage.kt", "-d", output.path,
            environment = jdk11,
        )
        runProcess(<|endoftext|>


Prompt:
): Collection<MemberWithBaseScope<D>> {
        val result = mutableSetOf<MemberWithBaseScope<D>>()

        collectRealOverridden(symbol, scope, result, mutableSetOf(), processDirectOverridden)

        return result
    }

    private fun <D : FirCallableSymbol<*>> collectRealOverridden(
        symbol: D,
        scope: FirTypeScope,

Response:
result: MutableCollection<MemberWithBaseScope<D>>,
        // There's no guarantee that directOverridden(symbol) is strictly different
        // It might be the same instance that when being requested with a different/new scope would return next level of overridden
        visited: MutableSet<Pair<FirTypeScope, D>>,<|endoftext|>


Prompt:
if (a2!! != 2.toShort()) return "fail 2"
    if (a3!! != 2) return "fail 3"
    if (a4!! != 2L) return "fail 4"
    if (a5!! != 2.0) return "fail 5"
    if (a6!! != 2f) return "fail 6"
    if (a7!! != 'B') return "fail 7"

Response:
if (a8!! != 1) return "fail 8"

    return "OK"
}<|endoftext|>


Prompt:
@DisplayName("Multiplatform project could depend on JVM project")
    @GradleTest
    fun testMppLibResolvesJvmKtApp(gradleVersion: GradleVersion) {
        project("new-mpp-lib-and-app/sample-lib", gradleVersion) {
            includeOtherProjectAsSubmodule("simpleProject")
            buildGradle.appendText(
                """
                    |

Response:
|dependencies { jvm6MainImplementation project(':simpleProject') }
                    |
                    """.trimMargin()
            )

            testResolveAllConfigurations()
        }
    }

    @DisplayName("Multiplatform project could depend on JS project")
    @GradleTest
    fun testMppLibResolvesJsKtApp(gradleVersion: GradleVersion) {<|endoftext|>


Prompt:
@NullMarked
public class B<T> {
    public void foo(T t) {}
    public <E> void bar(E e) {}
}

// FILE: Test.java
public class Test {}

// FILE: main.kt
// jspecify_nullness_mismatch, jspecify_nullness_mismatch

Response:
fun <T : Test> main(a1: A<<!UPPER_BOUND_VIOLATED!>Any?<!>>, a2: A<Test>, b1: B<<!UPPER_BOUND_VIOLATED!>Any?<!>>, b2: B<Test>, x: T): Unit {
    a1.foo(null)<|endoftext|>


Prompt:
override fun get(index: Int): Nothing = null!!
    override fun indexOf(element: Nothing): Int = -1
    override fun lastIndexOf(element: Nothing): Int = -1

    override fun iterator(): Iterator<Nothing> = null!!
    override fun listIterator(): ListIterator<Nothing> = null!!
    override fun listIterator(index: Int): ListIterator<Nothing> = null!!

Response:
override fun subList(fromIndex: Int, toIndex: Int): List<Nothing> = null!!
}

fun box(): String {
    try {
        J.test()
        return "Fail: no exception is thrown from J.add()"
    } catch (e: UnsupportedOperationException) {
        return "OK"
    } catch (e: Throwable) {<|endoftext|>


Prompt:
fun List<FirFunction>.filterClashingDeclarations(classSymbol: FirClassSymbol<*>): List<FirFunctionSymbol<*>> {
    @Suppress("UNCHECKED_CAST")
    val allStaticFunctionsAndConstructors = classSymbol.fir.declarations.filterIsInstance<FirFunction>().toMutableList()
    val result = mutableListOf<FirFunction>()

Response:
for (function in this) {
        if (allStaticFunctionsAndConstructors.none { sameSignature(it, function) }) {
            allStaticFunctionsAndConstructors += function
            result += function
        }
    }
    return result.map { it.symbol }
}

/**
 * Lombok treat functions as having the same signature by arguments count only<|endoftext|>


Prompt:
COROUTINE_SUSPENDED
    }
}

suspend fun lock(owner: Controller) {
    owner.result += "L"
}

fun unlock(owner: Controller) {
    owner.result += "U"
}

public suspend inline fun doInline(owner: Controller, action: () -> Unit): Unit {
    lock(owner)
    try {
        return action()

Response:
} finally {
        unlock(owner)
    }
}

fun builder(c: suspend Controller.() -> Unit): String {
    val controller = Controller()
    c.startCoroutine(controller, EmptyContinuation)
    return controller.result
}

fun box(): String {
    val value = builder {
        doInline(this) {
            result += "X"
        }
    }<|endoftext|>


Prompt:
fun minMaxOfEmpty() {
        val empty = mapOf<Int, Int>()

        assertNull(empty.minOfOrNull { it.toString() })
        assertNull(empty.maxOfOrNull { it.toString() })
        assertFailsWith<NoSuchElementException> { empty.minOf { it.toString() } }

Response:
assertFailsWith<NoSuchElementException> { empty.maxOf { it.toString() } }

        assertNull(empty.minOfOrNull { 0.0 })
        assertNull(empty.maxOfOrNull { 0.0 })
        assertFailsWith<NoSuchElementException> { empty.minOf { 0.0 } }<|endoftext|>


Prompt:
0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,
            0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,

Response:
0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,
            0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,<|endoftext|>


Prompt:
class length {
    companion object {
        fun test() {}
    }
}

@JsExport
class C {
    class <!JS_BUILTIN_NAME_CLASH!>prototype<!>

    class <!JS_BUILTIN_NAME_CLASH!>length<!>

Response:
class <!JS_BUILTIN_NAME_CLASH!>`$metadata$`<!>

    <!JS_BUILTIN_NAME_CLASH!>fun constructor()<!> {}
}

// FILE: f2.kt
package foo2

external class prototype {
    companion object {
        fun test()
    }
}

external class length {
    companion object {<|endoftext|>


Prompt:
if (SIndex < 0 || SIndex >= SCount) {
                return null
            } else {
                val L = LBase + SIndex / NCount
                val V = VBase + SIndex % NCount / TCount
                var T = SIndex % TCount
                val decomp: IntArray

                if (T == 0) {
                    decomp = intArrayOf(L, V)
                } else {

Response:
T = TBase + T
                    decomp = intArrayOf(L, V, T)
                }
                return decomp
            }
        }
    }
}<|endoftext|>


Prompt:
package test.collections

import kotlin.test.*

class IteratorsTest {
    @Test
    fun iterationOverIterator() {
        val c = listOf(0, 1, 2, 3, 4, 5)
        var s = ""
        for (i in c.iterator()) {
            s = s + i.toString()
        }
        assertEquals("012345", s)

Response:
}
}<|endoftext|>


Prompt:
require(n >= 0) { "Requested element count $n is less than zero." }
    return take((size - n).coerceAtLeast(0))
}

/**
 * Returns a list containing all elements except last [n] elements.
 *
 * @throws IllegalArgumentException if [n] is negative.
 *
 * @sample samples.collections.Collections.Transformations.drop
 */

Response:
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
public fun UByteArray.dropLast(n: Int): List<UByte> {
    require(n >= 0) { "Requested element count $n is less than zero." }
    return take((size - n).coerceAtLeast(0))
}

/**
 * Returns a list containing all elements except last [n] elements.<|endoftext|>


Prompt:
class GD: GetterDeprecated() {
    override var p: Int
        get() = 3
        set(value) {
        }
}

class SD: SetterDeprecated() {
    override var p: Int
        get() = 3
        set(value) {
        }
}

class SDH: SetterDeprecated(), HiddenDeprecated {
    override var p: Int

Response:
get() = 3
        set(value) {
        }
}

class EDH: ErrorDeprecated(), HiddenDeprecated {
    override var <!OVERRIDE_DEPRECATION!>p<!>: Int
        get() = 3
        set(value) {
        }
}

class NED: ErrorDeprecated(), NoDeprecation {
    override var p: Int
        get() = 3<|endoftext|>


Prompt:
annotation class Anno(val value: String = "Anno")

expect annotation class Classes(
    val s: String = "OK",
    val e: En = En.B,
    // TODO: this does not work at the moment because AnnotationDescriptor subclasses do not implement equals correctly
    // val a: Anno = Anno(),
    val k: KClass<*> = List::class
)

Response:
expect annotation class ClassArrays(
    val s: Array<String> = ["OK"],
    val e: Array<En> = [En.B],
    // val a: Array<Anno> = [Anno()],
    val k: Array<KClass<*>> = [List::class],
    vararg val v: Int = [42]
)<|endoftext|>


Prompt:
public actual interface KProperty1<T, out V> : kotlin.reflect.KProperty<V>, (T) -> V {
    public actual fun get(receiver: T): V

    public override operator fun invoke(p1: T): V
}

public actual interface KProperty2<D, E, out V> : kotlin.reflect.KProperty<V>, (D, E) -> V {

Response:
public actual fun get(receiver1: D, receiver2: E): V

    public override operator fun invoke(p1: D, p2: E): V
}

/**
 * Represents a property declared as a `var`.
 */
public actual interface KMutableProperty<V> : KProperty<V>

public actual interface KMutableProperty0<V> : KProperty0<V>, KMutableProperty<V> {<|endoftext|>


Prompt: val <!LOCAL_VARIABLE_WITH_TYPE_PARAMETERS!><T : <!DEBUG_INFO_MISSING_UNRESOLVED!>__UNRESOLVED__<!>><!> a1 = ""

Response: val <!LOCAL_VARIABLE_WITH_TYPE_PARAMETERS!><T : <!DEBUG_INFO_MISSING_UNRESOLVED!>String<!>><!> a2 = 0<|endoftext|>


Prompt: @Special(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>NestedNested<!>::class<!>)

Response: class Nested<@Special(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>NestedNested<!>::class<!>) T> :<|endoftext|>


Prompt:
// IGNORE_BACKEND: JS

private object EmptyList : List<Nothing> {
    override fun contains(element: Nothing): Boolean = false
    override fun containsAll(elements: Collection<Nothing>): Boolean = elements.isEmpty()
    override fun indexOf(element: Nothing): Int = -2
    override fun lastIndexOf(element: Nothing): Int = -2

Response:
override val size: Int get() = 0
    override fun isEmpty(): Boolean = true

    override fun iterator(): Iterator<Nothing> = throw UnsupportedOperationException()
    override fun get(index: Int): Nothing = throw UnsupportedOperationException()
    override fun listIterator(): ListIterator<Nothing> = throw UnsupportedOperationException()<|endoftext|>


Prompt:
if (topLevelDelegatedVal != 1) throw AssertionError()
    if (topLevelDelegatedVar != 2) throw AssertionError()
    topLevelDelegatedVar = 3
    if (topLevelDelegatedVar != 3) throw AssertionError()

    if (topLevelDelegatedValByProvider != 1) throw AssertionError()

Response:
if (topLevelDelegatedVarByProvider != 2) throw AssertionError()
    topLevelDelegatedVarByProvider = 3
    if (topLevelDelegatedVarByProvider != 3) throw AssertionError()

    if (localDelegatedVal != 1) throw AssertionError()
    if (localDelegatedVar != 2) throw AssertionError()
    localDelegatedVar = 3<|endoftext|>


Prompt:
constructor() : this(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f)
}

data class C(val a: B, val b: B) {

    constructor(aW: B, aX: B, aY: B, aZ: B,

Response:
bW: B, bX: B, bY: B, bZ: B) : this(aW, bW)

    constructor() : this(B(), B())
}

fun box(): String {
    require(B().a == A(0.0f))
    require(B().b == A(4.0f))<|endoftext|>


Prompt:
* Rounds the given value [x] towards the closest integer with ties rounded towards even integer.
 *
 * Special cases:
 *   - `round(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.
 */
@SinceKotlin("1.2")

Response:
public actual fun round(x: Double): Double = kotlin.math.fdlibm.rint(x)

/**
 * Returns the absolute value of the given value [x].
 *
 * Special cases:
 *   - `abs(NaN)` is `NaN`
 *
 * @see absoluteValue extension property for [Double]
 */
@SinceKotlin("1.2")<|endoftext|>


Prompt:
is FirDeclarationOrigin.Synthetic -> {
        when {
            source?.kind == KtFakeSourceElementKind.DataClassGeneratedMembers -> KtSymbolOrigin.SOURCE_MEMBER_GENERATED
            this is FirValueParameter && this.containingFunctionSymbol.origin is FirDeclarationOrigin.Synthetic -> KtSymbolOrigin.SOURCE_MEMBER_GENERATED

Response:
this is FirSyntheticProperty || this is FirSyntheticPropertyAccessor -> KtSymbolOrigin.JAVA_SYNTHETIC_PROPERTY

            else -> errorWithAttachment("Invalid FirDeclarationOrigin ${origin::class.simpleName}") {
                withFirEntry("firToGetOrigin", this@ktSymbolOrigin)
            }
        }
    }<|endoftext|>


Prompt:
if (framework.buildType != envBuildType || !envTargets.contains(framework.konanTarget)) return

    embedAndSignTask.configure { task ->
        val frameworkFile = framework.outputFile
        task.dependsOn(assembleTask)
        if (swiftExportTask != null) {
            task.dependsOn(swiftExportTask)
        }

Response:
task.sourceFramework.fileProvider(appleFrameworkDir(frameworkTaskName).map { it.resolve(frameworkFile.name) })
        task.destinationDirectory.set(envEmbeddedFrameworksDir)
        if (envSign != null) {
            task.doLast {
                val binary = envEmbeddedFrameworksDir
                    .resolve(frameworkFile.name)<|endoftext|>


Prompt:
return -(low + 1)  // key not found
}

/**
 * Searches the array or the range of the array for the provided [element] using the binary search algorithm.
 * The array is expected to be sorted, otherwise the result is undefined.
 *
 * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found.
 *
 * @param element the to search for.

Response:
* @param fromIndex the start of the range (inclusive) to search in, 0 by default.
 * @param toIndex the end of the range (exclusive) to search in, size of this array by default.
 *
 * @return the index of the element, if it is contained in the array within the specified range;
 * otherwise, the inverted insertion point `(-insertion point - 1)`.<|endoftext|>


Prompt:
expectOrder("x(4) !in 3 downTo low(1)", "LX") { assertTrue(x(4) !in 3 downTo low(1)) }

    expectOrder("x(2) in (high(3) downTo low(1)).reversed()", "HLX") { assertTrue(x(2) in (high(3) downTo low(1)).reversed()) }

Response:
expectOrder("2 in (high(3) downTo low(1)).reversed()", "HL") { assertTrue(2 in (high(3) downTo low(1)).reversed()) }
    expectOrder("x(2) in high(3) downTo 1", "HX") { assertTrue(x(2) in high(3) downTo 1) }<|endoftext|>


Prompt:
statements.forEach { remapper.remap(it) }
                    }
                    null -> {}
                }
                block.statements += statements
                file.moduleName?.let { dce.moduleMapping[block] = it }
                block
            }

            if (hasErrors) return DeadCodeEliminationResult(dce.context, emptySet(), DeadCodeEliminationStatus.FAILED)

Response:
program.globalBlock.statements += blocks
            program.globalBlock.fixForwardNameReferences()

            dce.reachableNames += rootReachableNames
            dce.apply(program.globalBlock)

            for ((file, block) in inputFiles.zip(blocks)) {
                val sourceMapFile = File(file.outputPath + ".map")
                val textOutput = TextOutputImpl()<|endoftext|>


Prompt:
if (b.getAInA() != 2) return "b.getAInA() != 2, it: ${b.getAInA()}"

    if (b.getSuperA() != 1) return "b.getSuperA() != 1, it: ${b.getSuperA()}"
    b.setSuperA(3)

Response:
if (b.getSuperA() != 3) return "b.getSuperA() != 3, it: ${b.getSuperA()}"

    if (b.getAInA() != 2) return "b.getAInA() != 2 after b.setAInB(3), it: ${b.getAInA()}"

    return "OK"
}<|endoftext|>


Prompt:
// !JAVAC_EXPECTED_FILE
// !DIAGNOSTICS: -UNUSED_PARAMETER

class Base<T : <!CYCLIC_GENERIC_UPPER_BOUND!>T<!>> : HashSet<T>() {
    fun foo() {
        super.remove(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
    }

Response: }<|endoftext|>


Prompt:
try {
                                initIsRunning.set(true)
                                try {
                                    calculatedValue = computeValue()
                                } finally {
                                    initIsRunning.set(false)
                                }
                            } finally {
                                lock.unlock()
                            }
                        }
                    }

                    calculatedValue ?: computeValue()
                }
            }

        override fun isInitialized() = holder.isInitialized()

Response:
}

    companion object {
        @JvmStatic
        private val initIsRunning: ThreadLocal<Boolean> = ThreadLocal.withInitial { false }
    }
}<|endoftext|>


Prompt:
var x: String? = null

    outer@ while (x != null) {
        inner@ do {
            x = null
        } while (<!SENSELESS_COMPARISON!>x != null<!>)
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
    }
}

// TESTCASE NUMBER: 10
fun case_10() {
    var x: String? = null

    outer@ while (x != null) {
        inner@ do {<|endoftext|>


Prompt:
// FILE: 1.kt

inline fun <R> performWithFinally(finally: () -> R) : R {
    try {
        throw RuntimeException("1")
    } catch (e: RuntimeException) {
        throw RuntimeException("2")
    } finally {
        return finally()
    }
}

// FILE: 2.kt

inline fun test2Inline() = performWithFinally { "OK" }

Response:
fun box(): String {
    return test2Inline()
}<|endoftext|>


Prompt:
memberOwnerLookupTag = memberOwnerLookupTag,
    memberRequiredPhase = memberRequiredPhase,
)

fun ConeKotlinType.scopeForSupertype(
    useSiteSession: FirSession,
    scopeSession: ScopeSession,
    derivedClass: FirClass,
    memberRequiredPhase: FirResolvePhase?,
): FirTypeScope? {
    if (this !is ConeClassLikeType) return null

Response:
if (this is ConeErrorType) return null

    val symbol = lookupTag.toSymbol(useSiteSession) as? FirRegularClassSymbol ?: return null

    val substitutor = substitutorForSuperType(useSiteSession, symbol)

    return symbol.fir.scopeForClassImpl(
        substitutor,
        useSiteSession,
        scopeSession,
        skipPrivateMembers = true,<|endoftext|>


Prompt:
//   - shutdown/takeover smaller daemon
                    //   - run (or better persuade client to run) a bigger daemon (in fact may be even simple shutdown will do, because of client's daemon choosing logic)
                }
            }
        }
    }

    private fun shutdownNow() {
        log.info("Shutdown started")
        fun Long.mb() = this / (1024 * 1024)

Response:
with(Runtime.getRuntime()) {
            log.info("Memory stats: total: ${totalMemory().mb()}mb, free: ${freeMemory().mb()}mb, max: ${maxMemory().mb()}mb")
        }
        state.alive.set(Aliveness.Dying.ordinal)

        UnicastRemoteObject.unexportObject(this, true)
        log.info("Shutdown complete")<|endoftext|>


Prompt: // library.kt:17 box: $i$f$flaf:int=0:int, flafVar$iv:int=0:int, fooParam\1$iv:int=0:int, $i$f$foo\1\12:int=0:int, fooVar\1$iv:int=0:int, it\2$iv:int=42:int,

Response: $i$a$-foo-LibraryKt$flaf$1\2\25\0$iv:int=0:int, x\2$iv:int=1:int<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.plugin.KotlinProjectSetupAction
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget

Response:
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinWithJavaCompilation
import org.jetbrains.kotlin.gradle.utils.providerWithLazyConvention
import org.jetbrains.kotlin.gradle.utils.withType

internal const val KOTLIN_MODULE_GROUP = "org.jetbrains.kotlin"<|endoftext|>


Prompt:
packageProto,
            FirDeserializationContext.createForPackage(
                packageFqName, packageProto, nameResolver, moduleData,
                JvmBinaryAnnotationDeserializer(session, kotlinClass, kotlinClassFinder, byteContent),
                JavaAwareFlexibleTypeFactory,

Response:
FirJvmConstDeserializer(session, facadeBinaryClass ?: kotlinClass, BuiltInSerializerProtocol),
                source
            ),
        )
    }

    private object JavaAwareFlexibleTypeFactory : FirTypeDeserializer.FlexibleTypeFactory {
        override fun createFlexibleType(
            proto: ProtoBuf.Type,<|endoftext|>


Prompt:
return if (psi.hasBody() && (psi.funKeyword == null || psi.nameIdentifier == null)) {
            getAnonymousFunctionSymbol(psi)
        } else {
            KtFe10PsiFunctionSymbol(psi, analysisContext)
        }
    }

Response:
override fun getConstructorSymbol(psi: KtConstructor<*>): KtConstructorSymbol {
        return KtFe10PsiConstructorSymbol(psi, analysisContext)
    }

    override fun getTypeParameterSymbol(psi: KtTypeParameter): KtTypeParameterSymbol {
        return KtFe10PsiTypeParameterSymbol(psi, analysisContext)<|endoftext|>


Prompt: contract { returnsNotNull() implies (this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) }

Response:
return if (this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) true else null
}
fun <T : Number?> T.case_6_4(value_2: Any?): Boolean? {<|endoftext|>


Prompt:
description = "Handle inline class usages"
)

private val autoboxingTransformerPhase = makeIrModulePhase<WasmBackendContext>(
    { context -> AutoboxingTransformer(context) },
    name = "AutoboxingTransformer",
    description = "Insert box/unbox intrinsics"
)

private val staticMembersLoweringPhase = makeIrModulePhase(
    ::StaticMembersLowering,

Response:
name = "StaticMembersLowering",
    description = "Move static member declarations to top-level"
)

private val classReferenceLoweringPhase = makeIrModulePhase(
    ::WasmClassReferenceLowering,
    name = "WasmClassReferenceLowering",
    description = "Handle class references"
)

private val wasmVarargExpressionLoweringPhase = makeIrModulePhase(<|endoftext|>


Prompt:
abstract override fun <D> transformSetter(transformer: FirTransformer<D>, data: D): FirValueParameter

    abstract override fun <D> transformBackingField(transformer: FirTransformer<D>, data: D): FirValueParameter

    abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirValueParameter

Response:
abstract override fun <D> transformOtherChildren(transformer: FirTransformer<D>, data: D): FirValueParameter
}<|endoftext|>


Prompt:
override fun <S : MemberScope> getOrPutScopeForClass(classDescriptor: ClassDescriptor, compute: () -> S): S {
            return compute()
        }
    }
}

@TypeRefinement
fun KotlinTypeRefiner.refineTypes(types: Iterable<KotlinType>): List<KotlinType> = types.map { refineType(it) }

Response:
class Ref<T : Any>(var value: T)

@TypeRefinement
val REFINER_CAPABILITY = ModuleCapability<Ref<TypeRefinementSupport>>("KotlinTypeRefiner")

sealed class TypeRefinementSupport(val isEnabled: Boolean) {
    object Disabled : TypeRefinementSupport(isEnabled = false)
    object EnabledUninitialized : TypeRefinementSupport(isEnabled = true)<|endoftext|>


Prompt:
private val autoCacheRootDirectory = configuration.get(KonanConfigKeys.AUTO_CACHE_DIR)?.let {
        File(it).apply {
            if (!isDirectory) configuration.reportCompilationError("auto cache directory $this is not found or is not a directory")
        }
    } ?: systemCacheRootDirectory

Response:
internal val autoCacheDirectory = autoCacheRootDirectory.child(userCacheFlavorString).also { it.mkdirs() }
    private val incrementalCacheRootDirectory = configuration.get(KonanConfigKeys.INCREMENTAL_CACHE_DIR)?.let {
        File(it).apply {
            if (!isDirectory) configuration.reportCompilationError("incremental cache directory $this is not found or is not a directory")<|endoftext|>


Prompt:
}

        private fun warnAboutInheritedAnnotations(
            kind: FunctionKind,
            function: IrFunctionSymbol,
            annotatedFunction: IrFunctionSymbol
        ) {
            if (function.owner != annotatedFunction.owner) {
                context.reportWarning(
                    "Super method has a test annotation ${kind.annotationFqName} but the overriding method doesn't. " +

Response:
"Note that the overriding method will still be executed.",
                    irFile,
                    function.owner
                )
            }
        }

        private fun warnAboutLoneIgnore(functionSymbol: IrFunctionSymbol): Unit = with(functionSymbol) {
            if (hasAnnotation(IGNORE_FQ_NAME) && !hasAnnotation(FunctionKind.TEST.annotationFqName)) {<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT

/*
 * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
 *

Response:
* SPEC VERSION: 0.1-220
 * MAIN LINK: expressions, comparison-expressions -> paragraph 1 -> sentence 2
 * PRIMARY LINKS: overloadable-operators -> paragraph 4 -> sentence 1
 * NUMBER: 1
 * DESCRIPTION: <, >, <= and >=  operators are overloadable
 */

// TESTCASE NUMBER: 1
class A(val a: Int)  {<|endoftext|>


Prompt:
val propagateExiledToHeapObjects: Boolean
    ) {

        private val symbols = context.ir.symbols

        private fun DataFlowIR.Type.resolved(): DataFlowIR.Type.Declared {
            if (this is DataFlowIR.Type.Declared) return this
            val hash = (this as DataFlowIR.Type.External).hash

Response:
return externalModulesDFG.publicTypes[hash] ?: error("Unable to resolve exported type $hash")
        }

        val escapeAnalysisResults = mutableMapOf<DataFlowIR.FunctionSymbol.Declared, FunctionEscapeAnalysisResult>()

        fun analyze() {
            context.logMultiple {
                +"CALL GRAPH"<|endoftext|>


Prompt:
addDependencies(cachedDependency, notHandledFiles.toList())
                }
            }
        }
    }

    private inner class Dependencies {
        val immediateBitcodeDependencies = run {
            val usedBitcode = usedBitcode().groupBy { it.library }
            val bitcodeModuleDependencies = mutableListOf<DependenciesTracker.ResolvedDependency>()

Response:
val bitcodeFileDependencies = mutableListOf<DependenciesTracker.ResolvedDependency>()
            val libraryToCache = config.cacheSupport.libraryToCache
            val strategy = libraryToCache?.strategy as? CacheDeserializationStrategy.SingleFile
            topSortedLibraries.forEach { library ->
                val filesUsed = usedBitcode[library]<|endoftext|>


Prompt:
}
    }

    //endregion Task Configuration State & Inputs

    @TaskAction
    fun transformMetadata() {
        val transformation = GranularMetadataTransformation(
            params = transformationParameters,
            parentSourceSetVisibilityProvider = ParentSourceSetVisibilityProvider { identifier: ComponentIdentifier ->
                val serializableKey = identifier.serializableUniqueKey

Response:
parentVisibleSourceSetFiles.flatMap { visibleSourceSetsFile ->
                    readVisibleSourceSetsFile(visibleSourceSetsFile)[serializableKey].orEmpty()
                }.toSet()
            }
        )

        if (outputsDir.isDirectory) {
            outputsDir.deleteRecursively()
        }
        outputsDir.mkdirs()<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE

interface X<T>
interface A: X<String>
interface B : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>A, X<Int><!>

fun foo(x: B) {

Response:
// Checks that when checking subtypes we search closes corresponding constructor (e.g. with BFS)
    val y: X<Int> = x
}<|endoftext|>


Prompt:
val setMethodSymbol = with(arraySymbol.owner.functions) {
            // For unsigned types use set method.
            singleOrNull { it.name == KonanNameConventions.setWithoutBoundCheck } ?: single { it.name == OperatorNameConventions.SET }
        }
        val sizeGetterSymbol = arraySymbol.getPropertyGetter("size")!!

Response:
val copyIntoSymbol = symbols.copyInto[arraySymbol]!!
        val copyOfSymbol = symbols.copyOf[arraySymbol]!!
        protected val singleParameterConstructor =
                arraySymbol.owner.constructors.find { it.valueParameters.size == 1 }!!<|endoftext|>


Prompt:
public inline fun <R> kotlin.UByteArray.minOfWith(comparator: kotlin.Comparator<in R>, selector: (kotlin.UByte) -> R): R

@kotlin.SinceKotlin(version = "1.4")
@kotlin.OverloadResolutionByLambdaReturnType
@kotlin.ExperimentalUnsignedTypes

Response:
@kotlin.internal.InlineOnly
public inline fun <R> kotlin.UIntArray.minOfWith(comparator: kotlin.Comparator<in R>, selector: (kotlin.UInt) -> R): R

@kotlin.SinceKotlin(version = "1.4")
@kotlin.OverloadResolutionByLambdaReturnType<|endoftext|>


Prompt:
val x = listOf(1, 2, 3)
}

@Test
fun `stable refs in root set`() {
    GC.collect()
    val stat0 = GC.lastGCInfo
    assertNotNull(stat0)
    val rootSet0 = stat0.rootSet
    assertNotNull(rootSet0)
    val x = listOf(1, 2, 3)

Response:
val stable = kotlinx.cinterop.StableRef.create(x)
    GC.collect();
    val stat1 = GC.lastGCInfo
    assertNotNull(stat1)
    val rootSet1 = stat1.rootSet
    assertNotNull(rootSet1)
    assertEquals(rootSet0.stableReferences + 1, rootSet1.stableReferences)
    stable.dispose()<|endoftext|>


Prompt:
public fun <T> listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List<T> = TODO()
fun <T> Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List<T> = TODO()

// FILE: Lib4.kt
package libPackageCase2Explicit

Response:
import testsCase2.*

val Case2.listOf: A
    get() = A()

fun <T> Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List<T> = TODO()<|endoftext|>


Prompt:
(readUByte().toUInt() shl 16) or
                (readUByte().toUInt() shl 24)

    fun readUInt64(): ULong =
        readUByte().toULong() or
                (readUByte().toULong() shl 8) or
                (readUByte().toULong() shl 16) or

Response:
(readUByte().toULong() shl 24) or
                (readUByte().toULong() shl 32) or
                (readUByte().toULong() shl 40) or
                (readUByte().toULong() shl 48) or
                (readUByte().toULong() shl 56)

    fun readVarInt7() = readSignedLeb128().let {<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1285
package foo

var flag = false
fun toggle(): Boolean {
    flag = !flag

    return flag
}

inline fun run(noinline f: () -> Int): Int {
    return f()
}

// CHECK_BREAKS_COUNT: function=box count=0 TARGET_BACKENDS=JS_IR

Response:
// CHECK_LABELS_COUNT: function=box name=$l$block count=0 TARGET_BACKENDS=JS_IR
fun box(): String {
    run({ toggle(); 4 })
    assertEquals(true, flag)

    return "OK"
}<|endoftext|>


Prompt:
package org.jetbrains.kotlin.abicmp.defects

val JAR_FILE1_A = DefectAttribute("JAR_FILE1", "jarFile1")
val JAR_FILE2_A = DefectAttribute("JAR_FILE2", "jarFile2")
val CLASS_A = DefectAttribute("CLASS", "class")

Response:
val METHOD_A = DefectAttribute("METHOD", "method")
val FIELD_A = DefectAttribute("FIELD", "field")
val VALUE1_A = DefectAttribute("VALUE1", "value1")
val VALUE2_A = DefectAttribute("VALUE2", "value2")
val VP_INDEX_A = DefectAttribute("VP_INDEX", "vpIndex")<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<KtTypeReference>(firDiagnostic, token), KtFirDiagnostic.ExpandedTypeCannotBeInherited

internal class ProjectionInImmediateArgumentToSupertypeImpl(
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,

Response:
) : KtAbstractFirDiagnostic<KtModifierListOwner>(firDiagnostic, token), KtFirDiagnostic.ProjectionInImmediateArgumentToSupertype

internal class InconsistentTypeParameterValuesImpl(
    override val typeParameter: KtTypeParameterSymbol,
    override val type: KtClassLikeSymbol,
    override val bounds: List<KtType>,<|endoftext|>


Prompt: contract { returns(false) implies ((this@case_8_2 is Number || this@case_8_2 is Int) && value_2 is Int && value_3 != null && value_3 is Number && value_4 != null) }

Response:
return !((this@case_8_2 is Number || this@case_8_2 is Int) && value_2 is Int && value_3 != null && value_3 is Number && value_4 != null)
}
inline fun <reified T : Any?> T?.case_8_3(value_2: Number, value_3: Any?, value_4: String?): Boolean? {<|endoftext|>


Prompt:
// DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1
annotation class PropertyAnnotation
annotation class FieldAnnotation
annotation class GetAnnotation
annotation class SetAnnotation
annotation class SetparamAnnotation
annotation class ExplicitGetAnnotation
annotation class ExplicitSetAnnotation
annotation class ExplicitSetparamAnnotation

@property:PropertyAnnotation
@field:FieldAnnotation

Response:
@get:GetAnnotation
@set:SetAnnotation
@setparam:SetparamAnnotation
var x: Int = 0
    @ExplicitGetAnnotation
    ge<caret>t() = field
    @ExplicitSetAnnotation
    set(@ExplicitSetparamAnnotation value) {
        field = value
    }<|endoftext|>


Prompt:
#endif""".trimIndent())

        output("#endif  /* KONAN_${prefix.uppercase()}_H */")

        outputStreamWriter.close()

        outputStreamWriter = cppAdapterFile.printWriter()

        // Include header into C++ source.
        headerFile.forEachLine { it -> output(it) }

        output("#include <exception>")

Response:
output("""
    |struct KObjHeader;
    |typedef struct KObjHeader KObjHeader;
    |struct KTypeInfo;
    |typedef struct KTypeInfo KTypeInfo;
    |
    |struct FrameOverlay;
    |typedef struct FrameOverlay FrameOverlay;
    |
    |#define RUNTIME_NOTHROW __attribute__((nothrow))<|endoftext|>


Prompt:
* applied to each character in the char sequence.
 *
 * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.
 *
 * @throws NoSuchElementException if the char sequence is empty.
 */
@SinceKotlin("1.4")
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)

Response:
@OverloadResolutionByLambdaReturnType
@kotlin.internal.InlineOnly
public inline fun CharSequence.maxOf(selector: (Char) -> Float): Float {
    if (isEmpty()) throw NoSuchElementException()
    var maxValue = selector(this[0])
    for (i in 1..lastIndex) {
        val v = selector(this[i])<|endoftext|>


Prompt:
package kotlin.time

import kotlin.math.truncate
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.TimeSource.Monotonic.ValueTimeMark

@Suppress("ACTUAL_WITHOUT_EXPECT") // visibility
internal actual typealias ValueTimeMarkReading = Any

internal interface DefaultTimeSource : TimeSource.WithComparableMarks {

Response:
override fun markNow(): ValueTimeMark
    fun elapsedFrom(timeMark: ValueTimeMark): Duration
    fun differenceBetween(one: ValueTimeMark, another: ValueTimeMark): Duration
    fun adjustReading(timeMark: ValueTimeMark, duration: Duration): ValueTimeMark
}

@SinceKotlin("1.3")<|endoftext|>


Prompt:
val OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS: KtDiagnosticFactory0 by warning0<KtAnnotationEntry>()
    val OVERLOADS_ABSTRACT: KtDiagnosticFactory0 by error0<KtAnnotationEntry>()
    val OVERLOADS_INTERFACE: KtDiagnosticFactory0 by error0<KtAnnotationEntry>()

Response:
val OVERLOADS_LOCAL: KtDiagnosticFactory0 by error0<KtAnnotationEntry>()
    val OVERLOADS_ANNOTATION_CLASS_CONSTRUCTOR: KtDiagnosticFactoryForDeprecation0 by deprecationError0<KtAnnotationEntry>(ProhibitJvmOverloadsOnConstructorsOfAnnotationClasses)<|endoftext|>


Prompt:
object TestFn17 : TestFnBase {
    override fun testGood(x: Any) =
            reifiedAsSucceeds<Function17<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *>>(

Response:
x, "x as Function17<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *>")
    override fun testBad(x: Any) =<|endoftext|>


Prompt:
override fun getTopLevelPropertySymbolsTo(destination: MutableList<FirPropertySymbol>, packageFqName: FqName, name: Name) {
    }

    override fun getPackage(fqName: FqName): FqName? = providers.firstNotNullOfOrNull { it.getPackage(fqName) }

    companion object {

Response:
fun merge(session: FirSession, project: Project, providers: List<LLFirJavaSymbolProvider>): FirSymbolProvider? =
            if (providers.size > 1) {
                val combinedScope = GlobalSearchScope.union(providers.map { it.searchScope })
                val javaClassFinder = project.createJavaClassFinder(combinedScope)<|endoftext|>


Prompt: @Ann(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>intArrayOf(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>i<!>, i2, <!ANNOTATION_ARGUMENT_MUST_BE_CONST!>i3<!>)<!>)

Response: @Ann(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION!>intArrayOf(<!NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION, TYPE_MISMATCH!>intArrayOf(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>i<!>, i2,<|endoftext|>


Prompt:
FirPackageMemberScope(file.packageFqName, session, excludedNames = excludedNamesInPackage)
            }
        }
        // TODO: explicit simple importing scope should have highest priority (higher than inner scopes added in process)
        this += FirExplicitSimpleImportingScope(file.imports, session, scopeSession)
    }
}

Response: private class ListStorageFirScope(val result: List<FirScope>) : FirScope()<|endoftext|>


Prompt:
private fun computeClassLikeSymbolByClassId(classId: ClassId): FirClassLikeSymbol<*>? {
        val candidates = declarationProvider.getAllClassesByClassId(classId) + declarationProvider.getAllTypeAliasesByClassId(classId)
        val (ktClass, provider) = selectFirstElementInClasspathOrder(candidates) { it } ?: return null

Response:
return provider.getClassLikeSymbolByClassId(classId, ktClass)
    }

    @FirSymbolProviderInternals
    override fun getTopLevelCallableSymbolsTo(destination: MutableList<FirCallableSymbol<*>>, packageFqName: FqName, name: Name) {
        forEachCallableProvider(
            packageFqName,
            name,<|endoftext|>


Prompt:
assertEquals(0, count, "onEachIndex should be executed only when resulting sequence is iterated")

        val sum = newData.foldIndexed(0) { i, acc, e -> acc + i + e.length }
        assertEquals(sum, count)
    }

    @Test fun filterAndTakeWhileExtractTheElementsWithinRange() {

Response:
assertEquals(listOf(144, 233, 377, 610, 987), fibonacci().filter { it > 100 }.takeWhile { it < 1000 }.toList())
    }

    @Test fun foldReducesTheFirstNElements() {
        val sum = { a: Int, b: Int -> a + b }<|endoftext|>


Prompt:
// no local optimizations
    if (element11 in emptyCharSequence.indices != range1.contains(element11)) throw AssertionError()
    if (element11 !in emptyCharSequence.indices != !range1.contains(element11)) throw AssertionError()

Response:
if (!(element11 in emptyCharSequence.indices) != !range1.contains(element11)) throw AssertionError()
    if (!(element11 !in emptyCharSequence.indices) != range1.contains(element11)) throw AssertionError()
}

fun testR1xE12() {
    // with possible local optimizations<|endoftext|>


Prompt:
get() = booleanProperty("kotlin.wasm.stability.nowarn") ?: false

    val ignoreDisabledNativeTargets: Boolean?
        get() = booleanProperty(KOTLIN_NATIVE_IGNORE_DISABLED_TARGETS)

    val ignoreAbsentAndroidMultiplatformTarget: Boolean

Response:
get() = booleanProperty("kotlin.mpp.absentAndroidTarget.nowarn") ?: false

    val ignoreAndroidGradlePluginCompatibilityIssues: Boolean
        get() = booleanProperty(KOTLIN_MPP_ANDROID_GRADLE_PLUGIN_COMPATIBILITY_NO_WARN) ?: false

    val mppAndroidSourceSetLayoutVersion: Int?<|endoftext|>


Prompt:
map.put(DELEGATION_NOT_TO_INTERFACE, "Delegation is supported only for interfaces.")
        map.put(
            DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE,
            "Delegated member ''{0}'' hides supertype override ''{1}''. Please specify proper override explicitly.", SYMBOL, SYMBOL
        )

Response:
map.put(NESTED_CLASS_NOT_ALLOWED, "''{0}'' is prohibited here.", TO_STRING)
        map.put(VAL_OR_VAR_ON_LOOP_PARAMETER, "''{0}'' on loop parameter is prohibited.", TO_STRING)<|endoftext|>


Prompt:
jump: HighLevelJump,
                                     startOffset: Int,
                                     endOffset: Int,
                                     value: IrExpression
    ): IrExpression {
        if (index == tryScopes.size)
            return jump.toIr(context, startOffset, endOffset, value)

        val currentTryScope = tryScopes[index]
        currentTryScope.jumps.getOrPut(jump) {

Response:
val type = (jump as? Return)?.target?.owner?.returnType(context) ?: value.type
            jump.toString()
            val symbol = IrReturnableBlockSymbolImpl()
            with(currentTryScope) {
                irBuilder.run {
                    val inlinedFinally = irInlineFinally(symbol, type, expression, finallyExpression)
                    expression = performHighLevelJump(<|endoftext|>


Prompt:
var packageFilter: String? = null
    val argsIterator = args.iterator()
    while (argsIterator.hasNext()) {
        val arg = argsIterator.next()

        when (arg) {
            "--pkg" -> if (argsIterator.hasNext()) packageFilter = argsIterator.next() else throw IllegalArgumentException("argument $arg requires argument")

Response:
else -> throw IllegalArgumentException("Argument $arg is unknown")
        }
    }

    val urlsPerFiles = urls.filter { packageFilter == null || it.second == packageFilter }.groupBy { it.second + ".idl" }

    urlsPerFiles.forEach { e ->
        val fileName = e.key
        val pkg = e.value.first().second<|endoftext|>


Prompt:
.finalizeValueOnRead()
            task.buildFinishedListenerService.value(buildFinishedListenerService).disallowChanges()
            task.buildIdService.value(buildIdService).disallowChanges()

            task.incremental = false
            task.useModuleDetection.convention(false)

Response:
task.runViaBuildToolsApi.convention(propertiesProvider.runKotlinCompilerViaBuildToolsApi).finalizeValueOnRead()
            task.classLoadersCachingService.value(cachedClassLoadersService).disallowChanges()

            task.explicitApiMode
                .value(project.providers.provider { ext.explicitApi })
                .finalizeValueOnRead()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.konan.library.KonanLibrary
import org.jetbrains.kotlin.library.SearchPathResolver
import org.jetbrains.kotlin.library.isInterop
import org.jetbrains.kotlin.library.metadata.CurrentKlibModuleOrigin

Response:
import org.jetbrains.kotlin.library.metadata.DeserializedKlibModuleOrigin
import org.jetbrains.kotlin.library.metadata.SyntheticModulesOrigin
import org.jetbrains.kotlin.library.metadata.klibModuleOrigin
import org.jetbrains.kotlin.library.metadata.resolver.KotlinLibraryResolveResult<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.util.classId
import org.jetbrains.kotlin.ir.util.isAnnotationClass
import org.jetbrains.kotlin.ir.util.parentClassOrNull

Response:
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames
import org.jetbrains.kotlin.name.StandardClassIds
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource<|endoftext|>


Prompt:
fun Array<String>.test3Nested(): Array<String> {
    fun local(): Array<String> {
        fun local2(): Array<String> {
            return this@test3Nested
        }
        return local2()
    }
    return local()
}

fun Array<String>.test4() : Array<String> {
    return object {
                fun run() : Array<String> {

Response:
return this@test4
                }
            }.run()
}

fun Array<String>.test4Nested() : Array<String> {
    return object {
        fun run() : Array<String> {
            return object {
                fun run() : Array<String> {
                    return this@test4Nested
                }
            }.run()
        }
    }.run()
}<|endoftext|>


Prompt:
0x0UL,     0x3da5fd7fe1796495UL,     0x3da5fd7fe1796495UL,     0x0UL,
            0x0UL,     0x0UL,     0x0UL,     0x0UL,

Response:
0x3da5fd7fe1796495UL,     0x3da5fd7fe1796495UL,     0x0UL,     0x0UL,
            0x0UL,     0x0UL,     0x3ff0000000000000UL,     0x3ff000000000afecUL,<|endoftext|>


Prompt:
public inline fun Int.toBigInteger(): BigInteger = BigInteger.valueOf(this.toLong())

/**
 * Returns the value of this [Long] number as a [BigInteger].
 */
@SinceKotlin("1.2")
@kotlin.internal.InlineOnly
public inline fun Long.toBigInteger(): BigInteger = BigInteger.valueOf(this)

/**

Response:
* Returns the value of this [BigInteger] number as a [BigDecimal].
 */
@SinceKotlin("1.2")
@kotlin.internal.InlineOnly
public inline fun BigInteger.toBigDecimal(): BigDecimal = BigDecimal(this)

/**
 * Returns the value of this [BigInteger] number as a [BigDecimal]<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>a.x<!>.funNullableAny()
    }
}

/*
 * TESTCASE NUMBER: 29
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28785
 */
fun case_29(a: Inv<in Nothing>) {

Response:
if (a.x != null) {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>a.x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>a.x<!>.equals(null)<|endoftext|>


Prompt:
*   to fix the KT-65218, which provoked by different stdlib declarations order in CLI compilation mode and AA mode (see
         *   the issue for more details)
         */
        if (
            (applicability == currentApplicability && group == bestGroup) ||

Response:
(currentApplicability == INAPPLICABLE_ARGUMENTS_MAPPING_ERROR && applicability == INAPPLICABLE_WRONG_RECEIVER)
        ) {
            candidates.add(candidate)
        }

        return applicability
    }

    fun bestCandidates(): List<Candidate> = candidates

    open fun shouldStopAtTheGroup(group: TowerGroup): Boolean =<|endoftext|>


Prompt:
if (f < 8) { // Want more precision with smallest values.
                f = f shl 2
                pow -= 2
            }
            var ff = f
            while (ff and 0x00800000 == 0) {
                ff = ff shl 1
                numBits--
            }
        } else {
            // 0 < e < 255.
            // A "normalized" number.

Response:
f = f or 0x00800000
            pow = e - p
        }

        if (-59 < pow && pow < 35 || pow == -59 && !mantissaIsZero)
            longDigitGenerator(f.toLong(), pow, e == 0, mantissaIsZero, numBits)
        else<|endoftext|>


Prompt:
assertFileExists(javaClassesDir().resolve("example/SourceAnnotatedTestClassGenerated.class"))
                assertFileExists(javaClassesDir().resolve("example/BinaryAnnotatedTestClassGenerated.class"))
                assertFileExists(javaClassesDir().resolve("example/RuntimeAnnotatedTestClassGenerated.class"))
            }

Response:
javaSourcesDir().resolve("test.kt").modify {
                it.replace("@ExampleBinaryAnnotation", "")
            }

            build("build") {
                assertTasksExecuted(":kaptGenerateStubsKotlin", ":kaptKotlin", ":compileKotlin")
                assertTasksUpToDate(":compileJava")<|endoftext|>


Prompt:
partiallyAppliedSymbol as KtPartiallyAppliedVariableSymbol<KtVariableLikeSymbol>,
                    fir.unwrapLValue()?.toTypeArgumentsMapping(partiallyAppliedSymbol) ?: emptyMap(),
                    KtSimpleVariableAccess.Write(rhs)
                )
            }
            is FirPropertyAccessExpression, is FirCallableReferenceAccess -> {

Response:
@Suppress("USELESS_IS_CHECK") // K2 warning suppression, TODO: KT-62472
                require(fir is FirQualifiedAccessExpression)
                when (unsubstitutedKtSignature.symbol) {
                    is KtVariableLikeSymbol -> {
                        @Suppress("UNCHECKED_CAST") // safe because of the above check on targetKtSymbol<|endoftext|>


Prompt:
* overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 8 -> sentence 1
 * overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 5

Response:
* overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 6 -> sentence 1
 * overload-resolution, building-the-overload-candidate-set-ocs, call-with-specified-type-parameters -> paragraph 1 -> sentence 2
 * NUMBER: 5<|endoftext|>


Prompt:
// we can create element with just value, no list
            A(value=x)

            // if we add a list, it can infer the type
            A(
                value=x,
                list=listOf(234, x)
            )
        }
        """
        )
    }

    @Test
    fun testSimpleNoArgsComponent() {
        testCompile(
            """

Response:
import androidx.compose.runtime.*

        @Composable
        fun Simple() {}

        @Composable
        fun run() {
            Simple()
        }
        """
        )
    }

    @Test
    fun testDotQualifiedObjectToClass() {
        testCompile(
            """
        import androidx.compose.runtime.*

        object Obj {<|endoftext|>


Prompt:
public val Long.milliseconds: Duration get() = toDuration(DurationUnit.MILLISECONDS)

/**
 * Returns a [Duration] equal to this [Double] number of milliseconds.
 *
 * @throws IllegalArgumentException if this [Double] value is `NaN`.
 */
@SinceKotlin("1.3")
@ExperimentalTime

Response:
@Deprecated("Use 'Double.milliseconds' extension property from Duration.Companion instead.", ReplaceWith("this.milliseconds", "kotlin.time.Duration.Companion.milliseconds"))
@DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8", hiddenSince = "1.9")<|endoftext|>


Prompt:
public fun maxOf(a: UShort, b: UShort): UShort {
    return if (a >= b) a else b
}

/**
 * Returns the greater of three values.
 */
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@kotlin.internal.InlineOnly

Response:
public inline fun maxOf(a: UInt, b: UInt, c: UInt): UInt {
    return maxOf(a, maxOf(b, c))
}

/**
 * Returns the greater of three values.
 */
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@kotlin.internal.InlineOnly<|endoftext|>


Prompt:
0x3fefffffffdd3059UL,     0x3ff00000001167d3UL,     0x3ff0000000000000UL,     0x3ff0000000000000UL,
            0x3ff0000000000000UL,     0x3ff0000000000000UL,     0x3da5fd7fe1796495UL,     0x3da5fd7fe161788bUL,

Response: 0x3da5fd7fe191509fUL,     0x3eca86f0875fcf94UL,     0x3b5e392010175ee5UL,     0x3f5d22a4fa316facUL,<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1286
open class A {
    private val `.` = "A"
    private val `;` = "B"

    private fun `@`() = "C"
    private fun `#`() = "D"

    fun foo() = `.` + `;` + `@`() + `#`()
}

fun box(): String {

Response:
val x = A().foo()
    if (x != "ABCD") return "fail: $x"

    return "OK"
}<|endoftext|>


Prompt:
override fun createStubTypeForBuilderInference(typeVariable: TypeVariableMarker): StubTypeMarker {
        return StubTypeForBuilderInference(
            typeVariable.freshTypeConstructor() as NewTypeVariableConstructor,
            typeVariable.defaultType().isMarkedNullable()
        )
    }

Response:
override fun createStubTypeForTypeVariablesInSubtyping(typeVariable: TypeVariableMarker): StubTypeMarker {
        return StubTypeForTypeVariablesInSubtyping(
            typeVariable.freshTypeConstructor() as NewTypeVariableConstructor,
            typeVariable.defaultType().isMarkedNullable()
        )
    }

    override fun TypeConstructorMarker.isTypeVariable(): Boolean {<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("T? & T?!!")!>x<!>.propNullableAny
        <!DEBUG_INFO_EXPRESSION_TYPE("T? & T?!!")!>x<!>.funT()
        <!DEBUG_INFO_EXPRESSION_TYPE("T? & T?!!")!>x<!>.funAny()

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("T? & T?!!")!>x<!>.funNullableT()
        <!DEBUG_INFO_EXPRESSION_TYPE("T? & T?!!")!>x<!>.funNullableAny()
    }
}

// TESTCASE NUMBER: 18
fun <T>case_18(x: T, f: Boolean) {<|endoftext|>


Prompt:
|stderr: $stdErr
        """.trimMargin()
    )
    check(exitCode == 0) { "Compilation failed" }
    check(output.toFile().exists()) { "Compiler swiftc hasn't produced an output file: $output" }
}

fun targetSupportsMimallocAllocator(targetName: String) =

Response:
HostManager().targetByName(targetName).supportsMimallocAllocator()

fun targetSupportsLibBacktrace(targetName: String) =
    HostManager().targetByName(targetName).supportsLibBacktrace()

fun targetSupportsCoreSymbolication(targetName: String) =
    HostManager().targetByName(targetName).supportsCoreSymbolication()<|endoftext|>


Prompt:
package org.jetbrains.kotlin.analysis.api.renderer.declarations.bodies

import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.symbols.*
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithMembers

Response:
public interface KtRendererBodyMemberScopeProvider {
    public fun getMemberScope(analysisSession: KtAnalysisSession, symbol: KtSymbolWithMembers): List<KtDeclarationSymbol>

    public object ALL : KtRendererBodyMemberScopeProvider {
        override fun getMemberScope(analysisSession: KtAnalysisSession, symbol: KtSymbolWithMembers): List<KtDeclarationSymbol> {<|endoftext|>


Prompt:
true as java.lang.Boolean, '#' as java.lang.Character,
        3.toByte() as java.lang.Byte, 10.toShort() as java.lang.Short,
        -300 as java.lang.Integer, -5.0f as java.lang.Float,
        10L as java.lang.Long, 3.14 as java.lang.Double,

Response:
true as java.lang.Boolean, '#' as java.lang.Character,
        3.toByte() as java.lang.Byte, 10.toShort() as java.lang.Short,
        -300 as java.lang.Integer, -5.0f as java.lang.Float,
        10L as java.lang.Long, 3.14 as java.lang.Double
    )<|endoftext|>


Prompt:
if (virtualFile != null && virtualFile.extension == BuiltInSerializerProtocol.BUILTINS_FILE_EXTENSION) {
            return builtinsModule
        }

        computeSpecialModule(containingFile)?.let { return it }

        if (virtualFile == null) {
            throw KotlinExceptionWithAttachments("Cannot find a KtModule for a non-physical file")

Response:
.withPsiAttachment("containingFile", containingFile)
                .withAttachment("contextualModule", contextualModule?.asDebugString())
        }

        return allKtModules.firstOrNull { module -> virtualFile in module.contentScope }
            ?: throw KotlinExceptionWithAttachments("Cannot find a KtModule for the VirtualFile")
                .withPsiAttachment("containingFile", containingFile)<|endoftext|>


Prompt:
* the returned value is an angle in the range from `-PI/2` to `PI/2` radians.
 *
 * Special cases:
 *    - `asin(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`
 */
@SinceKotlin("1.2")
public expect fun asin(x: Float): Float

/**

Response:
* Computes the arc cosine of the value [x];
 * the returned value is an angle in the range from `0.0` to `PI` radians.
 *
 * Special cases:
 *    - `acos(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`
 */
@SinceKotlin("1.2")<|endoftext|>


Prompt:
sealed class KtDiagnosticWithParameters3<A, B, C> : KtDiagnostic(), DiagnosticWithParameters3Marker<A, B, C> {
    abstract override val a: A
    abstract override val b: B
    abstract override val c: C
    abstract override val factory: KtDiagnosticFactory3<A, B, C>
}

Response:
sealed class KtDiagnosticWithParameters4<A, B, C, D> : KtDiagnostic(), DiagnosticWithParameters4Marker<A, B, C, D> {
    abstract override val a: A
    abstract override val b: B
    abstract override val c: C
    abstract override val d: D<|endoftext|>


Prompt:
error("Debug metadata version mismatch. Expected: $expected, got $actual. Please update the Kotlin standard library.")
    }
}

/**
 * Returns an array of spilled variable names and continuation's field names where the variable has been spilled.
 * The structure is the following:
 * - field names take 2*k'th indices
 * - corresponding variable names take (2*k + 1)'th indices.
 *

Response:
* The function is for debugger to use, thus it returns simplest data type possible.
 * This function should only be called on suspended coroutines to get accurate mapping.
 *
 * The result is `null` when debug metadata is not available.
 */
@SinceKotlin("1.3")
@JvmName("getSpilledVariableFieldMapping")<|endoftext|>


Prompt:
override fun f(b: B): B = b
}

public interface I3<B> : I4<B>

public expect interface I4<B> {
    public fun f(b: B): B
}

fun box() = X().f("O") + Y<String>().f("K")

// MODULE: platform()()(common)
// FILE: platform.kt

Response:
public actual interface I2 {
    public actual fun <A> f(a: A): A
}

public actual interface I4<B> {
    public actual fun f(b: B): B
}<|endoftext|>


Prompt:
isMutable = false,
            init = initITableGlobal
        )
        context.defineGlobalClassITable(klass.symbol, wasmClassIFaceGlobal)
    }

    override fun visitClass(declaration: IrClass) {
        if (declaration.isExternal) return
        val symbol = declaration.symbol

        // Handle arrays

Response:
declaration.getWasmArrayAnnotation()?.let { wasmArrayAnnotation ->
            val nameStr = declaration.fqNameWhenAvailable.toString()
            val wasmArrayDeclaration = WasmArrayDeclaration(
                nameStr,
                WasmStructFieldDeclaration(
                    name = "field",
                    type = context.transformFieldType(wasmArrayAnnotation.type),
                    isMutable = true<|endoftext|>


Prompt:
LookupSymbol(name = "changedProperty", scope = "com.example.SubClassOfChangedSuperClass"),
                LookupSymbol(name = "changedProperty", scope = "com.example.SubSubClassOfChangedSuperClass"),
                LookupSymbol(name = "changedFunction", scope = "com.example.ChangedSuperClass"),

Response:
LookupSymbol(name = "changedFunction", scope = "com.example.SubClassOfChangedSuperClass"),
                LookupSymbol(name = "changedFunction", scope = "com.example.SubSubClassOfChangedSuperClass"),
                LookupSymbol(name = SAM_LOOKUP_NAME.asString(), scope = "com.example.ChangedSuperClass"),<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.CannotInferParameterType

internal class NoTailCallsFoundImpl(
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,

Response:
) : KtAbstractFirDiagnostic<KtNamedFunction>(firDiagnostic, token), KtFirDiagnostic.NoTailCallsFound

internal class TailrecOnVirtualMemberErrorImpl(
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,<|endoftext|>


Prompt:
internal fun consumerApiUsage(target: KotlinTarget): Usage =
        consumerApiUsage(target.project, target.platformType)

    internal fun consumerRuntimeUsage(project: Project, platformType: KotlinPlatformType) = project.usageByName(
        when (platformType) {
            in jvmPlatformTypes -> JAVA_RUNTIME
            else -> KOTLIN_RUNTIME
        }

Response:
)

    internal fun consumerRuntimeUsage(target: KotlinTarget) = consumerRuntimeUsage(target.project, target.platformType)

    internal fun producerApiUsage(project: Project, platformType: KotlinPlatformType) = project.usageByName(
        when (platformType) {
            in jvmPlatformTypes -> "java-api-jars"
            else -> KOTLIN_API
        }
    )<|endoftext|>


Prompt:
@JvmField
        val EMPTY: TypeSubstitution = object : TypeSubstitution() {
            override fun get(key: KotlinType): Nothing? = null
            override fun isEmpty() = true
            override fun toString() = "Empty TypeSubstitution"
        }
    }

    abstract operator fun get(key: KotlinType): TypeProjection?

Response:
// This can be used to perform preliminary manipulations with top-level types
    open fun prepareTopLevelType(topLevelType: KotlinType, position: Variance): KotlinType = topLevelType

    open fun isEmpty(): Boolean = false

    open fun approximateCapturedTypes(): Boolean = false
    open fun approximateContravariantCapturedTypes(): Boolean = false<|endoftext|>


Prompt:
require(y is String)
        x.length
        y += ""
    } while (i < 10)
}

fun test21(i: Int) {
    val x: Any? = materialize()
    var y = x
    do {
        require(y is Int)
        x.inc()
        y++
    } while (i < 10)
}

//With bounds: assignment before smartcast

Response:
fun test22(i: Int) {
    val x: Any? = materialize()
    var y = x
    do {
        require(y is String)
        y = ""
        x.<!UNRESOLVED_REFERENCE!>length<!>
    } while (i < 10)
}

fun test23(i: Int) {
    val x: Any? = materialize()<|endoftext|>


Prompt:
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: STDLIB_ASSERT
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: JS

Response:
// See related issue: https://youtrack.jetbrains.com/issue/KT-59059/Native-Assert-does-not-evaluate-argument-value-when-disabled
// ASSERTIONS_MODE: always-disable
// WITH_STDLIB

@file:Suppress("OPT_IN_USAGE_ERROR") // ExperimentalNativeApi is defined only in Native

fun checkTrue(): Boolean {<|endoftext|>


Prompt:
Family.TVOS -> BinaryFormat.MACH_O
    Family.OSX -> BinaryFormat.MACH_O
    Family.ANDROID -> BinaryFormat.ELF
    Family.LINUX -> BinaryFormat.ELF
    Family.MINGW -> BinaryFormat.PE_COFF
}

fun KonanTarget.pointerBits() = when (architecture) {
    Architecture.X64 -> 64

Response:
Architecture.X86 -> 32
    Architecture.ARM64 -> if (this == KonanTarget.WATCHOS_ARM64) 32 else 64
    Architecture.ARM32 -> 32
}

fun KonanTarget.supportsMimallocAllocator(): Boolean =
     when(this) {
        is KonanTarget.LINUX_X64 -> true<|endoftext|>


Prompt:
if (!(element10 !in 3.0..<1.0) != range1.contains(element10)) throw AssertionError()
}

fun testR1xE11() {
    // with possible local optimizations
    if (4.0 in 3.0..<1.0 != range1.contains(4.0)) throw AssertionError()

Response:
if (4.0 !in 3.0..<1.0 != !range1.contains(4.0)) throw AssertionError()
    if (!(4.0 in 3.0..<1.0) != !range1.contains(4.0)) throw AssertionError()<|endoftext|>


Prompt:
<!NON_EXHAUSTIVE_WHEN_ON_SEALED_CLASS!>when<!> (x) {
        is IBase.A -> ""
        null -> ""
    }
}

fun test_8(x: Boolean?) {
    when (x) {
        true -> ""
        false -> ""
    }

    when (x) {
        true -> ""

Response:
null -> ""
    }
}

// ------------------ with else ------------------

fun test_9(x: SomeEnum?) {
    when (x) {
        SomeEnum.A -> ""
        else -> ""
    }
}

fun test_10(x: Base?) {
    when (x) {
        is Base.A -> ""
        else -> ""
    }
}<|endoftext|>


Prompt:
val a: String by MyProperty2()
}

class MyProperty2<T> {}
operator fun <T> MyProperty2<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
    throw Exception("$thisRef $desc")
}

//--------------------

class A3 {
    val a: String by MyProperty3()

    class MyProperty3<T> {}

Response:
operator fun <T> MyProperty3<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
        throw Exception("$thisRef $desc")
    }
}<|endoftext|>


Prompt:
/*p:bar p:foo p:foo.E(values) p:kotlin(Array)*/E.values()
    /*p:bar p:foo p:foo.E(valueOf)*/E.valueOf("")
}

/*p:foo*/fun classifiers(
        a: /*p:bar p:foo*/A,

Response:
ab: /*p:bar p:bar.A(B) p:foo p:foo.A(B)*/A.B,
        ac: /*p:bar p:bar.A(C) p:foo p:foo.A(C)*/A.C,<|endoftext|>


Prompt:
kotlinCompileTask: TaskProvider<out KotlinJvmCompile>,
            config: Property<Boolean>.() -> Unit
        ) {
            project.whenKaptEnabled {
                val kaptGenerateStubsTaskName = getKaptTaskName(kotlinCompileTask.name, KAPT_GENERATE_STUBS_PREFIX)

Response:
project.tasks.withType<KaptGenerateStubsTask>().configureEach { task ->
                    if (task.name == kaptGenerateStubsTaskName) {
                        config(task.useModuleDetection)
                    }
                }
            }
        }
    }
}<|endoftext|>


Prompt:
// LANGUAGE: -ProhibitSimplificationOfNonTrivialConstBooleanExpressions
fun x(): Boolean { return true }

public fun foo(p: String?): Int {
    // Like whileTrue but 2 == 2 is in use
    while(<!NON_TRIVIAL_BOOLEAN_CONSTANT!>2 == 2<!>) {
        p!!.length
        if (x()) break

Response:
}
    // Smart cast should not work in this case, see KT-6284
    return p<!UNSAFE_CALL!>.<!>length
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.providers.impl.util.mergeInto
import org.jetbrains.kotlin.analysis.utils.errors.withKtModuleEntry
import org.jetbrains.kotlin.assignment.plugin.AssignmentCommandLineProcessor
import org.jetbrains.kotlin.assignment.plugin.AssignmentConfigurationKeys

Response:
import org.jetbrains.kotlin.assignment.plugin.k2.FirAssignmentPluginExtensionRegistrar
import org.jetbrains.kotlin.cli.plugins.processCompilerPluginsOptions
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM_IR
// LANGUAGE: +MultiPlatformProjects
// FULL_JDK
// ISSUE: KT-63574

// MODULE: commonJvm
// FILE: common.kt
import java.nio.ByteOrder

fun foo(): String = ByteOrder.LITTLE_ENDIAN.toString()

// MODULE: platformJvm()()(commonJvm)

Response:
// FILE: platform.kt
import java.nio.ByteOrder

fun bar(): String = ByteOrder.LITTLE_ENDIAN.toString()

fun box(): String {
    val expected = "LITTLE_ENDIAN"
    if (foo() != expected) return "Fail 1"
    if (bar() != expected) return "Fail 2"
    return "OK"
}<|endoftext|>


Prompt: xBar3$iv:int=3:int, $i$f$bar:int=0:int, xBaz1\1$iv:int=100:int, xBaz2\1$iv:int=101:int, xBaz3\1$iv:int=102:int, $i$f$baz\1\14:int=0:int,

Response: $i$f$x1\2\76:int=0:int<|endoftext|>


Prompt:
v.pop() // -> arr, length, (index + 1)
        v.goTo(nextLoopIteration)

        v.visitLabel(loopIsOver)
        v.pop2() // -> arr
        v.pop()
    }

    override fun readValue(v: InstructionAdapter) {

Response:
v.invokevirtual(PARCEL_TYPE.internalName, "readInt", "()I", false) // -> length
        v.dup() // -> length, length
        v.newarray(elementSerializer.asmType) // -> length, arr
        v.swap() // -> arr, length
        v.aconst(0) // -> arr, length, index

        val nextLoopIteration = Label()<|endoftext|>


Prompt:
is KmClassifier.TypeAlias -> t.typeAliasName = getClassName(cls.name)
        is KmClassifier.TypeParameter -> t.typeParameter = cls.id
    }
    kmType.arguments.forEach { argument ->
        t.addArgument(writeTypeProjection(argument))
    }

Response:
kmType.abbreviatedType?.let { t.abbreviatedType = writeType(it).build() }
    kmType.outerType?.let { t.outerType = writeType(it).build() }
    kmType.flexibleTypeUpperBound?.let { fub ->
        val fubType = writeType(fub.type)<|endoftext|>


Prompt:
* Returns the value of this duration expressed as a [Long] number of nanoseconds.
     *
     * If the value doesn't fit in the range of [Long] type, it is coerced into that range, see the conversion [Double.toLong] for details.
     *
     * The range of durations that can be expressed as a `Long` number of nanoseconds is approximately ±292 years.
     */

Response:
@ExperimentalTime
    @Deprecated("Use inWholeNanoseconds property instead.", ReplaceWith("this.inWholeNanoseconds"))
    @DeprecatedSinceKotlin(warningSince = "1.5", errorSince = "1.8", hiddenSince = "1.9")
    public fun toLongNanoseconds(): Long = inWholeNanoseconds

    /**<|endoftext|>


Prompt:
// Auto-generated by GenerateSteppedRangesCodegenTestData. Do not edit!
// WITH_STDLIB
import kotlin.test.*

fun box(): String {
    val intList = mutableListOf<Int>()
    for (i in ((1..8).reversed() step 2).reversed()) {
        intList += i
    }

Response:
assertEquals(listOf(2, 4, 6, 8), intList)

    val longList = mutableListOf<Long>()
    for (i in ((1L..8L).reversed() step 2L).reversed()) {
        longList += i
    }
    assertEquals(listOf(2L, 4L, 6L, 8L), longList)<|endoftext|>


Prompt:
protected abstract val typesCreatorImpl: KtTypeCreator

    internal val substitutorProvider: KtSubstitutorProvider get() = substitutorProviderImpl
    protected abstract val substitutorProviderImpl: KtSubstitutorProvider

    @KtAnalysisNonPublicApi
    internal val dataFlowInfoProvider: KtDataFlowInfoProvider get() = dataFlowInfoProviderImpl
    @KtAnalysisNonPublicApi

Response:
protected abstract val dataFlowInfoProviderImpl: KtDataFlowInfoProvider

    internal val klibSourceFileProvider: KtKlibSourceFileNameProvider get() = klibSourceFileProviderImpl
    protected abstract val klibSourceFileProviderImpl: KtKlibSourceFileNameProvider
}

public fun KtAnalysisSession.getModule(element: PsiElement): KtModule {<|endoftext|>


Prompt:
// IGNORE_FE10
// KT-64503

// MODULE: lib
// MODULE_KIND: LibraryBinary
// FILE: Lib.kt
interface KotlinForDelegationInterface {
    fun justFun()
}

open class KotlinAbsImplKtInterface(val delegate: KotlinForDelegationInterface) : KotlinForDelegationInterface by delegate

// MODULE: main(lib)

Response:
// FILE: usage.kt
class UseLibDelegate(private val b: KotlinForDelegationInterface) : KotlinAbsImplKtInterface(b)<|endoftext|>


Prompt:
}
    return name
}

internal class LocationInfo(val scope: DIScopeOpaqueRef,
                            val line: Int,
                            val column: Int,
                            val inlinedAt: LocationInfo? = null)

internal fun NativeGenerationState.generateRuntimeConstantsModule() : LLVMModuleRef {
    val llvmModule = LLVMModuleCreateWithNameInContext("constants", llvmContext)!!

Response:
LLVMSetDataLayout(llvmModule, runtime.dataLayout)
    val static = StaticData(llvmModule, llvm)

    fun setRuntimeConstGlobal(name: String, value: ConstValue) {
        val global = static.placeGlobal(name, value)
        global.setConstant(true)
        global.setLinkage(LLVMLinkage.LLVMExternalLinkage)
    }<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & DeepObject.A.B.C.D.E.F.G.J")!>a<!>.propNullableT

Response: <!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & DeepObject.A.B.C.D.E.F.G.J")!>a<!>.propNullableAny<|endoftext|>


Prompt:
is FirQualifiedAccessExpression -> qualifiedAccess.calleeReference.symbol?.let { it.fir as? FirProperty }?.getter
            is FirVariableAssignment -> qualifiedAccess.calleeReference?.symbol?.let { it.fir as? FirProperty }?.setter
            else -> null
        } ?: return

Response:
if (callee.symbol.callableId == StandardClassIds.Callables.not) {
            // Special hardcoded contract for Boolean.not():
            //   returns(true) implies (this == false)
            //   returns(false) implies (this == true)
            return exitBooleanNot(flow, qualifiedAccess as FirFunctionCall)
        }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.platform.isWasm

@PhaseDescription(
    name = "ConstEvaluationLowering",
    description = "Evaluate functions that are marked as `IntrinsicConstEvaluation`"
)
class ConstEvaluationLowering(
    val context: CommonBackendContext,

Response:
private val suppressErrors: Boolean = context.configuration.getBoolean(CommonConfigurationKeys.IGNORE_CONST_OPTIMIZATION_ERRORS),
    configuration: IrInterpreterConfiguration = IrInterpreterConfiguration(printOnlyExceptionMessage = true),
) : FileLoweringPass {
    private val interpreter = IrInterpreter(IrInterpreterEnvironment(context.irBuiltIns, configuration), emptyMap())<|endoftext|>


Prompt:
val DOCUMENT_FRAGMENT_NODE: Short
        val NOTATION_NODE: Short
        val DOCUMENT_POSITION_DISCONNECTED: Short
        val DOCUMENT_POSITION_PRECEDING: Short
        val DOCUMENT_POSITION_FOLLOWING: Short
        val DOCUMENT_POSITION_CONTAINS: Short

Response:
val DOCUMENT_POSITION_CONTAINED_BY: Short
        val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short
    }
}

/**
 * Exposes the JavaScript [SVGSymbolElement](https://developer.mozilla.org/en/docs/Web/API/SVGSymbolElement) to Kotlin
 */<|endoftext|>


Prompt:
predefinedOrigin: IrDeclarationOrigin?,
        isLocal: Boolean,
        fakeOverrideOwnerLookupTag: ConeClassLikeLookupTag?,
        allowLazyDeclarationsCreation: Boolean
    ): IrSimpleFunction = convertCatching(function) {
        val simpleFunction = function as? FirSimpleFunction
        val isLambda = function is FirAnonymousFunction && function.isLambda
        val updatedOrigin = when {

Response:
isLambda -> IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA
            function.symbol.callableId.isKFunctionInvoke() -> IrDeclarationOrigin.FAKE_OVERRIDE
            !predefinedOrigin.isExternal && // we should preserve origin for external enums
                    simpleFunction?.isStatic == true &&<|endoftext|>


Prompt:
fun collectPackageFragments(fqName: FqName, packageFragments: MutableCollection<PackageFragmentDescriptor>)
    fun isEmpty(fqName: FqName): Boolean
}

fun PackageFragmentProvider.packageFragments(fqName: FqName): List<PackageFragmentDescriptor> {
    val packageFragments = mutableListOf<PackageFragmentDescriptor>()

Response:
collectPackageFragmentsOptimizedIfPossible(fqName, packageFragments)
    return packageFragments
}

fun PackageFragmentProvider.isEmpty(fqName: FqName): Boolean {
    return when (this) {
        is PackageFragmentProviderOptimized -> isEmpty(fqName)
        else -> packageFragments(fqName).isEmpty()
    }
}<|endoftext|>


Prompt:
klass.addFunction("invoke", returnType.defaultType, Modality.ABSTRACT, isSuspend = isSuspend).apply {
                for (i in 1..n) {
                    addValueParameter("p$i", klass.typeParameters[i - 1].defaultType)
                }
            }
        }

    fun getJvmFunctionClass(parameterCount: Int): IrClassSymbol =

Response:
jvmFunctionClasses(parameterCount)

    private val jvmSuspendFunctionClasses = storageManager.createMemoizedFunction { n: Int ->
        createFunctionClass(n, true)
    }

    fun getJvmSuspendFunctionClass(parameterCount: Int): IrClassSymbol =
        jvmSuspendFunctionClasses(parameterCount)<|endoftext|>


Prompt:
* where the first value is the key and the second is the value.
 *
 * The resulting [SortedMap] determines the equality and order of keys according to their natural sorting order.
 *
 * @sample samples.collections.Maps.Instantiation.sortedMapFromPairs
 */

Response:
public fun <K : Comparable<K>, V> sortedMapOf(vararg pairs: Pair<K, V>): SortedMap<K, V> =
    TreeMap<K, V>().apply { putAll(pairs) }

/**
 * Returns a new [SortedMap] with the specified contents, given as a list of pairs
 * where the first value is the key and the second is the value.
 *<|endoftext|>


Prompt:
@get:Optional
    @get:Input
    val packageName: String? get() = settings.packageName

    @get:Input
    val compilerOpts: List<String> get() = settings.compilerOpts

    @get:Input
    val linkerOpts: List<String> get() = settings.linkerOpts

    @get:IgnoreEmptyDirectories
    @get:InputFiles

Response:
@get:NormalizeLineEndings
    @get:PathSensitive(PathSensitivity.RELATIVE)
    val headers: FileCollection get() = settings.headers

    @get:IgnoreEmptyDirectories
    @get:InputFiles
    @get:PathSensitive(PathSensitivity.RELATIVE)<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses

inline class Z(val x: Int)

@JvmOverloads
fun testTopLevelFunction1(z: Z, x: Int = 0) {}

@JvmOverloads

Response:
fun testTopLevelFunction2(x: Int, z: Z = Z(0)) {}

@JvmOverloads
fun testTopLevelFunction3(x: Int = 0): Z = Z(x)

class C {
    @JvmOverloads
    constructor(i: Int, z: Z = Z(0))

    @JvmOverloads<|endoftext|>


Prompt:
} else {
            val (lower, upper) = approximateProjection(typeArgument)
            lowerBoundArguments.add(lower)
            upperBoundArguments.add(upper)
        }
    }
    val lowerBoundIsTrivial = lowerBoundArguments.any { !it.isConsistent }
    return ApproximationBounds(

Response:
if (lowerBoundIsTrivial) type.builtIns.nothingType else type.replaceTypeArguments(lowerBoundArguments),
        type.replaceTypeArguments(upperBoundArguments)
    )
}

private fun KotlinType.replaceTypeArguments(newTypeArguments: List<TypeArgument>): KotlinType {<|endoftext|>


Prompt:
if (value_3.compareTo(0.000) != 0 || value_3.compareTo(0.000) != 0) return null
    if (value_4.compareTo(0.0000) != 0 || value_4.compareTo(0.0) != 0) return null

Response:
if (value_5.compareTo(00.0) != 0 || value_5.compareTo(0.0) != 0) return null
    if (value_6.compareTo(000.000) != 0 || value_6.compareTo(0.0) != 0) return null<|endoftext|>


Prompt:
DoubleArray(size) { it.toDouble() }.runningFoldIndexed("+") { index, acc, e -> "$acc[$index: ${'a' + e.toInt()}]" }
            )
            assertEquals(

Response:
expected.map { it.map { c -> if (c.isAsciiLetter()) c.code % 2 != 0 else c }.joinToString(separator = "") },
                BooleanArray(size) { it % 2 == 0 }.runningFoldIndexed("+") { index, acc, e -> "$acc[$index: $e]" }
            )
        }
    }

    @Test<|endoftext|>


Prompt:
for (typeParameter in descriptor.declaredTypeParameters) {
                    checkTypeParameter(typeParameter)
                }

                val wrongDeclaration: String? = when (descriptor.kind) {
                    ANNOTATION_CLASS -> "annotation class"
                    CLASS -> when {
                        descriptor.isInsideInterface -> "nested class inside exported interface"

Response:
descriptor.isInlineClass() -> "${if (descriptor.isInline) "inline " else ""}${if (descriptor.isValue) "value " else ""}class"
                        else -> null
                    }
                    else -> if (descriptor.isInsideInterface && (!allowCompanionInInterface || !descriptor.isCompanionObject)) {<|endoftext|>


Prompt:
return C.MyWithL<R, S>()
    }
}

// FILE: repro/Repro.kt

package repro

import lib.R
import lib.a.C
import lib.Ke
import lib.Pr
import lib.En

abstract class Repro {
    abstract fun <T> f(r: R<T>): T

Response:
abstract fun <P : Pr, E : En<P>> g(p: P): R.FMR<E, E>
    private fun isTableValid(c: Class<En<Pr>>, key: Pr, b: Boolean) {
        if (b) {
            f(g(key))
        } else {
            f(C.from(c).withL(1))
        }
    }
}<|endoftext|>


Prompt:
yield(arg)
        }
        checkExactType<Buildee<() -> Unit>>(buildee)
    }

    fun testLiterals() {
        fun test1() {
            val buildee = build {
                yield { -> }
            }
            checkExactType<Buildee<() -> Unit>>(buildee)
        }
        fun test2() {

Response:
val buildee = build {
                yield(fun() {})
            }
            checkExactType<Buildee<() -> Unit>>(buildee)
        }
        fun test3() {
            val buildee = build {
                yield {}
            }
            checkExactType<Buildee<() -> Unit>>(buildee)
        }

        test1()
        test2()<|endoftext|>


Prompt:
additionalImports(emptyArgumentListType)
        }

        builder(whileLoop) {
            parents += loopBuilder
            defaultNull("label")
        }

        builder(doWhileLoop) {
            parents += loopBuilder
            defaultNull("label")
        }

        builder(errorExpression) {
            defaultNull("expression")
        }

        builder(errorLoop) {

Response:
defaultNull("label")
        }

        builder(delegatedConstructorCall, type = "FirDelegatedConstructorCallImpl") {
            parents += callBuilder
            default("argumentList") {
                value = "FirEmptyArgumentList"
            }
            defaultNull("dispatchReceiver")
            additionalImports(emptyArgumentListType)
        }<|endoftext|>


Prompt:
@file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("SequencesKt")

package kotlin.sequences

//
// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//

Response:
import kotlin.contracts.*
import kotlin.random.*

/**
 * Returns `true` if [element] is found in the sequence.
 *
 * The operation is _terminal_.
 */
public operator fun <@kotlin.internal.OnlyInputTypes T> Sequence<T>.contains(element: T): Boolean {
    return indexOf(element) >= 0
}

/**<|endoftext|>


Prompt:
if (context is JsIrBackendContext && declaration.isExported(context)) {
                    context.additionalExportedDeclarations.add(declaration)
                }
                var extractedUnder = declaration
                var newContainer = declaration.parent
                while (newContainer is IrDeclaration && newContainer != irClass.file) {
                    extractedUnder = newContainer
                    newContainer = newContainer.parent
                }

Response:
val insertBefore = irClass.file.declarations.indexOf(extractedUnder)
                if (insertBefore >= 0) {
                    irClass.file.declarations.add(insertBefore, declaration)
                } else {
                    irClass.file.declarations += declaration
                }
                declaration.parent = irClass.file
                return listOf()
            }
        }

        return null
    }
}<|endoftext|>