Prompt:
expectMinMaxOf("_" + 'a', "_" + 'a', charArrayOf('a'), { "_$it" })
        expectMinMaxOf("_" + 'a', "_" + 'b', charArrayOf('a', 'b'), { "_$it" })

Response:
expectMinMaxOf("_" + 'a', "_" + Char.MAX_VALUE, charArrayOf('a', 'b', Char.MAX_VALUE), { "_$it" })

    }

    @Test
    fun minMaxOfDouble() {
        val middle = 'b'
        val items = charArrayOf('a', 'b', Char.MAX_VALUE).apply { shuffle() }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.util.trimTrailingWhitespacesAndAddNewlineAtEOF
import java.io.File
import kotlin.test.assertEquals
import kotlin.test.fail

internal fun BuildResult.printBuildOutput() {
    println(
        """
        |Failed assertion build output:
        |#######################
        |$output

Response:
|#######################
        |
        """.trimMargin()
    )
}

internal fun String.normalizeLineEndings(): String = replace("\n", System.lineSeparator())

/*
Ideally, this would've been just KotlinTestUtils.assertEqualsToFile, throwing FileComparisonException.
Normally this is actually desired, because IDEA and TC provide special support for those exceptions with<|endoftext|>


Prompt:
val compilation = ExecutableCompilation(
            testRunSettings,
            freeCompilerArgs = testCase.freeCompilerArgs,
            sourceModules = testCase.modules,
            extras = testCase.extras,
            dependencies = emptyList(),
            expectedArtifact = expectedArtifact,
        )
        val compilationResult = compilation.result

Response:
val goldenData = rootDir.resolve("logging_invalid_error.txt")

        KotlinTestUtils.assertEqualsToFile(goldenData, compilationResult.toOutput())
    }

    private fun doBuildObjCFrameworkWithNameCollisions(rootDir: File, additionalOptions: List<String>): TestCompilationResult<out TestCompilationArtifact.ObjCFramework> {<|endoftext|>


Prompt:
const val nonConstInitializer1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>foo()<!>
const val nonConstInitializer2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1 as String<!>

Response:
const val nonConstInitializer3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.0 as String<!>
const val nonConstInitializer4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1 as Double<!><|endoftext|>


Prompt:
val z : Int
        doSmth(<!UNINITIALIZED_VARIABLE!>z<!>)
    }
}

val g = { ->
    val x: Int
    doSmth(<!UNINITIALIZED_VARIABLE!>x<!>)
}

class A {
    val a : Int = 1
      get() {

Response:
val x : Int
          doSmth(<!UNINITIALIZED_VARIABLE!>x<!>)
          return field
      }
}

fun doSmth(i: Int) = i<|endoftext|>


Prompt:
assertFailsWith<IllegalArgumentException> {
        val longProgression = 7L downTo 1L
        for (i in longProgression step 0L) {
        }
    }

    assertFailsWith<IllegalArgumentException> {
        val charProgression = 'g' downTo 'a'
        for (i in charProgression step 0) {
        }
    }

Response:
return "OK"
}<|endoftext|>


Prompt:
getOrPut(key) { TestClass(key) }

        override fun visitElement(element: IrElement) {
            element.acceptChildrenVoid(this)
        }

        fun IrFunctionSymbol.hasAnnotation(fqName: FqName) = owner.hasAnnotation(fqName)

        /**

Response:
* Checks if [this] or any of its parent functions has the annotation with the given [testAnnotation].
         * If [this] contains the given annotation, returns [this].
         * If one of the parent functions contains the given annotation, returns the [IrFunctionSymbol] for it.
         * If the annotation isn't found or found only in interface methods, returns null.
         */<|endoftext|>


Prompt:
.appendHashCode(relativeNameSegments).also { hashCode -> _hashCode = hashCode }

    override fun hashCode(): Int = _hashCode

    override fun toString(): String = buildString {
        packageName.segments.joinTo(this, "/")
        append('/')
        relativeNameSegments.joinTo(this, ".")
    }

Response:
fun toQualifiedNameString(): String = buildString {
        packageName.segments.joinTo(this, ".")
        if (packageName.segments.isNotEmpty()) append(".")
        relativeNameSegments.joinTo(this, ".")
    }

    val isNestedEntity: Boolean get() = relativeNameSegments.size > 1<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.utils.getByType
import org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName
import org.jetbrains.kotlin.gradle.utils.property
import org.jetbrains.kotlin.tooling.core.UnsafeApi

/**
 * Run task for executing Kotlin/Jvm code.

Response:
* Shall be configured using the [KotlinJvmRunDsl]
 *
 * ### IDE carrier task:
 * This task can act as 'carrier' task for IDE run gutters:
 * It accepts configurable 'mainClass' when a Gradle property is provided as
 * `<taskName>.mainClass=...`
 *
 * e.g.
 * ```<|endoftext|>


Prompt:
/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with

Response:
*  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<|endoftext|>


Prompt:
fun generatedPlusExtensionAny(maybeStr: String?, maybeAny: Any?): String {
    return "$maybeStr$maybeAny"
}

// CHECK-LABEL: define %struct.ObjHeader* @"kfun:codegen.stringConcatenationTypeNarrowing.kt53119_plus_extension#generatedPlusExtensionString

Response:
// CHECK-OPT-NOT: kfun:kotlin.String#plus(kotlin.Any?)

// CHECK-OPT: call %struct.ObjHeader* @Kotlin_String_plusImpl
// CHECK-OPT-NOT: call %struct.ObjHeader* @Kotlin_String_plusImpl<|endoftext|>


Prompt:
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
            testClass<AbstractNativeBlackBoxTest>(
                suiteTestClassName = "NativeGCTestGenerated",
                annotations = listOf(
                    *gc(),
                    provider<UseStandardTestCaseGroupProvider>(),
                )
            ) {
                model("gc")
            }

Response:
testClass<AbstractNativeBlackBoxTest>(
                suiteTestClassName = "FirNativeGCTestGenerated",
                annotations = listOf(
                    *gc(),
                    provider<UseStandardTestCaseGroupProvider>(),
                    *frontendFir(),
                )
            ) {
                model("gc")
            }
        }
    }
}<|endoftext|>


Prompt:
override fun referenceSimpleFunctionByLocalSignature(file: IrFile, idSignature: IdSignature) : IrSimpleFunctionSymbol =
        delegate.referenceSimpleFunctionByLocalSignature(file, idSignature)

    override fun referencePropertyByLocalSignature(file: IrFile, idSignature: IdSignature): IrPropertySymbol =

Response:
delegate.referencePropertyByLocalSignature(file, idSignature)

    override fun deserializeReachableDeclarations() {
        delegate.deserializeReachableDeclarations()
    }

    private fun computeFunctionClass(className: String): IrClass {
        val isK = className[0] == 'K'<|endoftext|>


Prompt:
//   companion object
            // }
            //
            // val companionOfA = A // This standalone class reference `A` here should resolve to the companion object.
            // ```
            //
            // If this `FirResolvedQualifier` is a receiver expression of some other qualified access, the value is updated in
            // `FirCallResolver` according to the resolution result.

Response:
default("resolvedToCompanionObject", "(symbol?.fir as? FirRegularClass)?.companionObjectSymbol != null")
            additionalImports(regularClass)
        }

        impl(errorResolvedQualifier) {
            defaultFalse("resolvedToCompanionObject", withGetter = true)
            defaultClassIdFromRelativeClassName()
        }

        noImpl(userTypeRef)<|endoftext|>


Prompt:
super.setupCompilerArgs(args, defaultsOnly, ignoreClasspathResolutionErrors)
    }

    override fun createCompilerArguments(
        context: KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext
    ): K2JVMCompilerArguments = context.create<K2JVMCompilerArguments> {
        primitive { args ->

Response:
args.multiPlatform = multiPlatformEnabled.get()

            args.pluginOptions = (pluginOptions.toSingleCompilerPluginOptions() + kotlinPluginData?.orNull?.options)
                .arguments.toTypedArray()

            args.destinationAsFile = destinationDirectory.get().asFile

            args.javaPackagePrefix = javaPackagePrefix<|endoftext|>


Prompt:
Annotations.create(this + BuiltInAnnotationDescriptor(builtIns, StandardNames.FqNames.extensionFunctionType, emptyMap()))
    }

fun Annotations.withContextReceiversFunctionAnnotation(builtIns: KotlinBuiltIns, contextReceiversCount: Int) =
    if (hasAnnotation(StandardNames.FqNames.contextFunctionTypeParams)) {
        this
    } else {

Response:
Annotations.create(
            this + BuiltInAnnotationDescriptor(
                builtIns, StandardNames.FqNames.contextFunctionTypeParams, mapOf(
                    StandardNames.CONTEXT_FUNCTION_TYPE_PARAMETER_COUNT_NAME to IntValue(contextReceiversCount)
                )
            )
        )
    }<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER
// MODULE: m1-common
// FILE: common.kt
import kotlin.reflect.KProperty

fun <T> lazy(initializer: () -> T): Lazy<T> = TODO()

interface Lazy<out T> {

Response:
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO()
}

expect class OuterClass {
    class NestedClass {
        class DeepNested {
            class Another {
                fun f(s: String)
                val p: Int
                val c: Int = <!EXPECTED_PROPERTY_INITIALIZER!>1<!><|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.declarations.builder.*
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl

Response:
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty
import org.jetbrains.kotlin.fir.declarations.synthetic.buildSyntheticProperty
import org.jetbrains.kotlin.fir.declarations.utils.*
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic<|endoftext|>


Prompt:
override val directFriendDependencies: List<KtModule> = emptyList(),
    override val platform: TargetPlatform = JvmPlatforms.defaultJvmPlatform,
    override val file: PsiFile? = null,
    override val moduleDescription: String,
    override val project: Project,
) : KtNotUnderContentRootModule, KtModuleWithPlatform {

Response:
override val transitiveDependsOnDependencies: List<KtModule> by lazy { computeTransitiveDependsOnDependencies(directDependsOnDependencies) }
    override val analyzerServices: PlatformDependentAnalyzerServices = super.analyzerServices

    override val contentScope: GlobalSearchScope =<|endoftext|>


Prompt:
@kotlin.internal.InlineOnly
    public final inline fun floorDiv(other: kotlin.UByte): kotlin.UInt

    @kotlin.internal.InlineOnly
    public final inline fun floorDiv(other: kotlin.UInt): kotlin.UInt

    @kotlin.internal.InlineOnly

Response:
public final inline fun floorDiv(other: kotlin.ULong): kotlin.ULong

    @kotlin.internal.InlineOnly
    public final inline fun floorDiv(other: kotlin.UShort): kotlin.UInt

    public open override fun hashCode(): kotlin.Int

    @kotlin.internal.InlineOnly<|endoftext|>


Prompt:
fun foo(a : Int = 1, b : String = "abc") {
}

fun bar(x : Int = 1, y : Int = 1, z : String) {
}

fun test() {
    foo()
    foo(2)
    foo(<!TYPE_MISMATCH!>""<!>)
    foo(b = "")
    foo(1, "")
    foo(a = 2)

Response:
foo(1, "", <!TOO_MANY_ARGUMENTS!>""<!>)

    bar(z = "")
    bar<!NO_VALUE_FOR_PARAMETER!>()<!>
    bar(<!NO_VALUE_FOR_PARAMETER!><!TYPE_MISMATCH!>""<!>)<!>
    bar(1, 1, "")<|endoftext|>


Prompt:
override fun invoke() = cif()
        }
    }
    return factory()
}
// FILE: 2.kt

import test.*

fun box(): String {
    val simpleName = inf {
        javaClass.simpleName
    }()

    if (simpleName != "" ) return "fail 1: $simpleName"

    val name = inf {
        javaClass.name
    }()

Response:
if (name != "_2Kt\$box$\$inlined\$inf$2$1" ) return "fail 2: $name"

    return "OK"
}<|endoftext|>


Prompt: ExpectedData(0x392058251cf22accUL, 0x54bc9bee7cbe1767UL, 0x485820bdbe442431UL, 0x54d6120ea2972e90UL, 0xf437a0341f29b72aUL),

Response: ExpectedData(0xadf5c1e5d6419947UL, 0x80973ea532b0f310UL, 0xa471829aa9c17dd9UL, 0xc2ff3479394804abUL, 0x6bf44f8606753636UL),<|endoftext|>


Prompt:
final override fun visitCallableReferenceAccess(callableReferenceAccess: FirCallableReferenceAccess, data: Nothing?) {
        visitCallableReferenceAccess(callableReferenceAccess)
    }

    open fun visitCallableReferenceAccess(callableReferenceAccess: FirCallableReferenceAccess) {
        visitElement(callableReferenceAccess)
    }

Response:
final override fun visitThisReceiverExpression(thisReceiverExpression: FirThisReceiverExpression, data: Nothing?) {
        visitThisReceiverExpression(thisReceiverExpression)
    }

    open fun visitThisReceiverExpression(thisReceiverExpression: FirThisReceiverExpression) {
        visitElement(thisReceiverExpression)
    }<|endoftext|>


Prompt:
object O1 : SI2
    interface I1 : SI2
//    object Added : SI2
    class C2 : SI2
    object O2 : SI2
    interface I2 : SI2
}

sealed interface SI3 {
    class C1 : SI3
    object O1 : SI3
    interface I1 : SI3
//    interface Added : SI3
    class C2 : SI3

Response:
object O2 : SI3
    interface I2 : SI3
}<|endoftext|>


Prompt:
if (C().suspendInlineReturnsVCAnyNullable_Null() != null) throw IllegalStateException("C().suspendInlineReturnsVCAnyNullable_Null")

    if (C().suspendInlineReturnsVCInt_Null() != null) throw IllegalStateException("C().suspendInlineReturnsVCInt_Null")

Response:
if (C().suspendInlineReturnsVCIntNullable_Null() != null) throw IllegalStateException("C().suspendInlineReturnsVCIntNullable_Null")

    C().suspendInlineAcceptsVCString(1, VCString("OK"))
    if (result != VCString("OK")) throw IllegalStateException("C().suspendInlineAcceptsVCString")<|endoftext|>


Prompt:
contract { returns(false) implies (this@case_4_2 != null && this@case_4_2 is String) }
    return !(this@case_4_2 != null && this@case_4_2 is String)
}
fun <T> T?.case_4_3(): Boolean? {

Response:
contract { returnsNotNull() implies (this@case_4_3 != null && this@case_4_3 is String) }
    return if (this@case_4_3 != null && this@case_4_3 is String) true else null
}
fun <T> T?.case_4_4(): Boolean? {<|endoftext|>


Prompt:
if (a.x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char"), DEBUG_INFO_SMARTCAST!>a.x<!>.funAny()
    if (a.x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?")!>a.x<!>.funNullableT()

Response:
if (a.x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?")!>a.x<!>.funNullableAny()
    if (a.x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?")!>a.x<!><|endoftext|>


Prompt:
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
     */
    @SinceKotlin("1.4")
    public fun insert(index: Int, value: Boolean): StringBuilder

    /**
     * Inserts the string representation of the specified int [value] into this string builder at the specified [index] and returns this instance.
     *

Response:
* The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,
     * and then that string was inserted into this string builder at the specified [index].
     *
     * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
     */
    @SinceKotlin("1.9")<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>inv()
    }
}

