Prompt:
abstract class KtLightModifierListDescriptorBased<out T : KtLightElement<KtModifierListOwner, PsiModifierListOwner>>(owner: T) :
    KtLightModifierList<T>(owner) {
    override fun computeAnnotations(): List<KtLightAbstractAnnotation> {
        val annotationsForEntries = owner.givenAnnotations ?: lightAnnotationsForEntries(this)

Response:
//TODO: Hacky way to update wrong parents for annotations
        annotationsForEntries.forEach {
            @Suppress("DEPRECATION_ERROR")
            it.parent = this
        }
        val modifierListOwner = parent
        if (modifierListOwner is KtLightClassForSourceDeclaration && modifierListOwner.isAnnotationType) {<|endoftext|>


Prompt:
expectedStderr = "error: unrecognized script type: noInline.myscript; Specify path to the script file as the first argument\n"
        )
        runProcess(
            "kotlin", "-Xallow-any-scripts-in-source-roots", "-howtorun", ".kts", "$testDataDirectory/noInline.myscript",

Response:
expectedExitCode = 1, expectedStderr = """compiler/testData/launcher/noInline.myscript:1:7: error: unresolved reference 'CompilerOptions'.
@file:CompilerOptions("-Xno-inline")
      ^
"""
        )
        runProcess(
            "kotlin", "-howtorun", ".main.kts", "$testDataDirectory/noInline.myscript",<|endoftext|>


Prompt:
package testPackCase3
import libPackage.plusAssign
import libPackage.invoke
import libPackage.*
class Case() {

    class E(val plusAssign: Inv? = null) {
        /*operator*/ fun plusAssign(value: Int) {}
    }

    class Inv() {
        /*operator*/ fun invoke(value: Int) {}
    }

    fun foo(e: E) {

Response:
operator fun E.plusAssign(value: Int) {}

        run {
            <!DEBUG_INFO_CALL("fqName: testPackCase3.Case.foo.plusAssign; typeCall: operator extension function")!>e += 1<!>
        }<|endoftext|>


Prompt:
GC.collect()
    // This cleans up all the references from the worker thread and destroys C2, but C1 is still alive.
    worker.execute(TransferMode.SAFE, {}) { GC.collect() }.result
    // And this finally destroys C1
    GC.collect()

    assertNull(ref1Weak.value)
    assertNull(ref2Weak.value)

Response:
worker.requestTermination().result
}<|endoftext|>


Prompt:
x.x.funNullableAny()
        }
        if (x.y != null) {
            x.y
            x.y.equals(null)
            x.y.propT
            x.y.propAny
            x.y.propNullableT
            x.y.propNullableAny
            x.y.funT()
            x.y.funAny()

Response:
x.y.funNullableT()
            x.y.funNullableAny()
        }
        if (x.z != null) {
            x.z
            x.z.equals(null)
            x.z.propT
            x.z.propAny
            x.z.propNullableT
            x.z.propNullableAny
            x.z.funT()<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers

class Param
class C {
    val c = 42
}
class R {
    val r = 42
}

context(C)
fun R.f1(g: context(C) R.(Param) -> Unit) {
    g(this@C, this@R, Param())
}

context(C)

Response:
fun f2(g: context(C) (Param) -> Unit) {
    g(this@C, Param())
}

context(C)
fun R.f3(g: context(C) R.() -> Unit) {
    g(this@C, this@R)
}

context(C)
fun f4(g: context(C) () -> Unit) {
    g(this@C)<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1293
package foo

interface Base {
    abstract fun foo(x: String): String
}

class BaseImpl(val s: String) : Base {
    override fun foo(x: String): String = "Base: ${s}:${x}"
}

fun newBase(s: String): Base = BaseImpl(s)

Response:
class Derived() : Base by newBase("test")

fun box(): String {
    assertEquals("Base: test:!!", Derived().foo("!!"), "delegation by function expression")

    return "OK"
}<|endoftext|>


Prompt:
descriptor?.extensionReceiverParameter?.toKtReceiverParameterSymbol(analysisContext)
        }

    override val contextReceivers: List<KtContextReceiver>
        get() = withValidityAssertion { descriptor?.createContextReceivers(analysisContext) ?: emptyList() }

    override val isExtension: Boolean

Response:
get() = withValidityAssertion { psi.isExtensionDeclaration() }

    override fun createPointer(): KtSymbolPointer<KtAnonymousFunctionSymbol> = withValidityAssertion {
        KtPsiBasedSymbolPointer.createForSymbolFromSource<KtAnonymousFunctionSymbol>(this) ?: KtFe10NeverRestoringSymbolPointer()
    }<|endoftext|>


Prompt:
// IGNORE_BACKEND: JS

// Test for KT-36188 bug compatibility between non-IR and IR backends

interface A {
    fun foo(a: String = "OK"): String
}

interface A2 : A

interface B {
    fun foo(a: String = "Fail"): String
}

interface C : A2, B

class Impl : C {

Response:
override fun foo(a: String) = a
}

fun box(): String = Impl().foo()<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<KtBackingField>(firDiagnostic, token), KtFirDiagnostic.LateinitNullableBackingField

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

Response:
) : KtAbstractFirDiagnostic<KtBackingField>(firDiagnostic, token), KtFirDiagnostic.BackingFieldForDelegatedProperty

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


Prompt:
"k2-serialization-plugin-in-common-sourceset",
            gradleVersion,
        ) {
            val taskToExecute = ":compileKotlinJs"
            build(taskToExecute) {
                assertTasksExecuted(taskToExecute)
            }
        }
    }

    @GradleTest

Response:
@DisplayName("HMPP compilation without JS target. KT-57376, KT-57377, KT-57635, KT-57654")
    fun testHmppCompilationWithoutJsTarget(gradleVersion: GradleVersion) {
        with(project("k2-mpp-without-js", gradleVersion)) {
            val taskToExecute = ":compileIntermediateMainKotlinMetadata"<|endoftext|>


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

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

Response:
assertEquals(listOf(1, 2, 3, 4), intList)

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


Prompt:
testServices.assertions.assertEqualsToTestDataFileSibling(
            actualText,
            extension = ".${modificationEventKind.name.lowercase()}.txt",

            // Support differing result data. Using `testPrefix` takes away the ability for different kinds of tests (such as IDE vs.

Response:
// Standalone modes) to have different test results (since `testPrefix` normally supports this functionality), but (1) we are
            // currently only testing the IDE mode and (2) the test results between different modes should not differ for session
            // invalidation in the first place.
            testPrefix = resultFileSuffix,
        )
    }

    private fun checkSessionValidityBeforeModification(<|endoftext|>


Prompt:
* Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with copies of the sign bit.
     *
     * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.
     * The shift distance actually used is therefore always in the range `0..31`.
     */
    @kotlin.internal.IntrinsicConstEvaluation

Response:
@TypedIntrinsic(IntrinsicType.SHR)
    public external infix fun shr(bitCount: Int): Int

    /**
     * Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros.
     *
     * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.<|endoftext|>


Prompt:
package org.jetbrains.kotlinx.serialization

import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.JvmTarget

Response:
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.TestJdkKind
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.runners.codegen.configureModernJavaTest<|endoftext|>


Prompt:
* @property className FQ name of the referenced array element type.
     * @property arrayDimensionCount Referenced array dimension.
     */
    public data class ArrayKClassValue(val className: ClassName, val arrayDimensionCount: Int) : KmAnnotationArgument() {
        init {

Response:
require(arrayDimensionCount > 0) { "ArrayKClassValue must have at least one dimension. For regular X::class argument, use KClassValue." }
        }

        private val stringRepresentation = buildString {
            append("ArrayKClassValue(")
            repeat(arrayDimensionCount) { append("kotlin/Array<") }
            append(className)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.declarations.utils.modality
import org.jetbrains.kotlin.fir.extensions.FirDeclarationGenerationExtension
import org.jetbrains.kotlin.fir.extensions.FirDeclarationPredicateRegistrar
import org.jetbrains.kotlin.fir.extensions.MemberGenerationContext

Response:
import org.jetbrains.kotlin.fir.extensions.predicate.LookupPredicate
import org.jetbrains.kotlin.fir.extensions.predicateBasedProvider
import org.jetbrains.kotlin.fir.plugin.SimpleFunctionBuildingContext
import org.jetbrains.kotlin.fir.plugin.createConeType<|endoftext|>


Prompt:
public inline fun <T, R> kotlin.Array<out T>.flatMapIndexed(transform: (index: kotlin.Int, T) -> kotlin.collections.Iterable<R>): kotlin.collections.List<R>

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

Response:
@kotlin.jvm.JvmName(name = "flatMapIndexedSequence")
@kotlin.internal.InlineOnly
public inline fun <T, R> kotlin.Array<out T>.flatMapIndexed(transform: (index: kotlin.Int, T) -> kotlin.sequences.Sequence<R>): kotlin.collections.List<R><|endoftext|>


Prompt:
gradleVersion = gradleVersion,
            addHeapDumpOptions = addHeapDumpOptions,
            enableKotlinDaemonMemoryLimitInMb = if (shouldConfigureStrategyViaGradleProperty) null else 1024,
            enableGradleDaemonMemoryLimitInMb = null, // We need to make an assertion based on default Gradle Daemon JDK configuration
            buildOptions = defaultBuildOptions.copy(

Response:
useDaemonFallbackStrategy = testFallbackStrategy,
                compilerExecutionStrategy = if (shouldConfigureStrategyViaGradleProperty) {
                    executionStrategy
                } else {
                    null
                },
                logLevel = if (!testFallbackStrategy && executionStrategy == KotlinCompilerExecutionStrategy.DAEMON) {<|endoftext|>


Prompt:
internal val LN2: Double = ln(2.0)

    @JvmField
    internal val epsilon: Double = nativeMath.ulp(1.0)
    @JvmField
    internal val taylor_2_bound = nativeMath.sqrt(epsilon)
    @JvmField
    internal val taylor_n_bound = nativeMath.sqrt(taylor_2_bound)

Response:
@JvmField
    internal val upper_taylor_2_bound = 1 / taylor_2_bound
    @JvmField
    internal val upper_taylor_n_bound = 1 / taylor_n_bound

}

// region ================ Double Math ========================================

/** Computes the sine of the angle [x] given in radians.
 *
 *  Special cases:<|endoftext|>


Prompt:
import org.jetbrains.kotlin.js.inline.ImportIntoFragmentInliningScope
import org.jetbrains.kotlin.js.translate.declaration.transformCoroutineMetadataToSpecialFunctions
import org.jetbrains.kotlin.js.translate.expression.InlineMetadata
import org.jetbrains.kotlin.js.translate.utils.JsAstUtils

Response:
class CoroutineTransformer : JsVisitorWithContextImpl() {

    val functionName = mutableMapOf<JsFunction, String?>()

    override fun visit(x: JsExpressionStatement, ctx: JsContext<*>): Boolean {
        val expression = x.expression
        val assignment = JsAstUtils.decomposeAssignment(expression)
        if (assignment != null) {<|endoftext|>


Prompt:
it, session, scopeSession
            )

            superClassesStaticsAndCompanionReceivers += superCompanionReceiver.asTowerDataElement()
            allImplicitCompanionValues += superCompanionReceiver
        }
    }

    val thisReceiver = ImplicitDispatchReceiverValue(owner.symbol, defaultType, session, scopeSession)

Response:
val contextReceivers = (owner as? FirRegularClass)?.contextReceivers?.mapIndexed { index, receiver ->
        ContextReceiverValueForClass(
            owner.symbol, receiver.typeRef.coneType, receiver.labelName, session, scopeSession,
            contextReceiverNumber = index,
        )
    }.orEmpty()

    return TowerElementsForClass(
        thisReceiver,<|endoftext|>


Prompt:
val type = arg.getType()
                    TypeAndDefaultQualifiers(type, type.extractAndMergeDefaultQualifiers(it.defaultQualifiers), parameter)
                }
            }
        }
    }

    private class TypeAndDefaultQualifiers(
        val type: KotlinTypeMarker?,
        val defaultQualifiers: JavaTypeQualifiersByElementType?,

Response:
val typeParameterForArgument: TypeParameterMarker?
    )
}

typealias IndexedJavaTypeQualifiers = (Int) -> JavaTypeQualifiers<|endoftext|>


Prompt:
assertEquals(200, atomicIntArr.getAndSet(2, 2000), "getAndSet: FAIL 2")
        assertEquals(2000, atomicIntArr[2], "getAndSet: FAIL 3")
        assertFailsWith<IndexOutOfBoundsException> {
            val res = atomicIntArr.getAndSet(22, 33535)
        }.let { ex ->

Response:
assertEquals("The index 22 is out of the bounds of the AtomicIntArray with size 10.", ex.message)
        }
        assertFailsWith<IndexOutOfBoundsException> {
            val res = atomicIntArr.getAndSet(-1, 33535)
        }.let { ex ->
            assertEquals("The index -1 is out of the bounds of the AtomicIntArray with size 10.", ex.message)<|endoftext|>


Prompt: P10, P11) -> R): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) -> R>> =

Response:
staticCFunctionImpl(
                function,
                t<R>(), t<P1>(), t<P2>(), t<P3>(), t<P4>(), t<P5>(), t<P6>(), t<P7>(), t<P8>(), t<P9>(), t<P10>(), t<P11>()
        )<|endoftext|>


Prompt:
// !OPT_IN: kotlin.contracts.ExperimentalContracts

/*
 * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE)
 *
 * SECTIONS: contracts, declarations, contractBuilder, effects, returns
 * NUMBER: 5
 * DESCRIPTION: Contract on the extension function with Boolean upper bound (Boolean or Nothing) or smartcast to Boolean.
 * DISCUSSION
 */

Response:
import kotlin.contracts.*

// TESTCASE NUMBER: 1
fun <T : <!FINAL_UPPER_BOUND!>Boolean<!>>T.case_1(): Boolean? {
    contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>returns(null) implies (!this@case_1)<!> }
    return if (!this) null else true
}<|endoftext|>


Prompt:
fun case_30(a: Int?, b: Nothing?, c: Int = if (a === b || <!SENSELESS_COMPARISON!>a == null<!>) 0 else a) {
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>b<!>

Response: }<|endoftext|>


Prompt:
expectMinMax("a", "a", listOf("a"))
        expectMinMax("a", "bcd", listOf("a", "bcd"))
        expectMinMax("a", "e", listOf("a", "bcd", "e"))
        expectMinMax(1, Int.MAX_VALUE, listOf(1, 2, Int.MAX_VALUE))

Response:
expectMinMax(1, Long.MAX_VALUE, listOf(1, 2, Long.MAX_VALUE))
        expectMinMax(1U, UInt.MAX_VALUE, listOf(1U, 2U, UInt.MAX_VALUE))
        expectMinMax('a', Char.MAX_VALUE, listOf('a', 'b', Char.MAX_VALUE))

    }

    @Test<|endoftext|>


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

import org.jetbrains.kotlin.gradle.dsl.*
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptionsDefault
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptionsHelper

Response:
import org.jetbrains.kotlin.gradle.plugin.*
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycle
import org.jetbrains.kotlin.gradle.plugin.await
import org.jetbrains.kotlin.gradle.plugin.launch<|endoftext|>


Prompt:
override val classId: ClassId?
            get() = getAnnotationConeType()?.lookupTag?.classId

        override val isRetentionSource: Boolean
            get() = getAnnotationClass()?.getRetention(actualSession) == AnnotationRetention.SOURCE

        override val isOptIn: Boolean

Response:
get() = getAnnotationClass()?.hasAnnotation(OptInNames.REQUIRES_OPT_IN_CLASS_ID, actualSession) ?: false

        private fun getAnnotationClass(): FirRegularClassSymbol? =
            getAnnotationConeType()?.toRegularClassSymbol(actualSession)

        private fun getAnnotationConeType(): ConeClassLikeType? {<|endoftext|>


Prompt:
<!UNREACHABLE_CODE!>val x = 1<!>
}

fun test_8() {
    do {

    } while (<!NON_TRIVIAL_BOOLEAN_CONSTANT!>1 == 1<!>)
    <!UNREACHABLE_CODE!>val x = 1<!>
}

fun test_9() {
    do {

Response:
val x = 1
    } while (false)
    val y = 2
}

fun test_10() {
    do {
        val x = 1
    } while (<!NON_TRIVIAL_BOOLEAN_CONSTANT!>false && true<!>)
    val y = 2
}<|endoftext|>


Prompt:
sourceElement.startOffsetSkippingComments, sourceElement.endOffset, IrDeclarationOrigin.DEFINED,
            variableDescriptor,
            variableDescriptor.type.toIrType(),
            property.initializer?.let { generateExpression(it) }
        )
    }

    private fun generateLocalDelegatedProperty(
        ktProperty: KtProperty,

Response:
ktDelegate: KtPropertyDelegate,
        variableDescriptor: VariableDescriptorWithAccessors,
        scopeOwnerSymbol: IrSymbol
    ): IrStatement =
        DelegatedPropertyGenerator(context)
            .generateLocalDelegatedProperty(ktProperty, ktDelegate, variableDescriptor, scopeOwnerSymbol)<|endoftext|>


Prompt:
): SMAPAndMethodNode {
    getMethodNode(owner, bytes, method, isSuspend)?.let { return it }
    if (isMangled) {
        // Compatibility with old inline class ABI versions.
        val dashIndex = method.name.indexOf('-')

Response:
val nameWithoutManglingSuffix = if (dashIndex > 0) method.name.substring(0, dashIndex) else method.name
        if (nameWithoutManglingSuffix != method.name) {
            getMethodNode(owner, bytes, Method(nameWithoutManglingSuffix, method.descriptor), isSuspend)?.let { return it }
        }<|endoftext|>


Prompt:
addRangesGenerators(jsGeneratedDir, KotlinTarget.JS)
            oneToOneMappingsGenerators.add(MappingsGenerator.forTitlecase(jsGeneratedDir.resolve("_TitlecaseMappings.kt")))

            val nativeGeneratedDir = baseDir.resolve("kotlin-native/runtime/src/main/kotlin/generated/")

Response:
addRangesGenerators(nativeGeneratedDir, KotlinTarget.Native)
            addOneToOneMappingsGenerators(nativeGeneratedDir, KotlinTarget.Native)
            addOneToManyMappingsGenerators(nativeGeneratedDir, KotlinTarget.Native)
            stringUppercaseGenerators.add(<|endoftext|>


Prompt:
fun foo()
}

// MODULE: jvm()()(common)
// FILE: main.kt
actual interface I1 {
    fun bar()
}

actual <!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface F1 : I1 {
    fun baz()
}

actual interface I2 : I1 {}

Response:
actual <!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface F2 : I2 {
    actual fun foo()
}<|endoftext|>


Prompt:
BindingContextUtils.addOwnDataTo(trace, null, commitDiagnostics, map, mutableDiagnostics)
        }

        @TestOnly
        override fun <K, V> getSliceContents(slice: ReadOnlySlice<K, V>): ImmutableMap<K, V> {

Response:
return ImmutableMap.copyOf(parentContext.getSliceContents(slice) + map.getSliceContents(slice))
        }

        override fun getProject(): Project? {
            return this@DelegatingBindingTrace.getProject()
        }
    }

    private val bindingContext = MyBindingContext()<|endoftext|>


Prompt:
if (containingClass != null) {
                    val containingLightClass = containingClass.toLightClass()
                    if (containingLightClass != null) {
                        psiClass = containingLightClass
                    }
                }
            } else {
                // Decompiled version of [KtLightClass] may not have [kotlinOrigin]
                val containingDeclaration = declaration.containingClassOrObject

Response:
if (containingDeclaration is KtObjectDeclaration &&
                    containingDeclaration.isCompanion()
                ) {
                    psiClass.containingClass?.let { containingClass ->
                        psiClass = containingClass
                        fieldFinder = { psiField ->
                            psiField.name == declaration.name
                        }
                    }
                }
            }
        }<|endoftext|>


