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

/*

Response:
* TESTCASE NUMBER: 18
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28328
 */
fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?, b: Nothing?) {<|endoftext|>


Prompt:
val profilerProcess = profilerProcessBuilder.start()
        // Stop profiler on script stop
        Runtime.getRuntime().addShutdownHook(Thread {
            profilerProcess.destroy()
        })
        profilerProcess.waitFor()

        if (profilerProcess.exitValue() != 0) {
            throw BenchmarkFailedException(profilerProcess.exitValue())
        }

Response:
println("Benchmark $projectName has ended")
        return BenchmarkResult(
            projectName,
            benchmarkOutputDir.resolve("benchmark.csv")
        )
    }

    // Not working as intended due to this bug: https://github.com/gradle/gradle-profiler/issues/317
    fun aggregateBenchmarkResults(benchmarkResult: BenchmarkResult) {<|endoftext|>


Prompt:
// !LANGUAGE: -SafeCallsAreAlwaysNullable
// http://youtrack.jetbrains.net/issue/KT-418

fun ff() {
    val i: Int = 1
    val a: Int = i<!SAFE_CALL_WILL_CHANGE_NULLABILITY!><!UNNECESSARY_SAFE_CALL!>?.<!>plus(2)<!>

Response: }<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
// FILE: A.java

public class A<E> {
    public <T> A(T x, java.util.List<T> y) {}
}

// FILE: main.kt

fun test(x: List<Int>, y: List<String>) {

Response:
var z: A<Double> = A("", x) // E inferred from expected type
    z = A("", y)

    z = A<Double, String>("", <!TYPE_MISMATCH!>x<!>)

    z = A<Double, Any>("", x)
    z = A<Double, String>("", y)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.types.coneType
import org.jetbrains.kotlin.name.StandardClassIds

abstract class AbstractDiagnosticCollector(
    override val session: FirSession,
    override val scopeSession: ScopeSession = ScopeSession(),
    protected val createComponents: (DiagnosticReporter) -> DiagnosticCollectorComponents,

Response:
) : SessionHolder {

    fun collectDiagnosticsInSettings(reporter: DiagnosticReporter) {
        val visitor = createVisitor(createComponents(reporter))
        visitor.checkSettings()
    }

    fun collectDiagnostics(firDeclaration: FirDeclaration, reporter: DiagnosticReporter) {
        val visitor = createVisitor(createComponents(reporter))<|endoftext|>


Prompt:
recorder = FileStructureElement.recorderFor(firElement),
    )

    fun getElement(ktElement: KtElement): FirElement? {
        return mapping[ktElement]
    }

    fun getFir(element: KtElement): FirElement? {
        var current: PsiElement? = element
        while (
            current == element ||
            current is KtUserType ||

Response:
current is KtTypeReference ||
            current is KtDotQualifiedExpression ||
            current is KtNullableType
        ) {
            // We are still referring to the same element with possible type parameter/name qualification/nullability,
            // hence it is always correct to return a corresponding element if present
            if (current is KtElement) getElement(current)?.let { return it }
            current = current.parent<|endoftext|>


Prompt:
grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc * unit)
            return len
        }
    }
}

private fun grisuRound(buffer: WasmCharArray, len: Int, delta: Long, restInp: Long, ten_kappa: Long, wp_w: Long) {
    var rest = restInp

Response:
val lastp = len - 1
    var digit = buffer.get(lastp)
    while (
        rest < wp_w &&
        delta - rest >= ten_kappa && (
                rest + ten_kappa < wp_w ||
                        wp_w - rest > rest + ten_kappa - wp_w
                )
    ) {
        --digit
        rest += ten_kappa;<|endoftext|>


Prompt:
* @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.
 * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.
 *
 * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.

Response:
* @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],
 * or when that index is out of the [destination] array indices range.
 *
 * @return the [destination] array.
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly<|endoftext|>


Prompt:
// Check whether a fake override will resolve to an implementation in class, not an interface.
private fun IrSimpleFunction.resolvesToClass(): Boolean {
    val overriddenFromClass = overriddenFromClass() ?: return false
    return overriddenFromClass.modality != Modality.ABSTRACT
}

private fun IrSimpleFunction.overriddenFromClass(): IrSimpleFunction? =

Response: overriddenSymbols.singleOrNull { !it.owner.parentAsClass.isJvmInterface }?.owner<|endoftext|>


Prompt:
* KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE)
 *
 * SECTIONS: dfa
 * NUMBER: 67
 * DESCRIPTION: Raw data flow analysis test
 * HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses
 */

// TESTCASE NUMBER: 1
fun case_1(x: Any?) {

Response:
when (x) {
        is Any -> {
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>x<!>
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>x<!>.equals(10)
        }
        else -> return<|endoftext|>


Prompt:
const val I32_REM_U = "I32_REM_U"
        const val I32_AND = "I32_AND"
        const val I32_OR = "I32_OR"
        const val I32_XOR = "I32_XOR"
        const val I32_SHL = "I32_SHL"

Response:
const val I32_SHR_S = "I32_SHR_S"
        const val I32_SHR_U = "I32_SHR_U"
        const val I32_ROTL = "I32_ROTL"
        const val I32_ROTR = "I32_ROTR"
        const val I64_ADD = "I64_ADD"<|endoftext|>


Prompt:
when (compatibility) {
            ExpectActualCheckingCompatibility.Compatible -> return
            is ExpectActualCheckingCompatibility.Incompatible<*> -> incompatibilityMap.getOrPut(compatibility) { SmartList() }.add(actualMember)
        }

        incompatibleMembers?.add(expectMember to incompatibilityMap)

Response:
onIncompatibleMembersFromClassScope(expectMember, incompatibilityMap, expectClassSymbol, actualClassSymbol)
    }

    private fun ExpectActualMatchingContext<*>.getCallablesCompatibility(
        expectDeclaration: CallableSymbolMarker,
        actualDeclaration: CallableSymbolMarker,
        parentSubstitutor: TypeSubstitutorMarker?,<|endoftext|>


Prompt:
module = module,
            version = version,
            sourceSetName = sourceSetName,
            capabilities = capabilities,
            attributes = attributes,
        )
    }

    fun copy(
        group: String = this.group,
        module: String = this.module,
        version: String? = this.version,
        sourceSetName: String? = this.sourceSetName,

Response:
capabilities: Set<IdeaKotlinBinaryCapability> = this.capabilities,
        attributes: IdeaKotlinBinaryAttributes = this.attributes,
    ): IdeaKotlinBinaryCoordinates {
        return IdeaKotlinBinaryCoordinates(
            group = group,
            module = module,
            version = version,
            sourceSetName = sourceSetName,<|endoftext|>


Prompt:
typeEnhancementImprovementsInStrictMode = languageVersionSettings.supportsFeature(LanguageFeature.TypeEnhancementImprovementsInStrictMode),
            ignoreNullabilityForErasedValueParameters = languageVersionSettings.supportsFeature(LanguageFeature.IgnoreNullabilityForErasedValueParameters),
            enhancePrimitiveArrays = languageVersionSettings.supportsFeature(LanguageFeature.EnhanceNullabilityOfPrimitiveArrays),
        )

Response:
)
    useInstance(JavaModuleResolver.getInstance(moduleContext.project))

    useImpl<FilesByFacadeFqNameIndexer>()
    useImpl<JvmDiagnosticComponents>()
}