/*
 * TESTCASE NUMBER: 5
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28265
 */
fun case_5(x: Int?) {

Response:
val y = object {
        val z = null
    }

    if (x == y.z == true) {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!><|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.analysis.collectors.components

import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.fir.FirElement
import org.jetbrains.kotlin.fir.FirSession

Response:
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.declarations.FirFile

class ReportCommitterDiagnosticComponent(
    session: FirSession,
    reporter: DiagnosticReporter
) : AbstractDiagnosticCollectorComponent(session, reporter) {<|endoftext|>


Prompt:
val indices = (instance as MfvcNodeWithSubnodes).subnodeIndices[it.node]!!
                Setter(it, values.slice(indices))
            }
        }
    }

    private val possibleExtraBoxUsageGenerated = mutableSetOf<IrDeclaration>()

    private val irCurrentScope
        get() = currentScope!!.irElement as IrDeclaration

Response:
private val irCurrentClass
        get() = currentClass!!.irElement as IrClass

    private fun registerPossibleExtraBoxUsage() {
        possibleExtraBoxUsageGenerated.add(irCurrentScope)
    }

    /**
     * The class is used to get replacing expression and MFVC instance if present for the given old value declaration.
     */
    private inner class ValueDeclarationRemapper {<|endoftext|>


Prompt:
// !DUMP_CFG
import kotlin.contracts.*

fun bar(x: () -> Unit) {

}

@ExperimentalContracts
fun foo(x: () -> Unit, y: () -> Unit, z: () -> Unit) {
    contract {

Response:
<!LEAKED_IN_PLACE_LAMBDA!>callsInPlace(x, InvocationKind.AT_MOST_ONCE)<!>
        <!LEAKED_IN_PLACE_LAMBDA!>callsInPlace(y, InvocationKind.AT_MOST_ONCE)<!><|endoftext|>


Prompt:
// FIR_IDENTICAL
// WITH_STDLIB
// ISSUE: KT-57543

// FILE: JavaClass.java
import kotlin.jvm.functions.Function0;

public class JavaClass {

    public static class Val<T> {
        private final Function0<T> initializer;
        public Val(Function0<T> initializer) {
            this.initializer = initializer;

Response:
}
        public final T getValue(Object instance, Object metadata) {
            return initializer.invoke();
        }
    }

    public static <T> Val<T> lazySoft(Function0<T> initializer) {
        return new Val<T>(initializer);
    }
}

// FILE: main.kt

class A(
    val c: Int? = 0,<|endoftext|>


Prompt:
return this
    }

    override fun <D> transformTypeParameters(transformer: FirTransformer<D>, data: D): FirAnonymousFunctionImpl {
        typeParameters.transformInplace(transformer, data)
        return this
    }

    override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) {
        annotations = newAnnotations.toMutableOrEmpty()
    }

Response:
override fun replaceStatus(newStatus: FirDeclarationStatus) {
        status = newStatus
    }

    override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) {
        returnTypeRef = newReturnTypeRef
    }

    override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?) {
        receiverParameter = newReceiverParameter
    }<|endoftext|>


Prompt:
// See The Java Virtual Machine Specification, section 4.7.9.1 https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.9.1
    val INVALID_CHARS = setOf('.', ';', '[', ']', '/', '<', '>', ':', '\\')

Response:
// These characters can cause problems on Windows. '?*"|' are not allowed in file names, and % leads to unexpected env var expansion.
    private val DANGEROUS_CHARS = setOf('?', '*', '"', '|', '%')

    override fun checkIdentifier(simpleNameExpression: KtSimpleNameExpression, diagnosticHolder: DiagnosticSink) {<|endoftext|>


Prompt:
}

fun box(): String {
    val b = A().B()
    if (b.test1() != "A.bar") return "test1 ${b.test1()}"
    if (b.test2() != "B.bar") return "test2 ${b.test2()}"
    if (b.test3() != "B.bar") return "test3 ${b.test3()}"

Response:
if (b.test4() != "A.bar") return "test4 ${b.test4()}"
    if (b.test5() != "B.bar") return "test5 ${b.test5()}"
    if (b.test6() != "B.bar") return "test6 ${b.test6()}"

    return "OK"
}<|endoftext|>


Prompt:
{ it.name },
            { it.valueParameters.size },
            { KonanManglerDesc.run { it.signatureString(false) } }
        )
    )

internal fun List<PackageFragmentDescriptor>.makePackagesOrderStable() =
    this.sortedBy { it.fqName.asString() }

/**

Response:
* Sort order of files. Order of declarations will be stabilized in the corresponding functions later.
 */
internal fun Map<SourceFile, MutableList<CallableMemberDescriptor>>.makeFilesOrderStable() =
    this.entries.sortedBy { it.key.name }

/**
 * Sort order of categories. Order of extensions will be stabilized in the corresponding functions later.
 */<|endoftext|>