Prompt:
JsUnaryOperator.DELETE -> listOf(expression)
                }
            }

            is JsBinaryOperation -> {
                when (expression.operator) {
                    JsBinaryOperator.BIT_AND,
                    JsBinaryOperator.BIT_OR,
                    JsBinaryOperator.BIT_XOR,
                    JsBinaryOperator.COMMA,

Response:
JsBinaryOperator.ADD,
                    JsBinaryOperator.SUB,
                    JsBinaryOperator.MUL,
                    JsBinaryOperator.DIV,
                    JsBinaryOperator.MOD,
                    JsBinaryOperator.EQ,
                    JsBinaryOperator.NEQ,
                    JsBinaryOperator.REF_EQ,
                    JsBinaryOperator.REF_NEQ,<|endoftext|>


Prompt:
class Qux<T1, T2: Baz<T2, <!UPPER_BOUND_VIOLATED!>Bar<Foo, T2><!>>>(var f: T2)

class Quux<T> {
    fun test(): Unit {

Response:
val x: Qux<in T, <!UPPER_BOUND_VIOLATED!>Baz<T, <!UPPER_BOUND_VIOLATED!>Bar<Foo, <!CONFLICTING_PROJECTION!>in<!> T><!>><!>> = <!INITIALIZER_TYPE_MISMATCH!>null!!<!>
        x.f = null!!<|endoftext|>


Prompt:
if (components.root != otherComponents.root)
        return false
    return if (components.size < otherComponents.size) false
    else components.segments.subList(0, otherComponents.size).equals(otherComponents.segments)
}

/**
 * Determines whether this file belongs to the same root as [other]

Response:
* and starts with all components of [other] in the same order.
 * So if [other] has N components, first N components of `this` must be the same as in [other].
 *
 * @return `true` if this path starts with [other] path, `false` otherwise.
 */
public fun File.startsWith(other: String): Boolean = startsWith(File(other))

/**<|endoftext|>


Prompt:
import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.diagnostics.KtDiagnostic
import org.jetbrains.kotlin.diagnostics.KtDiagnosticReporterWithContext
import org.jetbrains.kotlin.ir.declarations.IrAnnotationContainer

Response:
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.IrFile
import org.jetbrains.kotlin.ir.declarations.path
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.types.classOrNull<|endoftext|>


Prompt:
var isInvokeCalled = false
    infix operator fun invoke(i: Int) { isInvokeCalled = true } //(1)
}

class B() {
    val memberValC
        get() = c
}
val c = C()

val B.extensionValC: C
    get() = c

fun box(): String{
    val b = B()

Response:
b memberValC 3         //resolved to (1)
    if (b.memberValC.isInvokeCalled) {
        c.isInvokeCalled = false
        b extensionValC 4      //resolved to (1)
        if (b.extensionValC.isInvokeCalled)
            return "OK"
    }
    return "NOK"
}<|endoftext|>


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

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


Prompt:
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol

Response:
import org.jetbrains.kotlin.fir.symbols.lazyDeclarationResolver
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.util.ListMultimap
import org.jetbrains.kotlin.fir.util.Multimap<|endoftext|>


Prompt:
if (!ownersEquivalent(a, b, equivalentCallables, allowCopiesFromTheSameDeclaration)) return false

        return a.index == b.index // We ignore type parameter names
    }

    @Suppress("NO_TAIL_CALLS_FOUND", "NON_TAIL_RECURSIVE_CALL") // K2 warning suppression, TODO: KT-62472

Response:
private tailrec fun CallableDescriptor.singleSource(): SourceElement? {
        if (this !is CallableMemberDescriptor || kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE) return source

        return overriddenDescriptors.singleOrNull()?.singleSource()
    }

    fun areCallableDescriptorsEquivalent(
        a: CallableDescriptor,<|endoftext|>


Prompt:
var bundleId: String? = null

    @Argument(
        value = "-Xcache-directory",
        valueDescription = "<path>",
        description = "Path to the directory containing caches.",
        delimiter = Argument.Delimiters.none
    )
    var cacheDirectories: Array<String>? = null

    @Argument(
        value = CACHED_LIBRARY,

Response:
valueDescription = "<library path>,<cache path>",
        description = "Paths to a library and its cache, separated by a comma.",
        delimiter = Argument.Delimiters.none
    )
    var cachedLibraries: Array<String>? = null

    @Argument(
        value = "-Xauto-cache-from",
        valueDescription = "<path>",<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid

abstract class AbstractValueRemapper : IrElementTransformerVoid() {

    protected abstract fun remapValue(oldValue: IrValueSymbol): IrValueSymbol?

    override fun visitGetValue(expression: IrGetValue): IrExpression {

Response:
val newValue = remapValue(expression.symbol) ?: return expression
        return expression.run { IrGetValueImpl(startOffset, endOffset, newValue, origin) }
    }

    override fun visitSetValue(expression: IrSetValue): IrExpression {
        expression.transformChildrenVoid()
        val newValue = remapValue(expression.symbol) ?: return expression<|endoftext|>


Prompt:
is ExportedType.TypeParameter -> if (constraint == null) {
            name
        } else {
            "$name extends ${constraint.toTypeScript(indent, isInCommentContext)}"
        }
    }

    private fun ExportedClass.couldBeProperty(): Boolean {
        return this is ExportedObject && nestedClasses.all {

Response:
it.couldBeProperty() && it.ir.visibility != DescriptorVisibilities.PROTECTED
        }
    }

    private fun tsIgnore(reason: String): String {
        return "/* @ts-ignore: $reason */"
    }

    private fun tsDeprecated(message: String): String {
        return "/** @deprecated $message */"
    }
}<|endoftext|>


Prompt: fun <@Anno("type param $prop") F : @Anno("bound $prop") List<@Anno("nested bound $prop") List<@Anno("nested nested bound $prop") String>>> @receiver:Anno("receiver annotation: $prop") @Anno("receiver type $prop") Collection<@Anno("nested receiver type $prop") List<@Anno("nested nested receiver type

Response: $prop")String>>.implicitType(@Anno("parameter annotation $prop") param: @Anno("parameter type $prop") ListIterator<@Anno("nested parameter type $prop") List<@Anno("nested nested parameter type $prop")String>>) = explicitType()<|endoftext|>


Prompt:
expect annotation class CommonAnnotationForAnnotationClassesOnly(text: String) {
    val text: String
}

expect annotation class CommonAnnotation(text: String) {
    val text: String
}

expect var propertyWithoutBackingField: Double
expect val propertyWithBackingField: Double
expect val propertyWithDelegateField: Int

Response:
expect val <T : CharSequence> T.propertyWithExtensionReceiver: Int

expect fun function1(text: String): String
expect fun <Q : Number> Q.function2(): Q

expect class AnnotatedClass(value: String) {
    val value: String
}
typealias AnnotatedLiftedUpTypeAlias = AnnotatedClass<|endoftext|>


Prompt:
open class <!CYCLIC_SCOPES_WITH_COMPANION!>Base<!>() {
            // error-scope
            val foo: <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, DEPRECATED_ACCESS_BY_SHORT_NAME!>Int<!> = 42
        }

        // error-scope

Response:
val data: <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, DEPRECATED_ACCESS_BY_SHORT_NAME!>Data<!> = Data()

        companion <!CYCLIC_SCOPES_WITH_COMPANION!>object<!> : DerivedAbstract()
    }
}