fun ComponentProvider.initJvmBuiltInsForTopDownAnalysis() {
    get<JvmBuiltIns>().initialize(get<ModuleDescriptor>(), get<LanguageVersionSettings>())<|endoftext|>


Prompt:
* https://kotlinlang.org/spec/type-system.html#type-kinds for more details.
     */
    public val KtType.isDenotable: Boolean
        get() = withValidityAssertion { analysisSession.typeInfoProvider.isDenotable(this) }

    /**

Response:
* Returns true if this type is a functional interface type, a.k.a. SAM type, e.g., Runnable.
     */
    public val KtType.isFunctionalInterfaceType: Boolean
        get() = withValidityAssertion { analysisSession.typeInfoProvider.isFunctionalInterfaceType(this) }

    /**
     * Returns [FunctionTypeKind] of the given [KtType]<|endoftext|>


Prompt:
metadataKlib: TaskProvider<out Zip>, compilation: KotlinSharedNativeCompilation
) {
    metadataKlib.configure { jar ->
        launch { includeCommonizedCInteropMetadata(jar, compilation) }
    }
}

internal suspend fun Project.includeCommonizedCInteropMetadata(metadataKlib: Zip, compilation: KotlinSharedNativeCompilation) {

Response:
val commonizerTask = commonizeCInteropTask()?.get() ?: return
    val commonizerDependencyToken = CInteropCommonizerDependent.from(compilation) ?: return
    val outputDirectory = commonizerTask.commonizedOutputDirectory(commonizerDependencyToken) ?: return

    metadataKlib.from(outputDirectory) { spec -><|endoftext|>


Prompt:
package test.ranges

import kotlin.test.*

public class RangeTest {
    @Test fun intRange() {
        val range = -5..9
        assertFalse(-1000 in range)
        assertFalse(-6 in range)

        assertTrue(-5 in range)
        assertTrue(-4 in range)
        assertTrue(0 in range)
        assertTrue(3 in range)

Response:
assertTrue(8 in range)
        assertTrue(9 in range)

        assertFalse(10 in range)
        assertFalse(9000 in range)

        assertFalse(range.isEmpty())

        assertTrue(9 in (range as ClosedRange<Int>))
        assertFalse((range as ClosedRange<Int>).isEmpty())

        assertTrue(1.toShort() in range)<|endoftext|>


Prompt:
// ISSUE: KT-41215, KT-43551

// FILE: Base.java
public sealed class Base permits A, B {}

// FILE: A.java
public final class A extends Base {}

// FILE: B.java
public sealed class B extends Base permits B.C, B.D {
    public static final class C extends B {}

    public static non-sealed class D extends B {}
}

Response:
// FILE: main.kt
fun test_1(base: Base): String {
    return when (base) {
        is A -> "O"
        is B -> "Fail"
    }
}

fun test_2(base: Base): String {
    return when (base) {
        is A -> "Fail A"
        is B.C -> "K"<|endoftext|>


Prompt:
* TESTCASE NUMBER: 11
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-30376
 */
fun case_11(x: Any?) {
    if ((x as Boolean?)!!) {

Response: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()<|endoftext|>


Prompt:
wasCalled = true
                    suspendWithValue("OK")
                }
        )
    }

    builder {
        tryCatchFinally(
                {
                    suspendWithValue("<none>")
                    wasCalled = true
                    suspendWithValue("OK")
                },
                {
                    suspendWithValue("fail 1")
                },
                {
                    suspendWithValue("ignored 1")

Response:
wasCalled = true
                }
        )
    }

    builder {
        tryCatchFinally(
                {
                    suspendWithException(RuntimeException("M"))
                },
                { e ->
                    if (e.message != "M") throw RuntimeException("fail 2")
                    suspendWithValue("OK")
                },
                {
                    suspendWithValue("ignored 2")<|endoftext|>


Prompt:
/*
 * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
 *
 * SPEC VERSION: 0.1-300
 * MAIN LINK: expressions, constant-literals, boolean-literals -> paragraph 1 -> sentence 2
 * NUMBER: 15
 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the parameter.

Response:
* NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY!
 * HELPERS: reflect
 */

fun f1(`true`: Boolean) = !!!`true`
fun f2(`false`: Boolean, `true`: Boolean) = `false` && `true`<|endoftext|>


Prompt:
private fun IrClass.shouldNotBeImplemented(): Boolean {
        return isInterface && !isExternal || isJsImplicitExport()
    }

    private fun IrValueParameter.shouldBeExported(): Boolean {
        return origin != JsLoweredDeclarationOrigin.JS_SUPER_CONTEXT_PARAMETER && origin != ES6_BOX_PARAMETER
    }

Response:
private fun IrClass.shouldContainImplementationOfMagicProperty(superTypes: Iterable<IrType>): Boolean {
        return !isExternal && superTypes.any {
            val superClass = it.classOrNull?.owner ?: return@any false
            superClass.isInterface && it.shouldAddMagicPropertyOfSuper() || superClass.isJsImplicitExport()
        }
    }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.backend.wasm.lower

import org.jetbrains.kotlin.backend.common.FileLoweringPass
import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
import org.jetbrains.kotlin.backend.common.ir.createArrayOfExpression

Response:
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
import org.jetbrains.kotlin.backend.common.lower.irBlock
import org.jetbrains.kotlin.backend.wasm.WasmBackendContext
import org.jetbrains.kotlin.backend.wasm.lower.WasmPropertyReferenceLowering.KTypeGeneratorInterface<|endoftext|>


Prompt:
for (classFqName in fqNames) {
                assert(!classFqName.isRoot) { "$classFqName is root when processing $change" }

                val scope = classFqName.parent().asString()
                val name = classFqName.shortName().identifier
                dirtyLookupSymbols.add(LookupSymbol(name, scope))
            }

Response:
} else if (change is ChangeInfo.MembersChanged) {
            val fqNames = withSubtypes(change.fqName, caches)
            // need to recompile subtypes because changed member might break override
            dirtyClassesFqNames.addAll(fqNames)

            for (name in change.names) {<|endoftext|>


Prompt:
into: org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions,
    ) {
        org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptionsHelper.syncOptionsAsConvention(from, into)
        into.javaParameters.convention(from.javaParameters)

Response:
into.jvmTarget.convention(from.jvmTarget)
        into.moduleName.convention(from.moduleName)
        into.noJdk.convention(from.noJdk)
    }
}<|endoftext|>


Prompt:
// DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS, -MISPLACED_TYPE_PARAMETER_CONSTRAINTS

package pkg

class TestBasic {
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor()
    constructor()
}

class TestIdenticalPrimaryAndSecondaryConstructorsA constructor() {

Response:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor() : this()
}

class TestIdenticalPrimaryAndSecondaryConstructorsB() {
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor() : this()
}

class TestIdenticalDelegatedPrimaryConstructorCalls constructor(placeholder: UserKlass) {<|endoftext|>


Prompt:
fun bar2(): MutableList<in Number>

    fun foo3(a: MutableList<*>)
    fun bar3(): MutableList<*>
}

interface KotlinInterface2 {
    fun foo(a: List<Number>)
    fun bar(): List<Number>
}

Response:
fun test(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H){
    a.foo(null)
    a.foo(mutableListOf(1))
    a.foo(listOf(1))
    a.bar()
    a.foo2(null)
    a.foo2(mutableListOf(null))<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.backend.js.FirJsKotlinMangler
import org.jetbrains.kotlin.fir.pipeline.Fir2IrActualizedResult
import org.jetbrains.kotlin.fir.pipeline.Fir2KlibMetadataSerializer

Response:
import org.jetbrains.kotlin.ir.backend.js.JsFactories
import org.jetbrains.kotlin.ir.backend.js.getSerializedData
import org.jetbrains.kotlin.ir.backend.js.incrementalDataProvider
import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerIr<|endoftext|>


Prompt:
get() = getter.hasImplementation && (isVal || setter.hasImplementation)

private fun FirProperty.getEffectiveModality(containingClass: FirClass?): Modality? =
    when (status.modality == Modality.OPEN && containingClass?.status?.modality == Modality.FINAL) {
        true -> Modality.FINAL
        false -> status.modality
    }

Response:
private fun FirProperty.getEffectiveModality(containingClass: FirClass?, languageVersionSettings: LanguageVersionSettings): Modality? =
    when (languageVersionSettings.supportsFeature(LanguageFeature.TakeIntoAccountEffectivelyFinalInMustBeInitializedCheck)) {
        true -> getEffectiveModality(containingClass)
        false -> status.modality
    }<|endoftext|>


Prompt:
* @param invokeBuiltinExtensionMode is true only when the original call has a form "x.f()" and invokeReceiverInfo is "f"
     * @param runResolutionForInvokeReceiverVariable runs the process of looking for the receiver ("x.f" or "f") on the given FirTowerResolveTask
     */
    private inline fun enqueueInvokeReceiverTask(
        info: CallInfo,

Response:
invokeReceiverInfo: CallInfo,
        towerDataElementsForName: TowerDataElementsForName = TowerDataElementsForName(invokeReceiverInfo.name, components.towerDataContext),
        invokeBuiltinExtensionMode: Boolean,
        crossinline runResolutionForInvokeReceiverVariable: suspend (FirTowerResolveTask) -> Unit
    ) {<|endoftext|>


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

Response: <!CONFLICTING_OVERLOADS!>fun <T> testTypeParameterWithMultipleTypeAliasedUpperBoundsAAB(arg: T)<!> where T: UserInterfaceA, T: SameUserInterfaceB {}<|endoftext|>


Prompt:
val e4: InlineNullableReference2<T>? = e // box
}

fun box(): String {
    val a = InlineNotNullPrimitive(1)
    val b = InlineNullablePrimitive(1)
    val c = InlineNotNullReference("some")
    val d = InlineNullableReference("other")
    val e = InlineNullableReference2("other2")

Response:
test1(a)
    test2(b)
    test3(c)
    test4(d)
    test5(e)

    return "OK"
}<|endoftext|>


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

import kotlin.reflect.KProperty

class UsefulClass(val param: Int = 2) {
    operator fun getValue(instance: Any, property: KProperty<*>) : Int = 1
    operator fun setValue(instance: Any, property: KProperty<*>, value: Int) {}

Response:
@Deprecated("message")
    fun member() {}
}

@Deprecated("message")
fun Obsolete(param: Int = 1): UsefulClass = UsefulClass(param)

class Invocable {
    @Deprecated("message")
    operator fun invoke() {}
}

object InvocableHolder {
    val invocable = Invocable()
}

fun invoker() {<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !LANGUAGE: +ContextReceivers
// !DIAGNOSTICS: -UNUSED_PARAMETER

interface NumberOperations {
    fun Number.plus(other: Number): Number
}

class Matrix

context(NumberOperations) fun Matrix.plus(other: Matrix): Matrix = TODO()

Response:
fun NumberOperations.plusMatrix(m1: Matrix, m2: Matrix) {
    m1.plus(m2)
    m2.plus(m1)
}<|endoftext|>


Prompt:
val classNode = parseClassNode(jarFile2.getInputStream(entry2))
                if (!classNode.shouldBeIgnored()) {
                    report.addMissingClassName1("$name2 ${classNode.access.classFlags()}")
                    ++totalDiffs
                }
            }
        }
    }

    private fun writeReportIfRequired() {
        if (report.isNotEmpty()) {

Response:
PrintWriter(outputFile).use { out ->
                out.tag("html") {
                    out.tag("head") {
                        out.printCss()
                    }
                    out.tag("body") {
                        report.writeAsHtml(out)
                    }
                }
            }
        }
    }

    private fun PrintWriter.printCss() {
        tag("style", REPORT_CSS)<|endoftext|>


Prompt:
val receiver = if (this is IrConstructor) parentAsClass.thisReceiver else dispatchReceiverParameter
        receiver?.let {
            frameMap.enter(it, classCodegen.typeMapper.mapTypeAsDeclaration(it.type))
        }
        val contextReceivers = valueParameters.subList(0, contextReceiverParametersCount)
        for (contextReceiver in contextReceivers) {

Response:
frameMap.enter(contextReceiver, classCodegen.typeMapper.mapType(contextReceiver.type))
        }
        extensionReceiverParameter?.let {
            frameMap.enter(it, classCodegen.typeMapper.mapType(it))
        }
        val regularParameters = valueParameters.subList(contextReceiverParametersCount, valueParameters.size)<|endoftext|>


Prompt:
*      temp = computeValueAsync() // suspension point and resumption point, value NOT restored as it is dead
 *      load temp
 *      goto L3
 *  L2: (value alive here)
 *      load value
 *  L3: (merge point, cannot extend `value` local across as it is not defined on one of the paths)
 *      load "K"
 *      add strings
 *      return
 *

Response:
* @return true if the range has been extended
 */
private fun LocalVariableNode.extendRecordIfPossible(
    method: MethodNode,
    suspensionPoints: List<LabelNode>,
    endLabel: LabelNode,
    liveness: List<VariableLivenessFrame>,
    nextSuspensionPointIndex: Int
): Boolean {
    val nextSuspensionPointLabel =<|endoftext|>


Prompt:
public inline fun DoubleArray.onEach(action: (Double) -> Unit): DoubleArray {
    return apply { for (element in this) action(element) }
}

/**
 * Performs the given [action] on each element and returns the array itself afterwards.
 */
@SinceKotlin("1.4")
@kotlin.internal.InlineOnly

Response:
public inline fun BooleanArray.onEach(action: (Boolean) -> Unit): BooleanArray {
    return apply { for (element in this) action(element) }
}

/**
 * Performs the given [action] on each element and returns the array itself afterwards.
 */
@SinceKotlin("1.4")
@kotlin.internal.InlineOnly<|endoftext|>


Prompt:
testClass<AbstractIrBlackBoxCodegenTest>("IrBlackBoxModernJdkCodegenTestGenerated") {
                model("codegen/boxModernJdk")
            }

            testClass<AbstractJvmIrAgainstOldBoxTest> {
                model("codegen/box/compileKotlinAgainstKotlin")
            }

            testClass<AbstractJvmOldAgainstIrBoxTest> {

Response:
model("codegen/box/compileKotlinAgainstKotlin")
            }

            testClass<AbstractClassicJvmIrTextTest> {
                model(
                    "ir/irText",
                    excludeDirs = listOf("declarations/multiplatform/k2")
                )
            }

            testClass<AbstractClassicJvmIrSourceRangesTest> {<|endoftext|>


Prompt: expectSuccess("OpenClassNarrowedVisibilityTATypeParameterHolder(t=OpenClassNarrowedVisibilityTAImpl(x=-4))") { getOpenClassNarrowedVisibilityTATypeParameterHolder2(4).toString() }

Response:
expectSuccess("setOpenClassNarrowedVisibilityTATypeParameterHolder1") { setOpenClassNarrowedVisibilityTATypeParameterHolder1(null) }
    expectSuccess("setOpenClassNarrowedVisibilityTATypeParameterHolder2") { setOpenClassNarrowedVisibilityTATypeParameterHolder2(null) }<|endoftext|>


Prompt:
public fun deleteRange(startIndex: Int, endIndex: Int): StringBuilder {
        checkReplaceRange(startIndex, endIndex, length)

        string = string.substring(0, startIndex) + string.substring(endIndex)
        return this
    }

    /**
     * Copies characters from this string builder into the [destination] character array.
     *

Response:
* @param destination the array to copy to.
     * @param destinationOffset the position in the array to copy to, 0 by default.
     * @param startIndex the beginning (inclusive) of the range to copy, 0 by default.
     * @param endIndex the end (exclusive) of the range to copy, length of this string builder by default.
     *<|endoftext|>


Prompt:
?: k1Directive.takeIf { configurator.frontendKind == FrontendKind.Fe10 && it in this }
        ?: k2Directive.takeIf { configurator.frontendKind == FrontendKind.Fir && it in this }

    private fun compareResults(
        data: SymbolPointersData,
        testServices: TestServices,
    ) {

Response:
val actual = data.pointers.renderDeclarations()
        testServices.assertions.assertEqualsToTestDataFileSibling(actual)

        val actualPretty = data.pointersForPrettyRendering.renderDeclarations()
        testServices.assertions.assertEqualsToTestDataFileSibling(actualPretty, extension = ".pretty.txt")
    }<|endoftext|>


Prompt:
assertEquals("NativeFoo('hello') (object)", o.describeNativeFooWrapper(NativeFooWrapper(NativeFoo("hello"))))
    assertEquals("NativeFoo('goodbye') (object)", o.describeNativeFooWrapperN(NativeFooWrapper(NativeFoo("goodbye"))))

Response:
assertEquals("null (object)", o.describeNativeFooWrapperN(null))

    assertEquals("NativeFoo('hello') (object)", o.describeNativeFooNWrapper(NativeFooNWrapper(NativeFoo("hello"))))
    assertEquals("null (object)", o.describeNativeFooNWrapper(NativeFooNWrapper(null)))<|endoftext|>


Prompt:
private inline fun buildFictitiousFunctionClass(prefix: String, arity: Int, consumer: (CirEntityId, CirProvided.RegularClass) -> Unit) {
        val typeParameters = List(arity + 1) { index ->
            CirProvided.TypeParameter(
                index = index,

Response:
variance = if (index == arity) Variance.OUT_VARIANCE else Variance.IN_VARIANCE
            )
        }

        val classId = CirEntityId.create(PACKAGE_NAME, CirName.create("$prefix$arity"))
        val clazz = CirProvided.RegularClass(typeParameters, emptyList(), Visibilities.Public, ClassKind.INTERFACE)<|endoftext|>


Prompt:
@Suppress("UNCHECKED_CAST")
    override fun <E : FirElement, D> transform(transformer: FirTransformer<D>, data: D): E =
        transformer.transformField(this, data) as E

    abstract override fun replaceStatus(newStatus: FirDeclarationStatus)

    abstract override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef)

Response:
abstract override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?)

    abstract override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider)

    abstract override fun replaceContextReceivers(newContextReceivers: List<FirContextReceiver>)

    abstract override fun replaceInitializer(newInitializer: FirExpression?)<|endoftext|>


Prompt:
interface SomeInterface {
    fun foo(x: Int, y: String): String

    val bar: Boolean
}

class SomeClass : SomeInterface {
    private val baz = 42

    override fun foo(x: Int, y: String): String {
        return y + x + baz
    }

    override var bar: Boolean
        get() = true
        set(value) {}

Response:
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit<!> var fau: Double
}

<!ABSENCE_OF_PRIMARY_CONSTRUCTOR_FOR_VALUE_CLASS!>inline<!> class InlineClass<|endoftext|>


Prompt:
import org.jetbrains.kotlin.backend.common.serialization.proto.IrComposite as ProtoComposite
import org.jetbrains.kotlin.backend.common.serialization.proto.IrConst as ProtoConst
import org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall as ProtoConstructorCall

Response:
import org.jetbrains.kotlin.backend.common.serialization.proto.IrContinue as ProtoContinue
import org.jetbrains.kotlin.backend.common.serialization.proto.IrDelegatingConstructorCall as ProtoDelegatingConstructorCall
import org.jetbrains.kotlin.backend.common.serialization.proto.IrDoWhile as ProtoDoWhile<|endoftext|>


Prompt:
type: ConeKotlinType = field.returnTypeRef.coneType,
        origin: IrDeclarationOrigin = IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB
    ): IrField = convertCatching(field) {
        val irType = type.toIrType(c)

        val parentIsExternal = irParent.isExternalParent()

Response:
if (field is FirJavaField && field.isStatic && field.isFinal && parentIsExternal) {
            // We are going to create IR for Java static final fields lazily because they can refer to some Kotlin const.
            // This way we delay const evaluation of Java fields until IR tree is fully built, and we can run IR interpreter.<|endoftext|>


Prompt: fun main2() = if (true) <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>minus<!><!> else

Response: <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>times<!><!><|endoftext|>


Prompt:
return this.zipFileSystem(create).use(action)
}

fun <T> File.withZipFileSystem(action: (FileSystem) -> T): T = this.withZipFileSystem(false, action)

private fun File.recursiveCopyTo(destination: File, resetTimeAttributes: Boolean = false) {
    val sourcePath = javaPath
    val destPath = destination.javaPath

Response:
val destFs = destPath.fileSystem
    val normalizedDestPath = destPath.normalize()
    Files.walk(sourcePath).forEach next@{ oldPath ->

        val relative = sourcePath.relativize(oldPath)

        // We are copying files between file systems,
        // so pass the relative path through the String.<|endoftext|>


Prompt:
val commonMainApi = project.configurations.sourceSetDependencyConfigurationByScope(
                    commonMain,
                    KotlinDependencyScope.API_SCOPE
                )
                val commonMainDependencies = commonMainApi.allDependencies
                commonMainDependencies.map { ModuleCoordinates(it.group, it.name, it.version) }.toSet()
            }
    }

Response:
internal fun Configuration.configureSourcesPublicationAttributes(target: KotlinTarget) {
    val project = target.project

    // In order to be consistent with Java Gradle Plugin, set usage attribute for sources variant
    // to be either JAVA_RUNTIME (for jvm) or KOTLIN_RUNTIME (for other targets)<|endoftext|>


Prompt:
val lookupTag = annotationClassId.toLookupTag()

        return object : AnnotationsLoaderVisitorImpl() {
            private val argumentMap = mutableMapOf<Name, FirExpression>()

            override fun visitExpression(name: Name?, expr: FirExpression) {
                if (name != null) argumentMap[name] = expr
            }

            override val visitNullNames: Boolean = false

Response:
override fun visitEnd() {
                // Do not load the @java.lang.annotation.Repeatable annotation instance generated automatically by the compiler for
                // Kotlin-repeatable annotation classes. Otherwise the reference to the implicit nested "Container" class cannot be
                // resolved, since that class is only generated in the backend, and is not visible to the frontend.<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Any?>?")!>select(Test.foo(this@build.getInv()), getInv())<!>
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>select(id(this@build.get()), id(get()))<!>
            ""
        }
        ""
    }

Response:
val ret2 = build {
        emit("1")
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>select(get(), null)<!><|endoftext|>


Prompt:
arguments.add("-Pkotlin.internal.diagnostics.showStacktrace=$showDiagnosticsStacktrace")
        }

        if (stacktraceMode != null) {
            arguments.add("--$stacktraceMode")
        }

        konanDataDir?.let {

Response:
arguments.add("-Pkonan.data.dir=${konanDataDir.toAbsolutePath().normalize()}")
        }

        if (kotlinUserHome != null) {
            arguments.add("-Pkotlin.user.home=${kotlinUserHome.absolutePathString()}")
        }

        if (compilerArgumentsLogLevel != null) {<|endoftext|>


Prompt:
) : KtCollectionLiteralReference(expression), KtFe10Reference {
    override fun getTargetDescriptors(context: BindingContext): Collection<DeclarationDescriptor> {
        val resolvedCall = context[BindingContext.COLLECTION_LITERAL_CALL, element]
        return listOfNotNull(resolvedCall?.resultingDescriptor)
    }

Response:
override fun isReferenceToImportAlias(alias: KtImportAlias): Boolean {
        return super<KtFe10Reference>.isReferenceToImportAlias(alias)
    }
}<|endoftext|>


Prompt:
return copyOfUninitializedElements(fromIndex, toIndex)
}

/**
 * Returns a new array which is a copy of the specified range of the original array.
 *
 * @param fromIndex the start of the range (inclusive) to copy.
 * @param toIndex the end of the range (exclusive) to copy.
 *

Response:
* @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */
public actual fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray {
    checkCopyOfRangeArguments(fromIndex, toIndex, size)<|endoftext|>


Prompt:
val a : (cnames.structs.FwdStruct) -> Unit = ::<!FORWARD_DECLARATION_AS_REIFIED_TYPE_ARGUMENT!>inlineF<!>
    val b : (objcnames.classes.FwdObjcClass) -> Unit = ::<!FORWARD_DECLARATION_AS_REIFIED_TYPE_ARGUMENT!>inlineF<!>

Response:
val c : (objcnames.protocols.FwdProtocol) -> Unit = ::<!FORWARD_DECLARATION_AS_REIFIED_TYPE_ARGUMENT!>inlineF<!>
}

fun testCheckedAs1(x : lib.FwdStruct) = x as cnames.structs.FwdStruct<|endoftext|>


Prompt:
inner.forEach { it.generateMethods(thisDescriptor, name, result, c) }
    }

    override fun getStaticFunctionNames(thisDescriptor: ClassDescriptor, c: LazyJavaResolverContext): List<Name> =
        inner.flatMap { it.getStaticFunctionNames(thisDescriptor, c) }

    override fun generateStaticFunctions(

Response:
thisDescriptor: ClassDescriptor,
        name: Name,
        result: MutableCollection<SimpleFunctionDescriptor>,
        c: LazyJavaResolverContext,
    ) {
        inner.forEach { it.generateStaticFunctions(thisDescriptor, name, result, c) }
    }

    override fun generateConstructors(
        thisDescriptor: ClassDescriptor,<|endoftext|>


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

import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.services.BuildService
import org.gradle.api.services.BuildServiceParameters

Response:
import org.gradle.api.tasks.Internal
import org.jetbrains.kotlin.gradle.tasks.withType
import org.jetbrains.kotlin.gradle.utils.SingleActionPerProject
import java.io.File
import java.util.concurrent.ConcurrentHashMap

internal interface UsesLibraryFilterCachingService : Task {
    @get:Internal<|endoftext|>


Prompt:
val idSigIndex = reversedSignatureIndex[idSig] ?: error("Not found Idx for $idSig")
        return libraryFile.declaration(idSigIndex)
    }

    fun deserializeFileImplicitDataIfFirstUse() {
        annotations?.let {
            file.annotations += declarationDeserializer.deserializeAnnotations(it)
            annotations = null

Response:
}
    }
}

class FileDeserializationState(
    val linker: KotlinIrLinker,
    val fileIndex: Int,
    val file: IrFile,
    val fileReader: IrLibraryFileFromBytes,
    fileProto: ProtoFile,
    deserializeBodies: Boolean,
    allowErrorNodes: Boolean,
    deserializeInlineFunctions: Boolean,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.EmptyPackageFragmentDescriptor
import org.jetbrains.kotlin.descriptors.runtime.components.ReflectKotlinClass
import org.jetbrains.kotlin.descriptors.runtime.components.RuntimeModuleData

Response:
import org.jetbrains.kotlin.descriptors.runtime.structure.functionClassArity
import org.jetbrains.kotlin.descriptors.runtime.structure.wrapperByPrimitive
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.load.java.JvmAbi<|endoftext|>


Prompt:
override val history: IReplStageHistory<Pair<T1, T2>> = AggregatedReplStateHistory(state1.history, state2.history, lock)

    override fun <StateT : IReplStageState<*>> asState(target: Class<out StateT>): StateT =
        @Suppress("UNCHECKED_CAST")
        when {

Response:
target.isAssignableFrom(state1::class.java) -> state1 as StateT
            target.isAssignableFrom(state2::class.java) -> state2 as StateT
            else -> super.asState(target)
        }

    override fun getNextLineNo() = state1.getNextLineNo()

    override val currentGeneration: Int get() = state1.currentGeneration<|endoftext|>


Prompt:
fun symlinkToDirectory() {
        val basedir = createTestFiles().cleanupRecursively()
        val original = basedir.resolve("8")
        basedir.resolve("1/3/link").tryCreateSymbolicLinkTo(original) ?: return

        // directory "8" contains "9.txt" file

Response:
val followWalk = basedir.walk(PathWalkOption.INCLUDE_DIRECTORIES, PathWalkOption.FOLLOW_LINKS)
        testVisitedFiles(referenceFilenames + listOf("", "1/3/link", "1/3/link/9.txt"), followWalk, basedir)<|endoftext|>


Prompt:
private val JUNIT_GENERATED_TEST_CLASS_BYTES by lazy { constructSyntheticTestClass() }
        private const val JUNIT_GENERATED_TEST_CLASS_PACKAGE = "test"
        private const val JUNIT_GENERATED_TEST_CLASS_NAME = "JunitTest.class"

Response:
const val JUNIT_GENERATED_TEST_CLASS_FQNAME = "test.JunitTest"

        private fun constructSyntheticTestClass(): ByteArray {
            return with(ClassWriter(ClassWriter.COMPUTE_MAXS or ClassWriter.COMPUTE_FRAMES)) {<|endoftext|>


Prompt:
if (irValue !is IrVariable || !irValue.isLateinit) {
                return expression
            }

            return backendContext.createIrBuilder(
                (irValue.parent as IrSymbolOwner).symbol,
                expression.startOffset,
                expression.endOffset
            ).run {
                irIfThenElse(
                    expression.type,
                    irEqualsNull(irGet(irValue)),

Response:
backendContext.throwUninitializedPropertyAccessException(this, irValue.name.asString()),
                    irGet(irValue)
                )
            }
        }

        override fun visitGetField(expression: IrGetField): IrExpression {
            expression.transformChildrenVoid(this)
            val irField = expression.symbol.owner
            if (irField.isLateinitBackingField()) {<|endoftext|>


Prompt:
propertyReturnType: FirTypeRef,
        isVar: Boolean,
        annotationsFromProperty: List<FirAnnotationCall>,
        property: LighterASTNode,
    ): FirBackingField {
        var modifiers: Modifier? = null
        val fieldAnnotations = mutableListOf<FirAnnotationCall>()
        var returnType: FirTypeRef = implicitType

Response:
var backingFieldInitializer: FirExpression? = null
        this?.forEachChildren {
            when {
                it.tokenType == MODIFIER_LIST -> {
                    modifiers = convertModifierList(it)
                    fieldAnnotations += convertAnnotationList(it)
                }
                it.tokenType == TYPE_REFERENCE -> returnType = convertType(it)
                it.isExpression() -> {<|endoftext|>


Prompt:
internal class HighSurrogateCharSet(high: Char) : CharSet(high) {

    override fun accepts(startIndex: Int, testString: CharSequence): Int {
        val result = super.accepts(startIndex, testString)
        if (result < 0 || testString.isLowSurrogate(startIndex + 1)) {
            return -1
        }
        return result
    }

Response:
private fun CharSequence.isLowSurrogate(index: Int, leftBound: Int = 0, rightBound: Int = length)
            = (index in leftBound until rightBound && this[index].isLowSurrogate())

    // TODO: We have a similar code here, in LowSurrogateCharSet and in CharSet. Reuse it somehow.<|endoftext|>


Prompt:
@Test
    fun testNativeCrash() {
        treatFailedTestOutputAsStacktrace = true

        var e: Throwable? = null
        try {
            assertEvents(
                """
STARTED SUITE root // root
  STARTED SUITE  // root/
    STARTED TEST displayName: Test, classDisplayName: , className: , name: Test // root//Test

Response:
StdOut[Crash info] // root//Test
      FAILURE  // root//Test
    COMPLETED FAILURE // root//Test
  COMPLETED FAILURE // root/
COMPLETED FAILURE // root
            """.trimIndent()
            ) {
                serviceMessage(TestSuiteStarted(""))
                serviceMessage(TestStarted("Test", false, null))
                regularText(<|endoftext|>


Prompt:
// MODULE: context

// FILE: context.kt
fun test() {
    <caret_context>call("foo")
}

fun call(text: String) {}

// MODULE: main
// MODULE_KIND: CodeFragment
// CONTEXT_MODULE: context

// FILE: fragment.kt
// CODE_FRAGMENT_KIND: EXPRESSION

Response:
// CODE_FRAGMENT_FOREIGN_VALUE: foo_DebugLabel(Ljava/lang/String;)
<caret>foo_DebugLabel<|endoftext|>


Prompt: */ = undefined, facingMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, resizeMode: JsAny? /* String|JsArray<JsString>|ConstrainDOMStringParameters */ = undefined, volume: JsAny? /* Double|ConstrainDoubleRange */ = undefined, sampleRate: JsAny? /* Int|ConstrainULongRange */ = undefined, sampleSize:

Response: JsAny? /* Int|ConstrainULongRange */ = undefined, echoCancellation: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, autoGainControl: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, noiseSuppression: JsAny? /* Boolean|ConstrainBooleanParameters */ = undefined, latency: JsAny? /* Double|ConstrainDoubleRange */ =<|endoftext|>


Prompt:
package org.jetbrains.kotlin.cli.js.dce

import org.jetbrains.kotlin.cli.common.CLITool
import org.jetbrains.kotlin.cli.common.ExitCode
import org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies

Response:
import org.jetbrains.kotlin.cli.common.arguments.K2JSDceArguments
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.config.Services<|endoftext|>


Prompt:
}
    return res
}

// FILE: 2.kt

import test.*

class Holder {
    var value: String = ""
}

fun test0(h: Holder): Int {
    val localResult = doCall2 (
            {
                h.value += "OK_NONLOCAL"
                if (true) {
                    throw RuntimeException()
                }
                return 1
            },

Response:
{
                h.value += ", OK_EXCEPTION"
                return 2
            },
            {
                h.value += ", OK_FINALLY"
                "OK_FINALLY"
            }, "FAILT")

    return -1;
}

fun test1(h: Holder): Int {
    val localResult = doCall2 (
            {<|endoftext|>


Prompt: <!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, "")<!>.length

Response: <!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.baz("", null)<!>.length<|endoftext|>


Prompt:
assertEquals(true, notNullToNull(B()), "B is B?")
    assertEquals(false, notNullToNull(C()), "C is B?")
    assertEquals(true, notNullToNull(D()), "D is B?")
    assertEquals(true, notNullToNull(E()), "E is B?")

Response:
assertEquals(false, notNullToNull(F()), "F is B?")
    assertEquals(false, notNullToNull(Any()), "Any is B?")
    assertEquals(false, dtoNB(dyn), "dynamic is B?")

    assertEquals(false, notNullToNull({}), "Function is B?")<|endoftext|>


Prompt:
nameRef.name!!.specialFunction = specialFunction
            }
        })
    }

    private fun markDefaultParams(function: JsFunction) {
        val paramsByNames = function.parameters.associate { it.name to it }
        for (ifStatement in function.body.statements) {
            if (ifStatement !is JsIf || ifStatement.elseStatement != null) break

Response:
val thenStatement = ifStatement.thenStatement as? JsExpressionStatement ?: break
            val testExpression = ifStatement.ifExpression as? JsBinaryOperation ?: break

            if (testExpression.operator != JsBinaryOperator.REF_EQ) break
            val testLhs = testExpression.arg1 as? JsNameRef ?: break<|endoftext|>


Prompt: u?.b?.foo()!! // was UNNECESSARY_SAFE_CALL everywhere, because result type (of 'foo()') wasn't made nullable

Response:
u<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.b<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
    x?.b!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!><|endoftext|>


Prompt:
// WITH_STDLIB

/*
 * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
 *
 * SPEC VERSION: 0.1-218
 * MAIN LINK: expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 2 -> sentence 1

Response:
* PRIMARY LINKS: expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 1 -> sentence 2
 * expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 1 -> sentence 1
 * expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 3 -> sentence 1
 *<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.expressions.IrConstantPrimitive
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.util.IrElementConstructorIndicator

class IrConstantPrimitiveImpl internal constructor(

Response:
@Suppress("UNUSED_PARAMETER")
    constructorIndicator: IrElementConstructorIndicator?,
    override val startOffset: Int,
    override val endOffset: Int,
    override var type: IrType,
    override var value: IrConst<*>,
) : IrConstantPrimitive() {
    override var attributeOwnerId: IrAttributeContainer = this<|endoftext|>


Prompt:
override fun equals(other: Any?) = true
}

@JvmInline
value class D<T : Int>(val t: T) {
    override fun equals(other: Any?) = true
}

@JvmInline
value class E(val d: Double) {
    override fun equals(other: Any?) = true
}

@JvmInline

Response:
value class F(val e: E) {
    override fun equals(other: Any?) = true
}

@JvmInline
value class G(val e: Int?) {
    override fun equals(other: Any?) = true
}

@JvmInline
value class H(val e: Any?) {
    override fun equals(other: Any?) = true
}

@JvmInline<|endoftext|>


Prompt:
val smap = it.value.sortedByDescending(CommonSMAPTestUtil.SMAPAndFile::outputFile).mapNotNull(CommonSMAPTestUtil.SMAPAndFile::smap).joinToString("\n")
            CommonSMAPTestUtil.SMAPAndFile(if (smap.isNotEmpty()) smap else null, it.key, "NOT_SORTED")

Response:
}.associateBy { it.sourceFile }

        dumper.builderForModule(module).apply {
            for (source in compiledData.values) {
                appendLine("// FILE: ${File(source.sourceFile).name}")
                appendLine(source.smap ?: "")
            }
        }
    }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DONT_SORT_DECLARATIONS
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_IR
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_ANNOTATIONS

Response:
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.WITH_SIGNATURES
import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.FIR_DUMP
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
import org.jetbrains.kotlin.test.model.BinaryArtifacts<|endoftext|>


Prompt:
* Returns a list containing elements at indices in the specified [indices] range.
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
public fun ULongArray.slice(indices: IntRange): List<ULong> {
    if (indices.isEmpty()) return listOf()
    return copyOfRange(indices.start, indices.endInclusive + 1).asList()
}

Response:
/**
 * Returns a list containing elements at indices in the specified [indices] range.
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
public fun UByteArray.slice(indices: IntRange): List<UByte> {
    if (indices.isEmpty()) return listOf()
    return copyOfRange(indices.start, indices.endInclusive + 1).asList()
}<|endoftext|>


Prompt:
// test.kt:23 box: p:MyPair=MyPair
// EXPECTATIONS FIR JVM_IR
// test.kt:18 box: p:MyPair=MyPair
// EXPECTATIONS JVM_IR
// test.kt:6 component1:
// test.kt:18 box: p:MyPair=MyPair
// EXPECTATIONS FIR JVM_IR

Response:
// test.kt:20 box: p:MyPair=MyPair, o:java.lang.String="O":java.lang.String
// EXPECTATIONS JVM_IR
// test.kt:10 component2:
// test.kt:20 box: p:MyPair=MyPair, o:java.lang.String="O":java.lang.String<|endoftext|>


Prompt:
output.addSourceMappingURL(outputFile)
            }
            val code = output.toString()

            val prefix = outputPrefixFile?.readText() ?: ""
            val postfix = outputPostfixFile?.readText() ?: ""

            val jsFile = SimpleOutputFile(sourceFiles, outputFile.name, prefix + code + postfix)

Response:
val outputFiles = arrayListOf<OutputFile>(jsFile)

            outputFiles += metadataFiles(outputFile)

            if (sourceMapBuilderConsumer != null) {
                sourceMapBuilder.skipLinesAtBeginning(StringUtil.getLineBreakCount(prefix))
                val sourceMapFile = SimpleOutputFile(sourceFiles, sourceMapBuilder.outFile.name, sourceMapBuilder.build())<|endoftext|>


Prompt:
}.apply(::addModule)
    }

    buildKtSourceModule {
        configLanguageVersionSettings?.let { this.languageVersionSettings = it }
        this.platform = platform
        this.moduleName = compilerConfig.get(CommonConfigurationKeys.MODULE_NAME) ?: "<no module name provided>"

        addModuleDependencies(moduleName)

Response:
addSourceRoots(compilerConfig.javaSourceRoots.map { Paths.get(it) })
    }.apply(::addModule)

    this.platform = platform
}<|endoftext|>


Prompt:
* despite no modifier being present. This is considered a 'special Kotlin Native' class in the context of this function.
 */
context(KtAnalysisSession)
private fun KtNamedClassOrObjectSymbol.isInlineIncludingKotlinNativeSpecialClasses(): Boolean {
    if (this.isInline) return true
    val classId = classIdIfNonLocal ?: return false

Response:
/* Top Level symbols can be special K/N types */
    if (getContainingSymbol() is KtClassOrObjectSymbol) return false

    if (classId.packageFqName == KonanFqNames.internalPackageName && classId.shortClassName == KonanFqNames.nativePtr.shortName()) {
        return true
    }<|endoftext|>


Prompt:
return expression.branches.all { it.accept(this, data) }
    }

    override fun visitBranch(branch: IrBranch, data: IrInterpreterCheckerData): Boolean {
        return branch.condition.accept(this, data) && branch.result.accept(this, data)
    }

Response:
override fun visitWhileLoop(loop: IrWhileLoop, data: IrInterpreterCheckerData): Boolean {
        return loop.asVisited {
            loop.condition.accept(this, data) && (loop.body?.accept(this, data) ?: true)
        }
    }<|endoftext|>


Prompt: if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) {

Response: if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) { if (<!USELESS_IS_CHECK!>x is Int<!>) {<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null)
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.propT
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.propAny

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.propNullableT
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.propNullableAny
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.funT()<|endoftext|>


Prompt:
import kotlin.script.experimental.host.ScriptingHostConfiguration
import kotlin.script.experimental.host.withDefaultsFrom
import kotlin.script.experimental.impl.internalScriptingRunSuspend
import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration
import kotlin.script.experimental.jvm.util.isIncomplete

/**

Response:
* REPL Compilation wrapper for "legacy" REPL APIs defined in the org.jetbrains.kotlin.cli.common.repl package
 */
class JvmReplCompiler(
    val scriptCompilationConfiguration: ScriptCompilationConfiguration,
    val hostConfiguration: ScriptingHostConfiguration = defaultJvmScriptingHostConfiguration
) : ReplCompilerWithoutCheck {<|endoftext|>


Prompt:
resumeResult               = irBlock(startOffset, endOffset) {
                            +irCall(restoreCoroutineState)
                            +irGetOrThrow(irGet(resultArgument))
                        })
                val expressionResult = when {
                    suspendCall.type.isUnit() -> irImplicitCoercionToUnit(suspensionPoint)
                    else -> irAs(suspensionPoint, suspendCall.type)
                }

Response:
return irBlock(expression) {
                    tempStatements.forEach { +it }
                    +expressionResult
                }
            }

        }
    }

    private fun IrBuilderWithScope.irWrap(expression: IrExpression, tempStatements: List<IrStatement>)
            = if (tempStatements.isEmpty())
        expression<|endoftext|>


Prompt:
private fun genInstanceOfImpl(obj: LLVMValueRef, dstClass: IrClass) = with(functionGenerationContext) {
        if (dstClass.defaultType.isObjCObjectType()) {
            genInstanceOfObjC(obj, dstClass)
        } else with(VirtualTablesLookup) {
            checkIsSubtype(

Response:
objTypeInfo = loadTypeInfo(bitcast(codegen.kObjHeaderPtr, obj)),
                    dstClass
            )
        }
    }

    private fun genInstanceOfObjC(obj: LLVMValueRef, dstClass: IrClass): LLVMValueRef {
        val objCObject = callDirect(
                context.ir.symbols.interopObjCObjectRawValueGetter.owner,<|endoftext|>


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

inline fun run(block: () -> Unit) {
    block()
}

fun box(): String {
    var result = ""
    run {
        builder {
            try {
                result += suspendHere("O")
            } finally {
                result += suspendHere("K")
            }

Response:
}
    }

    return result
}<|endoftext|>


Prompt:
typeArgument.type.mapToReferenceTypeIgnoringNullability()
            }
        }
    }
}

/**
 * Types to be "hidden" during mapping, i.e., represented as `id`.
 *
 * Currently, it contains super types of classes handled by custom type mappers.
 * Note: It can be generated programmatically, but requires stdlib in this case.
 */

Response:
private val hiddenClassIds: Set<ClassId> = listOf(
    "kotlin.Any",
    "kotlin.CharSequence",
    "kotlin.Comparable",
    "kotlin.Function",
    "kotlin.Number",
    "kotlin.collections.Collection",
    "kotlin.collections.Iterable",<|endoftext|>


Prompt:
package org.jetbrains.kotlin.konan.test.blackbox

import org.jetbrains.kotlin.konan.test.blackbox.support.TestName
import org.jetbrains.kotlin.konan.test.blackbox.support.util.TCTestOutputFilter

Response:
import org.jetbrains.kotlin.konan.test.blackbox.support.util.TestOutputFilter
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test

@Tag("infrastructure")<|endoftext|>


Prompt:
processControlFlowEdge(current, insnNode, label.indexOf())
        }
    }

    private fun visitLookupSwitchInsnNode(insnNode: LookupSwitchInsnNode, current: F) {
        processControlFlowEdge(current, insnNode, insnNode.dflt.indexOf())
        for (label in insnNode.labels) {

Response:
processControlFlowEdge(current, insnNode, label.indexOf())
        }
    }

    private fun visitJumpInsnNode(insnNode: JumpInsnNode, current: F, insn: Int, insnOpcode: Int) {
        if (insnOpcode != Opcodes.GOTO) {
            processControlFlowEdge(current, insnNode, insn + 1)
        }<|endoftext|>


Prompt:
@JvmName("mapDirectoryToFile") // avoids jvm signature clash
internal fun Provider<Directory>.mapToFile(): Provider<File> = map { it.asFile }

internal fun Provider<RegularFile>.getFile(): File = get().asFile

@JvmName("getDirectoryAsFile") // avoids jvm signature clash
internal fun Provider<Directory>.getFile(): File = get().asFile

/**

Response:
* Checks if the file exists, taking into account compatibility with different versions of Gradle.
 * It should be used instead of [File.exists] in checking UPD inputs. See KT-54232 for more info.
 *
 * @return `true` if the file exists, `false` otherwise.
 *
 * NOTE: You can remove this method and all its usages since the minimal supported version of gradle become 8.0
 */<|endoftext|>


Prompt:
if (!(value_1 !is Int)) throw Exception()
}

// TESTCASE NUMBER: 5
fun case_5_1(value_1: Int?): Boolean {
    contract { returns(true) implies (value_1 == null) }
    return value_1 == null
}
fun case_5_2(value_1: Int?): Boolean {

Response:
contract { returns(true) implies (value_1 != null) }
    return value_1 != null
}
fun case_5_3(value_1: Int?): Boolean {
    contract { returns(false) implies (value_1 == null) }
    return !(value_1 == null)
}
fun case_5_4(value_1: Int?): Boolean {<|endoftext|>


Prompt:
package test

class ClassWithPrivateVarAdded {
    private var x: Int = 100
    public fun unchangedFun() {}
}

class ClassWithPrivateVarRemoved {
    public fun unchangedFun() {}
}

class ClassWithPrivateVarSignatureChanged {
    private var x: String = "X"
    public fun unchangedFun() {}
}

class ClassWithGetterAndSetterForPrivateVarChanged {

Response:
private var x: Int
    get() = 200
    set(value) {}
    public fun unchangedFun() {}
}<|endoftext|>


Prompt:
?: throw IncorrectOperationException("Class was not created. Method name: $name; return type: $canonicalText")

        return klass.methods.singleOrNull()
            ?: throw IncorrectOperationException("Method was not created. Method name: $name; return type: $canonicalText")
    }

Response:
fun createDummyClass(project: Project): PsiClass = PsiElementFactory.getInstance(project).createClass("dummy")

    private fun createDummyJavaFile(project: Project, text: String): PsiJavaFile {
        return PsiFileFactory.getInstance(project).createFileFromText(
            DUMMY_FILE_NAME,
            JavaFileType.INSTANCE,
            text<|endoftext|>


Prompt:
import org.jetbrains.kotlin.objcexport.analysisApiUtils.objCErrorType
import org.jetbrains.kotlin.objcexport.extras.objCTypeExtras
import org.jetbrains.kotlin.objcexport.extras.originClassId
import org.jetbrains.kotlin.objcexport.extras.requiresForwardDeclaration

Response:
/**
 * [org.jetbrains.kotlin.backend.konan.objcexport.ObjCExportTranslatorImpl.mapType]
 */
context(KtAnalysisSession, KtObjCExportSession)
internal fun KtType.translateToObjCType(typeBridge: TypeBridge): ObjCType {
    return when (typeBridge) {<|endoftext|>


Prompt:
) {}
            """.trimIndent()
        }

        result.assertCommonized(
            "(${WATCHOS_ARM64.name}, ${IOS_ARM64.name})", """
                typealias OtherAlias = PlatformUInt

                expect class Box<T>()

                expect fun fn(

Response:
arg1: Box<kotlinx.cinterop.PlatformUIntVarOf<OtherAlias>>,
                    arg2: Box<kotlinx.cinterop.PlatformUIntVarOf<OtherAlias>>
                )
            """.trimIndent()
        )
    }
}<|endoftext|>


Prompt:
(0 until irAnnotation.typeArgumentsCount).joinTo(this, ", ", "<", ">") { i ->
            irAnnotation.getTypeArgument(i)?.renderTypeWithRenderer(renderer, options) ?: "null"
        }
    }

    if (irAnnotation.valueArgumentsCount == 0) return

Response:
val valueParameterNames = irAnnotation.getValueParameterNamesForDebug()

    appendIterableWith(0 until irAnnotation.valueArgumentsCount, separator = ", ", prefix = "(", postfix = ")") {
        append(valueParameterNames[it])
        append(" = ")
        renderAsAnnotationArgument(irAnnotation.getValueArgument(it), renderer, options)
    }
}<|endoftext|>


Prompt:
override val receiverParameter: KtReceiverParameterSymbol?
        get() = withValidityAssertion { propertyDescriptor.extensionReceiverParameter?.toKtReceiverParameterSymbol(analysisContext) }

    override val modality: Modality
        get() = withValidityAssertion { propertyDescriptor.ktModality }

    override val visibility: Visibility

Response:
get() = withValidityAssertion { propertyDescriptor.ktVisibility }

    override val annotationsList: KtAnnotationsList
        get() = withValidityAssertion { KtEmptyAnnotationsList(token) }

    override fun createPointer(): KtSymbolPointer<KtPropertyGetterSymbol> = withValidityAssertion {<|endoftext|>


Prompt:
// Implicitly checking none of string constants starts with "kotlin/" prefix, just in case.
                assertFalse("$constant found at ${entry.name}", constant.startsWith("kotlin/"))
            }
        }
    }

    companion object {
        private val INTERNAL_COMPANIONS =

Response:
listOf("Char", "Byte", "Short", "Int", "Float", "Long", "Double", "String", "Enum")
                .map { "kotlin/jvm/internal/${it}CompanionObject" }
        val PREDEFINED_STRINGS =<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter

// FILE: test.kt

OPTIONAL_JVM_INLINE_ANNOTATION
value class R<T: Int>(private val r: T) {

    companion object {
        val ok

Response:
@JvmStatic get() = "OK"
    }
}

fun box() = J.test()

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


Prompt:
val initializer = it.expression as IrCall
                        when {
                            initializer.isAtomicFieldGetter() -> {
                                // val _a = atomic(0)
                                // var a: Int by _a
                                // Accessors of the delegated property `a` are implemented via the generated property `a$delegate`,
                                // that is the copy of the original `_a`.

Response:
// They should be delegated to the value of the original field `_a` instead of `a$delegate`.

                                // fun <get-a>() = a$delegate.value -> _a.value
                                // fun <set-a>(value: Int) = { a$delegate.value = value } -> { _a.value = value }
                                val originalField = initializer.getBackingField()<|endoftext|>


Prompt:
val newArgumentsList = arguments.mapIndexed { index, oldArgument -> newArguments[index] ?: oldArgument }
        return type.replace(newArgumentsList)
    }
}

object EmptySubstitutor : NewTypeSubstitutor {
    override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? = null

Response:
override val isEmpty: Boolean get() = true
}

class NewTypeSubstitutorByConstructorMap(val map: Map<TypeConstructor, UnwrappedType>) : NewTypeSubstitutor {
    override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? = map[constructor]

    override val isEmpty: Boolean get() = map.isEmpty()<|endoftext|>


Prompt:
@Test
    fun testEvalWithIfResult() {
        checkEvaluateInRepl(
            sequenceOf(
                "val x = 5",
                "x + 6",
                "if (x < 10) res1 * 2 else x"
            ),
            sequenceOf(null, 11, 22)
        )
    }

    @Test
    fun testImplicitReceiver() {

Response:
val receiver = TestReceiver()
        checkEvaluateInRepl(
            sequenceOf(
                "val x = 4",
                "x + prop1",
                "res1 * 3"
            ),
            sequenceOf(null, 7, 21),
            simpleScriptCompilationConfiguration.with {
                implicitReceivers(TestReceiver::class)
            },
            simpleScriptEvaluationConfiguration.with {<|endoftext|>


Prompt:
*/
public external abstract class NodeList : ItemArrayLike<Node> {
    override fun item(index: Int): Node?
}

@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun NodeList.get(index: Int): Node? = asDynamic()[index]

/**

Response:
* Exposes the JavaScript [HTMLCollection](https://developer.mozilla.org/en/docs/Web/API/HTMLCollection) to Kotlin
 */
public external abstract class HTMLCollection : ItemArrayLike<Element>, UnionElementOrHTMLCollection {
    override fun item(index: Int): Element?
    fun namedItem(name: String): Element?
}<|endoftext|>


Prompt:
@kotlin.SinceKotlin(version = "1.3")
@kotlin.ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun kotlin.UShortArray.first(): kotlin.UShort

@kotlin.SinceKotlin(version = "1.3")
@kotlin.ExperimentalUnsignedTypes

Response:
@kotlin.internal.InlineOnly
public inline fun kotlin.UShortArray.first(predicate: (kotlin.UShort) -> kotlin.Boolean): kotlin.UShort

public fun <T> kotlin.collections.Iterable<T>.first(): T<|endoftext|>


Prompt: // library.kt:20 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:
public inline val ResponseType.Companion.DEFAULT: ResponseType get() = "default".toJsString().unsafeCast<ResponseType>()

public inline val ResponseType.Companion.ERROR: ResponseType get() = "error".toJsString().unsafeCast<ResponseType>()

Response:
public inline val ResponseType.Companion.OPAQUE: ResponseType get() = "opaque".toJsString().unsafeCast<ResponseType>()

public inline val ResponseType.Companion.OPAQUEREDIRECT: ResponseType get() = "opaqueredirect".toJsString().unsafeCast<ResponseType>()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.objcexport.testUtils.getClassOrFail
import org.jetbrains.kotlin.objcexport.testUtils.getFunctionOrFail
import org.junit.jupiter.api.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue

class IsVisibleInObjCTest(

Response:
private val inlineSourceCodeAnalysis: InlineSourceCodeAnalysis,
) {
    @Test
    fun `test - simple public function`() {
        val file = inlineSourceCodeAnalysis.createKtFile("fun foo() = Unit")
        analyze(file) {
            val fooSymbol = file.getFunctionOrFail("foo")
            assertTrue(fooSymbol.isVisibleInObjC())
        }<|endoftext|>


Prompt:
// !OPT_IN: kotlin.ExperimentalStdlibApi
// IGNORE_BACKEND: JVM

// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
// Range and progression-based loops generated with Kotlin compiler should be

Response:
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
// with compiler built from your changes if you are not sure.

const val M = Char.MIN_VALUE<|endoftext|>


Prompt:
abstract override val annotations: List<FirAnnotation>
    abstract val statements: List<FirStatement>

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

    @Suppress("UNCHECKED_CAST")

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

    abstract override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?)

    abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)<|endoftext|>


Prompt:
) {

    /** The current time period, which starts from 0 and will increment by 1 whenever [newTimePeriod] is called. */
    private val currentTimePeriod = AtomicInteger(0)

    private val cache = ConcurrentHashMap<KEY, CacheEntryValue<VALUE>>()

    fun newTimePeriod() {
        currentTimePeriod.incrementAndGet()
    }

Response:
fun computeIfAbsent(key: KEY, valueProvider: (KEY) -> VALUE): VALUE {
        return readLock { // Read lock so that this method can be called concurrently
            val cacheEntryValue = cache.computeIfAbsent(key) { // `cache` is thread-safe
                CacheEntryValue(value = valueProvider(key), currentTimePeriod = currentTimePeriod.get())
            }<|endoftext|>


Prompt:
executable = "ssh"
                    val remoteExecutable = this@RunKotlinNativeTask.executable.split("/").last()
                    args (remoteHost, "$remoteHostFolder/$remoteExecutable")
                }
                else -> executable = this@RunKotlinNativeTask.executable
            }

            args(argumentsList)
            args("-f", benchmark)

Response:
// Logging with application should be done only in case it controls running benchmarks itself.
            // Although it's a responsibility of gradle task.
            if (verbose && repeatingType == BenchmarkRepeatingType.INTERNAL) {
                args("-v")
            }
            args("-w", warmupCount.toString())
            args("-r", repeatCount.toString())
            standardOutput = output
        }<|endoftext|>


Prompt:
// FILE: TestCase3.kt
// TESTCASE NUMBER: 3
package testsCase3
import libCase3.format
import kotlin.text.*

fun case3() {
    val y1 =(String)::format

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KProperty1<kotlin.String, kotlin.Int>")!>y1<!>

    val y2 =""::format
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KProperty0<kotlin.Int>")!>y2<!>
}<|endoftext|>


Prompt:
public inline fun <S, T : S> Array<out T>.reduce(operation: (acc: S, T) -> S): S {
    if (isEmpty())
        throw UnsupportedOperationException("Empty array can't be reduced.")
    var accumulator: S = this[0]
    for (index in 1..lastIndex) {
        accumulator = operation(accumulator, this[index])
    }

Response:
return accumulator
}

/**
 * Accumulates value starting with the first element and applying [operation] from left to right
 * to current accumulator value and each element.
 *
 * Throws an exception if this array is empty. If the array can be empty in an expected way,
 * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.
 *<|endoftext|>


Prompt:
project("customSrcDir", gradleVersion) {
            build("build")
        }
    }

    @GradleTest
    @DisplayName("Plugin should correctly handle additional java source directories")
    fun testKotlinExtraJavaSrc(gradleVersion: GradleVersion) {
        project("additionalJavaSrc", gradleVersion) {
            build("build")
        }
    }

Response:
@GradleTest
    @DisplayName("Using newer language features with older api level should fail the build")
    fun testLanguageVersion(gradleVersion: GradleVersion) {
        project("languageVersion", gradleVersion) {
            buildAndFail("build") {
                assertOutputContains("Suspend function type is allowed as a supertype only since version 1.6")
            }
        }
    }<|endoftext|>


Prompt:
open class FirImplicitAwareBodyResolveTransformer(
    session: FirSession,
    scopeSession: ScopeSession,
    private val implicitBodyResolveComputationSession: ImplicitBodyResolveComputationSession,
    phase: FirResolvePhase,
    implicitTypeOnly: Boolean,
    returnTypeCalculator: ReturnTypeCalculatorWithJump,

Response:
outerBodyResolveContext: BodyResolveContext? = null,
) : FirBodyResolveTransformer(
    session,
    phase,
    implicitTypeOnly,
    scopeSession,
    returnTypeCalculator,
    outerBodyResolveContext,
) {
    override fun transformForeignAnnotationCall(symbol: FirBasedSymbol<*>, annotationCall: FirAnnotationCall): FirAnnotationCall {<|endoftext|>


Prompt:
override fun clashingMethodWithObjCNameInBoth(): Any = "five"
}

class InterfaceNameManglingC1 {
    val clashingProperty: String = "one"

    fun clashingMethod(): String = "two"
}

final class InterfaceNameManglingC2 {
    val clashingProperty: Int = 1

    fun clashingMethod(): Int = 2
}

Response:
fun o1() = InterfaceNameManglingC1()

fun o2() = InterfaceNameManglingC2()<|endoftext|>


Prompt:
put(JVMConfigurationKeys.NO_KOTLIN_NOTHING_VALUE_EXCEPTION, arguments.noKotlinNothingValueException)
    put(JVMConfigurationKeys.NO_RESET_JAR_TIMESTAMPS, arguments.noResetJarTimestamps)
    put(JVMConfigurationKeys.NO_UNIFIED_NULL_CHECKS, arguments.noUnifiedNullChecks)

Response:
put(JVMConfigurationKeys.NO_SOURCE_DEBUG_EXTENSION, arguments.noSourceDebugExtension)

    put(JVMConfigurationKeys.SERIALIZE_IR, JvmSerializeIrMode.fromString(arguments.serializeIr))

    put(JVMConfigurationKeys.VALIDATE_IR, arguments.validateIr)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.visitors.FirVisitor
import org.jetbrains.kotlin.fir.visitors.transformInplace

@OptIn(FirImplementationDetail::class, ResolveStateAccess::class)
internal class FirCodeFragmentImpl(
    override val source: KtSourceElement?,
    resolvePhase: FirResolvePhase,

Response:
override var annotations: MutableOrEmptyList<FirAnnotation>,
    override val moduleData: FirModuleData,
    override val origin: FirDeclarationOrigin,
    override val attributes: FirDeclarationAttributes,
    override val symbol: FirCodeFragmentSymbol,
    override var block: FirBlock,
) : FirCodeFragment() {

    init {<|endoftext|>


Prompt:
- TEST_METHOD_IMPL(directExt);

@end

@implementation CallingConventionsHeir

@end

// MODULE: main(cinterop)
// FILE: main.kt
@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
import direct.*
import kotlinx.cinterop.*
import kotlin.test.*

Response:
class CallingConventionsNativeHeir() : CallingConventions() {
    // nothing
}

typealias CC = CallingConventions
typealias CCH = CallingConventionsHeir
typealias CCN = CallingConventionsNativeHeir

// KT-54610
fun box(): String {
    autoreleasepool {
        val cc = CC()
        val cch = CCH()
        val ccn = CCN()<|endoftext|>


Prompt:
fun addClassExpectation(name: String, jvmSignature: String?, genericSignature: String) {
            classExpectations.add(SignatureExpectation("class: $name", name, jvmSignature, genericSignature))
        }

        fun addFieldExpectation(className: String, memberName: String, jvmSignature: String?, genericSignature: String) {

Response:
fieldExpectations.add(SignatureExpectation("field: $className::$memberName", memberName, jvmSignature, genericSignature))
        }

        fun addMethodExpectation(className: String, memberName: String, jvmSignature: String?, genericSignature: String) {<|endoftext|>


Prompt:
// UNEXPECTED BEHAVIOUR
// Issue: KT-37056
class A()

// TESTCASE NUMBER: 1
fun case1(a: A?) {
    val test = a?.let {

        Case1.invoke(it)  //resolved to private constructor

        Case1(it) //resolved to private constructor

        Case1(A()) //resolved to private constructor
    }

Response:
Case1(A()) //resolved to private constructor
    Case1(a = A()) //resolved to private constructor
}

class Case1 private constructor(val a: String) {
    companion object {
        operator fun invoke(a: A) = ""
    }
}

// TESTCASE NUMBER: 2
fun case2(a: A){
    Case2(a)<|endoftext|>


Prompt:
assertFailsWith<IllegalArgumentException> { HexFormat { bytes.bytesPerLine = Int.MIN_VALUE } }
    }

    @Test
    fun nonPositiveBytesPerGroup() {
        assertFailsWith<IllegalArgumentException> { HexFormat { bytes.bytesPerGroup = 0 } }

Response:
assertFailsWith<IllegalArgumentException> { HexFormat { bytes.bytesPerGroup = -1 } }
        assertFailsWith<IllegalArgumentException> { HexFormat { bytes.bytesPerGroup = Int.MIN_VALUE } }
    }

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


Prompt:
* The capacity is the maximum length this string builder can have before an allocation occurs.
     *
     * In Kotlin/JS implementation of StringBuilder the value returned from this method may not indicate the actual size of the backing storage.
     */
    @SinceKotlin("1.3")
    public fun capacity(): Int

    /**

Response:
* Ensures that the capacity of this string builder is at least equal to the specified [minimumCapacity].
     *
     * If the current capacity is less than the [minimumCapacity], a new backing storage is allocated with greater capacity.
     * Otherwise, this method takes no action and simply returns.
     */
    @SinceKotlin("1.4")
    public fun ensureCapacity(minimumCapacity: Int)

    /**<|endoftext|>


Prompt:
if (descriptor.kind == CallableMemberDescriptor.Kind.SYNTHESIZED) {
        return true
    }
    if (descriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
        return descriptor.overriddenDescriptors.all(::isOrOverridesSynthesized)
    }
    return false
}

Response:
fun isBinaryRemOperator(call: Call): Boolean {
    val callElement = call.callElement as? KtBinaryExpression ?: return false
    val operator = callElement.operationToken
    if (operator !is KtToken) return false

    val name = OperatorConventions.getNameForOperationSymbol(operator, true, true) ?: return false<|endoftext|>


Prompt:
var outerClass = findClass(outerClassId, scope) ?: return null

            pathSegments.drop(1).forEach {
                outerClass = outerClass.findInnerClass(Name.identifier(it)) ?: return null
            }

            return outerClass
        }

        treeBasedJavaClasses[classId]?.let { javaClass ->

Response:
javaClass.virtualFile?.let { if (it in scope) return javaClass }
        }

        val javaClass = symbolBasedClassesCache[classId]
        if (javaClass != null) {
            javaClass.virtualFile?.let { file ->
                if (file in scope) return javaClass
            }
        }<|endoftext|>


Prompt:
element.accept(IrValidator(backendContext, validatorConfig), null)
                element.checkDeclarationParents()
            } catch (t: Throwable) {
                // TODO: Add reference to source.
                if (validatorConfig.abortOnError)
                    throw IllegalStateException("Failed IR validation ${state.beforeOrAfter} ${state.phase}", t)

Response:
else context.reportCompilationWarning("[IR VALIDATION] ${state.beforeOrAfter} ${state.phase}: ${t.message}")
            }
        }

private fun <Data, Context : PhaseContext> getIrDumper(): Action<Data, Context> =
        fun(state: ActionState, data: Data, context: Context) {
            if (!state.isDumpNeeded()) return<|endoftext|>


Prompt:
package org.jetbrains.kotlin.javac.resolve

import com.sun.source.tree.CompilationUnitTree
import com.sun.tools.javac.code.TypeTag
import com.sun.tools.javac.tree.JCTree
import org.jetbrains.kotlin.javac.JavacWrapper

Response:
import org.jetbrains.kotlin.load.java.structure.JavaClass
import kotlin.experimental.inv

class ConstantEvaluator(private val containingClass: JavaClass,
                        private val javac: JavacWrapper,
                        private val compilationUnit: CompilationUnitTree) {
    fun getValue(expr: JCTree.JCExpression): Any? {<|endoftext|>


Prompt:
}

        @Fun
        fun localMember(): @FunType Int {
            @Anno1 val a = @Anno2 1
            val b = @AnonymousFunction fun(@AnonymousParameter a: @AnonymousParameterType Int) {
                @Anno foo()
            }

            @Anno
            fun boo(@Anno a: @Anno Int): @Anno Int {
                @Anno

Response:
fun boo(@Anno a: @Anno Int): @Anno Int {
                    @Anno
                    fun boo(@Anno a: @Anno Int): @Anno Int {

                    }
                }
            }

            @Anno<|endoftext|>


Prompt:
path.startsWith(PROJECT_DIR_PLACEHOLDER) -> {
                val basePath = baseDirPath ?: error("Could not get project root dir")
                File(basePath + path.substring(PROJECT_DIR_PLACEHOLDER.length))
            }
            else -> File(path)
        }

    private companion object {

Response:
private const val PROJECT_DIR_PLACEHOLDER = "${'$'}PROJECT_DIR$"
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolKind
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtPsiBasedSymbolPointer
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer

Response:
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.Name<|endoftext|>


Prompt:
declarationToRender.render()
    } else {
        declaration.getOrBuildFirOfType<FirDeclaration>(firSession)
        declarationToRender.render()
    }

    val firDeclarationAfter = declaration.getOrBuildFirOfType<FirDeclaration>(firSession)
    testServices.assertions.assertEquals(firDeclarationBefore, firDeclarationAfter) {

Response:
"The declaration before and after must be the same"
    }

    testServices.assertions.assertEquals(textBefore, textAfter) {
        "The declaration must have the same in the resolved state"
    }

    return "BEFORE MODIFICATION:\n$textBefore\nAFTER MODIFICATION:\n$textAfterModification"
}

/**<|endoftext|>


Prompt:
// !LANGUAGE: +InlineClasses -MangleClassMembersReturningInlineClasses
// WITH_STDLIB
// TARGET_BACKEND: JVM

// FILE: 1.kt

package test

inline class S(val string: String)

@Suppress("INAPPLICABLE_JVM_NAME")
@JvmName("foo")
inline fun foo() = S("OK")

Response:
// FILE: 2.kt

import test.*

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


Prompt:
import org.jetbrains.kotlin.resolve.jvm.shouldHideConstructorDueToValueClassTypeValueParameters

class LocalFunInlineChecker : DeclarationChecker {
    override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {
        if (InlineUtil.isInline(descriptor) &&

Response:
declaration is KtNamedFunction &&
            descriptor is FunctionDescriptor &&
            descriptor.visibility == DescriptorVisibilities.LOCAL
        ) {
            context.trace.report(Errors.NOT_YET_SUPPORTED_IN_INLINE.on(declaration, "Local inline functions"))
        }
    }
}<|endoftext|>


Prompt:
if (d != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String"), DEBUG_INFO_SMARTCAST!>this.d<!>.equals(null)
        if (d != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String"), DEBUG_INFO_SMARTCAST!>this.d<!>.propT

Response:
if (d != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String"), DEBUG_INFO_SMARTCAST!>this.d<!>.propAny
        if (d != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & kotlin.String?")!>this.d<!>.propNullableT<|endoftext|>


Prompt:
if (!AbstractTypeChecker.RUN_SLOW_ASSERTIONS) return
        checkState(*arrayOf(a, b, c, d))
    }

    private fun checkState(vararg allowedState: State) {
        if (!AbstractTypeChecker.RUN_SLOW_ASSERTIONS) return
        assert(state in allowedState) {

Response:
"State $state is not allowed. AllowedStates: ${allowedState.joinToString()}"
        }
    }

    override val errors: List<ConstraintSystemError>
        get() = storage.errors

    override fun getBuilder() = apply { checkState(State.BUILDING, State.COMPLETION, State.TRANSACTION) }<|endoftext|>


Prompt:
origin = JvmLoweredDeclarationOrigin.LAMBDA_IMPL
        name = SpecialNames.NO_NAME_PROVIDED
    }.apply {
        parent = currentDeclarationParent
        superTypes = listOfNotNull(superType)
        createImplicitParameterDeclarationWithWrappedDescriptor()
        copyAttributes(irFunctionExpression)
        metadata = irFunctionExpression.function.metadata
    }

Response:
fun build(): IrExpression = DeclarationIrBuilder(
        generatorContext,
        currentScopeOwnerSymbol
    ).run {
        irBlock(irFunctionExpression.startOffset, irFunctionExpression.endOffset) {
            val constructor = createConstructor()
            createInvokeMethod()
            functionReferenceClass.addFakeOverrides(irTypeSystemContext)
            +functionReferenceClass<|endoftext|>


Prompt:
synchronized(lock) {
            b()
        }
    }
}

fun test() {
    builder {
        synchronized(lock) {
            suspensionPoint()
        }
    }

    builder {
        inlineMe {
            suspensionPoint()
        }
    }

    builder {
        monitorInFinally(
            {},
            { suspensionPoint() }
        )

Response:
}

    synchronized(lock) {
        builder {
            suspensionPoint()
        }
    }

    synchronized(lock) {
        object : SuspendRunnable {
            override suspend fun run() {
                suspensionPoint()
            }
        }
    }

    object : SuspendRunnable {
        override suspend fun run() {<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("CapturedType(in CapturedType(out kotlin.CharSequence))")!>x.bar().foo()<!> checkType { _<Any?>() } // See KT-10448

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("CapturedType(in CapturedType(out kotlin.CharSequence))")!>x.bar().foo()<!> checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><CharSequence>() } // Inference change in K2
}<|endoftext|>


Prompt:
get.set(1)
    if (get.get() != 1) return "Fail get: ${get.get()}"

    val set = Host::set as KMutableProperty0<Int>
    set.set(1)
    if (set.get() != 1) return "Fail set: ${set.get()}"

    val both = Host::both as KMutableProperty0<Int>

Response:
both.set(1)
    if (both.get() != 1) return "Fail both: ${both.get()}"

    val property = Host::property as KMutableProperty0<Int>
    property.set(1)
    if (property.get() != 1) return "Fail property: ${property.get()}"

    return "OK"
}<|endoftext|>


Prompt:
package org.jetbrains.kotlin.multiplatform

import org.jetbrains.kotlin.cli.AbstractCliTest
import org.jetbrains.kotlin.cli.common.CLICompiler
import org.jetbrains.kotlin.cli.js.K2JSCompiler
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler

Response:
import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler
import org.jetbrains.kotlin.test.InTextDirectivesUtils
import org.jetbrains.kotlin.test.KotlinTestUtils
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase<|endoftext|>


Prompt:
sourceRoot.kotlinSourceSetName to testDataDir.resolve(sourceRoot.directoryName).walkTopDown()
                    .filter { it.extension == "kt" }
                    .map { CodeWithErrorInfo.parse(it.readText()) }.toList()
                    .flatMap { it.errorInfo }
            }

            // put sources into project dir:

Response:
sourceRoots.forEach { sourceRoot ->
                val sourceSetDir = projectPath.resolve(sourceRoot.gradleSrcDir).toFile()
                testDataDir.resolve(sourceRoot.directoryName).copyRecursively(sourceSetDir)
                sourceSetDir.walkTopDown().filter { it.isFile }.forEach { file -><|endoftext|>


Prompt:
val projStepId = projStep.id
            val moduleTestDir = File(testDir, module)
            val moduleSourceDir = File(sourceDir, module)
            val moduleInfo = moduleInfos[module] ?: error("No module info found for $module")
            val moduleStep = moduleInfo.steps.getValue(projStepId)
            for (modification in moduleStep.modifications) {

Response:
modification.execute(moduleTestDir, moduleSourceDir) {}
            }

            val outputKlibFile = resolveModuleArtifact(module, buildDir)

            val friends = mutableListOf<File>()
            if (moduleStep.rebuildKlib) {
                val dependencies = mutableListOf(File(STDLIB_KLIB), File(KOTLIN_TEST_KLIB))<|endoftext|>


Prompt:
* Gets the latest version of a published library.
     *
     * Note that the library must have been locally published to locate its latest version, this
     * can be done in test by adding :publish as a test dependency, for example:
     * ```
     * tasks.findByPath("test")
     *   .dependsOn(tasks.findByPath(":room:room-compiler:publish")

Response:
* ```
     *
     * @param path - The library m2 path e.g. "androidx/room/room-compiler"
     */
    fun getLibraryLatestVersionInLocalRepo(path: String): String {
        val metadataFile = File(props.tipOfTreeMavenRepoPath)
            .resolve(path)
            .resolve("maven-metadata.xml")<|endoftext|>


Prompt:
package org.jetbrains.kotlin.psi2ir.intermediate

import org.jetbrains.kotlin.ir.builders.irBlock
import org.jetbrains.kotlin.ir.builders.irIfNull
import org.jetbrains.kotlin.ir.builders.irNull
import org.jetbrains.kotlin.ir.expressions.IrExpression

Response:
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
import org.jetbrains.kotlin.ir.types.makeNullable
import org.jetbrains.kotlin.psi2ir.generators.GeneratorWithScope

internal class SafeExtensionInvokeCallReceiver(
    val generator: GeneratorWithScope,
    val startOffset: Int,<|endoftext|>


Prompt:
val (stdout, stderr) = runModule("usage/some.module.withsome.packages.UsageKt", listOf(usage))
        assertEquals("", stderr)
        assertEquals("usage/some.module.withsome.packages.Test", stdout)
    }

    fun testReflection() {
        val reflect = ForTestCompileRuntime.reflectJarForTests()

Response:
val usage = module("usage", listOf(reflect))
        val (stdout, stderr) = runModule("usage/usage.test.UsageKt", listOf(usage, reflect))
        assertEquals("", stderr)
        assertEquals("OK", stdout)
    }

    fun testDoNotLoadIrrelevantJarsFromUnnamed() {<|endoftext|>


Prompt:
}

    open fun checkEqualsFunctionVersionRequirement(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {
        if (old.versionRequirementCount != new.versionRequirementCount) return false

        for(i in 0..old.versionRequirementCount - 1) {
            if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false

Response:
}

        return true
    }

    open fun checkEqualsPropertyTypeParameter(old: ProtoBuf.Property, new: ProtoBuf.Property): Boolean {
        if (old.typeParameterCount != new.typeParameterCount) return false

        for(i in 0..old.typeParameterCount - 1) {<|endoftext|>


Prompt:
assert(innerClass.isInner) { "Class is not inner: $innerClass" }

        return originalInnerClassPrimaryConstructorByClass[innerClass]
    }

    private fun createInnerClassConstructorWithOuterThisParameter(oldConstructor: IrConstructor): IrConstructor =
        irFactory.buildConstructor {
            updateFrom(oldConstructor)

Response:
returnType = oldConstructor.returnType
        }.apply {
            parent = oldConstructor.parent
            returnType = oldConstructor.returnType
            copyAnnotationsFrom(oldConstructor)
            copyTypeParametersFrom(oldConstructor)

            val outerThisValueParameter = buildValueParameter(this) {
                origin = JvmLoweredDeclarationOrigin.FIELD_FOR_OUTER_THIS<|endoftext|>


Prompt:
// WITH_STDLIB

import kotlin.test.assertEquals

fun stringMultiArray(): Array<Array<String>> = Array(3) {
    i -> Array(3) { j -> "$i-$j" }
}

fun stringNullableMultiArray(): Array<Array<String?>> = Array(3) {

Response:
i -> if (i == 1) Array(3) { j -> "$i-$j" } as Array<String?> else arrayOfNulls<String>(3)
}

fun box(): String {
    val matrix = stringMultiArray()

    for (i in 0..2) {
        for (j in 0..2) {<|endoftext|>


Prompt:
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
 */

package org.jetbrains.kotlin.cli.common.arguments

import org.jetbrains.annotations.TestOnly
import java.io.File

Response:
import java.io.FileNotFoundException
import java.io.IOException
import java.io.Reader

const val ARGFILE_ARGUMENT = "@"
private const val EXPERIMENTAL_ARGFILE_ARGUMENT = "-Xargfile="

private const val SINGLE_QUOTE = '\''
private const val DOUBLE_QUOTE = '"'<|endoftext|>


Prompt:
private fun Printer.printlnIfWithComparison(field: Descriptors.FieldDescriptor, expr: String, statement: String = "return false") {
        this.println(ifWithComparison(field, expr, statement))
    }

    fun Printer.printlnIfWithComparisonIndent(field: Descriptors.FieldDescriptor, expr: String, statement: String = "return false") {

Response:
pushIndent()
        printlnIfWithComparison(field, expr, statement)
        popIndent()
    }

    private fun fieldToHashCode(field: Descriptors.FieldDescriptor, expr: String): String =
        when {
            field.options.getExtension(DebugExtOptionsProtoBuf.typeIdInTable) -><|endoftext|>


Prompt:
interface Intf {
    fun run()
}

abstract class Ordinary

annotation class Anno

@Anno
class Generic<T> : Ordinary(), Intf {
    override fun run() {}
}

enum class Direction {
    NORTH, SOUTH, WEST, EAST
}

sealed class Operation {

Response:
class Add(val firstValue: Int, val secondValue: Int) : Operation()
    class Subtract(val minuend: Int, val subtrahend: Int) : Operation()
    class Negate(val value: Int) : Operation()
}<|endoftext|>


Prompt:
// !DIAGNOSTICS:-USELESS_CAST
// !MARK_DYNAMIC_CALLS

fun test(d: dynamic) {
    d.<!DEBUG_INFO_DYNAMIC!>onAny<!>()
    d?.<!DEBUG_INFO_DYNAMIC!>onAny<!>()
    run {

Response:
d!!.<!DEBUG_INFO_DYNAMIC!>onAny<!>()
    }

    d.<!DEBUG_INFO_DYNAMIC!>onAny<!>(1)

    d.<!DEBUG_INFO_DYNAMIC!>onNullableAny<!>()
    d.<!DEBUG_INFO_DYNAMIC!>onString<!>()<|endoftext|>


Prompt:
assertEquals(null, TestObject.fooWrapperN?.foo?.s)

    assertEquals("null (object)", describeValueOfProperty(TestObject, "fooNWrapper"))
    TestObject.fooNWrapper = FooNWrapper(Foo("mouse"))
    assertEquals("Foo(s=mouse) (object)", describeValueOfProperty(TestObject, "fooNWrapper"))

Response:
assertEquals("mouse", TestObject.fooNWrapper.fooN?.s)
    TestObject.fooNWrapper = FooNWrapper(null)
    assertEquals("null (object)", describeValueOfProperty(TestObject, "fooNWrapper"))
    assertEquals(null, TestObject.fooNWrapper.fooN?.s)<|endoftext|>


Prompt:
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.

// FILE: box.kt
import kotlin.test.*

fun box(): String {
    // Sanity check to make sure there IS an exception even when not in a for-loop
    try {
        val i = J.listOfNotNull()[0]
        return "Fail: should throw on get()"

Response:
} catch (e: NullPointerException) {}

    try {
        for (i in J.listOfNotNull()) {
            return "Fail: should throw on get() in loop header"
        }
    }
    catch (e: NullPointerException) {}
    return "OK"
}

// FILE: J.java
import java.util.*;
import org.jetbrains.annotations.*;<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}

/*
 * TESTCASE NUMBER: 26
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-30867
 */
fun case_26(x: Boolean?) {
    while (true) {

Response:
<!UNREACHABLE_CODE!>for (i in listOf(<!>break, <!UNREACHABLE_CODE!>x as Boolean, x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>)) {

        }<!>
    }<|endoftext|>


Prompt:
public inline fun <R> kotlin.UIntArray.runningFold(initial: R, operation: (acc: R, kotlin.UInt) -> R): kotlin.collections.List<R>

@kotlin.SinceKotlin(version = "1.4")
@kotlin.ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly

Response:
public inline fun <R> kotlin.ULongArray.runningFold(initial: R, operation: (acc: R, kotlin.ULong) -> R): kotlin.collections.List<R>

@kotlin.SinceKotlin(version = "1.4")
@kotlin.ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly<|endoftext|>


Prompt:
fun <A: Double?, B: Long?> eqDoubleQLongQ(a: A, b: B) = a == b
fun <A: Long, B: Byte> eqLongByte(a: A, b: B) = a == b
fun <A: Long, B: Byte?> eqLongByteQ(a: A, b: B) = a == b

Response:
fun <A: Long?, B: Byte> eqLongQByte(a: A, b: B) = a == b
fun <A: Long?, B: Byte?> eqLongQByteQ(a: A, b: B) = a == b
fun <A: Long, B: Boolean> eqLongBoolean(a: A, b: B) = a == b<|endoftext|>


Prompt:
"""
            class Modifier
            fun Modifier.pointerInput(key1: Any?, block: () -> Unit) = this
            fun detectTapGestures(block: () -> Unit) {}
            @Composable fun someComposableValue(): Int = 1
        """,
        """
        @Composable
        fun Test(a: Boolean, visible: Boolean, onDismiss: () -> Unit) {

Response:
if (a) {
                val a = someComposableValue()
                used(a)
                val m = Modifier()
                val dismissModifier = if (visible) {
                    m.pointerInput(Unit) { detectTapGestures { onDismiss() } }
                } else {
                    m
                }
                used(dismissModifier)
            }
        }
        """
    )<|endoftext|>


Prompt:
|            url = "https://nodejs.org/dist"
    |            patternLayout {
    |                artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
    |            }
    |            metadataSources {
    |                artifact()
    |            }
    |            content {

Response:
|                includeModule("org.nodejs", "node")
    |            }
    |        }
    |        ivy {
    |            url = uri("https://nodejs.org/download/v8-canary")
    |            patternLayout {
    |                artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]")
    |            }<|endoftext|>


Prompt:
var shadowBlur: Double
    var shadowColor: String
}

public external interface CanvasFilters {
    var filter: String
}

public external interface CanvasRect {
    fun clearRect(x: Double, y: Double, w: Double, h: Double)
    fun fillRect(x: Double, y: Double, w: Double, h: Double)

Response:
fun strokeRect(x: Double, y: Double, w: Double, h: Double)
}

public external interface CanvasDrawPath {
    fun beginPath()
    fun fill(fillRule: CanvasFillRule = definedExternally)
    fun fill(path: Path2D, fillRule: CanvasFillRule = definedExternally)
    fun stroke()
    fun stroke(path: Path2D)<|endoftext|>


Prompt:
val res = repl.compileAndEval(ReplCodeLine(evals + 1, 0, "x$evals"))
            assertEquals(res.second.toString(), evals, (res.second as? ReplEvalResult.ValueResult)?.value)
        }
    }
}

// Artificial split into several testsuites, to speed up parallel testing
class LegacyReplTestLong2 : TestCase() {

Response:
fun testReplSlowdownKt22740() {
        LegacyTestRepl().use { repl ->
            repl.compileAndEval(ReplCodeLine(0, 0, "class Test<T>(val x: T) { fun <R> map(f: (T) -> R): R = f(x) }".trimIndent()))

            // We expect that analysis time is not exponential<|endoftext|>


Prompt:
final override fun visitPackageFragment(declaration: IrPackageFragment, data: Nothing?): IrElement =
        visitPackageFragment(declaration)

    open fun visitExternalPackageFragment(declaration: IrExternalPackageFragment): IrExternalPackageFragment =
        visitPackageFragment(declaration) as IrExternalPackageFragment

Response:
final override fun visitExternalPackageFragment(declaration: IrExternalPackageFragment, data: Nothing?): IrExternalPackageFragment =
        visitExternalPackageFragment(declaration)

    open fun visitFile(declaration: IrFile): IrFile =
        visitPackageFragment(declaration) as IrFile

    final override fun visitFile(declaration: IrFile, data: Nothing?): IrFile =<|endoftext|>


Prompt:
val linuxMain = kotlin.sourceSets.getByName("linuxMain")
        val macosMain = kotlin.sourceSets.getByName("macosMain")
        val linuxTest = kotlin.sourceSets.getByName("linuxTest")
        val macosTest = kotlin.sourceSets.getByName("macosTest")

Response:
val iosX64Main = kotlin.sourceSets.getByName("iosX64Main")
        val iosX64Test = kotlin.sourceSets.getByName("iosX64Test")
        val iosArm64Main = kotlin.sourceSets.getByName("iosArm64Main")<|endoftext|>