Prompt:
"""
        }

        body(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) {
            """
            require(n >= 0) { "Requested element count $n is less than zero." }
            return takeLast((size - n).coerceAtLeast(0))
            """
        }
    }

Response:
val f_take = fn("take(n: Int)") {
        includeDefault()
        include(CharSequences, Strings, ArraysOfUnsigned)
    } builder {
        val n = "\$n"
        doc {
            """
            Returns a list containing first [n] elements.
            """
        }
        throws("IllegalArgumentException", "if [n] is negative.")<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>a.prop_4<!>.funNullableT()
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>a.prop_4<!>.funNullableAny()
        }
    }
}

// TESTCASE NUMBER: 11

Response:
fun case_11(x: TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>, y: TypealiasNullableStringIndirect) {
    val t: TypealiasNullableStringIndirect = null

    if (<!EQUALITY_NOT_APPLICABLE!>x == <!USELESS_IS_CHECK!>null is Boolean<!><!>) {<|endoftext|>


Prompt:
if (maybeCharVar != null) return "Fail (maybeCharVar initial value)"
    maybeCharVar = 'a'
    if (js("typeof maybeCharVar") != "number") return "Fail (typeof maybeCharVar after 1st modification)"
    if (maybeCharVar != 'a') return "Fail (maybeCharVar after 1st modification)"
    maybeCharVar = null

Response:
if (js("typeof maybeCharVar") != "object") return "Fail (typeof maybeCharVar after 2nd modification)"
    if (maybeCharVar != null) return "Fail (maybeCharVar after 2nd modification)"

    val a = A('b')
    if (a.foo() != 'b') return "Fail (a.foo())"<|endoftext|>


Prompt:
val result7 = (1L..100L).map { x -> 2 * x }.count { x -> x % 2 == 0L }
    val result8 = (1L..100L).map { x -> 2 * x }.filter { x -> x % 2 == 0L }.size
    assertEquals(result7, 100)
    assertEquals(result8, 100)

Response:
val result9 = (0..10).reduce { total, next -> total + next }
    val result10 = (0L..10L).reduce { total, next -> total + next }
    assertEquals(result9, 55)
    assertEquals(result10, 55L)

    return "OK"
}<|endoftext|>


Prompt: @Anno1(s = arrayOf(elements = <!ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR, TYPE_MISMATCH!>"foo"<!>))

Response:
@Anno2(i = intArrayOf(elements = *<!REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION!>intArrayOf(1)<!>))
fun f3() {}

fun foo(vararg ints: Int) {}

fun test() {<|endoftext|>


Prompt: if (w != null || <!SENSELESS_COMPARISON!>this.w != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Number?")!>this.w<!>.funNullableT()

Response: if (w != null || <!SENSELESS_COMPARISON!>this.w != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Number?")!>this.w<!>.funNullableAny()<|endoftext|>


Prompt:
// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect +ContractsOnCallsWithImplicitReceiver
// !OPT_IN: kotlin.contracts.ExperimentalContracts
// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER
//
// ISSUE: KT-28672

import kotlin.contracts.*

Response:
fun CharSequence?.isNullOrEmpty(): Boolean {
    contract {
        returns(false) implies (this@isNullOrEmpty != null)
    }

    return this == null || <!DEBUG_INFO_SMARTCAST!>this<!>.length == 0
}

fun smartcastOnReceiver(s: String?) {
    with(s) {
        if (isNullOrEmpty()) {<|endoftext|>


Prompt:
FirTypeSpecificityComparatorProvider(JsTypeSpecificityComparatorWithoutDelegate(typeContext))
        )
        register(FirPlatformDiagnosticSuppressor::class, FirJsPlatformDiagnosticSuppressor())

        if (moduleKind != null) {
            register(FirJsModuleKind::class, FirJsModuleKind(moduleKind))
        }

Response:
register(FirDefaultImportProviderHolder::class, FirDefaultImportProviderHolder(JsPlatformAnalyzerServices))
    }
}<|endoftext|>


Prompt:
if (skipMinification) +JsEnvironmentConfigurationDirectives.SKIP_MINIFICATION
            if (getBoolean("kotlin.js.ir.skipRegularMode")) +JsEnvironmentConfigurationDirectives.SKIP_REGULAR_MODE
        }

        useAdditionalSourceProviders(
            ::JsAdditionalSourceProvider,
            ::CoroutineHelpersSourceFilesProvider,
        )

Response:
forTestsNotMatching("compiler/testData/codegen/box/diagnostics/functions/tailRecursion/*") {
            defaultDirectives {
                DIAGNOSTICS with "-warnings"
            }
        }

        enableMetaInfoHandler()

        configureIrHandlersStep {
            useHandlers(::IrMangledNameAndSignatureDumpHandler)
        }<|endoftext|>


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

/*
 * TESTCASE NUMBER: 30
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-30369
 */
fun case_30(x: Class.NestedClass?) {

Response:
if (x?.prop_4 != null == true) {
        <!DEBUG_INFO_EXPRESSION_TYPE("Class.NestedClass? & Class.NestedClass")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("Class.NestedClass? & Class.NestedClass")!>x<!>.prop_4
    }
}

/*<|endoftext|>


Prompt:
override fun visitElement(element: IrElement, data: IrDeclaration?) {
        element.acceptChildren(this, data)
    }

    override fun visitDeclaration(declaration: IrDeclarationBase, data: IrDeclaration?) {
        declaration.acceptChildren(this, declaration)
    }

    override fun visitClass(declaration: IrClass, data: IrDeclaration?) {

Response:
declaration.thisReceiver?.accept(this, declaration)
        declaration.typeParameters.forEach { it.accept(this, declaration) }
        ArrayList(declaration.declarations).forEach { it.accept(this, declaration) }
    }

    override fun visitBody(body: IrBody, data: IrDeclaration?) {<|endoftext|>


Prompt:
for (e in other) min = minOf(min, e)
    return min
}

/**
 * Returns the smaller of the given values.
 *
 * If any value is `NaN`, returns `NaN`.
 */
@SinceKotlin("1.4")
public actual fun minOf(a: Float, vararg other: Float): Float {
    var min = a

Response:
for (e in other) min = minOf(min, e)
    return min
}

/**
 * Returns the smaller of the given values.
 *
 * If any value is `NaN`, returns `NaN`.
 */
@SinceKotlin("1.4")
public actual fun minOf(a: Double, vararg other: Double): Double {
    var min = a<|endoftext|>


Prompt:
class Value<T>(var value: T = null as T, var text: String? = null)

val <T> Value<T>.additionalText by DVal(Value<T>::text)

val <T> Value<T>.additionalValue by DVal(Value<T>::value)

class DVal(val kmember: Any) {
    operator fun getValue(t: Any?, p: Any) = 42

Response:
}

var recivier : Any? = "fail"
var value2 : Any? = "fail2"

var <T> T.bar : T
    get() = this
    set(value) { recivier = this; value2 = value}

val barRef = String?::bar<|endoftext|>


Prompt:
constructor(extras: Iterable<Entry<*>>) : this(extras.associateBy { it.key })

    constructor(extras: Array<out Entry<*>>) : this(extras.associateBy { it.key })

    override val keys: Set<Key<*>> = extras.keys

    override fun isEmpty(): Boolean = extras.isEmpty()

Response:
override val size: Int = extras.size

    override val entries: Set<Entry<*>> = extras.values.toSet()

    override fun <T> get(key: Key<T>): T? {
        return extras[key]?.let { it.value as T }
    }

    internal companion object {
        private const val serialVersionUID = 0L
    }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.codegen.intrinsics

import org.jetbrains.kotlin.codegen.Callable
import org.jetbrains.kotlin.codegen.CallableMethod

class StringGetChar : IntrinsicMethod() {
    override fun toCallable(method: CallableMethod): Callable =

Response:
createIntrinsicCallable(method) {
                it.invokevirtual("java/lang/String", "charAt", "(I)C", false)
            }
}<|endoftext|>


Prompt:
"IntList.filterManual" to BenchmarkEntryWithInit.create(::IntListBenchmark, { filterManual() }),
                    "IntList.countFilteredManual" to BenchmarkEntryWithInit.create(::IntListBenchmark, { countFilteredManual() }),
                    "IntList.countFiltered" to BenchmarkEntryWithInit.create(::IntListBenchmark, { countFiltered() }),

Response:
"IntList.countFilteredLocal" to BenchmarkEntryWithInit.create(::IntListBenchmark, { countFilteredLocal() }),
                    "IntList.reduce" to BenchmarkEntryWithInit.create(::IntListBenchmark, { reduce() }),
                    "IntStream.copy" to BenchmarkEntryWithInit.create(::IntStreamBenchmark, { copy() }),<|endoftext|>


Prompt:
} else if (fqName == deprecatedSinceKotlinClassId) {
                deprecatedSinceKotlin = annotation
            }

            checkAnnotationTarget(declaration, annotation, context, reporter)
        }

        if (declaration is FirCallableDeclaration) {
            val receiverParameter = declaration.receiverParameter
            if (receiverParameter != null) {

Response:
for (receiverAnnotation in receiverParameter.annotations) {
                    reportIfMfvc(context, reporter, receiverAnnotation, "receivers", receiverParameter.typeRef.coneType)
                }
            }
        }

        if (deprecatedSinceKotlin != null) {
            checkDeprecatedCalls(deprecatedSinceKotlin, deprecated, context, reporter)
        }<|endoftext|>


Prompt:
@OptIn(ExperimentalContracts::class)
inline fun buildAnonymousFunction(init: FirAnonymousFunctionBuilder.() -> Unit): FirAnonymousFunction {
    contract {
        callsInPlace(init, InvocationKind.EXACTLY_ONCE)
    }
    return FirAnonymousFunctionBuilder().apply(init).build()
}

@OptIn(ExperimentalContracts::class)

Response:
inline fun buildAnonymousFunctionCopy(original: FirAnonymousFunction, init: FirAnonymousFunctionBuilder.() -> Unit): FirAnonymousFunction {
    contract {
        callsInPlace(init, InvocationKind.EXACTLY_ONCE)
    }
    val copyBuilder = FirAnonymousFunctionBuilder()
    copyBuilder.source = original.source
    copyBuilder.resolvePhase = original.resolvePhase<|endoftext|>


Prompt:
if (test3 != "32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1") {
        return "test3 = $test3"
    }

Response:
val test4 = B(54, 217, h = 236, l = 18, q = 3216, u = 8, aa = 22, ff = 33, jj = 44, mm = 55).toString()
    val test5 = B::class.java.newInstance().toString()<|endoftext|>


Prompt:
* Returns true if the declaration is a platform-specific implementation in a multiplatform project.
     */
    public val isActual: Boolean

    /**
     * Returns true if the declaration is platform-specific declaration in a multiplatform project. An implementation
     * in platform modules is expected. Note, that in the following example:
     * ```
     * expect class A {
     *     class Nested
     * }

Response:
* ```
     * `isExpect` returns `true` for both `A` and `A.Nested`.
     */
    public val isExpect: Boolean
}<|endoftext|>


Prompt:
value class A7(<!VALUE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER!>vararg val x: Int<!>)
@JvmInline

Response:
value class A8(<!VALUE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER!><!NON_FINAL_MEMBER_IN_FINAL_CLASS!>open<!> val x: Int<!>)
@JvmInline
value class A9(final val x: Int)

class B1 {
    companion object {
        @JvmInline<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.idea.tcs.extras.sourcesClasspath
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.plugin.ide.IdeAdditionalArtifactResolver

Response:
import org.jetbrains.kotlin.gradle.plugin.ide.IdeaKotlinBinaryCapability
import org.jetbrains.kotlin.gradle.plugin.sources.internal

internal object IdeSourcesVariantsResolver : IdeAdditionalArtifactResolver {
    override fun resolve(sourceSet: KotlinSourceSet, dependencies: Set<IdeaKotlinDependency>) {<|endoftext|>


Prompt:
irStatements.filterNotNull().takeIf { it.isNotEmpty() }
                        ?: listOf(IrBlockImpl(startOffset, endOffset, irBuiltIns.unitType, null, emptyList()))
                } else {
                    emptyList()
                }
            ).also {
                with(implicitCastInserter) {
                    it.insertImplicitCasts()
                }
            }
        }

Response:
}

    private val IrStatementOrigin.isLoop: Boolean
        get() {
            return this == IrStatementOrigin.DO_WHILE_LOOP || this == IrStatementOrigin.WHILE_LOOP || this == IrStatementOrigin.FOR_LOOP
        }

    private fun extractOperationFromDynamicSetCall(functionCall: FirFunctionCall) =<|endoftext|>


Prompt:
fun main() {
    // Module java.naming
    val b: javax.naming.Binding? = null
    println(b)

    // Module java.logging
    val j: java.util.logging.Filter? = null
    println(j)

    // Module java.desktop (this module doesn't depend on it)
    val s: javax.swing.JFrame? = null

Response:
println(s)
}<|endoftext|>


Prompt:
val name = JvmAbi.getSyntheticMethodNameForAnnotatedProperty(baseName)
        val desc = if (receiver == null) "()V" else "(${mapType(receiver.type)})V"
        return Method(name, desc)
    }

    fun mapScriptSignature(script: ScriptDescriptor): JvmMethodSignature {

Response:
val sw = BothSignatureWriter(BothSignatureWriter.Mode.METHOD)

        sw.writeParametersStart()

        for (valueParameter in script.unsubstitutedPrimaryConstructor.valueParameters) {
            writeParameter(sw, valueParameter.type, null)/* callableDescriptor = */
        }

        writeVoidReturn(sw)<|endoftext|>


Prompt:
override fun printStackTrace() = original.printStackTrace()
    override fun printStackTrace(s: PrintStream?) = original.printStackTrace(s)
    override fun printStackTrace(s: PrintWriter?) = original.printStackTrace(s)
}

class TestsCompilerError(original: Throwable) : TestsError(original, TestsExceptionType.COMPILER_ERROR)

Response:
class TestsInfrastructureError(original: Throwable) : TestsError(original, TestsExceptionType.INFRASTRUCTURE_ERROR)
class TestsCompiletimeError(original: Throwable) : TestsError(original, TestsExceptionType.COMPILETIME_ERROR)
class TestsRuntimeError(original: Throwable) : TestsError(original, TestsExceptionType.RUNTIME_ERROR)<|endoftext|>


Prompt:
// !LANGUAGE: +ImproveReportingDiagnosticsOnProtectedMembersOfBaseClass

// FILE: abc/Foo.java
package abc;

public class Foo {
    public String getBar() { return ""; }
    protected void setBar(String x) {  }
    public String getFoo() { return ""; }
    private void setFoo(String x) {  }
}

Response:
// FILE: main.kt

import abc.Foo

class Data(var x: Foo)

class B : Foo() {
    fun baz(a: Foo, t: Foo, d: Data) {
        a.<!INVISIBLE_SETTER!>bar<!> = t.bar
        a.<!INVISIBLE_SETTER!>foo<!> = t.foo<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// WITH_STDLIB
// FILE: test.kt

import kotlin.test.*

class C {
    fun test() { J.s().memberExtension() }
    private fun String.memberExtension() {}
}

fun box(): String {
    assertFailsWith<NullPointerException> {
        C().test()
    }
    return "OK"

Response:
}

// FILE: J.java
public class J {
    public static String s() { return null; }
}<|endoftext|>


Prompt:
return new StaticMethod<T>(t1, t2);
    }

    public static <T> StaticMethod<T> of2(T t1) {
        return new StaticMethod<T>(t1);
    }

    private final T[] ts;

    private StaticMethod(T... ts) {
        this.ts = ts;
    }
}

// FILE: lib.kt

Response:
package my.lib

fun String.func(): Int = this.length

// FILE: test.kt
package kapt

import java.util.Collections.unmodifiableCollection
import kapt.StaticMethod.of
import kapt.StaticMethod.of2
import my.lib.func

class StaticImport {
    val x = unmodifiableCollection(listOf(""))<|endoftext|>


Prompt:
fun notSubtype(value: ESValue, type: KotlinType) = apply { notSubtypes.initAndAdd(value, type) }

    fun equal(left: ESValue, right: ESValue) = apply {
        equalValues.initAndAdd(left, right)
        equalValues.initAndAdd(right, left)
    }

Response:
fun notEqual(left: ESValue, right: ESValue) = apply {
        notEqualValues.initAndAdd(left, right)
        notEqualValues.initAndAdd(right, left)
    }

    fun fire(effect: ESEffect) = apply { firedEffects += effect }

    fun or(other: MutableContextInfo): MutableContextInfo = MutableContextInfo(<|endoftext|>


Prompt:
appendVectorSize(element.values.size)
            if (funcIndices != null) {
                funcIndices.forEach { b.writeVarUInt32(it) }
            } else {
                element.values.forEach {
                    appendExpr((it as WasmTable.Value.Expression).expr)
                }
            }
        }

        fun writeTypeOrKind() {

Response:
if (isFuncIndices) {
                b.writeByte(0x00)
            } else {
                appendType(element.type)
            }
        }

        when (val mode = element.mode) {
            WasmElement.Mode.Passive -> {
                b.writeByte(if (isFuncIndices) 0x01 else 0x05)
                writeTypeOrKind()<|endoftext|>


Prompt:
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) inline fun <reified T> TestFunctionWithReifiedTypeParameterVsConstructorCReverse(arg: Invariant<T>)<!> {}

    class TestInlineFunctionVsConstructor {

Response:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor()<!>
    }
    <!CONFLICTING_OVERLOADS!>inline fun TestInlineFunctionVsConstructor()<!> {}

    class TestInlineFunctionVsConstructorReverse {<|endoftext|>


Prompt:
return exportType(type)

        return ExportedType.ErrorType("UnknownType ${type.render()}")
    }

    fun exportTypeParameter(typeParameter: IrTypeParameter): ExportedType.TypeParameter {
        val constraint = typeParameter.superTypes.asSequence()
            .filter { it != context.irBuiltIns.anyNType }
            .map {

Response:
val exportedType = exportType(it)
                if (exportedType is ExportedType.ImplicitlyExportedType && exportedType.exportedSupertype == ExportedType.Primitive.Any) {
                    exportedType.copy(exportedSupertype = ExportedType.Primitive.Unknown)
                } else {
                    exportedType
                }
            }<|endoftext|>


Prompt:
// MODULE: m1-common
// FILE: common.kt
expect class Foo {
    class Inner()
}

expect class SeveralInner {
    class Inner1 {
        class Inner2 {
            class Inner3()
        }
    }
}

// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
class FooImpl {
    class Inner
}

Response:
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> = FooImpl

class SeveralInnerImpl {
    class Inner1 {
        class Inner2 {
            class Inner3
        }
    }
}<|endoftext|>


Prompt:
public abstract fun getAnalysisSession(useSiteKtElement: KtElement): KtAnalysisSession

    public abstract fun getAnalysisSessionByUseSiteKtModule(useSiteKtModule: KtModule): KtAnalysisSession

    public inline fun <R> analyse(
        useSiteKtElement: KtElement,
        action: KtAnalysisSession.() -> R,
    ): R {

Response:
return analyse(getAnalysisSession(useSiteKtElement), action)
    }

    public inline fun <R> analyze(
        useSiteKtModule: KtModule,
        action: KtAnalysisSession.() -> R,
    ): R {
        return analyse(getAnalysisSessionByUseSiteKtModule(useSiteKtModule), action)
    }

    public inline fun <R> analyse(<|endoftext|>


Prompt:
mainCallArguments = mainCallArguments
        )

        // Run analysis if main module is sources
        var sourceModule: ModulesStructure? = null
        val includes = arguments.includes
        if (includes == null) {
            val outputKlibPath =
                if (arguments.irProduceKlibFile) outputDir.resolve("$outputName.klib").normalize().absolutePath

Response:
else outputDirPath
            if (configuration.get(CommonConfigurationKeys.USE_FIR) == true) {
                sourceModule = processSourceModuleWithK2(environmentForJS, libraries, friendLibraries, arguments, outputKlibPath)
            } else {
                sourceModule = processSourceModule(environmentForJS, libraries, friendLibraries, arguments, outputKlibPath)<|endoftext|>


Prompt:
override var typeParameters: List<IrTypeParameter> by lazyVar(stubGenerator.lock) {
        typeTranslator.buildWithScope(this) {
            stubGenerator.symbolTable.withScope(this) {
                val classTypeParametersCount = descriptor.constructedClass.original.declaredTypeParameters.size
                val allConstructorTypeParameters = descriptor.typeParameters

Response:
allConstructorTypeParameters.subList(classTypeParametersCount, allConstructorTypeParameters.size).mapTo(ArrayList()) {
                    stubGenerator.generateOrGetTypeParameterStub(it)
                }
            }
        }
    }

    override val containerSource: DeserializedContainerSource?
        get() = (descriptor as? DescriptorWithContainerSource)?.containerSource<|endoftext|>


Prompt:
@OptIn(ExperimentalStdlibApi::class)
    override fun produceAdditionalFiles(globalDirectives: RegisteredDirectives, module: TestModule): List<TestFile> {
        if (WITH_COROUTINES !in module.directives) return emptyList()
        return buildList {
            add(File(coroutineHelpersPath).toTestFile())

Response:
if (CHECK_STATE_MACHINE in module.directives) {
                add(File(coroutineUtilPath).toTestFile())
                add(File(stateMachineCheckerPath).toTestFile())
            }
            if (CHECK_TAIL_CALL_OPTIMIZATION in module.directives) {
                add(File(tailCallOptimizationCheckerPath).toTestFile())
            }<|endoftext|>


Prompt:
import org.gradle.tooling.events.task.TaskExecutionResult
import org.gradle.tooling.events.task.TaskFailureResult
import org.gradle.tooling.events.task.TaskFinishEvent
import org.gradle.tooling.events.task.TaskSkippedResult
import org.gradle.util.GradleVersion

Response:
import org.jetbrains.kotlin.build.report.metrics.*
import org.jetbrains.kotlin.build.report.statistics.HttpReportService
import org.jetbrains.kotlin.gradle.plugin.BuildEventsListenerRegistryHolder
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion<|endoftext|>


Prompt:
package org.jetbrains.kotlin.types

import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.resolve.descriptorUtil.classId

Response:
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.storage.CacheWithNotNullValues
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.storage.StorageManager<|endoftext|>


Prompt: // library.kt:28 box: m:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=100:int, x4Var\4$iv:int=4:int, $i$f$x4\4\8:int=0:int, y4\4$iv:int=4:int

Response: // library.kt:36 box: m:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=100:int, x4Var\4$iv:int=4:int, $i$f$x4\4\8:int=0:int, y4\4$iv:int=4:int, x6Var\6$iv:int=6:int,<|endoftext|>


Prompt:
if ('2' in '1' downTo '3' != range0.contains('2')) throw AssertionError()
    if ('2' !in '1' downTo '3' != !range0.contains('2')) throw AssertionError()
    if (!('2' in '1' downTo '3') != !range0.contains('2')) throw AssertionError()

Response:
if (!('2' !in '1' downTo '3') != range0.contains('2')) throw AssertionError()
    // no local optimizations
    if (element2 in '1' downTo '3' != range0.contains(element2)) throw AssertionError()<|endoftext|>


Prompt:
* @throws IllegalArgumentException if [initialCapacity] is negative or [loadFactor] is non-positive.
     */
    public actual constructor(initialCapacity: Int, loadFactor: Float) : super(initialCapacity, loadFactor)

    /**
     * Creates a new empty [LinkedHashSet] with the specified initial capacity.
     *

Response:
* Capacity is the maximum number of elements the set is able to store in current internal data structure.
     * When the set gets full by a certain default load factor, its capacity is expanded,
     * which usually leads to rebuild of the internal data structure.
     *
     * @param initialCapacity the initial capacity of the created set.
     *   Note that the argument is just a hint for the implementation and can be ignored.
     *<|endoftext|>


Prompt:
class WeakIncompatibilityImpl {
    fun foo(differentName: String) {}
}

actual typealias <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT, NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>WeakIncompatibility<!> = WeakIncompatibilityImpl

class StrongIncompatibilityImpl {
    fun foo(p: String) {} // Different param type
}

Response: actual typealias <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT, NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>StrongIncompatibility<!> = StrongIncompatibilityImpl<|endoftext|>


Prompt:
append(" {\n")
                val orderedDeclarations =
                    if (sortDeclarations) declarationsInsideClass.sortedBy { it.text } else declarationsInsideClass
                for (declaration in orderedDeclarations) {
                    append("    ").append(declaration.annotations.joinToString("")).append(declaration.text).append("\n")
                }
                append("}")
            }
        }.toString()

Response:
override fun visitSource(source: String?, debug: String?) {
        if (source != null) {
            declarationsInsideClass.add(Declaration("// source: '$source'"))
        } else {
            declarationsInsideClass.add(Declaration("// source: null"))
        }
    }

    override fun visitPermittedSubclass(permittedSubclass: String?) {<|endoftext|>


Prompt:
val valueArguments = psi.valueArguments.map { arg ->
        val expression = arg.getArgumentExpression()!!

        val result = when {
            expression is KtCollectionLiteralExpression ->
                evaluator.evaluateToConstantArrayValue(expression.getInnerExpressions(), trace, TypeUtils.NO_EXPECTED_TYPE)

Response:
expression is KtCallExpression && expression.isArrayCall -> {
                evaluator.evaluateToConstantArrayValue(
                    expression.valueArguments.mapNotNull { it.getArgumentExpression() },
                    trace,
                    TypeUtils.NO_EXPECTED_TYPE
                )
            }<|endoftext|>


Prompt:
check(js("Number"), "Float", klass<Float>())
    check(js("Number"), "Double", klass<Double>())
    check(js("Number"), "Number", klass<Number>())

    check(js("Array"), "BooleanArray", klass<BooleanArray>())
    check(js("Uint16Array"), "CharArray", klass<CharArray>())

Response:
check(js("Int8Array"), "ByteArray", klass<ByteArray>())
    check(js("Int16Array"), "ShortArray", klass<ShortArray>())
    check(js("Int32Array"), "IntArray", klass<IntArray>())
    check(js("Array"), "LongArray", klass<LongArray>())<|endoftext|>


Prompt:
inv()
    }
}

fun poll32(flag: Boolean): Flow<String> {
    return flow {
        val inv = when (flag) { true -> ::bar3 false -> ::foo3 }
        inv()
    }
}

fun poll33(flag: Boolean): Flow<String> {
    return flow {
        val inv = when (flag) { true -> ::bar4 false -> ::foo4 }

Response:
inv()
    }
}

fun poll34(flag: Boolean): Flow<String> {
    return flow {
        val inv = when (flag) { true -> ::bar5 false -> ::foo5 }
        inv
    }
}

fun poll35(flag: Boolean): Flow<String> {
    return flow {<|endoftext|>


Prompt:
fun <F2> select(e1: F2, e: F2): F2 = e

fun main() {
    generate {
        prop.call("")
    }.length

    generate {
        id(prop).call("")
    }.length

    generate {
        prop.call("")

Response: get().<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, DEBUG_INFO_UNRESOLVED_WITH_TARGET, UNRESOLVED_REFERENCE!>length<!><|endoftext|>


Prompt:
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment
import org.jetbrains.kotlin.config.ApiVersion
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.config.LanguageVersionSettings
import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl

Response:
import java.nio.file.Path
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.io.path.isDirectory

@KtModuleBuilderDsl
public class KtSourceModuleBuilder(
    private val kotlinCoreProjectEnvironment: KotlinCoreProjectEnvironment,<|endoftext|>


Prompt: doTest("getA().x--", 1, "getA();get-A.x;set-A.x;") { getA().x-- }

Response:
doTest("++getB()[1, 2, 3]", 1, "getB();1;2;3;get-B(1, 2, 3);set-B(1, 2, 3, 1);get-B(1, 2, 3);") {
        ++getB()[logged(1), logged(2), logged(3)]
    }<|endoftext|>


Prompt:
ProtoSimpleTypeNullablity.MARKED_NULLABLE -> SimpleTypeNullability.MARKED_NULLABLE
        ProtoSimpleTypeNullablity.NOT_SPECIFIED -> SimpleTypeNullability.NOT_SPECIFIED
        ProtoSimpleTypeNullablity.DEFINITELY_NOT_NULL -> SimpleTypeNullability.DEFINITELY_NOT_NULL
    }

Response:
private fun deserializeSimpleType(proto: ProtoSimpleType): IrSimpleType {
        val symbol = deserializeIrSymbolAndRemap(proto.classifier)
            .checkSymbolType<IrClassifierSymbol>(fallbackSymbolKind = /* just the first possible option */ CLASS_SYMBOL)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.objcinterop.*
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.getClass
import org.jetbrains.kotlin.ir.types.isNothing

Response:
import org.jetbrains.kotlin.ir.types.isUnit
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid<|endoftext|>


Prompt: public inline fun <K, V, M : kotlin.collections.MutableMap<in K, kotlin.collections.MutableList<V>>> kotlin.BooleanArray.groupByTo(destination: M, keySelector: (kotlin.Boolean) -> K, valueTransform: (kotlin.Boolean) -> V): M

Response: public inline fun <K, M : kotlin.collections.MutableMap<in K, kotlin.collections.MutableList<kotlin.Byte>>> kotlin.ByteArray.groupByTo(destination: M, keySelector: (kotlin.Byte) -> K): M<|endoftext|>


Prompt:
return checkTypeSpecifics(conditions, { it.isInt() }, { it.kind == IrConstKind.Int })
    }

    private fun areConstStringComparisons(conditions: List<IrCall>): Boolean {
        return checkTypeSpecifics(
            conditions,
            { it.isString() || it.isNullableString() },

Response:
{ it.kind == IrConstKind.String || it.kind == IrConstKind.Null })
    }

    private fun checkTypeSpecifics(
        conditions: List<IrCall>,
        subjectTypePredicate: (IrType) -> Boolean,
        irConstPredicate: (IrConst<*>) -> Boolean
    ): Boolean {<|endoftext|>


Prompt:
// TESTED_OBJECTS: Introspector$test$SchemaRetriever, SchemaRetriever
// FLAGS: ACC_FINAL, ACC_PUBLIC, ACC_STATIC

// TESTED_OBJECT_KIND: innerClass
// TESTED_OBJECTS: Introspector$test$SchemaRetriever, DefaultImpls

Response: // FLAGS: ACC_FINAL, ACC_PUBLIC, ACC_STATIC<|endoftext|>


Prompt:
DefaultKotlinUsageContext(compilation, RUNTIME, target.runtimeElementsPublishedConfiguration.name),
            DefaultKotlinUsageContext(
                compilation = compilation,
                mavenScope = null,
                dependencyConfigurationName = target.sourcesElementsPublishedConfiguration.name,
                includeIntoProjectStructureMetadata = false,
                publishOnlyIf = { target.isSourcesPublishable }
            )

Response:
)
    }

    override fun getUsages(): Set<KotlinUsageContext> = _usages.filter { it.publishOnlyIf.predicate() }.toSet()
}<|endoftext|>


Prompt:
assertEquals(kclasses[Short::class], 16)
        assertEquals(kclasses[ShortArray::class], 17)
        assertEquals(kclasses[UShort::class], 18)
        assertEquals(kclasses[UShortArray::class], 19)
        assertEquals(kclasses[Byte::class], 20)
        assertEquals(kclasses[ByteArray::class], 21)

Response:
assertEquals(kclasses[UByte::class], 22)
        assertEquals(kclasses[UByteArray::class], 23)
        assertEquals(kclasses[Boolean::class], 24)
        assertEquals(kclasses[BooleanArray::class], 25)
        assertEquals(kclasses[Unit::class], 26)
        assertEquals(kclasses[Nothing::class], 27)<|endoftext|>


Prompt:
package org.jetbrains.kotlin.android.synthetic.res

import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import com.intellij.psi.SmartPsiElementPointer
import com.intellij.psi.util.CachedValue
import com.intellij.psi.util.CachedValueProvider

Response:
import com.intellij.psi.util.CachedValuesManager
import org.jetbrains.kotlin.android.synthetic.AndroidConst
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.findClassAcrossModuleDependencies<|endoftext|>


Prompt:
package org.jetbrains.kotlin.javac.wrappers.symbols

import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.javac.JavacWrapper
import org.jetbrains.kotlin.load.java.structure.JavaAnnotation

Response:
import org.jetbrains.kotlin.load.java.structure.JavaClass
import org.jetbrains.kotlin.load.java.structure.JavaMember
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import javax.lang.model.element.Element<|endoftext|>


Prompt:
fun IrContainerExpression.unwrapBlock(): IrExpression = statements.singleOrNull() as? IrExpression ?: this

/**
 * Appends the parameters in [contextParameters] to the type parameters of
 * [this] function, renaming those that may clash with a provided collection of
 * [existingParameters] (e.g. type parameters of the function itself, when
 * creating DefaultImpls).
 *

Response:
* @returns List of newly created, possibly renamed, copies of type parameters
 *     in order of the corresponding parameters in [context].
 */
private fun IrSimpleFunction.copyAndRenameConflictingTypeParametersFrom(
    contextParameters: List<IrTypeParameter>,
    existingParameters: Collection<IrTypeParameter>
): List<IrTypeParameter> {
    val newParameters = mutableListOf<IrTypeParameter>()<|endoftext|>


Prompt:
private val resolver: IdeDependencyResolver,
        val constraint: SourceSetConstraint,
        val phase: DependencyResolutionPhase,
        val priority: Priority,
    ) : IdeDependencyResolver {

        private class TimeMeasuredResult(val timeInMillis: Long, val dependencies: Set<IdeaKotlinDependency>)

Response:
override fun resolve(sourceSet: KotlinSourceSet): Set<IdeaKotlinDependency> {
            return runCatching { resolveTimed(sourceSet) }
                .onFailure { error -> reportError(sourceSet, error) }
                .onSuccess { result -> reportSuccess(sourceSet, result) }
                .onSuccess { result -> attachResolvedByExtra(result.dependencies) }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.KtSimpleNameExpression
import org.jetbrains.org.objectweb.asm.Label
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter

Response:
class InContinuousRangeOfComparableExpressionGenerator(
    operatorReference: KtSimpleNameExpression,
    private val boundedValue: BoundedValue,
    private val frameMap: FrameMap
) : InExpressionGenerator {
    private val isNotIn = operatorReference.getReferencedNameElementType() == KtTokens.NOT_IN
    private val comparisonGenerator = ObjectComparisonGenerator<|endoftext|>


Prompt:
// JVM_ABI_K1_K2_DIFF: KT-63864
// WITH_STDLIB

import kotlin.test.*

val sb = StringBuilder()

fun box(): String {

    try {
        try {
            sb.appendLine("Try")
            throw Error("Error happens")
            sb.appendLine("After throw")
        } finally {

Response:
sb.appendLine("Finally")
        }

        sb.appendLine("After nested try")

    } catch (e: Error) {
        sb.appendLine("Caught Error")
    }

    sb.appendLine("Done")

    assertEquals("""
        Try
        Finally
        Caught Error
        Done

    """.trimIndent(), sb.toString())<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM_IR
// FILE: j/J.java

package j;

public class J {
    public static final String ok() { return "OK"; }
}

// FILE: foo.kt
fun foo(a: Any) {}

// FILE: k.kt
import j.J

fun test() {
    val a = J.ok()
    foo(a)

Response:
foo(a)
}

// @KKt.class:
// 0 LDC "a"
// 0 checkExpressionValueIsNotNull
// 1 checkNotNull<|endoftext|>


Prompt:
class D <!NON_INTERNAL_PUBLISHED_API!>@kotlin.PublishedApi<!> constructor() {

    <!NON_INTERNAL_PUBLISHED_API!>@kotlin.PublishedApi<!>
    constructor(a: String) : this()

Response:
<!NON_INTERNAL_PUBLISHED_API!>@kotlin.PublishedApi<!>
    private constructor(a: String, b: String): this()

    @kotlin.PublishedApi
    internal constructor(a: String, b: String, c: String): this()
}

class InConstructor(<|endoftext|>


Prompt:
@file:Suppress("FunctionName")

package org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers

import org.gradle.api.Project
import org.gradle.api.artifacts.DependencySubstitutions
import org.gradle.api.artifacts.component.ModuleComponentSelector
import org.gradle.api.artifacts.component.ProjectComponentIdentifier

Response:
import org.gradle.api.attributes.Category
import org.gradle.api.attributes.Usage
import org.gradle.api.attributes.java.TargetJvmEnvironment
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryDependency<|endoftext|>


Prompt:
if (this["export_enum_class"].Bar.B.bar("B") !== "B") return "fail15"

    if (this["export_enum_class"].Bar.A.bay() !== "A") return "fail15"
    if (this["export_enum_class"].Bar.B.bay() !== "B") return "fail16"

Response:
if (this["export_enum_class"].Bar.B.constructor.prototype.hasOwnProperty('d')) return "fail17"
    if (this["export_enum_class"].Bar.B.constructor.prototype.hasOwnProperty('huh')) return "fail18"<|endoftext|>


Prompt:
variableDependencyProvider: TypeVariableDependencyInformationProvider,
        topLevelTypeVariables: Set<TypeVariableTypeConstructorMarker>
    ): KotlinTypeMarker? = with(resolutionTypeSystemContext) {
        val expectedType = argument.expectedType ?: return null
        val expectedTypeConstructor = expectedType.typeConstructor()

        if (expectedTypeConstructor !in notFixedTypeVariables) return null

Response:
val relatedTopLevelVariable = selectFirstRelatedVariable(topLevelTypeVariables, expectedTypeConstructor, variableDependencyProvider)
        val pathFromRelatedTopLevelVariable = if (relatedTopLevelVariable != null) {
            val constraintTypes = notFixedTypeVariables.getValue(relatedTopLevelVariable).constraints.map { it.type }.toSet()
            val containingType = constraintTypes.find { constraintType -><|endoftext|>


Prompt:
return classId.packageFqName == StandardClassIds.BASE_REFLECT_PACKAGE &&
            classId.shortClassName.identifier.startsWith("KMutableProperty")
}

fun ConeKotlinType.isKClassType(): Boolean {
    return classId == StandardClassIds.KClass
}

Response:
val FirAnonymousFunction.returnType: ConeKotlinType? get() = returnTypeRef.coneTypeSafe()
val FirAnonymousFunction.receiverType: ConeKotlinType? get() = receiverParameter?.typeRef?.coneTypeSafe()

fun ConeTypeContext.isTypeMismatchDueToNullability(
    actualType: ConeKotlinType,
    expectedType: ConeKotlinType<|endoftext|>


Prompt:
// WITH_STDLIB
// KT-55458

val arr = arrayOf("a", "b", "c", "d")

fun useAny(x: Any) {}

fun box(): String {
    val s = StringBuilder()

    for ((index: Any, x) in arr.withIndex()) {
        useAny(index)
        s.append("$index:$x;")
    }

Response:
val ss = s.toString()
    return if (ss == "0:a;1:b;2:c;3:d;") "OK" else "fail: '$ss'"
}<|endoftext|>


Prompt:
lateinit var coocoo2: Coocoo2<String>
    lateinit var coocoo21: Coocoo2<Coocoo>
    lateinit var coocoo3: Coocoo3<String>
    lateinit var coocoo31: Coocoo3<Coocoo2<Coocoo>>

    lateinit var nested: Nested2

    val m = ABC()

Response:
val n = "".toString()

    lateinit var o11: List<List<List<List<List<List<List<List<List<List<ABC>>>>>>>>>>
    lateinit var o10: List<List<List<List<List<List<List<List<List<ABC>>>>>>>>>

    lateinit var p: Calendar.Builder

    fun f1(a: ABC): BCD? {<|endoftext|>


Prompt:
package org.jetbrains.kotlin.cli.common.repl

import java.util.concurrent.locks.ReentrantReadWriteLock
import kotlin.concurrent.read
import kotlin.concurrent.write

interface ILineId : Comparable<ILineId> {
    val no: Int
    val generation: Int
}

Response:
data class ReplHistoryRecord<out T> (val id: ILineId, val item: T)

interface IReplStageHistory<T> : List<ReplHistoryRecord<T>> {

    fun peek(): ReplHistoryRecord<T>? = lock.read { lastOrNull() }

    fun push(id: ILineId, item: T)

    fun pop(): ReplHistoryRecord<T>?<|endoftext|>


Prompt:
package org.jetbrains.kotlin.gradle.utils

import org.gradle.api.logging.Logger

internal fun formatDuration(milliseconds: Long): String {
    var ms: Long = milliseconds
    var s: Long = 0
    var m: Long = 0
    var h: Long = 0

    if (ms >= 1000) {
        s = ms / 1000

Response:
ms %= 1000
        if (s >= 60) {
            m = s / 60
            s %= 60
            if (m >= 60) {
                h = m / 60
                m %= 60
            }
        }
    }

    return buildString {
        if (h > 0) append(h).append(" h ")<|endoftext|>


Prompt: kotlin.Int?, out kotlin.Short?, out kotlin.String?>?>?")!>x<!>.propNullableT

Response: <!DEBUG_INFO_EXPRESSION_TYPE("ClassWithThreeTypeParameters<out kotlin.Int?, out kotlin.Short?, ClassWithThreeTypeParameters<out kotlin.Int?, out kotlin.Short?, out kotlin.String?>?> & ClassWithThreeTypeParameters<out kotlin.Int?, out kotlin.Short?, ClassWithThreeTypeParameters<out<|endoftext|>


Prompt:
visibility = if (it.index < 0) DescriptorVisibilities.PRIVATE else JavaDescriptorVisibilities.PACKAGE_VISIBILITY
                } else null
                ParameterInfo(field, it.type, it.name, it.origin)
            }

            context.continuationClassesVarsCountByType[attributeOwnerId] = varsCountByType

Response:
val constructor = addPrimaryConstructorForLambda(suspendLambda, arity)
            val invokeToOverride = functionNClass.functions.single {
                it.owner.valueParameters.size == arity + 1 && it.owner.name.asString() == "invoke"
            }
            val createToOverride = suspendLambda.symbol.functions.singleOrNull {<|endoftext|>


Prompt:
if (test3 != "2NStr(s=null)NStr(s=null)") return "fail 3: $test3"

    val test4 = testNStr(NStr("0"))
    if (test4 != "2NStr(s=0)NStr(s=0)") return "fail 4: $test4"

    val test5 = testNStr(null)

Response:
if (test5 != "2nullnull") return "fail 5: $test5"

    return "OK"
}<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>Companion("")<!>
    }
}

// TESTCASE NUMBER: 2
class Case2() {
    companion object {
        operator fun invoke(y: Any?, x: Any?): Unit = TODO() // (1.1)

Response:
operator fun invoke(vararg x: Int): String = TODO() // (1.2)
    }

    fun case() {
        <!DEBUG_INFO_CALL("fqName: Case2.Companion.invoke; typeCall: variable&invoke")!>Companion(1, 1)<!><|endoftext|>


Prompt:
projectDisposable = _projectEnvironment.parentDisposable,
            applicationDisposable = _projectEnvironment.environment.parentDisposable,
        )
    }

    override fun initializeProjectStructure() {
        val ktTestModuleStructure = testServices.ktTestModuleStructure
        val useSiteModule = testServices.moduleStructure.modules.first()

Response:
val useSiteCompilerConfiguration = testServices.compilerConfigurationProvider.getCompilerConfiguration(useSiteModule)
        val builtinsModule = KtBuiltinsModule(
            useSiteModule.targetPlatform,
            useSiteModule.targetPlatform.getAnalyzerServices(),
            getProject()
        )

        val globalLanguageVersionSettings = useSiteModule.languageVersionSettings<|endoftext|>


Prompt:
complexInlineFun(2.0, DPoint(3.0, 5.0), a4 = DPoint(11.0, 13.0))
    }

Response: require(complexInlineFun(2.0, DPoint(3.0, 5.0), 7.0, DPoint(11.0, 13.0)) == "2.0, ${DPoint(3.0, 5.0)}, 7.0, ${DPoint(11.0, 13.0)}") {<|endoftext|>


Prompt:
inline fun <reified T : CirDeclaration> get(node: CirNodeWithLiftingUp<*, *>): T? {
        return when {
            isCommon -> node.commonDeclaration() as T?
            node.isLiftedUp -> null
            else -> node.targetDeclarations[targetIndex] as T?
        }
    }

    companion object {

Response:
fun rootContext(rootNode: CirRootNode, targetIndex: Int): CirTreeSerializationContext =
            CirTreeSerializationContext(
                targetIndex = targetIndex,
                isCommon = rootNode.indexOfCommon == targetIndex,
                typeParameterIndexOffset = 0,
                currentPath = Path.Empty
            )
    }
}

internal class ClassConsumer {<|endoftext|>


Prompt:
}

    @Anno("first generation setSomething: ${setterProperty}")
    override fun setSomething(s: @Anno("setter type ${propertyFromSetter}") String) {
        println(s)
    }
}

@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE)
annotation class Anno(val s: String)

Response:
val getterProperty = 2.let { it + 1 }
val setterProperty = 2.let { it + 1 }
val propertyFromBody = "str" + 1.toString()
val propertyFromSetter = 1.toString() + "2"

// FILE: Base.java
public class Base {
    public String getSomething() {
        return "";
    }

    public void setSomething(String s) {<|endoftext|>


Prompt:
var x: Any? = materialize()
    for (i in 1..10) {
        require(x is String)
        atLeastOnce {
            <!SMARTCAST_IMPOSSIBLE!>x<!>.length
        }
        x = materialize()
    }
}

fun test30() {
    var x: Any? = materialize()

Response:
for (i in 1..10) {
        require(x is String)
        runWithoutContract {
            <!SMARTCAST_IMPOSSIBLE!>x<!>.length
        }
        x = materialize()
    }
}

fun test31() {
    var x: Any? = materialize()
    for (i in 1..10) {
        require(x is String)<|endoftext|>


Prompt:
* Note: Kotlin language constant appears in DWARF v6, while modern linker fails to links DWARF other then [2;4],
     * that why we emit version 4 actually.
     */
    fun dwarfVersion(config: KonanConfig) = when (config.debugInfoVersion()) {
        1 -> 2

Response:
2 -> 4 /* likely the most of the future kotlin native debug info format versions will emit DWARF v4 */
        else -> TODO("unsupported debug info format version")
    }

    fun language(config: KonanConfig) = when (config.debugInfoVersion()) {
        1 -> DwarfLanguage.DW_LANG_C89.value
        else -> DwarfLanguage.DW_LANG_Kotlin.value<|endoftext|>


Prompt:
trace: BindingTrace,
        isDebuggerContext: Boolean
    ): TypeQualifierResolutionResult {
        val ownerDescriptor = if (!isDebuggerContext) scope.ownerDescriptor else null
        if (userType.qualifier == null) {
            val descriptor = userType.referenceExpression?.let { expression ->
                val classifier = scope.findClassifierAndReportDeprecationIfNeeded(

Response:
expression.getReferencedNameAsName(),
                    KotlinLookupLocation(expression),
                    expression,
                    trace
                )

                checkNotEnumEntry(classifier, trace, expression)
                storeResult(trace, expression, classifier, ownerDescriptor, position = QualifierPosition.TYPE, isQualifier = false)
                classifier
            }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.session

import org.jetbrains.kotlin.fir.NoMutableState
import org.jetbrains.kotlin.fir.resolve.BodyResolveComponents
import org.jetbrains.kotlin.fir.resolve.calls.ConeCallConflictResolverFactory

Response:
import org.jetbrains.kotlin.fir.resolve.calls.ConeCompositeConflictResolver
import org.jetbrains.kotlin.fir.resolve.calls.ConeIntegerOperatorConflictResolver
import org.jetbrains.kotlin.fir.resolve.calls.ConeOverloadConflictResolver<|endoftext|>


Prompt:
import org.jetbrains.kotlin.utils.withIndent
import java.io.File
import kotlin.reflect.KClass
import kotlin.reflect.full.createType

private const val CONVERT_ARGUMENT = "convertArgument"

object ArgumentsConverterGenerator {
    fun render(file: File, packageName: String) {

Response:
val convertArgumentFunctionCallConversion = HLFunctionCallConversion(
            "$CONVERT_ARGUMENT({0}, firSymbolBuilder)",
            callType = Any::class.createType(nullable = true)
        )
        val convertersMap = FirToKtConversionCreator.getAllConverters(convertArgumentFunctionCallConversion)<|endoftext|>


Prompt:
private fun renderSetter(accessor: PropertyAccessor.Setter): String {
        val annotations = accessor.annotations.joinToString(separator = "") { renderAnnotation(it) + " " }
        return annotations + if (accessor is PropertyAccessor.Setter.ExternalSetter) {
            "external set"
        } else {

Response:
"set(value) { ${renderPropertyAccessorBody(accessor)} }"
        }
    }

    private fun renderPropertyAccessorBody(accessor: PropertyAccessor): String = when (accessor) {
        is PropertyAccessor.Getter.SimpleGetter -> {
            when {
                accessor in propertyAccessorBridgeBodies -> propertyAccessorBridgeBodies.getValue(accessor)<|endoftext|>


Prompt:
ownerFn.origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB &&
            ownerFn.needsComposableRemapping()
        ) {
            if (symbolRemapper.getReferencedConstructor(ownerFn.symbol) == ownerFn.symbol) {
                // Not remapped yet, so remap now.

Response:
// Remap only once to avoid IdSignature clash (on k/js 1.7.20).
                symbolRemapper.visitConstructor(ownerFn)
                super.visitConstructor(ownerFn).also {
                    it.patchDeclarationParents(ownerFn.parent)
                }
            }<|endoftext|>


Prompt:
is KtClassInitializerSymbol -> {
                val outerFirClassifier = firSymbol.getContainingClassSymbol(symbolFirSession)
                if (outerFirClassifier != null) {
                    return firSymbolBuilder.buildSymbol(outerFirClassifier) as? KtDeclarationSymbol
                }
            }

            is KtValueParameterSymbol -> {

Response:
return firSymbolBuilder.callableBuilder.buildCallableSymbol(symbol.firSymbol.fir.containingFunctionSymbol)
            }

            is KtCallableSymbol -> {
                val outerFirClassifier = firSymbol.getContainingClassSymbol(symbolFirSession)
                if (outerFirClassifier != null) {<|endoftext|>


Prompt:
if (destructuringStatements.isNotEmpty()) {
                    // Destructured variables must be in a separate block so that they can be shadowed.
                    buildBlock {
                        source = bodyBlock.source?.realElement()
                        statements.addAll(destructuringStatements)
                        statements.add(bodyBlock)
                    }
                } else {
                    bodyBlock
                }
                } else {

Response:
buildSingleExpressionBlock(buildErrorExpression(null, ConeSyntaxDiagnostic("Lambda has no body")))
                }
            }
            context.firFunctionTargets.removeLast()
        }.also {
            target.bind(it)
        }
        return buildAnonymousFunctionExpression {
            source = expressionSource
            this.anonymousFunction = anonymousFunction
        }
    }<|endoftext|>


Prompt:
+booleanField("resolvedToCompanionObject", withReplace = true)
            +booleanField("canBeValue", withReplace = true)
            +booleanField("isFullyQualified")
            +fieldList("nonFatalDiagnostics", coneDiagnosticType, useMutableOrEmpty = true)
            +typeArguments.withTransform()
        }

Response:
resolvedReifiedParameterReference.configure {
            +field("symbol", typeParameterSymbolType)
        }

        stringConcatenationCall.configure {
        }

        throwExpression.configure {
            +field("exception", expression).withTransform()
        }

        variableAssignment.configure {
            +field("lValue", expression).withTransform().withReplace()<|endoftext|>


Prompt:
package org.jetbrains.kotlin.ir.backend.js.transformers.irToJs

import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.backend.js.utils.TODO
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor

Response:
import org.jetbrains.kotlin.js.backend.ast.JsNode

interface BaseIrElementToJsNodeTransformer<out R : JsNode, in D> : IrElementVisitor<R, D> {
    override fun visitElement(element: IrElement, data: D): R {
        TODO(element)
    }
}<|endoftext|>


Prompt:
val en1: Any = En.A
    if (en1 is En) {
        when (en1) {
            En.A -> {res2 += "O"}
            En.B -> {}
            En.C -> {}
        }
        // Working without other examples
        when (en1 as En) {
            En.A -> {res2 += "K"}
            En.B -> {}

Response:
En.C -> {}
        }
    }

    if (res1 != res2) return "different results: $res1 != $res2"
    return res1
}<|endoftext|>


Prompt:
// WITH_STDLIB
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*

suspend fun callLocal(): String {
    suspend fun local() = "OK"
    return local()
}

fun builder(c: suspend () -> Unit) {
    c.startCoroutine(EmptyContinuation)
}

fun box(): String {
    var res = "FAIL"

Response:
builder {
        res = callLocal()
    }
    return res
}<|endoftext|>


Prompt:
}

@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()"))
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")
@SinceKotlin("1.1")
@Suppress("CONFLICTING_OVERLOADS")
public fun Array<out Float>.min(): Float? {

Response:
return minOrNull()
}

@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()"))
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")
@Suppress("CONFLICTING_OVERLOADS")
public fun <T : Comparable<T>> Array<out T>.min(): T? {<|endoftext|>


Prompt:
name = "EnumWhenLowering",
    description = "Replace `when` subjects of enum types with their ordinals"
)
internal class MappedEnumWhenLowering(override val context: JvmBackendContext) : EnumWhenLowering(context) {
    private val intArray = context.irBuiltIns.primitiveArrayForType.getValue(context.irBuiltIns.intType)

Response:
private val intArrayConstructor = intArray.constructors.single { it.owner.valueParameters.size == 1 }
    private val intArrayGet = intArray.functions.single { it.owner.name == OperatorNameConventions.GET }
    private val intArraySet = intArray.functions.single { it.owner.name == OperatorNameConventions.SET }<|endoftext|>


Prompt:
// DO_NOT_CHECK_SYMBOL_RESTORE_K1
// FILE: Derived.kt
fun usage() {
    Derived().some<caret>thing
}

class Derived : Base() {
    override fun getSomething(): String = "42"
    override fun setSomething(s: String) {

    }
}

// FILE: Base.java
public class Base {

Response:
public String getSomething() {
        return "";
    }

    public void setSomething(String s) {

    }
}<|endoftext|>


Prompt:
val metadata: Metadata? = proto.constructor?.`$metadata$`

    metadata?.errorInfo?.let { return it } // cached

    var result = 0
    if (hasProp(proto, "message")) result = result or 0x1
    if (hasProp(proto, "cause")) result = result or 0x2

    if (result != 0x3) { //

Response:
val parentProto = getPrototypeOf(proto)
        if (parentProto != js("Error").prototype) {
            result = result or calculateErrorInfo(parentProto)
        }
    }

    if (metadata != null) {
        metadata.errorInfo = result
    }

    return result
}<|endoftext|>


Prompt:
Platform B:    A -> B -> C    Z -> Y -> X -> C

    Expected: A, B, C, X, Y, Z
     */
    fun `test sample 6`() {
        val resolver = createCommonClassifierIdResolver(
            createCirTreeRootFromSourceCode(
                """
                class C
                typealias B = C
                typealias A = B