object WithPropertyInBaseDifferentOrder {<|endoftext|>


Prompt:
val booleanArray get() = irBuiltIns.booleanArray

    val byteArrayType get() = byteArray.owner.defaultType
    val charArrayType get() = charArray.owner.defaultType
    val shortArrayType get() = shortArray.owner.defaultType
    val intArrayType get() = intArray.owner.defaultType
    val longArrayType get() = longArray.owner.defaultType

Response:
val floatArrayType get() = floatArray.owner.defaultType
    val doubleArrayType get() = doubleArray.owner.defaultType
    val booleanArrayType get() = booleanArray.owner.defaultType

    val primitiveTypesToPrimitiveArrays get() = irBuiltIns.primitiveTypesToPrimitiveArrays
    val primitiveArraysToPrimitiveTypes get() = irBuiltIns.primitiveArraysToPrimitiveTypes<|endoftext|>


Prompt:
fun ASTNode.leaves(forward: Boolean = true): Sequence<ASTNode> {
    if (forward) {
        return generateSequence(TreeUtil.nextLeaf(this)) { TreeUtil.nextLeaf(it) }
    } else {
        return generateSequence(TreeUtil.prevLeaf(this)) { TreeUtil.prevLeaf(it) }
    }
}

Response:
fun ASTNode.closestPsiElement(): PsiElement? {
    var node = this
    while (node.psi == null) {
        node = node.treeParent
    }
    return node.psi
}

fun LazyParseablePsiElement.getContainingKtFile(): KtFile {

    val file = this.containingFile<|endoftext|>


Prompt:
createCirTreeRootFromSourceCode(
                """
                class E
                typealias D = E
                typealias C = D
            """.trimIndent()
            )
        )

        assertEquals(setOf("C"), resolver.resolveAssociatedIds("A"))
        assertEquals(setOf("C"), resolver.resolveAssociatedIds("B"))

Response:
assertEquals(setOf("C"), resolver.resolveAssociatedIds("C"))
        assertEquals(setOf("C"), resolver.resolveAssociatedIds("D"))
        assertEquals(setOf("C"), resolver.resolveAssociatedIds("E"))
    }

    /*
    Platform A:    A -> B -> C
    Platform B:    A -> X -> B -> C<|endoftext|>


Prompt:
functionContext.defineLoopLevel(loop, LoopLabelType.BREAK, wasmBreakBlock)
                    functionContext.defineLoopLevel(loop, LoopLabelType.CONTINUE, wasmContinueBlock)
                    loop.body?.let { generateAsStatement(it) }
                }
                generateExpression(loop.condition)
                body.buildBrIf(wasmLoop, loop.condition.getSourceLocation())
            }

Response:
}

        body.buildGetUnit()
    }

    override fun visitWhileLoop(loop: IrWhileLoop) {
        // (loop $CONTINUE_LABEL
        //     (block $BREAK_LABEL
        //         (br_if $BREAK_LABEL (i32.eqz <CONDITION>))
        //         <LOOP_BODY><|endoftext|>


Prompt:
while (j < length) {
                codePoint = codePointAt(j)
                if (codePoint.isCaseIgnorable()) {
                    j += codePoint.charCount()
                } else {
                    break
                }
            }
            if (j >= length || !codePoint.isCased()) {
                return true
            }
        }
    }
    return false
}

Response:
internal fun String.lowercaseImpl(): String {
    var unchangedIndex = 0
    while (unchangedIndex < this.length) {
        val codePoint = codePointAt(unchangedIndex)
        if (codePoint.lowercaseCodePoint() != codePoint) { // '\u0130' and '\u03A3' have lowercase corresponding mapping in UnicodeData.txt, no need to check them separately
            break
        }<|endoftext|>


Prompt:
<!CONFLICTING_OVERLOADS!>fun Test5(x: Int)<!> = x

    fun local() {
        <!CONFLICTING_OVERLOADS!>fun test1()<!> {}
        <!CONFLICTING_OVERLOADS!>fun test1()<!> {}

        fun Any.test2() {}
        fun test2(x: Any) = x

Response:
<!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}
        <!CONFLICTING_OVERLOADS!>fun Any.test3()<!> {}

        <!CONFLICTING_OVERLOADS!>fun test4(): Int<!> = 0
        <!CONFLICTING_OVERLOADS!>fun test4(): String<!> = ""<|endoftext|>


Prompt:
// TESTED_OBJECTS: Test, prop
// ABSENT: TRUE

// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test$Companion, prop
// ABSENT: TRUE

// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test$Companion, prop$delegate
// ABSENT: TRUE

Response:
// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test, prop$delegate
// FLAGS: ACC_STATIC, ACC_FINAL, ACC_PRIVATE<|endoftext|>


Prompt:
assertEquals(value.toUByte(), value.convert<UByte>())
    assertEquals(value.toShort(), value.convert<Short>())
    assertEquals(value.toUShort(), value.convert<UShort>())
    assertEquals(value.toInt(), value.convert<Int>())

Response:
assertEquals(value.toUInt(), value.convert<UInt>())
    assertEquals(value.toLong(), value.convert<Long>())
    assertEquals(value.toULong(), value.convert<ULong>())

    assertEquals(value.toByte(), value.narrow<Byte>())
    assertEquals(value.toShort(), value.narrow<Short>())<|endoftext|>


Prompt:
override fun onUnboxing(insn: AbstractInsnNode, value: BoxedBasicValue, resultType: Type) {
        value.descriptor.run {
            val unboxedType = getUnboxTypeOrOtherwiseMethodReturnType(insn as? MethodInsnNode)
            if (unboxedType == resultType)
                addAssociatedInsn(value, insn)
            else

Response:
addUnboxingWithCastTo(insn, resultType)
        }
    }

    override fun onAreEqual(insn: AbstractInsnNode, value1: BoxedBasicValue, value2: BoxedBasicValue) {
        val descriptor1 = value1.descriptor
        val descriptor2 = value2.descriptor
        candidatesBoxedValues.merge(descriptor1, descriptor2)<|endoftext|>


Prompt:
// WITH_STDLIB

/*
 * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
 *
 * SPEC VERSION: 0.1-268
 * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 2 -> sentence 3

Response:
* PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 3
 * overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 4 -> sentence 1<|endoftext|>


Prompt:
}

        if (
            outputPath == null
        )
            return

        //language=JavaScript 1.8
        appendLine(
            """
                config.output.path = require('path').resolve(__dirname, ${outputPathInput!!.jsQuoted()})
            """.trimIndent()
        )
    }

    private fun Appendable.appendErrorPlugin() {

Response:
//language=ES6
        appendLine(
            """
                // noinspection JSUnnecessarySemicolon
                ;(function(config) {
                    const tcErrorPlugin = require('kotlin-test-js-runner/tc-log-error-webpack');
                    config.plugins.push(new tcErrorPlugin())
                    config.stats = config.stats || {}<|endoftext|>


Prompt:
if (f != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>f<!>.propT

        if (f != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>f<!>.propAny

Response:
if (f != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>f<!>.propNullableT

        if (f != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>f<!>.propNullableAny<|endoftext|>


Prompt:
package org.jetbrains.kotlin.extensions

import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor

Response:
import org.jetbrains.kotlin.psi.KtModifierListOwner
import org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass
import org.jetbrains.kotlin.types.TypeUtils

interface AnnotationBasedExtension {

    fun getAnnotationFqNames(modifierListOwner: KtModifierListOwner?): List<String><|endoftext|>


Prompt:
return computeJvmDescriptor(withReturnType = false) ==
                builtinWithErasedParameters.original.computeJvmDescriptor(withReturnType = false)
                && !doesOverride(builtinWithErasedParameters)
    }

    private fun resolveConstructor(constructor: JavaConstructor): JavaClassConstructorDescriptor {
        val classDescriptor = ownerDescriptor

Response:
val constructorDescriptor = JavaClassConstructorDescriptor.createJavaConstructor(
            classDescriptor,
            c.resolveAnnotations(constructor), /* isPrimary = */
            false,
            c.components.sourceElementFactory.source(constructor)
        )

        val c =<|endoftext|>


Prompt:
assertEquals("aObjC", createObjCExportNamer().getParameterName(parameterA))
    }

    @Test
    fun `test - class mangling`() {
        val module = createModuleDescriptor {
            source(
                """
                package a
                class Foo
            """.trimIndent()
            )
            source(
                """
                package b
                class Foo

Response:
""".trimIndent()
            )
        }

        val aFoo = module.findClassAcrossModuleDependencies(ClassId.fromString("a/Foo"))!!
        val bFoo = module.findClassAcrossModuleDependencies(ClassId.fromString("b/Foo"))!!

        val namer = createObjCExportNamer()<|endoftext|>


Prompt:
reversedEdgesCount.reserve(toId + 1)
                reversedEdgesCount[toId]++
            }

            private fun concreteType(type: DataFlowIR.Type.Declared): Int {
                assert(!(type.isAbstract && type.isFinal)) { "Incorrect type: $type" }
                return if (type.isAbstract)
                    VIRTUAL_TYPE_ID

Response:
else {
                    if (!instantiatingClasses[type.index])
                        error("Type $type is not instantiated")
                    type.index
                }
            }

            private fun ordinaryNode(nameBuilder: () -> String) =
                    constraintGraph.addNode { Node.Ordinary(it, nameBuilder) }

            private fun sourceNode(typeId: Int, nameBuilder: () -> String) =<|endoftext|>