Response:
typealias X = C
                typealias Y = X
                typealias Z = Y
            """.trimIndent()
            ),
            createCirTreeRootFromSourceCode(
                """
                class C
                typealias B = C
                typealias A = B

                typealias X = C
                typealias Y = X
                typealias Z = Y
            """.trimIndent()
            )<|endoftext|>


Prompt:
reporter.reportOn(backingField.source, FirErrors.PROPERTY_FIELD_DECLARATION_MISSING_INITIALIZER, context)
        } else if (backingField.initializer != null && backingField.isLateInit) {

Response:
reporter.reportOn(backingField.source, FirErrors.LATEINIT_PROPERTY_FIELD_DECLARATION_WITH_INITIALIZER, context)
        }

        if (backingField.isLateInit && backingField.isNullable) {<|endoftext|>


Prompt:
object PrecedingDocCommentsBinder : WhitespacesAndCommentsBinder {
    override fun getEdgePosition(
        tokens: List<IElementType>, atStreamEdge: Boolean, getter: WhitespacesAndCommentsBinder.TokenTextGetter
    ): Int {
        if (tokens.isEmpty()) return 0

        for (idx in tokens.indices.reversed()) {

Response:
if (tokens[idx] == KtTokens.DOC_COMMENT) return idx
        }

        return tokens.size
    }
}

// Binds comments on the same line
object TrailingCommentsBinder : WhitespacesAndCommentsBinder {
    override fun getEdgePosition(<|endoftext|>


Prompt:
val constantExpression = (expression as? FirLiteralExpression<*>) ?: return null
        val stringValue = constantExpression.value as? String ?: return null
        if (!stringValue.matches(RequireKotlinConstants.VERSION_REGEX)) {
            reporter.reportOn(expression.source, FirErrors.ILLEGAL_KOTLIN_VERSION_STRING_VALUE, context)

Response:
return null
        }
        val version = ApiVersion.parse(stringValue)
        if (version == null) {
            reporter.reportOn(expression.source, FirErrors.ILLEGAL_KOTLIN_VERSION_STRING_VALUE, context)
        }
        return version
    }

    private fun checkAnnotationsWithVersion(
        fqName: FqName?,<|endoftext|>


Prompt:
private fun computeSecondaryConstructors(): List<ClassConstructorDescriptor> =
        classProto.constructorList.filter { Flags.IS_SECONDARY.get(it.flags) }.map {
            c.memberDeserializer.loadConstructor(it, false)
        }

    override fun getConstructors() = constructors()

Response:
override fun getContextReceivers(): List<ReceiverParameterDescriptor> = classProto.contextReceiverTypes(c.typeTable).map {
        val contextReceiverType = c.typeDeserializer.type(it)
        ReceiverParameterDescriptorImpl(
            thisAsReceiverParameter,
            ContextClassReceiver(
                this,
                contextReceiverType,<|endoftext|>


Prompt:
// test.kt:9 <init>
// test.kt:9 box
// test.kt:18 box
// test.kt:29 box

// EXPECTATIONS JS_IR
// test.kt:21 box
// test.kt:9 box
// test.kt:15 <init>
// test.kt:23 bar
// test.kt:25 <init>
// test.kt:23 <init>

Response:
// test.kt:12 bar
// test.kt:9 <init>
// test.kt:29 box

// EXPECTATIONS WASM
// test.kt:21 $box (17, 4)
// test.kt:22 $box
// test.kt:9 $box (4, 4)
// test.kt:15 $<no name provided>.<init><|endoftext|>


Prompt:
public abstract class MemoryAllocator {
    /**
     * Allocates a block of uninitialized linear memory of the given [size] in bytes.
     *
     * @return an address of allocated memory. It is guaranteed to be a multiple of 8.
     */
    public abstract fun allocate(size: Int): Pointer
}

/**

Response:
* Runs the [block] of code, providing it a temporary [MemoryAllocator] as an argument, and returns the result of this block.
 *
 * Frees all memory allocated with the provided allocator after running the [block].
 *
 * This function is intened to facilitate the exchange of values with outside world through linear memory.
 * For example:
 *
 * ```
 * val buffer_size = ...<|endoftext|>


Prompt:
import org.jetbrains.kotlin.library.metadata.KlibMetadataVersion
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.test.KotlinTestUtils

internal fun mockTAType(
    typeAliasId: String,
    nullable: Boolean = false,
    underlyingType: () -> CirClassOrTypeAliasType

Response:
): CirTypeAliasType = CirTypeAliasType.createInterned(
    typeAliasId = createValidClassifierId(typeAliasId),
    underlyingType = underlyingType().makeNullableIfNecessary(nullable),
    arguments = emptyList(),
    isMarkedNullable = nullable
)

internal fun mockClassType(
    classId: String,
    nullable: Boolean = false<|endoftext|>


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

// FILE: Lib6.kt
package libPackageCase3Explicit

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

// FILE: LibtestsPack3.kt
package testsCase3

val Case3.listOf: A
    get() = A()<|endoftext|>


Prompt:
}

    private var currentState = entryState
    private var currentBlock = entryState.entryBlock

    private val catchBlockStack = mutableListOf(rootExceptionTrap)
    private val tryStateMap = hashMapOf<IrExpression, TryState>()
    private val tryLoopStack = mutableListOf<IrExpression>()

    private fun buildExceptionTrapState(): SuspendState {

Response:
val state = SuspendState(unit)
        state.entryBlock.statements += JsIrBuilder.buildThrow(nothing, pendingException())
        return state
    }

    private fun newState() {
        val newState = SuspendState(unit)
        doDispatch(newState)
        updateState(newState)
    }

    private fun updateState(newState: SuspendState) {<|endoftext|>


Prompt:
"".<!UNRESOLVED_REFERENCE!>topLevelExtensionFun<!>()
        1.<!UNRESOLVED_REFERENCE!>topLevelExtensionFun<!>()
        "".<!UNRESOLVED_REFERENCE!>topLevelExtensionProperty<!>
        1.<!UNRESOLVED_REFERENCE!>topLevelExtensionProperty<!>

Response:
<!UNRESOLVED_REFERENCE!>memberFun<!>()
        <!UNRESOLVED_REFERENCE!>memberFun<!>(1)
        <!UNRESOLVED_REFERENCE!>privateFun<!>()
        <!UNRESOLVED_REFERENCE!>privateFun<!>(1)<|endoftext|>


Prompt:
override val hasStableParameterNames: Boolean
        get() = withValidityAssertion { true }

    override val callableIdIfNonLocal: CallableId?
        get() = withValidityAssertion { null }

    override val returnType: KtType

Response:
get() = withValidityAssertion { descriptor?.returnType?.toKtType(analysisContext) ?: createErrorType() }

    override val receiverParameter: KtReceiverParameterSymbol?
        get() = withValidityAssertion {
            if (!propertyPsi.isExtensionDeclaration()) {
                return null
            }<|endoftext|>


Prompt:
val uintList = mutableListOf<UInt>()
    val uintProgression = 1u..<11u
    for (i in (uintProgression step 2).reversed() step 3) {
        uintList += i
    }
    assertEquals(listOf(9u, 6u, 3u), uintList)

    val ulongList = mutableListOf<ULong>()

Response:
val ulongProgression = 1uL..<11uL
    for (i in (ulongProgression step 2L).reversed() step 3L) {
        ulongList += i
    }
    assertEquals(listOf(9uL, 6uL, 3uL), ulongList)

    return "OK"
}<|endoftext|>


Prompt:
@Deprecated("Use sumOf instead.", ReplaceWith("this.sumOf(selector)"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public inline fun ShortArray.sumBy(selector: (Short) -> Int): Int {
    var sum: Int = 0
    for (element in this) {
        sum += selector(element)
    }
    return sum
}

/**

Response:
* Returns the sum of all values produced by [selector] function applied to each element in the array.
 */
@Deprecated("Use sumOf instead.", ReplaceWith("this.sumOf(selector)"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public inline fun IntArray.sumBy(selector: (Int) -> Int): Int {
    var sum: Int = 0<|endoftext|>


Prompt:
return TimeSource.Monotonic.measureTimedValue(block)
}

/**
 * Executes the given function [block] and returns an instance of [TimedValue] class, containing both
 * the result of function execution and the duration of elapsed time interval.
 *
 * The elapsed time is measured with the specified `this` [TimeSource] instance.
 */
@SinceKotlin("1.9")

Response:
@WasExperimental(ExperimentalTime::class)
public inline fun <T> TimeSource.measureTimedValue(block: () -> T): TimedValue<T> {
    contract {
        callsInPlace(block, InvocationKind.EXACTLY_ONCE)
    }

    val mark = markNow()
    val result = block()
    return TimedValue(result, mark.elapsedNow())<|endoftext|>


Prompt:
}
                        append(DECOMPILED_CODE_COMMENT).append(" }")
                    }
                } else {
                    // descriptor instanceof PropertyDescriptor
                    builder.append(" ").append(DECOMPILED_CODE_COMMENT)
                }
            }
            if (descriptor is PropertyDescriptor) {
                for (accessor in descriptor.accessors) {

Response:
if (accessor.isDefault) continue
                    builder.append("\n$indent    ")
                    builder.append(accessor.visibility.internalDisplayName).append(" ")
                    builder.append(accessor.modality.name.toLowerCaseAsciiOnly()).append(" ")
                    if (accessor.isExternal) {
                        builder.append("external ")
                    }<|endoftext|>


Prompt:
LLVMAddAlias2(module, getGlobalFunctionType(entryPoint), programAddressSpace, entryPoint, "main")
}

internal fun linkBitcodeDependencies(generationState: NativeGenerationState,
                                     generatedBitcodeFiles: List<File>) {
    val config = generationState.config
    val produce = config.produce

Response:
if (produce == CompilerOutputKind.FRAMEWORK && config.produceStaticFramework) {
        embedAppleLinkerOptionsToBitcode(generationState.llvm, config)
    }
    linkAllDependencies(generationState, generatedBitcodeFiles.map { it.absoluteFile.normalize().path })

}<|endoftext|>


Prompt:
AnnotationTarget.PROPERTY_GETTER,
    AnnotationTarget.PROPERTY_SETTER,
    AnnotationTarget.TYPE,
)
annotation class Ann

@Ann
expect class OnClass

expect class OnMember {
    @Ann
    fun onMember()
}

@Ann
expect class ViaTypealias

expect class MemberScopeViaTypealias {
    @Ann

Response:
fun foo()
}

annotation class WithArg(val s: String)

@WithArg("str")
expect fun withDifferentArg()

expect fun inValueParam(@Ann arg: String)

expect fun <@Ann T> inTypeParam()

@get:Ann
expect val onGetter: String

expect fun onType(param: @Ann Any)<|endoftext|>


Prompt:
class RegexTest {

    @Test fun properties() {
        val pattern = "\\s+$"
        val regex1 = Regex(pattern, RegexOption.IGNORE_CASE)
        assertEquals(pattern, regex1.pattern)
        assertEquals(setOf(RegexOption.IGNORE_CASE), regex1.options)

Response:
val options2 = setOf(RegexOption.MULTILINE, RegexOption.IGNORE_CASE)
        val regex2 = Regex(pattern, options2)
        assertEquals(options2, regex2.options)
    }

    @Test fun matchResult() {
        val p = "\\d+".toRegex()
        val input = "123 456 789"<|endoftext|>


Prompt:
override fun toString() = variable.toString()
    }

    data class Receiver(val value: ReceiverValue) : IdentifierInfo {
        override val kind = STABLE_VALUE

        override fun toString() = value.toString()
    }

    data class PackageOrClass(val descriptor: DeclarationDescriptor) : IdentifierInfo {
        override val kind = STABLE_VALUE

Response:
override fun toString() = descriptor.toString()
    }

    data class EnumEntry(val descriptor: ClassDescriptor) : IdentifierInfo {
        override val kind: DataFlowValue.Kind = STABLE_VALUE
    }

    class Qualified(
        val receiverInfo: IdentifierInfo,
        val selectorInfo: IdentifierInfo,
        val safe: Boolean,<|endoftext|>


Prompt:
private val codegen = environment.codegen

    private val context = codegen.context

    private val IrCall.llvmReturnType: LLVMTypeRef
        get() = LLVMGetReturnType(codegen.getLlvmFunctionType(symbol.owner))!!

Response:
private fun LLVMTypeRef.sizeInBits() = LLVMSizeOfTypeInBits(codegen.llvmTargetData, this).toInt()

    /**
     * Some intrinsics have to be processed before evaluation of their arguments.
     * So this method looks at [callSite] and if it is call to "special" intrinsic
     * processes it. Otherwise, it returns null.
     */<|endoftext|>


Prompt:
else {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Number?")!>Object.prop_1<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number"), DEBUG_INFO_SMARTCAST!>Object.prop_1<!>.equals(null)

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number"), DEBUG_INFO_SMARTCAST!>Object.prop_1<!>.propT
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number"), DEBUG_INFO_SMARTCAST!>Object.prop_1<!>.propAny<|endoftext|>


Prompt:
@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()"))
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")
@Suppress("CONFLICTING_OVERLOADS")
public fun IntArray.max(): Int? {
    return maxOrNull()
}

Response:
@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()"))
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")
@Suppress("CONFLICTING_OVERLOADS")
public fun LongArray.max(): Long? {
    return maxOrNull()
}<|endoftext|>


Prompt:
if (!classSymbol.isSuitableJavaClass()) return emptySet()
        return cache.getValue(classSymbol)?.mapTo(mutableSetOf()) {
            when (it) {
                is FirConstructorSymbol -> SpecialNames.INIT
                else -> it.callableId.callableName
            }
        } ?: emptySet()
    }

Response:
override fun generateFunctions(callableId: CallableId, context: MemberGenerationContext?): List<FirNamedFunctionSymbol> {
        val owner = context?.owner ?: return emptyList()
        if (!owner.isSuitableJavaClass()) return emptyList()
        return cache.getValue(owner)?.filterIsInstance<FirNamedFunctionSymbol>().orEmpty()
    }<|endoftext|>


Prompt:
internal class AdditionalClassAnnotationLowering(private val context: JvmBackendContext) : ClassLoweringPass {
    private val symbols = context.ir.symbols.javaAnnotations
    private val noNewJavaAnnotationTargets =
        context.config.noNewJavaAnnotationTargets || !context.isCompilingAgainstJdk8OrLater

    override fun lower(irClass: IrClass) {

Response:
if (!irClass.isAnnotationClass) return

        generateDocumentedAnnotation(irClass)
        generateRetentionAnnotation(irClass)
        generateTargetAnnotation(irClass)
        generateRepeatableAnnotation(irClass)
    }

    private fun generateDocumentedAnnotation(irClass: IrClass) {<|endoftext|>


Prompt:
useK2: Boolean,
    pluginClasspaths: List<String>,
    pluginOptions: List<String>,
    pluginConfigurations: List<String>
): Boolean {
    var hasErrors = false

    for (classpath in pluginClasspaths) {
        if (!File(classpath).exists()) {

Response:
messageCollector.report(ERROR, "Plugin classpath entry points to a non-existent location: $classpath")
        }
    }

    if (pluginConfigurations.isNotEmpty()) {
        messageCollector.report(WARNING, "Argument -Xcompiler-plugin is experimental")
        if (!useK2) {
            hasErrors = true
            messageCollector.report(
                ERROR,<|endoftext|>


Prompt:
b.bar()
}

fun withTest(a: I1<*>, b: I3<*>) {
    with(a) {
        val x = foo()
        <!DEBUG_INFO_EXPRESSION_TYPE("I1<*>")!>x<!>
        bar()
    }
    with(b) {
        val y = foo()

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("I3<*>")!>y<!>
        bar()
    }
}<|endoftext|>


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

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

Response:
assertEquals(listOf(1), intList)

    val longList = mutableListOf<Long>()
    val longProgression = 1L downTo 1L
    for (i in longProgression step 2L) {
        longList += i
    }
    assertEquals(listOf(1L), longList)

    val charList = mutableListOf<Char>()<|endoftext|>


Prompt:
* after Kotlin `main` function gets invoked.
 *
 * Note: runtime lookup can be forced even when the class is referenced statically from
 * Objective-C source code by adding `__attribute__((objc_runtime_visible))` to its `@interface`.
 */
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.SOURCE)
@BetaInteropApi

Response: public annotation class ExportObjCClass(val name: String = "")<|endoftext|>


Prompt:
@file:OptIn(SymbolInternals::class)

package org.jetbrains.kotlin.fir.declarations.utils

import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.analysis.checkers.getContainingClassSymbol

Response:
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol<|endoftext|>


Prompt:
suspend fun <T> quz(t: T): T = t

    suspend fun bar(): IC {
        return foo(qux(quz(suspendMe<IC>())))
    }

    suspend fun test() = bar().s
}

class Test2 {

    suspend fun foo(value: IC): IC = value

Response:
suspend fun qux(s: String): IC = IC(s)

    suspend fun quz(): String = suspendMe<String>()

    suspend fun bar(): IC {
        return foo(qux(quz()))
    }

    suspend fun test() = bar().s
}

class Test3 {
    suspend fun <T> foo(value: T): T = value<|endoftext|>


Prompt:
if (!specificClassId.isUnsigned && generalClassId.isUnsigned) {
                return true
            }

            // int >= long, int >= short, short >= byte

            if (specificClassId == Int) {
                return generalClassId == Long || generalClassId == Short || generalClassId == Byte
            } else if (specificClassId == Short && generalClassId == Byte) {
                return true

Response:
}

            // uint >= ulong, uint >= ushort, ushort >= ubyte

            if (specificClassId == UInt) {
                return generalClassId == ULong || generalClassId == UShort || generalClassId == UByte
            } else if (specificClassId == UShort && generalClassId == UByte) {
                return true
            }

            // double >= float<|endoftext|>


Prompt: js(<!JSCODE_CAN_NOT_VERIFY_JAVASCRIPT!>"{ var a = ${<!JSCODE_ARGUMENT_NON_CONST_EXPRESSION!>TRUE === false<!>}; }"<!>)

Response: js(<!JSCODE_CAN_NOT_VERIFY_JAVASCRIPT!>"{ var a = ${<!JSCODE_ARGUMENT_NON_CONST_EXPRESSION!>CHAR === 's'<!>}; }"<!>)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact
import org.jetbrains.kotlin.test.model.Frontend2BackendConverter
import org.jetbrains.kotlin.test.model.FrontendFacade
import org.jetbrains.kotlin.test.model.FrontendKinds

Response:
open class AbstractIrSteppingWithBytecodeInlinerTest(
    private val useIrInliner: Boolean = false
) : AbstractSteppingTestBase<ClassicFrontendOutputArtifact>(FrontendKinds.ClassicFrontend) {
    override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
        get() = ::ClassicFrontendFacade<|endoftext|>


Prompt:
doTestFilters(Filter(listOf("A.foo*", "B.*"), listOf(), listOf("A.foo1", "A.foo2", "B.foo1", "B.foo2", "B.bar")))
    }

    @Test
    fun testFiltersNegativeGlob() {

Response:
doTestFilters(Filter(listOf(), listOf("A.foo*", "B.*"), listOf("A.bar", "FiltersKt.foo1", "FiltersKt.foo2", "FiltersKt.bar")))
    }

    @Test
    fun testFiltersPositiveGlobNegative() {<|endoftext|>


Prompt:
override fun visitFunctionAccess(expression: IrFunctionAccessExpression, data: Nothing?) {
        visitFunctionAccess(expression)
    }

    fun visitFunctionAccess(expression: IrFunctionAccessExpression) {
        visitMemberAccess(expression)
    }

    override fun visitConstructorCall(expression: IrConstructorCall, data: Nothing?) {
        visitConstructorCall(expression)
    }

Response:
fun visitConstructorCall(expression: IrConstructorCall) {
        visitFunctionAccess(expression)
    }

    override fun visitSingletonReference(expression: IrGetSingletonValue, data: Nothing?) {
        visitSingletonReference(expression)
    }

    fun visitSingletonReference(expression: IrGetSingletonValue) {
        visitDeclarationReference(expression)
    }<|endoftext|>


Prompt:
// WITH_STDLIB

// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
// Range and progression-based loops generated with Kotlin compiler should be
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').

Response:
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
// with compiler built from your changes if you are not sure.

fun test(uis: UIntArray): UInt {
    var s = 0U
    for (i in uis.indices) {
        s += uis[i]<|endoftext|>


Prompt: ExpectedData(0x39a9e146ec4b3210UL, 0x8b305d532e61226eUL, 0xcaeae80da2ea2eUL, 0x88a6289a76ac684eUL, 0x8ce5b5f9df1cbd85UL),

Response: ExpectedData(0x74cba303e2dd9d6dUL, 0x751390a8a5c41bdcUL, 0x6ee5fbf87605d34UL, 0x6ca73f610f3a8f7cUL, 0xe898b3c996570adUL),<|endoftext|>


Prompt:
val argType = this.typeOrNull
        if (argType == null) {
            adapter.throwIae("Star projections in type arguments are not allowed, but had ${ownerType.render()}")
            return null
        }
        val classifier = argType.classifierOrNull
        if (classifier is IrTypeParameterSymbol && !classifier.owner.isReified) {

Response:
val fullName = argType.render() // T of <function fqName>
            val name = classifier.owner.name.asString()
            val message = "Captured type parameter $fullName from generic non-reified function. " +
                    "Such functionality cannot be supported because $name is erased, either specify serializer explicitly or make " +
                    "calling function inline with reified $name."<|endoftext|>