Prompt:
fun IrClass.isUsedAsBoxClass(): Boolean = IrTypeInlineClassesSupport.isUsedAsBoxClass(this)

fun IrType.binaryTypeIsReference(): Boolean = this.computePrimitiveBinaryTypeOrNull() == null

internal inline fun <R> IrType.unwrapToPrimitiveOrReference(
        eachInlinedClass: (inlinedClass: IrClass, nullable: Boolean) -> Unit,

Response:
ifPrimitive: (primitiveType: KonanPrimitiveType, nullable: Boolean) -> R,
        ifReference: (type: IrType) -> R
): R = IrTypeInlineClassesSupport.unwrapToPrimitiveOrReference(this, eachInlinedClass, ifPrimitive, ifReference)

internal object IrTypeInlineClassesSupport : InlineClassesSupport<IrClass, IrType>() {<|endoftext|>


Prompt:
put(factory.warningFactory, KtDiagnosticWithParameters1Renderer(factory.warningMessage(message), rendererA))
    }

    fun <A, B> put(
        factory: KtDiagnosticFactoryForDeprecation2<A, B>,
        message: String,
        rendererA: DiagnosticParameterRenderer<A>?,

Response:
rendererB: DiagnosticParameterRenderer<B>?
    ) {
        put(factory.errorFactory, KtDiagnosticWithParameters2Renderer(message, rendererA, rendererB))
        put(factory.warningFactory, KtDiagnosticWithParameters2Renderer(factory.warningMessage(message), rendererA, rendererB))
    }<|endoftext|>


Prompt:
override fun invokeWithArguments(arguments: List<Computation>, typeSubstitution: ESTypeSubstitution, reducer: Reducer): List<ESEffect> =
        reducer.reduceEffects(doInvocation(arguments, typeSubstitution, reducer))

    protected abstract fun doInvocation(
        arguments: List<Computation>,
        typeSubstitution: ESTypeSubstitution,

Response:
reducer: Reducer
    ): List<ESEffect>
}

class ESTypeSubstitution(
    val substitutor: NewTypeSubstitutor,
    val builtIns: KotlinBuiltIns
) {
    companion object {
        fun empty(builtIns: KotlinBuiltIns): ESTypeSubstitution {
            return ESTypeSubstitution(EmptySubstitutor, builtIns)
        }<|endoftext|>


Prompt:
result = effectiveModality
            }
        }
        return result
    }

    private fun IrSimpleFunction.updateAccessorModalityAndVisibility(
        newModality: Modality,
        newVisibility: DescriptorVisibility
    ): IrSimpleFunction? {
        require(this is IrFunctionWithLateBinding) {
            "Unexpected fake override accessor kind: $this"
        }

Response:
// For descriptors it gets INVISIBLE_FAKE.
        if (DescriptorVisibilities.isPrivate(this.visibility)) return null

        this.visibility = newVisibility
        this.modality = newModality
        return this
    }

    private fun createAndBindFakeOverride(
        overridables: List<FakeOverride>,
        currentClass: IrClass,<|endoftext|>


Prompt:
if (x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>x<!>.funT()

        if (x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>x<!>.funAny()

Response:
if (x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>x<!>.funNullableT()

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


Prompt:
languageVersionSettings.getFeatureSupport(LanguageFeature.NonParenthesizedAnnotationsOnFunctionalTypes) == LanguageFeature.State.ENABLED

    open class TypeTransformerForTests {
        open fun transformType(kotlinType: KotlinType): KotlinType? = null
    }

    // Entry point for KotlinTypeCheckerTest

Response:
fun resolveTypeWithPossibleIntersections(scope: LexicalScope, typeReference: KtTypeReference, trace: BindingTrace): KotlinType {
        return resolveType(
            TypeResolutionContext(scope, trace, false, false, typeReference.suppressDiagnosticsInDebugMode(), false, true),
            typeReference
        )
    }<|endoftext|>


Prompt:
*  - a+? == a{1, <inf>}?;
 */
internal class ReluctantLeafQuantifierSet(
        quant: Quantifier,
        innerSet: LeafSet,
        next: AbstractSet,
        type: Int
) : LeafQuantifierSet(quant, innerSet, next, type) {

Response:
override fun matches(startIndex: Int, testString: CharSequence, matchResult: MatchResultImpl): Int {
        var index = startIndex
        var occurrences = 0

        while (occurrences < min) {
            if (index + leaf.charCount > testString.length) {
                return -1
            }

            val shift = leaf.accepts(index, testString)<|endoftext|>


Prompt:
removeGarbageForTests()
        flush()
    }

    @TestOnly
    fun dump(lookupSymbols: Set<LookupSymbol>): String {
        flush()

        val sb = StringBuilder()
        val p = Printer(sb)

        p.println("====== File to id map")
        p.println(fileToId.dump())

Response:
p.println("====== Id to file map")
        p.println(idToFile.dump())

        val lookupsStrings = lookupSymbols.groupBy { LookupSymbolKey(it.name, it.scope) }

        for (lookup in lookupMap.keys.sorted()) {
            val fileIds = lookupMap[lookup]!!<|endoftext|>


Prompt:
"native-klib-commonize",
        "Commonize any platform-specific libraries",
        listOf(
            NativeDistributionOptionType,
            OutputOptionType,
            InputLibrariesOptionType,
            DependencyLibrariesOptionType,
            OutputCommonizerTargetsOptionType,
            LogLevelOptionType
        ) + ADDITIONAL_COMMONIZER_SETTINGS,

Response:
::NativeKlibCommonize
    )
    ;

    companion object {
        fun getByAlias(alias: String) = values().firstOrNull { it.alias == alias }
    }
}<|endoftext|>


Prompt:
else -> return null
        }
    }
    return null
}

fun PsiElement.astReplace(newElement: PsiElement) = parent.node.replaceChild(node, newElement.node)

var KtElement.parentSubstitute: PsiElement? by UserDataProperty(Key.create<PsiElement>("PARENT_SUBSTITUTE"))

Response:
fun String?.isIdentifier(): Boolean {
    if (this == null || isEmpty()) return false

    val lexer = KotlinLexer()
    lexer.start(this, 0, length)
    if (lexer.tokenType !== KtTokens.IDENTIFIER) return false
    lexer.advance()
    return lexer.tokenType == null
}<|endoftext|>


Prompt:
if (predicate(it)) {
            changed = true
            transform(it)
        } else {
            it
        }
    }

    if (!changed) return null

    val updatedAlternative = getAlternativeType()?.let { alternative ->
        if (predicate(alternative)) transform(alternative) else alternative
    }

Response:
return IntersectionTypeConstructor(newSupertypes).setAlternative(updatedAlternative)
}<|endoftext|>


Prompt:
if (foo(L<Int>()) != "Int") return "fail3"

    val b = TestClass()
    val data = mutableListOf<List<Any>>()
    data.add(listOf("a", "b", "c"))
    data.add(listOf("d", "e", "f"))
    b.withData(data)

Response:
if (b.getCols() != 3) return "fail4"

    if (B.baz(B) != "[A]") return "fail5"
    if (B.baz("a") != "[S]") return "fail6"
    if (B.baz(arrayOf("b")) != "Array<String>") return "fail7"<|endoftext|>


Prompt: // library.kt:23 box: mainVar:int=1:int, fooParam\13:int=1:int, $i$f$foo\13\54:int=0:int, fooVar\13:int=1:int, bazParam\14:int=1:int, $i$f$baz\14\196:int=0:int, bazVar\14:int=3:int,

Response: baz1Param\15:int=1:int, $i$f$baz1\15\207:int=0:int, baz1Var\15:int=3:int, baz1BlockParam\17:int=1:int, $i$a$-baz1-LibraryKt$baz$1\17\210\14:int=0:int,<|endoftext|>


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

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

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

    val list2 = ArrayList<UInt>()
    for (i in 10u.toUByte()..5u.toUByte()) {
        list2.add(i)
        if (list2.size > 23) break
    }<|endoftext|>


Prompt:
marker?.<!DEBUG_INFO_CALL("fqName: tests.foo; typeCall: extension function")!>foo(x=1)<!><!OPERATOR_MODIFIER_REQUIRED!>><!><!SYNTAX!><!>
}

/*
 * TESTCASE NUMBER: 5
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-37391

Response:
*/
fun case5(marker : Marker?) {
    fun bar(){
        fun Marker.foo(y:Int) = TODO()
        marker?.<!DEBUG_INFO_CALL("fqName: libPackage.Marker.foo; typeCall: function")!>foo(y=1)<!><|endoftext|>


Prompt:
fun IrFunction.getObjCFactoryInitMethodInfo(): ObjCMethodInfo? {
    val factoryAnnotation = this.annotations.findAnnotation(objCFactoryFqName) ?: return null
    return objCMethodInfo(factoryAnnotation)
}

fun inferObjCSelector(descriptor: FunctionDescriptor): String = if (descriptor.valueParameters.isEmpty()) {

Response:
descriptor.name.asString()
} else {
    buildString {
        append(descriptor.name)
        append(':')
        descriptor.valueParameters.drop(1).forEach {
            append(it.name)
            append(':')
        }
    }
}

fun IrClass.getExternalObjCClassBinaryName(): String =<|endoftext|>


Prompt:
?: return ParameterizedTypeImpl(jClass, null, arguments.map(KTypeProjection::javaType))
    if (Modifier.isStatic(jClass.modifiers))
        return ParameterizedTypeImpl(jClass, ownerClass, arguments.map(KTypeProjection::javaType))

    val n = jClass.typeParameters.size
    return ParameterizedTypeImpl(
        jClass,

Response:
createPossiblyInnerType(ownerClass, arguments.subList(n, arguments.size)),
        arguments.subList(0, n).map(KTypeProjection::javaType)
    )
}

@ExperimentalStdlibApi
private val KTypeProjection.javaType: Type
    get() {
        val variance = variance ?: return WildcardTypeImpl.STAR
        val type = type!!<|endoftext|>


Prompt:
c.trace.record(JvmBindingContextSlices.RECEIVER_RUNTIME_ASSERTION_INFO, expressionReceiverValue, assertionInfo)
        }
    }
}

object RuntimeAssertionsOnDeclarationBodyChecker {
    @JvmStatic
    fun check(
        declaration: KtDeclaration,
        descriptor: DeclarationDescriptor,

Response:
bindingTrace: BindingTrace,
        languageVersionSettings: LanguageVersionSettings
    ) {
        if (!languageVersionSettings.supportsFeature(LanguageFeature.StrictJavaNullabilityAssertions)) return

        when {
            declaration is KtProperty && descriptor is VariableDescriptor ->
                checkLocalVariable(declaration, descriptor, bindingTrace)
            declaration is KtFunction && descriptor is FunctionDescriptor -><|endoftext|>


Prompt:
if (arg != null) {
                    stabilityOf(arg, substitutions, currentlyAnalyzing)
                } else {
                    Stability.Parameter(
                        type.classifierOrFail.owner as IrTypeParameter
                    )
                }
            }

            type.isNullable() -> stabilityOf(
                type.makeNotNull(),
                substitutions,
                currentlyAnalyzing
            )

Response:
type.isInlineClassType() -> {
                val inlineClassDeclaration = type.getClass()
                    ?: error("Failed to resolve the class definition of inline type $type")

                if (inlineClassDeclaration.hasStableMarker()) {
                    Stability.Stable
                } else {
                    stabilityOf(
                        type = getInlineClassUnderlyingType(inlineClassDeclaration),<|endoftext|>


Prompt:
}

internal fun throwNoBranchMatchedException(): Nothing {
    throw NoWhenBranchMatchedException()
}

internal fun rangeCheck(index: Int, size: Int) {
  if (index < 0 || index >= size) throw IndexOutOfBoundsException()
}

@PublishedApi
internal fun throwUninitializedPropertyAccessException(name: String): Nothing {

Response:
throw UninitializedPropertyAccessException("lateinit property $name has not been initialized")
}<|endoftext|>


Prompt:
importConverter("Kotlin_Interop_CreateRetainedKotlinMutableSetFromKSet")
    )

    setObjCExportTypeInfo(
            symbols.map.owner,
            importConverter("Kotlin_Interop_CreateRetainedNSDictionaryFromKMap")
    )

    setObjCExportTypeInfo(
            symbols.mutableMap.owner,

Response:
importConverter("Kotlin_Interop_CreateRetainedKotlinMutableDictionaryFromKMap")
    )
}

private fun ObjCExportFunctionGenerationContextBuilder.setupBridgeDebugInfo() {
    val location = setupBridgeDebugInfo(this.objCExportCodegen.generationState, function)
    startLocation = location
    endLocation = location
}<|endoftext|>


Prompt:
assertConstraint(linuxSourceSet, IdeMultiplatformImport.SourceSetConstraint.isLeaf, isMatchExpected = true)
            assertConstraint(linuxSourceSet, IdeMultiplatformImport.SourceSetConstraint.isNative, isMatchExpected = true)
            assertConstraint(linuxSourceSet, IdeMultiplatformImport.SourceSetConstraint.isSinglePlatformType, isMatchExpected = true)

Response:
assertConstraint(linuxSourceSet, IdeMultiplatformImport.SourceSetConstraint.unconstrained, isMatchExpected = true)
        }
    }

    @Test
    fun `test JVM + Android project`() {
        val project = buildMppProjectWithAndroidPlugin()
        val kotlin = project.multiplatformExtension
        kotlin.jvm()<|endoftext|>


Prompt:
@Getter @Setter private final int bar = 234;

    //not required
    @Getter(AccessLevel.PROTECTED) private String name;

    //required by annotation
    @NonNull
    private boolean otherField;

    //not required by annotation, because has initializer
    @NonNull
    private Long zzzz = 23L;

    @NonNull Integer somethingElse;

Response:
// Not required by annotation because static.
    private static String constant;

    static void javaUsage() {
        ConstructorExample generated = ConstructorExample.build("foo", true, 12);
    }
}

// FILE: test.kt

fun box(): String {
    val generated = ConstructorExample.build("foo", true, 12)
    assertEquals(generated.foo, "foo")<|endoftext|>


Prompt:
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import java.io.File

/**
 * Implementation of this interface in phase context, input or output
 * enables LLVM IR validation and dumping
 */
interface LlvmIrHolder {
    val llvmModule: LLVMModuleRef
}

/**

Response:
* Create action that searches context and data for LLVM IR and dumps it.
 */
private fun <Data, Context : PhaseContext> createLlvmDumperAction(): Action<Data, Context> =
        fun(state: ActionState, data: Data, context: Context) {
            if (state.phase.name in context.config.configuration.getList(KonanConfigKeys.SAVE_LLVM_IR)) {<|endoftext|>


Prompt:
generateTestsForFunction(fileName, rangeToBuilder.copy(last = last + 1), Function.UNTIL, extraCode, subdir)
        generateTestsForFunction(fileName, rangeToBuilder.copy(last = last + 1), Function.RANGE_UNTIL, extraCode, subdir)
    }

    private fun generateTestsForFunction(
        fileName: String,

Response:
builder: TestBuilder,
        function: Function,
        extraCode: String? = null,
        subdir: String? = null
    ) = generateTestsForFunction(fileName, Type.entries.associate { it to builder }, function, extraCode, subdir)

    private fun generateTestsForFunction(
        fileName: String,
        typeToBuilderMap: Map<Type, TestBuilder>,<|endoftext|>


Prompt:
assertFailsWith<AssertionError>("base and differentAbi header klib are equal") {
                assertContentEquals(headerKlibBase.readBytes(), headerKlibDifferentAbi.readBytes())
            }
        }
    }

}

@Tag("klib")
@UsePartialLinkage(UsePartialLinkage.Mode.ENABLED_WITH_ERROR)

Response:
abstract class AbstractNativeHeaderKlibCompilationTest : AbstractNativeSimpleTest() {

    protected fun runTest(@TestDataFile testPath: String) {
        val testPathFull = getAbsoluteFile(testPath)
        assert(testPathFull.exists())
        val testCaseLib: TestCase = generateTestcaseFromDirectory(testPathFull, "lib", listOf())<|endoftext|>


Prompt:
z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z +
            z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z +

Response:
z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z +
            z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z +<|endoftext|>


Prompt:
<!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>ENTRY1,<!>
        <!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>ENTRY2;<!>

        constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())

Response:
constructor(arg: UserKlass = UserKlass())
        constructor()
    }

    enum class EnumerationCEC {
        <!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>ENTRY1,<!>
        ENTRY2();

        constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())<|endoftext|>


Prompt:
fun A.foo() {
    if (this@foo.i != null) {
        useInt(this.i)
        useInt(i)
    }
}

fun test3() {
    useFunction {
        if(i != null) {
            useInt(this.i)
        }
    }
}

fun useInt(i: Int) = i

Response: fun useFunction(f: A.() -> Unit) = f<|endoftext|>


Prompt: nested return type $prop") Int>> = emptyList()

Response:
val <@Anno("type param $prop") F : @Anno("bound $prop") Number> @receiver:Anno("receiver annotation: $prop") @Anno("receiver type $prop") F.explicitType: @Anno("bound $prop") Int get() = 1

    companion object {
        private const val prop = 0
    }
}<|endoftext|>


Prompt:
var x: Any? = materialize()
    require(x is String)
    do {
        x.<!UNRESOLVED_REFERENCE!>length<!>
        do {
            x.<!UNRESOLVED_REFERENCE!>length<!>
        } while (i < 10)
        x = 10
    }while (j < 10)
}

Response:
fun test31(i: Int, j: Int) {
    var x: Any? = materialize()
    require(x is String)
    do {
        x.<!UNRESOLVED_REFERENCE!>length<!>
        do {
            x.<!UNRESOLVED_REFERENCE!>length<!>
        } while (i < 10)
        x = ""<|endoftext|>


Prompt:
"build/classes/kotlin/js/integrationTest/default/manifest"
                )

                // Native:
                assertFileExists("build/classes/kotlin/linux64/integrationTest/klib/new-mpp-associate-compilations_integrationTest.klib")
            }
        }
    }

    @Test

Response:
fun testTestRunsApi() = with(Project("new-mpp-associate-compilations")) {
        setupWorkingDir()
        gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)

        // TOOD: add Kotlin/JS tests once they can be tested without much performance overhead<|endoftext|>


Prompt:
class KlibMetadataClassDataFinder(
    private val fragment: PackageFragment,
    private val nameResolver: NameResolver,
    private val containerSource: DeserializedContainerSource? = null
) : ClassDataFinder {
    val nameList = fragment.getExtension(KlibMetadataProtoBuf.className).orEmpty()

Response:
override fun findClassData(classId: ClassId): ClassData? {

        val index = nameList.indexOfFirst { nameResolver.getClassId(it) == classId }
        if (index == -1) {
            return null
        }

        val foundClass = fragment.getClass_(index) ?: error("Could not find data for serialized class $classId")<|endoftext|>


Prompt:
{ it.length },
            { it }
        ))

        assertPrints(sorted, "[a, b, aa, bb]")
    }

    @Sample
    fun compareByWithComparator() {
        val list = listOf('B', 'a', 'A', 'b')

        val sorted = list.sortedWith(

Response:
compareBy(String.CASE_INSENSITIVE_ORDER) { v -> v.toString() }
        )

        assertPrints(sorted, "[a, A, B, b]")
    }

    @Sample
    fun compareByDescendingWithSingleSelector() {
        val list = listOf("aa", "b", "bb", "a")<|endoftext|>


Prompt:
private val computeFirSymbol: () -> FirTypeParameterSymbol,
) : KtFirTypeParameterSymbolBase(), KtFirPsiSymbol<PsiTypeParameter, FirTypeParameterSymbol> {
    override val name: Name = withValidityAssertion {
        psi.name?.let { Name.identifier(it) } ?: SpecialNames.NO_NAME_PROVIDED

Response:
}

    override val origin: KtSymbolOrigin
        get() = withValidityAssertion { KtSymbolOrigin.JAVA }

    override val variance: Variance
        get() = withValidityAssertion { Variance.INVARIANT }

    override val isReified: Boolean
        get() = withValidityAssertion { false }<|endoftext|>


Prompt:
@SinceKotlin("1.1")
    override val isFinal: Boolean
        get() = error()

    @SinceKotlin("1.1")
    override val isOpen: Boolean
        get() = error()

    @SinceKotlin("1.1")
    override val isAbstract: Boolean
        get() = error()

    @SinceKotlin("1.1")

Response:
override val isSealed: Boolean
        get() = error()

    @SinceKotlin("1.1")
    override val isData: Boolean
        get() = error()

    @SinceKotlin("1.1")
    override val isInner: Boolean
        get() = error()

    @SinceKotlin("1.1")
    override val isCompanion: Boolean<|endoftext|>


Prompt:
public actual inline fun todo(@Suppress("UNUSED_PARAMETER") block: () -> Unit) {
    println("TODO at " + currentStackTrace()[0])
}

/**
 * Returns an array of stack trace elements, each representing one stack frame.
 * The first element of the array (assuming the array is not empty) represents the top of the

Response:
* stack, which is the place where [currentStackTrace] function was called from.
 */
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@InlineOnly<|endoftext|>


Prompt:
return ByteArray(size) { index -> this[index] }
}

/**
 * Returns an array of Char containing all of the elements of this generic array.
 */
public fun Array<out Char>.toCharArray(): CharArray {
    return CharArray(size) { index -> this[index] }
}

/**
 * Returns an array of Double containing all of the elements of this generic array.
 */

Response:
public fun Array<out Double>.toDoubleArray(): DoubleArray {
    return DoubleArray(size) { index -> this[index] }
}

/**
 * Returns an array of Float containing all of the elements of this generic array.
 */
public fun Array<out Float>.toFloatArray(): FloatArray {
    return FloatArray(size) { index -> this[index] }
}

/**<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION

object Scope {
    fun foo(): Int = 0

    object Nested {
        @Deprecated("err", level = DeprecationLevel.HIDDEN)
        fun foo(): String = ""

        fun <T> take(f: () -> T): T = f()

Response:
fun test() {
            val r1 = take(::foo)
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>r1<!>

            val r2 = ::foo
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KFunction0<kotlin.Int>")!>r2<!>

            val r3 = foo()<|endoftext|>


Prompt:
private object A72 { val a = Random.nextInt(100) }
private object A73 { val a = Random.nextInt(100) }
private object A74 { val a = Random.nextInt(100) }
private object A75 { val a = Random.nextInt(100) }
private object A76 { val a = Random.nextInt(100) }

Response:
private object A77 { val a = Random.nextInt(100) }
private object A78 { val a = Random.nextInt(100) }
private object A79 { val a = Random.nextInt(100) }
private object A80 { val a = Random.nextInt(100) }
private object A81 { val a = Random.nextInt(100) }<|endoftext|>


Prompt:
} else if (element !is KtProperty || PsiTreeUtil.getParentOfType(element, KtDeclaration::class.java) !is KtClass) {
            context.trace.report(ErrorsAndroid.INAPPLICABLE_IGNORED_ON_PARCEL.on(annotationEntry))
        }
    }

    private fun checkTypeParcelerUsage(

Response:
resolvedCall: ResolvedCall<*>,
            annotationEntry: KtAnnotationEntry,
            context: CallCheckerContext,
            element: KtModifierListOwner
    ) {
        val descriptor = context.trace[BindingContext.DECLARATION_TO_DESCRIPTOR, element] ?: return<|endoftext|>


Prompt:
"byte" -> SirSwiftModule.int8
        "short" -> SirSwiftModule.int16
        "int" -> SirSwiftModule.int32
        "long" -> SirSwiftModule.int64

        "ubyte" -> SirSwiftModule.uint8
        "ushort" -> SirSwiftModule.uint16
        "uint" -> SirSwiftModule.uint32

Response:
"ulong" -> SirSwiftModule.uint64

        "any" -> buildClass {
            name = "MyClass"
            origin = SirOrigin.ExternallyDefined(name="MyClass")
        }

        else -> error("Unknown type: $typeName")
    }.let { SirNominalType(it) }
}

private fun readRequestFromFile(file: File): BridgeRequest {<|endoftext|>


Prompt:
"directives are applied in the order of appearance, i.e. !FOO +BAR means include only FOO and BAR"
                )
            }

            var first = true
            do {
                val operation = matcher.group(1)
                val name = matcher.group(2)

                val newCondition: Condition<Diagnostic> =

Response:
if (name in setOf("ERROR", "WARNING", "INFO")) {
                        Condition { diagnostic -> diagnostic.severity == Severity.valueOf(name) }
                    } else {
                        Condition { diagnostic -> name == diagnostic.factory.name }
                    }

                when (operation) {
                    "!" -> {
                        if (!first) {
                            Assert.fail(<|endoftext|>


Prompt:
}
                    ProgressionDirection.DECREASING -> {
                        if (headerInfo.step.constLongValue != -1L) return null

                        // There are 2 cases for an optimizable range with DECREASING direction:
                        //   1. `X in B downTo A`:

Response:
//      Produces HeaderInfo with first = B, last = A, isReversed = false (`last/A` is lower).
                        //      Expression for `upper/B` should come first.
                        //   2. `X in (A..B).reversed()`:
                        //      Produces HeaderInfo with first = B, last = A, isReversed = true (`last/A` is lower).<|endoftext|>


Prompt:
internal fun PhaseContext.firSerializer(input: FirOutput): SerializerOutput? = when (input) {
    !is FirOutput.Full -> null
    else -> firSerializerBase(input.firResult, null)
}

internal fun PhaseContext.fir2IrSerializer(input: FirSerializerInput): SerializerOutput {

Response:
return firSerializerBase(input.firToIrOutput.firResult, input.firToIrOutput, produceHeaderKlib = input.produceHeaderKlib)
}

internal fun PhaseContext.firSerializerBase(
        firResult: FirResult,
        fir2IrOutput: Fir2IrOutput?,
        produceHeaderKlib: Boolean = false,
): SerializerOutput {<|endoftext|>


Prompt:
package org.jetbrains.kotlin.assignment.plugin.gradle

open class AssignmentExtension {
    internal val myAnnotations = mutableListOf<String>()

    open fun annotation(fqName: String) {
        myAnnotations.add(fqName)
    }

    open fun annotations(fqNames: List<String>) {

Response:
myAnnotations.addAll(fqNames)
    }

    open fun annotations(vararg fqNames: String) {
        myAnnotations.addAll(fqNames)
    }
}<|endoftext|>


Prompt:
overloadSymbol = symbols.findContentHashCodeOverload(argumentType)
                    returnType = irBuiltins.intType
                } else {
                    overloadSymbol = symbols.findContentToStringOverload(argumentType)
                    returnType = irBuiltins.stringType
                }

                return builder.irCall(
                    overloadSymbol,
                    returnType,
                ).apply {

Response:
extensionReceiver = argument
                    if (argumentType.classOrNull == irBuiltins.arrayClass) {
                        putTypeArgument(0, argumentType.getArrayElementType(irBuiltins))
                    }
                }
            }
            in symbols.startCoroutineUninterceptedOrReturnIntrinsics -> {<|endoftext|>


Prompt:
* @sample samples.collections.Collections.Transformations.associateByToWithValueTransform
 */
public inline fun <T, K, V, M : MutableMap<in K, in V>> Iterable<T>.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {
    for (element in this) {

Response:
destination.put(keySelector(element), valueTransform(element))
    }
    return destination
}

/**
 * Populates and returns the [destination] mutable map with key-value pairs
 * provided by [transform] function applied to each element of the given collection.
 *
 * If any of two pairs would have the same key the last one gets added to the map.
 *<|endoftext|>


Prompt:
if (c >= 5) continue
        c++
    }
    return c
}

fun for_byte_list(): Int {
    val a = ArrayList<Byte>()
    a.add(0); a.add(0); a.add(0); a.add(0); a.add(0)

Response:
a.add(0); a.add(0); a.add(0); a.add(0); a.add(0)
    var c = 0
    for (i in a) {
        if (c >= 5) continue
        c++
    }
    return c
}

fun for_long_list(): Int {
    val a = ArrayList<Long>()<|endoftext|>


Prompt:
package kotlin.text

/**
 * Represents a compiled regular expression.
 * Provides functions to match strings in text with a pattern, replace the found occurrences and split text around matches.
 *
 * Note that the [pattern] syntax and the option set has differences on each platform.
 * See the docs of `Regex` for the specific platform for details.
 */
public expect class Regex {

Response:
/** Creates a regular expression from the specified [pattern] string and the default options.  */
    public constructor(pattern: String)

    /** Creates a regular expression from the specified [pattern] string and the specified single [option].  */
    public constructor(pattern: String, option: RegexOption)

    /** Creates a regular expression from the specified [pattern] string and the specified set of [options].  */<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T> testTypeParameterWithMultipleShuffledUpperBoundsAC(arg: Invariant<T>) where T: UserInterfaceA, T: UserInterfaceB {}
fun <T> testTypeParameterWithMultipleShuffledUpperBoundsAC(arg: Invariant<T>) where T: UserInterfaceB, T: UserInterfaceA {}

Response:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T: UserInterfaceA> testTypeParameterWithMultipleShuffledUpperBoundsBA() where T: UserInterfaceB {}
fun <T: UserInterfaceB> testTypeParameterWithMultipleShuffledUpperBoundsBA() where T: UserInterfaceA {}<|endoftext|>


Prompt:
require(availableFor(configurables)) {
            "$target cannot be run under Rosetta 2 from host ${HostManager.host}"
        }
        require(checkIsInstalled(hostExecutor)) {
            "Rosetta 2 is not installed on host ${HostManager.host}"
        }
    }

    // When Rosetta 2 is installed, all x64 binaries are automatically run through it.

Response:
override fun execute(request: ExecuteRequest): ExecuteResponse = hostExecutor.execute(request)
}<|endoftext|>


Prompt:
if (!(4F !in 3.0..<1.0) != range1.contains(4F)) throw AssertionError()
    // no local optimizations
    if (element10 in 3.0..<1.0 != range1.contains(element10)) throw AssertionError()

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


Prompt:
// considered to be non-user-reproducible code for the purposes of these tests
    checkExactType<Buildee<UserKlass>>(buildee)
}

/* REQUIRED DECLARATIONS */

class Buildee<CT> {
    fun yield(arg: CT) {}
}

fun <FT> build(
    instructions: UserKlass.(Buildee<FT>) -> Unit

Response:
): Buildee<FT> {
    return Buildee<FT>().apply { UserKlass().instructions(this) }
}

class UserKlass<|endoftext|>


Prompt:
* Calculates the remainder of flooring division of this value (dividend) by the other value (divisor).
     *
     * The result is always less than the divisor.
     *
     * For unsigned types, the remainders of flooring division and truncating division are the same.
     */
    @kotlin.internal.InlineOnly

Response:
public inline fun mod(other: UByte): UByte = this.mod(other.toUInt()).toUByte()
    /**
     * Calculates the remainder of flooring division of this value (dividend) by the other value (divisor).
     *
     * The result is always less than the divisor.
     *<|endoftext|>


Prompt:
* DESCRIPTION: call with explicit receiver: different built-in integer types and one of them is kotlin.Int
 */

// TESTCASE NUMBER: 1
class Case1

fun case1(case: Case1) {
    //to (1.1)
    case.<!DEBUG_INFO_CALL("fqName: boo; typeCall: extension function")!>boo(1)<!>

Response:
//(1.1) return type is String
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>case.boo(1)<!>
    //to (1.1)
    case.<!DEBUG_INFO_CALL("fqName: boo; typeCall: extension function")!>boo(x = 1)<!><|endoftext|>


Prompt:
override fun indexOf(element: UInt): Int = this@asList.indexOf(element)
        override fun lastIndexOf(element: UInt): Int = this@asList.lastIndexOf(element)
    }
}

/**
 * Returns a [List] that wraps the original array.
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes

Response:
public actual fun ULongArray.asList(): List<ULong> {
    return object : AbstractList<ULong>(), RandomAccess {
        override val size: Int get() = this@asList.size
        override fun isEmpty(): Boolean = this@asList.isEmpty()
        override fun contains(element: ULong): Boolean = this@asList.contains(element)<|endoftext|>


Prompt:
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
actual interface My {
    actual fun openFunPositive() = Unit
    actual fun <!ACTUAL_WITHOUT_EXPECT!>openFunNegative<!>()
    actual fun abstractFun()

    actual val openValPositive: Int get() = 0

Response:
actual val <!ACTUAL_WITHOUT_EXPECT!>openValNegative<!>: Int
    actual val abstractVal: Int
}<|endoftext|>


Prompt:
* Applies the given [transform] function to each element and its index in the original array
 * and appends the results to the given [destination].
 * @param [transform] function that takes the index of an element and the element itself
 * and returns the result of the transform applied to the element.
 */

Response:
public inline fun <T, R, C : MutableCollection<in R>> Array<out T>.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C {
    var index = 0
    for (item in this)
        destination.add(transform(index++, item))
    return destination
}

/**<|endoftext|>


Prompt:
val copy = getFunction.original.copy(classDescriptor, Modality.OPEN, getFunction.visibility, getFunction.kind, false)
            return copy.substitute(ANY_SUBSTITUTOR)!!
        }

        @JvmStatic
        fun findGetFunction(localVariableDescriptorForReference: VariableDescriptor) =

Response:
localVariableDescriptorForReference.type.memberScope.getContributedFunctions(
                OperatorNameConventions.GET,
                NoLookupLocation.FROM_BACKEND
            ).single()
    }

    class PropertyReferenceGenerationStrategy(
        private val isGetter: Boolean,
        private val originalFunctionDesc: FunctionDescriptor,
        private val target: VariableDescriptor,<|endoftext|>


Prompt:
override fun testBad(x: Any) =
            reifiedAsFailsWithCCE<Function4<*, *, *, *, *>>(
                    x, "x as Function4<*, *, *, *, *>")
}

object TestFn5 : TestFnBase {
    override fun testGood(x: Any) =

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


Prompt:
assertEquals(listOf(1u, 2u, 3u, 4u, 5u), uintList)

    val ulongList = mutableListOf<ULong>()
    val ulongProgression = 1uL..6uL
    for (i in ulongProgression step 2L step 1L) {
        ulongList += i
    }

Response:
assertEquals(listOf(1uL, 2uL, 3uL, 4uL, 5uL), ulongList)

    return "OK"
}<|endoftext|>


Prompt:
@kotlin.jvm.JvmName("maxByOrThrow-U")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
@Suppress("CONFLICTING_OVERLOADS")
public inline fun <R : Comparable<R>> UByteArray.maxBy(selector: (UByte) -> R): UByte {
    if (isEmpty()) throw NoSuchElementException()

Response:
var maxElem = this[0]
    val lastIndex = this.lastIndex
    if (lastIndex == 0) return maxElem
    var maxValue = selector(maxElem)
    for (i in 1..lastIndex) {
        val e = this[i]
        val v = selector(e)
        if (maxValue < v) {
            maxElem = e
            maxValue = v<|endoftext|>


Prompt:
I.invoke(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KFunction0<kotlin.String>")!>::y<!>)
        I.invoke(::y)
        I.invoke(::y)

Response:
I(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KProperty0<kotlin.String>")!>::x<!>)
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit")!>I(::x)<!><|endoftext|>


Prompt:
@SinceKotlin("1.4")
@ExperimentalUnsignedTypes
public fun UIntArray.minWithOrNull(comparator: Comparator<in UInt>): UInt? {
    if (isEmpty()) return null
    var min = this[0]
    for (i in 1..lastIndex) {
        val e = this[i]

Response:
if (comparator.compare(min, e) > 0) min = e
    }
    return min
}

/**
 * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.
 */
@SinceKotlin("1.4")
@ExperimentalUnsignedTypes<|endoftext|>


Prompt:
// FIR_IDENTICAL
// JSPECIFY_STATE: strict

// FILE: SelfType.java
import org.jspecify.annotations.*;

@NullMarked
public class SelfType<T extends SelfType<T>> {
    public void foo(T t) {}
}

// FILE: B.java
public class B extends SelfType<B> {}

// FILE: C.java

Response:
import org.jspecify.annotations.*;

@NullMarked
public class C<E extends C<E>> extends SelfType<E> {}

// FILE: AK.java
public class AK extends SelfType<AK> {}

// FILE: AKN.java
import org.jspecify.annotations.*;

public class AKN extends SelfType<@Nullable AK> {}<|endoftext|>


Prompt:
for (i in 7 downTo 1 step zero()) {
        }
    }

    assertFailsWith<IllegalArgumentException> {
        for (i in 7L downTo 1L step zero().toLong()) {
        }
    }

    assertFailsWith<IllegalArgumentException> {
        for (i in 'g' downTo 'a' step zero()) {
        }
    }

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


Prompt:
package org.jetbrains.kotlin.contracts.model

import org.jetbrains.kotlin.contracts.model.structure.ESType

/**
 * Generic abstraction of static information about some part of program.
 */
interface Computation {
    /**
     * Return-type of corresponding part of program.
     * If type is unknown or computation doesn't have a type (e.g. if

Response:
* it is some construction, like "for"-loop), then type is 'null'
     */
    val type: ESType?

    /**
     * List of all possible effects of this computation.
     * Note that it's not guaranteed to be complete, i.e. if list
     * doesn't mention some effect, then it should be interpreted
     * as the absence of information about that effect.
     */<|endoftext|>


Prompt:
* UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28369
 */
fun case_10() {
    var x: Boolean? = true
    if (x is Boolean) {

Response:
select(if (true) {x = null;Class()} else Class()).prop_9 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean & kotlin.Boolean?"), DEBUG_INFO_SMARTCAST!>x<!>.not()
    }
}

// TESTCASE NUMBER: 11<|endoftext|>


Prompt:
if (!getBoolean(JVMConfigurationKeys.NO_JDK) &&
                get(JVMConfigurationKeys.JDK_HOME) == null) {
                // We need to set `JDK_HOME` explicitly to use JDK 17
                put(JVMConfigurationKeys.JDK_HOME, File(System.getProperty("java.home")!!))
            }
            configureJdkClasspathRoots()
        },

Response:
registerExtensions = registerExtensions ?: { configuration ->
            ComposePluginRegistrar.registerCommonExtensions(this)
            IrGenerationExtension.registerExtension(
                this,
                ComposePluginRegistrar.createComposeIrExtension(configuration)
            )
        }
    )

    protected fun analyze(
        platformSources: List<SourceFile>,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.IdentifierChecker
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm

object JvmSimpleNameBacktickChecker : IdentifierChecker {

Response:
// 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('.', ';', '[', ']', '/', '<', '>', ':', '\\')<|endoftext|>


Prompt:
eraseType(typeParameterUpperBoundEraser.getErasedUpperBound(declaration, attr.markIsRaw(true)), attr)
            is ClassDescriptor -> {
                val declarationForUpper =
                    type.upperIfFlexible().constructor.declarationDescriptor

                check(declarationForUpper is ClassDescriptor) {

Response:
"For some reason declaration for upper bound is not a class " +
                            "but \"$declarationForUpper\" while for lower it's \"$declaration\""
                }

                val (lower, isRawL) = eraseInflexibleBasedOnClassDescriptor(type.lowerIfFlexible(), declaration, lowerTypeAttr)<|endoftext|>


Prompt:
// FIR_IDENTICAL
//KT-776 Wrong detection of unreachable code

package kt776

fun test5() : Int {
    var x = 0
    while(true) {
        try {
            if(x < 10) {
                x++
                continue
            }
            else {
                break
            }
        }
        finally {
            x++
        }
    }
    return x

Response:
}

fun test1() : Int {
    try {
        if (true) {
            return 1
        }
        else {
            return 2
        }
    }
    finally {
        doSmth()  //unreachable
    }
}

fun doSmth() {}<|endoftext|>


Prompt:
val platformName = when (target.family) {
            Family.OSX -> "macos"
            Family.IOS -> "ios"
            Family.TVOS -> "tvos"
            Family.WATCHOS -> "watchos"
            else -> error("Unexpected Apple target family: ${target.family}")
        } + if (targetTriple.isSimulator) "-simulator" else ""

Response:
add(platformName)

        add("$osVersionMin.0")
        add(sdkVersion)
    }.toList()

    override fun finalLinkCommands(objectFiles: List<ObjectFile>, executable: ExecutableFile,
                                   libraries: List<String>, linkerArgs: List<String>,
                                   optimize: Boolean, debug: Boolean, kind: LinkerOutputKind,<|endoftext|>


Prompt:
* and its index in the original collection.
 *
 * @sample samples.collections.Collections.Transformations.flatMapIndexed
 */
@SinceKotlin("1.4")
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
@kotlin.jvm.JvmName("flatMapIndexedIterable")

Response:
@kotlin.internal.InlineOnly
public inline fun <T, R> Iterable<T>.flatMapIndexed(transform: (index: Int, T) -> Iterable<R>): List<R> {
    return flatMapIndexedTo(ArrayList<R>(), transform)
}

/**
 * Returns a single list of all elements yielded from results of [transform] function being invoked on each element<|endoftext|>


Prompt:
inline val FirCallableSymbol<*>.isAbstract: Boolean get() = resolvedStatus.modality == Modality.ABSTRACT
inline val FirCallableSymbol<*>.isOpen: Boolean get() = resolvedStatus.modality == Modality.OPEN
inline val FirCallableSymbol<*>.isFinal: Boolean get() = resolvedStatus.modality == Modality.FINAL

Response:
inline val FirCallableSymbol<*>.visibility: Visibility get() = resolvedStatus.visibility
inline val FirCallableSymbol<*>.effectiveVisibility: EffectiveVisibility get() = resolvedStatus.effectiveVisibility

inline val FirCallableSymbol<*>.isActual: Boolean get() = rawStatus.isActual<|endoftext|>


Prompt:
}

// must be in sync with `fromGTestPattern(String)` in kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/test/TestRunner.kt
internal fun fromGTestPattern(pattern: String): Regex {
    val result = StringBuilder()
    var prevIndex = 0
    pattern.forEachIndexed { index, c ->

Response:
if (c == '*' || c == '?') {
            result.append(pattern.substringEscaped(prevIndex until index))
            prevIndex = index + 1
            result.append(if (c == '*') ".*" else ".")
        }
    }
    result.append(pattern.substringEscaped(prevIndex until pattern.length))
    return result.toString().toRegex()<|endoftext|>


Prompt:
File(moduleSourceDir, "runner.kt")
                    .writeText("@kotlin.wasm.WasmExport fun runBoxTest() = println($BOX_FUN_FQN())")
            }
        }

        override fun buildKlib(
            moduleName: String,
            buildDirs: ModuleBuildDirs,
            dependencies: Dependencies,
            klibFile: File,

Response:
) = this@AbstractWasmPartialLinkageTestCase.buildKlib(moduleName, buildDirs, dependencies, klibFile)

        override fun buildBinaryAndRun(mainModule: Dependency, otherDependencies: Dependencies) =
            this@AbstractWasmPartialLinkageTestCase.buildBinaryAndRun(mainModule, otherDependencies)<|endoftext|>


Prompt:
fun <TArray, T> doTest(
            build: Iterable<Int>.() -> TArray,
            reverse: TArray.(fromIndex: Int, toIndex: Int) -> Unit,
            snapshot: TArray.() -> List<T>
        ) {
            val arrays = (0..7).map { n -> n to (0 until n).build() }
            for ((size, array) in arrays) {

Response:
for (fromIndex in 0 until size) {
                    for (toIndex in fromIndex..size) {
                        val original = array.snapshot().toMutableList()
                        array.reverse(fromIndex, toIndex)
                        val reversed = array.snapshot()
                        assertEquals(original.apply { subList(fromIndex, toIndex).reverse() }, reversed)
                    }
                }<|endoftext|>


Prompt:
type = originalTypeNotNullable
                    }
                    typesFromSmartCast = listOf(originalTypeNotNullable)
                    smartcastStability = expressionWithSmartcastIfStable.smartcastStability
                    coneTypeOrNull = originalTypeNotNullable
                }
            else -> originalExpression
        }
    }

    return expressionForReceiver

}

Response:
private fun FirMemberDeclaration.getBackingFieldIfApplicable(): FirBackingField? {
    val field = (this as? FirProperty)?.getExplicitBackingField() ?: return null

    // This check prevents resolving protected and
    // public fields.
    return when (field.visibility) {
        Visibilities.PrivateToThis,
        Visibilities.Private,
        Visibilities.Internal -> field<|endoftext|>


Prompt:
0x0UL,     0x0UL,     0x0UL,     0x0UL,
            0x3ff0000000000000UL,     0x3ff000000000afecUL,     0x3feffffffffea028UL,     0x3fe0000000000000UL,

Response:
0x4000000000000000UL,     0x3fd0000000000000UL,     0x4010000000000000UL,     0x3ff0000000000000UL,
            0x3feffffffffea028UL,     0x3ff000000000afecUL,     0x3fe0000000000000UL,     0x4000000000000000UL,<|endoftext|>


Prompt:
x: Int,
                content2: @Composable () -> Unit,
                value2: Int
            ) {
                Foo(123) {
                    // named argument
                    Foo(x=value)

                    // indexed argument
                    Foo(x)

                    // tag
                    content()
                }
                Foo(x=123, composeItem={
                    val abc = 123

Response:
// attribute value
                    Foo(x=abc)

                    // attribute value
                    Foo(x=value2)

                    // tag
                    content2()
                })
            }
        """
    )

    @Test
    fun testDispatchInvoke() = check(
        """
            import androidx.compose.runtime.*

            class Bam {
                @Composable fun Foo() {}<|endoftext|>


Prompt:
<!INCOMPATIBLE_ENUM_COMPARISON_ERROR!>printer == UsualEnum.C<!>
    printer == CleverEnum.E

    <!EQUALITY_NOT_APPLICABLE!>printer === 20<!>
    printer === BufferedEnum.A

Response:
<!INCOMPATIBLE_ENUM_COMPARISON_ERROR!>printer === UsualEnum.C<!>
    printer === CleverEnum.E
}

fun <P> processInfo2(info: String, printer: P) where P: AIPowered, P: Buffered {
    <!EQUALITY_NOT_APPLICABLE!>printer == 20<!><|endoftext|>


Prompt:
val JVM_DEFAULT_CLASS_ID = ClassId.topLevel(JVM_DEFAULT_FQ_NAME)
    val JVM_DEFAULT_NO_COMPATIBILITY_FQ_NAME = FqName("kotlin.jvm.JvmDefaultWithoutCompatibility")

Response:
val JVM_DEFAULT_WITH_COMPATIBILITY_FQ_NAME = FqName("kotlin.jvm.JvmDefaultWithCompatibility")
    val JVM_DEFAULT_NO_COMPATIBILITY_CLASS_ID = ClassId.topLevel(JVM_DEFAULT_NO_COMPATIBILITY_FQ_NAME)<|endoftext|>


Prompt:
).lower(moduleFragment)
        }

        // transform all composable functions to have an extra synthetic composer
        // parameter. this will also transform all types and calls to include the extra
        // parameter.
        ComposerParamTransformer(
            pluginContext,
            symbolRemapper,
            stabilityInferencer,
            decoysEnabled,
            metrics,
        ).lower(moduleFragment)

Response:
ComposableTargetAnnotationsTransformer(
            pluginContext,
            symbolRemapper,
            metrics,
            stabilityInferencer
        ).lower(moduleFragment)

        // transform calls to the currentComposer to just use the local parameter from the
        // previous transform
        ComposerIntrinsicTransformer(pluginContext, decoysEnabled).lower(moduleFragment)<|endoftext|>


Prompt:
val (intersectedOverridingRenamedBuiltin, intersectedOverridingNonBuiltin) =
            resultOfIntersectionWithNaturalName.overriddenMembers.partition {
                it.member.getJvmMethodNameIfSpecial(it.baseScope, session) == jvmName
            }

Response:
val explicitlyDeclaredFunctionWithBuiltinJvmName = declaredMemberScope.getFunctions(jvmName).firstOrNull {
            overrideChecker.isOverriddenFunction(it, someSymbolWithNaturalNameFromSuperType)
        }
        val functionsFromSupertypesWithBuiltinJvmName = supertypeScopeContext.collectFunctions(jvmName).firstOrNull {<|endoftext|>


Prompt:
override fun <T> visitLiteralExpression(literalExpression: FirLiteralExpression<T>, data: IrElement): IrElement = data

    override fun visitThisReceiverExpression(thisReceiverExpression: FirThisReceiverExpression, data: IrElement): IrElement = data

Response:
override fun visitQualifiedAccessExpression(qualifiedAccessExpression: FirQualifiedAccessExpression, data: IrElement): IrElement = data

    override fun visitPropertyAccessExpression(propertyAccessExpression: FirPropertyAccessExpression, data: IrElement): IrElement = data

    override fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: IrElement): IrElement = data<|endoftext|>


Prompt:
private val signatureParsingComponent = BinaryClassSignatureParser()

    fun findClass(classId: ClassId, searchScope: GlobalSearchScope) = findClass(JavaClassFinder.Request(classId), searchScope)

    override fun findClass(request: JavaClassFinder.Request, searchScope: GlobalSearchScope): JavaClass? {

Response:
val (classId, classFileContentFromRequest, outerClassFromRequest) = request
        val virtualFile = findVirtualFileForTopLevelClass(classId, searchScope) ?: return null

        if (!usePsiClassFilesReading && (virtualFile.extension == "class" || virtualFile.extension == "sig")) {<|endoftext|>


Prompt:
return resolvedNicknames.getOrPut(annotation.key) {
            // This won't store nulls (ConcurrentHashMap does not permit that), but presumably unless the code
            // is broken a nickname should be resolvable.
            annotation.metaAnnotations.firstNotNullOfOrNull(::resolveTypeQualifierAnnotation) ?: return null
        }
    }

Response:
private fun resolveQualifierBuiltInDefaultAnnotation(annotation: TAnnotation): JavaDefaultQualifiers? {
        if (javaTypeEnhancementState.disabledDefaultAnnotations) {
            return null
        }

        return BUILT_IN_TYPE_QUALIFIER_DEFAULT_ANNOTATIONS[annotation.fqName]?.let { qualifierForDefaultingAnnotation -><|endoftext|>


Prompt:
* Convert list of [expectedSourceFiles] to relate to [TestProject] paths.
 */
fun TestProject.sourceFilesRelativeToProject(
    expectedSourceFiles: List<String>,
    sourcesDir: GradleProject.() -> Path = { javaSourcesDir() },
    subProjectName: String? = null
): Iterable<Path> {
    return expectedSourceFiles
        .map {

Response:
if (subProjectName != null) {
                subProject(subProjectName).sourcesDir().resolve(it)
            } else {
                sourcesDir().resolve(it)
            }
        }
        .map {
            it.relativeTo(projectPath)
        }
}

/**<|endoftext|>


Prompt:
if (!(2 !in 3L..1L) != range1.contains(2)) throw AssertionError()
    // no local optimizations
    if (element14 in 3L..1L != range1.contains(element14)) throw AssertionError()
    if (element14 !in 3L..1L != !range1.contains(element14)) throw AssertionError()

Response:
if (!(element14 in 3L..1L) != !range1.contains(element14)) throw AssertionError()
    if (!(element14 !in 3L..1L) != range1.contains(element14)) throw AssertionError()
}

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


Prompt:
fun foo() {
        val l1: Long = longMaxValue + 1
        val l2: Long = longMaxValue - 1 + 2
        val l3: Long = longMaxValue - longMinValue
        val l4: Long = -longMinValue
        val l5: Long = longMinValue - 1
        val l6: Long = longMinValue - longMaxValue

Response:
val l7: Long = longMinValue + longMaxValue
        val l8: Long = -longMaxValue
        val l10: Long = -intMinValue.toLong()
        val l11: Long = -1 + intMinValue.toLong()
        val l12: Long = longMinValue * intMinValue
        val l13: Long = longMinValue * -1<|endoftext|>


Prompt:
val expressionHandler: IndexedGetIterationHandler
) : NumericHeaderInfo(
    IntProgressionType(symbols), first, last, step,
    isLastInclusive = false,
    canCacheLast = canCacheLast,
    isReversed = false,
    direction = ProgressionDirection.INCREASING
) {

Response:
// Technically one can easily iterate over an array in reverse by swapping first/last and
    // negating the step. However, Array.reversed() and Array.reversedArray() return a collection
    // with a copy of the array elements, which means that the original array can be modified with
    // no effect on the iteration over the reversed array. That is:
    //<|endoftext|>


Prompt: ||    |    +--- org.jetbrains.kotlinx:atomicfu (org.jetbrains.kotlinx:atomicfu-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 0.15.1 -> 0.16.1 (*)

Response: ||    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core (org.jetbrains.kotlinx:kotlinx-coroutines-core-$DEFAULT_CURRENT_PLATFORM_TARGET_NAME_POSTFIX): 1.4.3-native-mt -> 1.5.0-RC-native-mt (*)<|endoftext|>


Prompt:
@OptIn(ExperimentalContracts::class)
inline fun buildErrorTypeRef(init: FirErrorTypeRefBuilder.() -> Unit): FirErrorTypeRef {
    contract {
        callsInPlace(init, kotlin.contracts.InvocationKind.EXACTLY_ONCE)
    }
    return FirErrorTypeRefBuilder().apply(init).build()
}

Response:
@OptIn(ExperimentalContracts::class)
inline fun buildErrorTypeRefCopy(original: FirErrorTypeRef, init: FirErrorTypeRefBuilder.() -> Unit): FirErrorTypeRef {
    contract {
        callsInPlace(init, kotlin.contracts.InvocationKind.EXACTLY_ONCE)
    }
    val copyBuilder = FirErrorTypeRefBuilder()<|endoftext|>


Prompt:
package kotlin.test

import kotlin.test.adapters.*

/**
 * Overrides current framework adapter with a provided instance of [FrameworkAdapter]. Use in order to support custom test frameworks.
 *
 * Also some string arguments are supported. Use "qunit" to set the adapter to [QUnit](https://qunitjs.com/), "mocha" for

Response:
* [Mocha](https://mochajs.org/), "jest" for [Jest](https://facebook.github.io/jest/),
 * "jasmine" for [Jasmine](https://github.com/jasmine/jasmine), and "auto" to detect one of those frameworks automatically.
 *<|endoftext|>


Prompt:
@OptIn(PrivateForInline::class)
    fun <T> withPropertyAccessor(
        property: FirProperty,
        accessor: FirPropertyAccessor,
        holder: SessionHolder,
        forContracts: Boolean = false,
        f: () -> T
    ): T {
        if (accessor is FirDefaultPropertyAccessor || accessor.body == null) {

Response:
return if (accessor.isGetter) withContainer(accessor, f)
            else withTowerDataCleanup {
                addLocalScope(FirLocalScope(holder.session))
                withContainer(accessor, f)
            }
        }
        return withTowerDataCleanup {
            val receiverTypeRef = property.receiverParameter?.typeRef<|endoftext|>


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

// TESTCASE NUMBER: 33
fun case_33(y: Inv<Int>) {
    val x = y.getNullable()

    if (x != null) {

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?"), DEBUG_INFO_SMARTCAST!>x<!>.equals(null)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.checkers.PrimitiveNumericComparisonCallChecker
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
import org.jetbrains.kotlin.resolve.scopes.LexicalScopeKind
import org.jetbrains.kotlin.types.*

Response:
import org.jetbrains.kotlin.types.error.ErrorUtils
import org.jetbrains.kotlin.types.TypeUtils.NO_EXPECTED_TYPE
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
import org.jetbrains.kotlin.types.error.ErrorTypeKind<|endoftext|>


Prompt:
javaSourceSet.addExtension(kotlinSourceSetDslName, kotlinSourceSet.kotlin)
                } else {
                    project.compatibilityConventionRegistrar.addConvention(javaSourceSet, kotlinSourceSetDslName, kotlinCompilation.defaultSourceSet)

Response:
javaSourceSet.addExtension(kotlinSourceSetDslName, kotlinCompilation.defaultSourceSet.kotlin)
                }
            }

            kotlinTarget.compilations.all { kotlinCompilation ->
                @Suppress("DEPRECATION")
                kotlinCompilation.addSourceSet(kotlinCompilation.defaultSourceSet)
            }<|endoftext|>


Prompt:
name = fqn.shortName()
    }.apply {
        createImplicitParameterDeclarationWithWrappedDescriptor()
        this.parent = parent
        addConstructor {
            isPrimary = true
        }
    }

@Suppress("UNCHECKED_CAST")

Response:
fun isElseBranch(branch: IrBranch) = branch is IrElseBranch || ((branch.condition as? IrConst<Boolean>)?.value == true)

fun IrFunction.isMethodOfAny(): Boolean =
    extensionReceiverParameter == null && dispatchReceiverParameter != null &&
            when (name) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilder
import org.jetbrains.kotlin.resolve.calls.inference.addSubtypeConstraintIfCompatible
import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage

Response:
import org.jetbrains.kotlin.types.model.KotlinTypeMarker
import org.jetbrains.kotlin.types.model.TypeConstructorMarker
import org.jetbrains.kotlin.types.model.freshTypeConstructor
import org.jetbrains.kotlin.types.model.safeSubstitute

data class ReturnArgumentsAnalysisResult(<|endoftext|>


Prompt:
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtWhenEntry
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType

Response:
import org.jetbrains.kotlin.psi.stubs.elements.KtFileElementType
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementType

/**
 * Creates [org.jetbrains.kotlin.psi.KtCommonFile] when java psi is not available e.g. on JB Client.<|endoftext|>


Prompt:
assertEquals(null, notNullToNullE(cib), "CIB as? IE?")
    assertEquals(d, notNullToNullE(d), "D as? IE?")
    assertEquals(e, notNullToNullE(e), "E as? IE?")
    assertEquals(null, notNullToNullE(f), "F as? IE?")

Response:
assertEquals(g, notNullToNullE(g), "G as? IE?")
    assertEquals(null, notNullToNullE(an), "Any as? IE?")

    assertEquals(null, notNullToNullI(a), "A as? II?")
    assertEquals(null, notNullToNullI(aia), "AIA as? II?")<|endoftext|>


Prompt:
fun byValue(value: Int): CXDiagnosticSeverity = values().find { it.value == value }!!
    }

    override open val value: Int = value
    class Var(rawPtr: NativePtr) : CEnumVar(rawPtr) {
        @Deprecated("Use sizeOf<T>() or alignOf<T>() instead.")

Response:
companion object : Type(sizeOf<IntVar>().toInt())
        var value: CXDiagnosticSeverity
            get() = byValue(this.reinterpret<IntVar>().value)
            set(value) { this.reinterpret<IntVar>().value = value.value }
    }
}

enum class CXLoadDiag_Error(value: Int) : CEnum {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.js.backend.ast.JsExpressionStatement
import org.jetbrains.kotlin.js.backend.ast.JsFunction
import org.jetbrains.kotlin.js.config.ErrorTolerancePolicy
import org.jetbrains.kotlin.js.config.JSConfigurationKeys

Response:
import org.jetbrains.kotlin.js.config.RuntimeDiagnostic
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.types.Variance<|endoftext|>