Prompt:
assertPrints(list.getOrNull(3), "null")

            val emptyList = emptyList<Int>()
            assertPrints(emptyList.getOrNull(0), "null")
        }

        @Sample
        fun last() {
            val list = listOf(1, 2, 3, 4)
            assertPrints(list.last(), "4")

Response:
assertPrints(list.last { it % 2 == 1 }, "3")
            assertPrints(list.lastOrNull { it < 0 }, "null")
            assertFails { list.last { it < 0 } }

            val emptyList = emptyList<Int>()
            assertPrints(emptyList.lastOrNull(), "null")
            assertFails { emptyList.last() }
        }
    }<|endoftext|>


Prompt:
assertEquals(10, atomicIntArr.addAndGet(1, -100), "addAndGet: FAIL 3")
        assertEquals(10, atomicIntArr[1], "addAndGet: FAIL 4")
        assertFailsWith<IndexOutOfBoundsException> {
            val res = atomicIntArr.addAndGet(22, 33535)
        }.let { ex ->

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


Prompt:
forTestsMatching("compiler/testData/diagnostics/foreignAnnotationsTests/tests/*") {
            defaultDirectives {
                ANNOTATIONS_PATH with JavaForeignAnnotationType.Annotations
                +WITH_JSR305_TEST_ANNOTATIONS
            }
        }

Response:
forTestsMatching("compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/*") {
            defaultDirectives {
                ANNOTATIONS_PATH with JavaForeignAnnotationType.Java8Annotations
            }
        }

        forTestsMatching("compiler/testData/diagnostics/foreignAnnotationsTests/java11Tests/*") {
            defaultDirectives {<|endoftext|>


Prompt:
val NAMESPACE_RULE: Short
    }
}

/**
 * Exposes the JavaScript [CSSNamespaceRule](https://developer.mozilla.org/en/docs/Web/API/CSSNamespaceRule) to Kotlin
 */
public external abstract class CSSNamespaceRule : CSSRule, JsAny {
    open val namespaceURI: String
    open val prefix: String

    companion object {

Response:
val STYLE_RULE: Short
        val CHARSET_RULE: Short
        val IMPORT_RULE: Short
        val MEDIA_RULE: Short
        val FONT_FACE_RULE: Short
        val PAGE_RULE: Short
        val MARGIN_RULE: Short
        val NAMESPACE_RULE: Short
    }
}

/**<|endoftext|>


Prompt:
internal fun parseOutputDataFile(baseDir: File, registeredDirectives: RegisteredDirectives, location: Location): OutputDataFile? =
    parseFileBasedDirective(baseDir, OUTPUT_DATA_FILE, registeredDirectives, location)?.let { OutputDataFile(file = it) }

internal fun parseInputDataFile(baseDir: File, registeredDirectives: RegisteredDirectives, location: Location): File? =

Response:
parseFileBasedDirective(baseDir, INPUT_DATA_FILE, registeredDirectives, location)

private fun parseFileBasedDirective(
    baseDir: File,
    directive: StringDirective,
    registeredDirectives: RegisteredDirectives,
    location: Location
): File? {
    if (directive !in registeredDirectives)
        return null

    val values = registeredDirectives[directive]<|endoftext|>


Prompt:
val Number.SquareMeters: SurfaceArea get() = SurfaceArea(toDouble())
val Number.CubicMeters: Volume get() = Volume(toDouble())

// FILE: operators.kt
operator fun Number.times(length: Length): Length = Length(toDouble() * length.meters)
operator fun Number.times(surfaceArea: SurfaceArea): SurfaceArea = SurfaceArea(toDouble() * surfaceArea.squareMeters)

Response:
operator fun Number.times(volume: Volume): Volume = Volume(toDouble() * volume.cubicMeters)

operator fun Length.times(factor: Number): Length = Length(meters * factor.toDouble())
operator fun Length.times(length: Length): SurfaceArea = SurfaceArea(meters * length.meters)<|endoftext|>


Prompt:
public abstract class Base_ShouldBeOpen {
    public void baseMethod() {}
}

// MODULE: main(lib)
open class BaseImpl : Base_ShouldBeOpen() {
    fun baseImplMethod_ShouldBeOpen() {}
}

class BaseImpl2_ShouldBeOpen : BaseImpl() {
    fun baseImpl2Method_ShouldBeOpen() {}
    val baseImpl2Property_ShouldBeOpen = ""
}

Response:
open class IntfImpl : Intf {
    fun intfImplMethod_ShouldBeOpen() {}
}

class IntfImpl2_ShouldBeOpen : IntfImpl() {
    fun intfImpl2Method_ShouldBeOpen() {}
}

fun box() = "OK"<|endoftext|>


Prompt:
* @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 *
 * @sample samples.collections.Arrays.Sorting.sortRangeOfArray
 */
@SinceKotlin("1.4")
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")

Response:
public actual fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
    AbstractList.checkRangeIndexes(fromIndex, toIndex, size)
    sortArray(this, fromIndex, toIndex)
}

/**
 * Sorts a range in the array in-place.
 *
 * @param fromIndex the start of the range (inclusive) to sort, 0 by default.<|endoftext|>


Prompt:
// TARGET_BACKEND: NATIVE
// FILECHECK_STAGE: CStubs

// CHECK-AAPCS-OPT-LABEL: define i1 @"kfun:kotlin.UIntArray#equals(kotlin.Any?){}kotlin.Boolean"(%struct.ObjHeader* %0, %struct.ObjHeader* %1)

Response: // CHECK-DEFAULTABI-OPT-LABEL: define zeroext i1 @"kfun:kotlin.UIntArray#equals(kotlin.Any?){}kotlin.Boolean"(%struct.ObjHeader* %0, %struct.ObjHeader* %1)<|endoftext|>


Prompt:
* IncrementalJvmCompilationConfiguration provides single-property API for forward-compatibility.
 *
 * configurationAdapters are there to regroup the properties and work with higher-level interfaces.
 */

internal fun ICConfiguration.extractIncrementalCompilationFeatures(): IncrementalCompilationFeatures {
    return IncrementalCompilationFeatures(
        withAbiSnapshot = false,

Response:
preciseCompilationResultsBackup = preciseCompilationResultsBackupEnabled,
        keepIncrementalCompilationCachesInMemory = incrementalCompilationCachesKeptInMemory,
    )
}<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("Out<Inv<Out<Bound1>>>")!>test15(first, second)<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("Out<Out<In<Bound1>>>")!>test16(first, second)<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("Out<In<Out<Bound1>>>")!>test17(first, second)<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("In<Out<Out<Bound1>>>")!>test18(first, second)<!>
}

interface Bound1
interface Bound2
object First : Bound1, Bound2<|endoftext|>


Prompt:
* Activities that contain this fragment must implement the
 * [StartFragment.OnFragmentInteractionListener] interface
 * to handle interaction events.
 * Use the [StartFragment.newInstance] factory method to
 * create an instance of this fragment.
 */
class StartFragment : Fragment() {
    // TODO: Rename and change types of parameters
    private var param1: String? = null

Response:
private var param2: String? = null
    private var listener: OnFragmentInteractionListener? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        arguments?.let {
            param1 = it.getString(ARG_PARAM1)
            param2 = it.getString(ARG_PARAM2)
        }<|endoftext|>


Prompt:
var wasCalled = false
class Controller {
    val postponedActions = mutableListOf<() -> Unit>()

    suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
        postponedActions.add {
            x.resume(v)
        }

        COROUTINE_SUSPENDED
    }

Response:
suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x ->
        postponedActions.add {
            x.resumeWithException(e)
        }

        COROUTINE_SUSPENDED
    }

    fun run(c: suspend Controller.() -> String) {
        c.startCoroutine(this, handleResultContinuation {<|endoftext|>


Prompt:
override var onpointerdown: ((PointerEvent) -> dynamic)?
    override var onpointermove: ((PointerEvent) -> dynamic)?
    override var onpointerup: ((PointerEvent) -> dynamic)?
    override var onpointercancel: ((PointerEvent) -> dynamic)?
    override var onpointerover: ((PointerEvent) -> dynamic)?

Response:
override var onpointerout: ((PointerEvent) -> dynamic)?
    override var onpointerenter: ((PointerEvent) -> dynamic)?
    override var onpointerleave: ((PointerEvent) -> dynamic)?
    override var oncopy: ((ClipboardEvent) -> dynamic)?
    override var oncut: ((ClipboardEvent) -> dynamic)?<|endoftext|>


Prompt:
// TODO (KT-60899): implement this checker for JS, similarly to K1's JsReflectionAPICallChecker.
abstract class AbstractFirReflectionApiCallChecker : FirBasicExpressionChecker(MppCheckerKind.Common) {
    protected abstract fun isWholeReflectionApiAvailable(context: CheckerContext): Boolean

Response:
protected abstract fun report(source: KtSourceElement?, context: CheckerContext, reporter: DiagnosticReporter)

    protected open fun isAllowedKClassMember(name: Name, context: CheckerContext): Boolean = when (name) {
        K_CLASS_SIMPLE_NAME, K_CLASS_IS_INSTANCE -> true<|endoftext|>


Prompt:
global = ""
    outer@ while(try { global += "A"; i++ } finally {}  < 3) {
        j = 0
        while( try {global += "B"; j++ } finally {} < 2) {
            if (j==1) continue@outer
        }
    }
    assertEquals("ABABABA", global)
    assertEquals(4, i)

Response:
assertEquals(1, j)

    return "OK"
}<|endoftext|>


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

/*
 * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
 *
 * SPEC VERSION: 0.1-387

Response:
* MAIN LINK: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1
 * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 4<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.util.findImplementationFromInterface
import org.jetbrains.kotlin.util.findInterfaceImplementation

fun <Signature> generateBridgesForFunctionDescriptor(
    descriptor: FunctionDescriptor,
    signature: (FunctionDescriptor) -> Signature

Response:
): Set<Bridge<Signature, DescriptorBasedFunctionHandle>> {
    return generateBridges(DescriptorBasedFunctionHandle(descriptor), { signature(it.descriptor) })
}

/**
 * An implementation of FunctionHandle based on descriptors.
 *
 * This implementation workarounds a minor inconvenience in descriptor hierarchy regarding traits with implementations.
 * Consider the following hierarchy:
 *<|endoftext|>


Prompt:
@kotlin.internal.InlineOnly
public inline operator fun ShortArray.component5(): Short {
    return get(4)
}

/**
 * Returns 5th *element* from the array.
 *
 * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS
 * where the behavior is unspecified.
 */

Response:
@kotlin.internal.InlineOnly
public inline operator fun IntArray.component5(): Int {
    return get(4)
}

/**
 * Returns 5th *element* from the array.
 *
 * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS
 * where the behavior is unspecified.
 */<|endoftext|>


Prompt:
override val foo: String
        get() = "foo"

    override val foo2: String = "foo2"

    override var foo3: String = "foo3"
}

fun box(): String {
    val bar = Bar()
    if (bar.foo != "foo") return "fail 1"
    if (bar.foo2 != "foo2") return "fail 2"

Response:
if (bar.foo3 != "foo3") return "fail 3"
    bar.foo3 = "foo4"
    if (bar.foo3 != "foo4") return "fail 4"

    val bay = Bay()
    if (bay.baz1 != "baz1") return "fail 5"
    if (bay.baz2 != "baz2") return "fail 6"<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.analysis.checkers.expression

import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext

Response:
import org.jetbrains.kotlin.fir.expressions.FirFunctionCall
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression
import org.jetbrains.kotlin.fir.expressions.toResolvedCallableSymbol<|endoftext|>


Prompt:
fun ltest4(a: Long, b: Long) = a <= b

fun ftest1(a: Float, b: Float) = a > b
fun ftest2(a: Float, b: Float) = a < b
fun ftest3(a: Float, b: Float) = a >= b
fun ftest4(a: Float, b: Float) = a <= b

Response:
fun dtest1(a: Double, b: Double) = a > b
fun dtest2(a: Double, b: Double) = a < b
fun dtest3(a: Double, b: Double) = a >= b
fun dtest4(a: Double, b: Double) = a <= b<|endoftext|>


Prompt:
val parcelerSuperType = parcelerClass.defaultType.supertypes().firstOrNull { it.fqName() == PARCELER_FQN } ?: return
        val expectedType = parcelerSuperType.arguments.singleOrNull()?.type ?: return

        if (!actualType.isSubtypeOf(expectedType)) {

Response:
context.trace.report(ErrorsParcelize.PARCELER_TYPE_INCOMPATIBLE.on(reportElement(), expectedType, actualType))
        }
    }

    private fun checkIfTheContainingClassIsParcelize(
        containingClass: KtClassOrObject?,
        annotationEntry: KtAnnotationEntry,
        context: CallCheckerContext
    ) {<|endoftext|>


Prompt: // library.kt:15 box: $i$f$foo\1\64:int=0:int, array\1:java.lang.Integer[]=java.lang.Integer[], myClass\1:MyClass=MyClass, this_\7:MyClass=MyClass, $i$f$f2\7\427:int=0:int

Response: // library.kt:16 box: $i$f$foo\1\64:int=0:int, array\1:java.lang.Integer[]=java.lang.Integer[], myClass\1:MyClass=MyClass, this_\7:MyClass=MyClass, $i$f$f2\7\427:int=0:int<|endoftext|>


Prompt:
private val configuration: CheckerConfiguration,
    private val packagePart1: KmPackageParts,
    private val packagePart2: KmPackageParts,
    private val packagePartsReport: MetadataPropertyReport
): Runnable {
    override fun run() {
        for (checker in configuration.enabledPackagePartsMetadataCheckers) {
            checker.check(packagePart1, packagePart2, packagePartsReport)

Response:
}
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.declarations.IrFile
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction

Response:
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
import org.jetbrains.kotlin.util.OperatorNameConventions

/**<|endoftext|>


Prompt:
override val returnType: KtType
        get() = withValidityAssertion { _returnType }
    override val receiverType: KtType?
        get() = withValidityAssertion { _receiverType }
    override val valueParameters: List<KtVariableLikeSignature<KtValueParameterSymbol>>
        get() = withValidityAssertion { _valueParameters }

Response:
override fun substitute(substitutor: KtSubstitutor): KtFunctionLikeSignature<S> = withValidityAssertion {
        KtFe10FunctionLikeSignature(
            symbol,
            substitutor.substitute(returnType),
            receiverType?.let { substitutor.substitute(it) },
            valueParameters.map { valueParameter -><|endoftext|>


Prompt:
* This function can be implemented to produce more precise result for [x] near zero.
 *
 * Special cases:
 *   - `ln1p(NaN)` is `NaN`
 *   - `ln1p(x)` is `NaN` where `x < -1.0`
 *   - `ln1p(-1.0)` is `-Inf`

Response:
*   - `ln1p(+Inf)` is `+Inf`
 *
 * @see [ln] function
 * @see [expm1] function
 */
@SinceKotlin("1.2")
public actual fun ln1p(x: Float): Float = kotlin.math.fdlibm.log1p(x.toDouble()).toFloat()

/**<|endoftext|>


Prompt:
throw new RuntimeException();
    }
}

// FILE: UtilNullMarkedGeneric.java
import org.jspecify.nullness.*;

@NullMarked
public class UtilNullMarkedGeneric {
    public static <K> Foo<K> getFooOfK() {
        throw new RuntimeException();
    }
}

// FILE: UtilNullMarkedGenericNullableBound.java

Response:
import org.jspecify.nullness.*;

@NullMarked
public class UtilNullMarkedGenericNullableBound {
    public static <K extends @Nullable Object> Foo<K> getFooOfK() {
        throw new RuntimeException();
    }
}

// FILE: UtilGenericNullableBound.java
import org.jspecify.nullness.*;<|endoftext|>


Prompt:
?: ((this as IrFunction).parent as IrClass).annotations.first { it.symbol.owner.parentAsClass.fqNameWhenAvailable == annotation }
}

internal fun IrAnnotationContainer.getEvaluateIntrinsicValue(): String? {
    if (this is IrClass && this.fqName.startsWith("java")) return this.fqName

Response:
if (!this.hasAnnotation(evaluateIntrinsicAnnotation)) return null
    return (this.getAnnotation(evaluateIntrinsicAnnotation).getValueArgument(0) as IrConst<*>).value.toString()
}

internal fun getPrimitiveClass(irType: IrType, asObject: Boolean = false): Class<*>? =
    when (irType.getPrimitiveType()) {<|endoftext|>


Prompt:
* ensures that parameter/return types of IR stubs are remapped correctly.
         * Classes extending fun interfaces with composable types will be processed by visitFunction
         * above as normal.
         */
        val type = expression.typeOperand
        val clsSymbol = type.classOrNull ?: return super.visitTypeOperator(expression)

        // Unbound symbols indicate they are in the current module and have not been

Response:
// processed by copier yet.
        if (
            clsSymbol.isBound &&
                clsSymbol.owner.origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB &&
                // Only process fun interfaces with @Composable types
                clsSymbol.owner.isFun &&<|endoftext|>


Prompt:
when {
                columnName == "scenario" -> DataColumn.createValueColumn(
                    columnName,
                    columns().map {
                        if (it.name.contains(currentKotlinVersion)) {
                            it.name.substringBefore(currentKotlinVersion) + currentKotlinVersion
                        } else {
                            it.name.substringBefore(stableKotlinVersions) + stableKotlinVersions

Response:
}
                    }.drop(1)
                )
                columnName == "version" -> DataColumn.createValueColumn(
                    columnName,
                    rowToColumn(columnName) { it.toString() }
                )
                columnName == "tasks" -> DataColumn.createValueColumn(
                    columnName,
                    rowToColumn(columnName) { it.toString() }
                )<|endoftext|>


Prompt:
public infix fun ULong.until(to: ULong): ULongRange {
    if (to <= ULong.MIN_VALUE) return ULongRange.EMPTY
    return this .. (to - 1u).toULong()
}

public infix fun UShort.until(to: UShort): UIntRange {
    if (to <= UShort.MIN_VALUE) return UIntRange.EMPTY

Response:
return this.toUInt() .. (to - 1u).toUInt()
}<|endoftext|>


Prompt:
it.exists()
            }?.rootDir?.let {
                objectFactory.fileTree().from(it)
            }
        }

    private enum class AppleArchitecture(val clangMacro: String) {
        X64("__x86_64__"),
        X86("__i386__"),
        ARM32("__arm__"),

Response:
// We need to distinguish between variants of aarch64, because there are two WatchOS ARM64 targets that we support
        // watchOsArm64 that compiles to arm64_32 architecture
        // watchOsDeviceArm64 that compiles to arm64 architecture<|endoftext|>


Prompt:
@kotlin.internal.IntrinsicConstEvaluation
    @WasmOp(WasmOp.I32_XOR)
    public infix fun xor(other: Int): Int =
        implementedAsIntrinsic

    /** Inverts the bits in this value. */
    @kotlin.internal.IntrinsicConstEvaluation
    public inline fun inv(): Int =

Response:
this.xor(-1)

    /**
     * Converts this [Int] value to [Byte].
     *
     * If this value is in [Byte.MIN_VALUE]..[Byte.MAX_VALUE], the resulting `Byte` value represents
     * the same numerical value as this `Int`.
     *
     * The resulting `Byte` value is represented by the least significant 8 bits of this `Int` value.<|endoftext|>


Prompt:
factory.createValueParameter(
            startOffset = startOffset,
            endOffset = endOffset,
            origin = origin,
            name = name,
            type = type.substitute(substitutionMap),
            isAssignable = isAssignable,
            symbol = IrValueParameterSymbolImpl(),
            index = index,

Response:
varargElementType = varargElementType?.substitute(substitutionMap),
            isCrossinline = isCrossinline,
            isNoinline = isNoinline,
            isHidden = isHidden,
        ).also { parameter ->
            parameter.parent = this@copyReceiverParametersFrom
        }
    }
    extensionReceiverParameter = from.extensionReceiverParameter?.copyTo(this)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.utils.bind
import java.lang.Boolean.getBoolean

open class AbstractFirJsTest(
    pathToTestDir: String = "${JsEnvironmentConfigurator.TEST_DATA_DIR_PATH}/box/",
    testGroupOutputDirPrefix: String,
    targetBackend: TargetBackend = TargetBackend.JS_IR,

Response:
val parser: FirParser = FirParser.Psi,
) : AbstractJsBlackBoxCodegenTestBase<FirOutputArtifact, IrBackendInput, BinaryArtifacts.KLib>(
    FrontendKinds.FIR, targetBackend, pathToTestDir, testGroupOutputDirPrefix, skipMinification = true
) {<|endoftext|>


Prompt:
open class WH : WarningDeprecated, HiddenDeprecated {
    override fun <!OVERRIDE_DEPRECATION!>f<!>() {

    }
}

open class EH : ErrorDeprecated, HiddenDeprecated {
    override fun <!OVERRIDE_DEPRECATION!>f<!>() {

    }
}

open class NW : WarningDeprecated, NotDeprecated {

Response:
override fun <!OVERRIDE_DEPRECATION!>f<!>() {

    }
}

open class NE : ErrorDeprecated, NotDeprecated {
    override fun <!OVERRIDE_DEPRECATION!>f<!>() {

    }
}

open class NH : HiddenDeprecated, NotDeprecated {<|endoftext|>


Prompt:
testR0xE0()
    testR0xE1()
    testR0xE2()
    testR0xE3()
    testR0xE4()
    testR1xE0()
    testR1xE1()
    testR1xE2()
    testR1xE3()
    testR1xE4()
    return "OK"
}

Response:
fun testR0xE0() {
    // with possible local optimizations
    if (0uL in 1uL..3uL != range0.contains(0uL)) throw AssertionError()
    if (0uL !in 1uL..3uL != !range0.contains(0uL)) throw AssertionError()<|endoftext|>


Prompt:
firTypeScope.processFunctionsByName(callableId.callableName) { }
    firTypeScope.processOverriddenFunctions(this) {
        overriddenFunctions.add(it)
        ProcessorAction.NEXT
    }

    /*
     * The original symbol may appear in `processOverriddenFunctions`, so it should be removed from the resulting

Response:
*   list to not confuse the caller with a situation when the function directly overrides itself
     *
     * For details see FirTypeScope.processDirectOverriddenFunctionsWithBaseScope
     */
    overriddenFunctions -= this

    return overriddenFunctions
}<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & kotlin.String?"), DEBUG_INFO_SMARTCAST!>x<!>.length
}

/*
 * TESTCASE NUMBER: 6
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-29482
 */
fun case_6(x: String?) {
    do {
        try {

Response:
if (x == null) {
                throw Exception()
            }
        } catch (e: Exception) {
            break
        }
    } while (true)
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & kotlin.String?")!>x<!><|endoftext|>


Prompt:
if (defaultArgsIncompatibleMembers.isNotEmpty()) { // report a nicer diagnostic for DefaultArgumentsInExpectActualizedByFakeOverride
                val problematicExpectMembers = defaultArgsIncompatibleMembers
                    .map {
                        it.first as? FirNamedFunctionSymbol

Response:
?: error("${ExpectActualCheckingCompatibility.DefaultArgumentsInExpectActualizedByFakeOverride} can be reported only for ${FirNamedFunctionSymbol::class}")
                    }
                reporter.reportOn(
                    source,
                    FirErrors.DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE,<|endoftext|>


Prompt:
private fun IrSymbol.dumpInternal(label: String? = null) {
        if (isBound)
            owner.dumpInternal(label)
        else
            printer.println("$label: UNBOUND ${javaClass.simpleName}")
    }

    private fun IrElement.dumpInternal(label: String? = null) {
        if (label != null) {

Response:
printer.println("$label: ", accept(elementRenderer, null))
        } else {
            printer.println(accept(elementRenderer, null))
        }

    }

    private inline fun indented(label: String, body: () -> Unit) {
        printer.println("$label:")
        indented(body)
    }<|endoftext|>


Prompt:
.map { ExportedType.PropertyType(exportType(it), ExportedType.LiteralType.StringLiteralType(magicPropertyName)) }
            .reduce(ExportedType::IntersectionType)
            .let { if (klass.shouldNotBeImplemented()) ExportedType.IntersectionType(klass.generateTagType(), it) else it }

Response:
add(ExportedProperty(name = magicPropertyName, type = intersectionOfTypes, mutable = false, isMember = true, isField = true))
    }

    private fun IrType.shouldAddMagicPropertyOfSuper(): Boolean {
        return classOrNull?.owner?.isOwnMagicPropertyAdded() ?: false
    }

    private fun IrClass.isOwnMagicPropertyAdded(): Boolean {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.FirFunctionCall
import org.jetbrains.kotlin.fir.expressions.FirReturnExpression
import org.jetbrains.kotlin.fir.references.toResolvedCallableSymbol
import org.jetbrains.kotlin.fir.resolve.toSymbol

Response:
import org.jetbrains.kotlin.fir.scopes.getDirectOverriddenFunctions
import org.jetbrains.kotlin.fir.scopes.getDirectOverriddenProperties
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.SymbolInternals<|endoftext|>


Prompt:
// test.kt:25 baz: param:int=6:int, b:int=2:int, $i$a$-bar-TestKt$box$2\1\14\0:int=0:int
// EXPECTATIONS JVM_IR +USE_INLINE_SCOPES_NUMBERS

Response:
// test.kt:26 baz: param:int=6:int, b:int=2:int, $i$a$-bar-TestKt$box$2\1\14\0:int=0:int, d\1:int=4:int
// test.kt:14 baz: param:int=6:int, b:int=2:int<|endoftext|>


Prompt:
if (fir is FirVariableAssignment && (baseExpression is KtDotQualifiedExpression ||
                        baseExpression is KtNameReferenceExpression)
            ) {
                val variablePartiallyAppliedSymbol = fir.toPartiallyAppliedSymbol() ?: return null
                val operationPartiallyAppliedSymbol =

Response:
getOperationPartiallyAppliedSymbolsForCompoundVariableAccess(fir, baseExpression) ?: return null
                return if (resolveFragmentOfCall) {
                    KtSimpleVariableAccessCall(
                        variablePartiallyAppliedSymbol,
                        fir.unwrapLValue()?.toTypeArgumentsMapping(variablePartiallyAppliedSymbol) ?: emptyMap(),<|endoftext|>


Prompt:
private fun getSimulatorRuntimesFor(
        descriptors: List<SimulatorRuntimeDescriptor>,
        family: Family,
        osMinVersion: String
): List<SimulatorRuntimeDescriptor> {
    val osName = simulatorOsName(family)
    return descriptors.filter {

Response:
it.checkAvailability() && it.name.startsWith(osName) && compareStringsAsVersions(it.version, osMinVersion) >= 0
    }
}

/**
 * Returns first available simulator runtime for [target] with at least [osMinVersion] OS version.
 * */
fun Xcode.getLatestSimulatorRuntimeFor(family: Family, osMinVersion: String): SimulatorRuntimeDescriptor? =<|endoftext|>


Prompt:
// FILE: Test.kt
package testPack
import libMyIteratorPackage.*
//import libPackage1.getValue
//import libPackage1.setValue
import libPackage2.*
import kotlin.reflect.KProperty

class Delegate {}

fun box() : String {
    class Test {
        var p: String by Delegate()
    }

    val test = Test()

Response:
assert(!isGetCalled && !isSetCalled)
    test.p = "NEW"
    if (isSetCalled && !isGetCalled) {
        isSetCalled = false
        val x = test.p
        if (!isSetCalled && isGetCalled)
            return "OK"
    }
    return "NOK"
}<|endoftext|>


Prompt:
project, CliAndroidOnDestroyClassBuilderInterceptorExtension(globalCacheImpl)
            )

            PackageFragmentProviderExtension.registerExtension(project,
                    CliAndroidPackageFragmentProviderExtension(isExperimental))
        }

        fun parseCacheImplementationType(s: String?): CacheImplementation = when (s) {
            "sparseArray" -> CacheImplementation.SPARSE_ARRAY

Response:
"none" -> CacheImplementation.NO_CACHE
            else -> CacheImplementation.DEFAULT
        }
    }

    override fun registerProjectComponents(project: MockProject, configuration: CompilerConfiguration) {
        reportRemovedError(configuration)

        val features = configuration.get(AndroidConfigurationKeys.FEATURES) ?: AndroidExtensionsFeature.values().toSet()<|endoftext|>


Prompt:
// CHECK-OPT: call %struct.ObjHeader* @"kfun:codegen.stringConcatenationTypeNarrowing.kt53119_plus_extension.Foo#toString(){}kotlin.String"
// CHECK-OPT-NOT: Foo#toString(){}kotlin.String

Response:
// CHECK-OPT: call %struct.ObjHeader* @Kotlin_String_plusImpl
// CHECK-OPT-NOT: call %struct.ObjHeader* @Kotlin_String_plusImpl

// CHECK-OPT-NOT: call %struct.ObjHeader* @"kfun:kotlin.String#toString(){}kotlin.String"<|endoftext|>


Prompt:
if (this@getterIfProperty is PropertyDescriptor) this@getterIfProperty.getter else this@getterIfProperty

    private inner class UltraLightModifierListForMember(
        private val declaration: KtDeclaration,
        private val accessedProperty: KtProperty?,
        private val outerDeclaration: KtDeclaration,
        private val forceStatic: Boolean,

Response:
private val forcePrivate: Boolean = false,
        private val forceNonFinal: Boolean = false,
    ) : LightModifierList(declaration.manager, declaration.language) {

        override fun hasModifierProperty(name: String): Boolean {

            val hasModifierByDeclaration = hasModifier(name)
            if (name != PsiModifier.FINAL) return hasModifierByDeclaration<|endoftext|>


Prompt:
object MyObject : Foo(<!SELF_CALL_IN_NESTED_OBJECT_CONSTRUCTOR_ERROR!>MyObject.<!SELF_CALL_IN_NESTED_OBJECT_CONSTRUCTOR_ERROR!>prop<!><!>)
}

fun box(): String? {

Response:
if (<!SENSELESS_COMPARISON!>Foo.MyObject == null<!>) return null

    return "OK"
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames
import org.jetbrains.kotlin.utils.memoryOptimizedMapIndexed
import org.jetbrains.kotlin.utils.memoryOptimizedPlus

class CallableReferenceLowering(private val context: JsCommonBackendContext) : BodyLoweringPass {

Response:
override fun lower(irFile: IrFile) {
        runOnFilePostfix(irFile, withLocalDeclarations = true)
    }

    override fun lower(irBody: IrBody, container: IrDeclaration) {
        val realContainer = container as? IrDeclarationParent ?: container.parent
        irBody.transformChildrenVoid(ReferenceTransformer(realContainer))
    }<|endoftext|>


Prompt:
// CHECK-NOT: call void @"kfun:$s8$lambda${{[0-9]*}}COROUTINE${{[0-9]*}}.<init>
        run {
            println("s8")
            return@builderInt sInt()
        }
    }
    // CHECK-LABEL: epilogue:
}

fun s9() {

Response:
// CHECK-LABEL: define internal %struct.ObjHeader* @"kfun:s9$lambda${{[0-9]*}}
    builderUnit {
        // CHECK-NOT: call void @"kfun:$s9$lambda${{[0-9]*}}COROUTINE${{[0-9]*}}.<init>
        run {
            println("s9-1")<|endoftext|>


Prompt:
if (position.kind != ConstraintPositionKind.RECEIVER_POSITION) it else it.makeNotNullable()
            } ?: return false
            val resultSuperType = superType.substitute() ?: return false
            when (kind) {
                SUB_TYPE -> KotlinTypeChecker.DEFAULT.isSubtypeOf(resultSubType, resultSuperType)

Response:
EQUAL -> KotlinTypeChecker.DEFAULT.equalTypes(resultSubType, resultSuperType)
            }
        }
    }

    override fun toBuilder(filterConstraintPosition: (ConstraintPosition) -> Boolean): ConstraintSystem.Builder {
        val result = ConstraintSystemBuilderImpl()
        for ((typeParameter, typeBounds) in allTypeParameterBounds) {<|endoftext|>


Prompt:
val result = data - sequenceOf("foo", "g")
        assertEquals(listOf("bar"), result)
    }

    @Test
    @Suppress("USELESS_CAST") // remove suppress and casts when tests are finally compiled only with K2
    fun minusAssign() {
        // lets use a mutable variable
        var result: Iterable<String> = data
        result -= "foo"

Response:
assertEquals(listOf("bar"), result as? List)
        result = data
        result -= listOf("beer", "bar")
        assertEquals(listOf("foo"), result as? List)
        result = data
        result -= arrayOf("bar", "foo")
        assertEquals(emptyList<String>(), result as? List)
        result = data
        result -= sequenceOf("foo", "g")<|endoftext|>


Prompt:
if (name == SerialEntityNames.SERIAL_DESC_FIELD_NAME && result.none(thisDescriptor::checkSerializableClassPropertyResult) &&
            fromSupertypes.none { thisDescriptor.checkSerializableClassPropertyResult(it) && it.modality == Modality.FINAL }
        ) {

Response:
result.add(createSerializableClassPropertyDescriptor(thisDescriptor, classDescriptor))
        }
        // don't add local serializer fields if typed constructor is not synthetic
        if (classDescriptor.declaredTypeParameters.isNotEmpty() &&
            findSerializerConstructorForTypeArgumentsSerializers(thisDescriptor, onlyIfSynthetic = true) != null
        ) {<|endoftext|>


Prompt: if (!(funWithReturnsNotNullAndTypeCheck(value_1) != null)) <!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)

Response: if (!!(funWithReturnsNotNullAndTypeCheck(value_1) == null)) <!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// USE_PSI_CLASS_FILES_READING
// MODULE: lib
// FILE: J.java

public @interface J {
    double minusInf() default Double.NEGATIVE_INFINITY;
    double plusInf() default Double.POSITIVE_INFINITY;
    double nan() default Double.NaN;

Response:
double divisionByZero() default 1.0 / 0.0;

    float minusInfFloat() default Float.NEGATIVE_INFINITY;
    float plusInfFloat() default Float.POSITIVE_INFINITY;
    float nanFloat() default Float.NaN;
    float divisionByZeroFloat() default 1.0f / 0.0f;
}

// MODULE: main(lib)<|endoftext|>


Prompt:
* @param mainFile a dedicated main file if it exists (see [findMainFile])
     *
     * @see findMainModule
     * @see isMainModule
     * @see AnalysisApiTestDirectives.MAIN_MODULE
     */
    protected open fun doTestByMainModuleAndOptionalMainFile(mainFile: KtFile?, mainModule: KtTestModule, testServices: TestServices) {

Response:
doTestByMainFile(mainFile ?: error("The main file is not found"), mainModule, testServices)
    }

    /**
     * Consider implementing this method if your test logic needs the whole
     * [KtTestModuleStructure][org.jetbrains.kotlin.analysis.test.framework.project.structure.KtTestModuleStructure].
     *
     * Examples of use cases:<|endoftext|>


Prompt:
override fun serializeTypeParameter(typeParameter: FirTypeParameter, proto: ProtoBuf.TypeParameter.Builder) {
        typeParameter.serializeAnnotations(
            session,
            additionalMetadataProvider,
            annotationSerializer,
            proto,
            protocol.typeParameterAnnotation
        )
    }

    @Suppress("Reformat")
    private fun <

Response:
MessageType : GeneratedMessageLite.ExtendableMessage<MessageType>,
        BuilderType : GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>,
    > List<FirAnnotation>.serializeAnnotations(
        proto: GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>,<|endoftext|>


Prompt: 0x3ff1e3779b97574eUL,     0x3ff1e3779b989201UL,     0x3fe6a09e667f3bcdUL,     0x40007e0f66afed07UL,

Response:
0x3fe1e3779b97f4a8UL,     0x40101fe03f61bad0UL,     0x7ff0000000000000UL,     0x7ff0000000000000UL,
            0x4000000000000000UL,     0x7fefffffffffffffUL,     0x7ff8000000000000UL,     0x6a83b03385a2fc07UL,<|endoftext|>


Prompt:
object TestAllFilesPresentMethodKind : MethodModel.Kind()

    inner class TestAllFilesPresentMethodModel : MethodModel {
        override val kind: MethodModel.Kind
            get() = TestAllFilesPresentMethodKind

        override val name: String
            get() = "testAllFilesPresentIn$testClassName"

        override val dataString: String?
            get() = null

Response:
val classModel: SimpleTestClassModel
            get() = this@SimpleTestClassModel

        override fun shouldBeGenerated(): Boolean {
            return true
        }

        override val tags: List<String>
            get() = emptyList()
    }

    companion object {
        private val BY_NAME = Comparator.comparing(TestEntityModel::name)<|endoftext|>


Prompt:
if (lastIndex == 0) return minElem
    var minValue = selector(minElem)
    for (i in 1..lastIndex) {
        val e = this[i]
        val v = selector(e)
        if (minValue > v) {
            minElem = e
            minValue = v
        }
    }
    return minElem
}

/**

Response:
* Returns the first element yielding the smallest value of the given function or `null` if there are no elements.
 *
 * @sample samples.collections.Collections.Aggregates.minByOrNull
 */
@SinceKotlin("1.4")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly<|endoftext|>


Prompt:
"MUST_BE_INITIALIZED_OR_FINAL_OR_ABSTRACT",
    "EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT",
    "BACKING_FIELD_IN_INTERFACE",
    "EXTENSION_PROPERTY_WITH_BACKING_FIELD",

Response:
"PROPERTY_INITIALIZER_NO_BACKING_FIELD",
    "ABSTRACT_DELEGATED_PROPERTY",
    "DELEGATED_PROPERTY_IN_INTERFACE",
    "ABSTRACT_PROPERTY_WITH_GETTER",
    "ABSTRACT_PROPERTY_WITH_SETTER",<|endoftext|>


Prompt:
it.dependsOn(packageJsonTask)
                        }
                    }

                val publicPackageJsonConfiguration = createPublicPackageJsonConfiguration()

                target.project.artifacts.add(publicPackageJsonConfiguration.name, packageJsonTask.map { it.packageJsonFile }) {
                    it.builtBy(packageJsonTask)
                }
            }
        }
    }

Response:
override fun toString(): String = "KotlinCompilationNpmResolver(${npmProject.name})"

    val aggregatedConfiguration: Configuration = run {
        createAggregatedConfiguration()
    }

    private var _compilationNpmResolution: KotlinCompilationNpmResolution? = null

    val compilationNpmResolution: KotlinCompilationNpmResolution
        get() {<|endoftext|>


Prompt:
if (a != z == true && b != implicitNullableNothingProperty == true) {
        val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>

Response:
if (x != implicitNullableNothingProperty == true || <!SENSELESS_COMPARISON!>z !== x<!>) {
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!><|endoftext|>


Prompt:
* @sample samples.collections.Collections.Aggregates.maxBy
 */
@SinceKotlin("1.7")
@kotlin.jvm.JvmName("maxByOrThrow")
@Suppress("CONFLICTING_OVERLOADS")
public inline fun <R : Comparable<R>> FloatArray.maxBy(selector: (Float) -> R): Float {

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


Prompt:
import org.jetbrains.kotlin.types.KotlinType

open class FragmentDeclarationGenerator(
    override val context: GeneratorContext,
    private val fragmentInfo: EvaluatorFragmentInfo
) : Generator {

    fun generateClassForCodeFragment(ktFile: KtBlockCodeFragment): IrClass {
        val classDescriptor = fragmentInfo.classDescriptor

Response:
val startOffset = UNDEFINED_OFFSET
        val endOffset = UNDEFINED_OFFSET

        return context.symbolTable.descriptorExtension.declareClass(classDescriptor) {
            context.irFactory.createIrClassFromDescriptor(
                startOffset, endOffset,
                IrDeclarationOrigin.DEFINED,
                symbol = it,
                classDescriptor,<|endoftext|>


Prompt:
val prevPrev = fieldNode.previous?.previous as? VarInsnNode

        fieldNode.opcode == Opcodes.PUTFIELD &&
                isCapturedFieldName(fieldNode.name) &&
                fieldNode.previous is VarInsnNode && prevPrev != null && prevPrev.`var` == 0
    }
}

Response:
fun AbstractInsnNode.getNextMeaningful(): AbstractInsnNode? {
    var result: AbstractInsnNode? = next
    while (result != null && !result.isMeaningful) {
        result = result.next
    }
    return result
}

// Interpreter, that analyzes functional arguments only, to replace SourceInterpreter, since SourceInterpreter's merge has O(N²) complexity<|endoftext|>


Prompt:
scope: Scope.FunctionScope,
        changedParam: IrChangedBitMaskValue,
        defaultParam: IrDefaultBitMaskValue?,
        numRealValueParameters: Int
    ): IrExpression {
        val function = scope.function

        // Save the dispatch receiver into a temporary created in
        // the outer scope because direct references to the
        // receiver sometimes cause an invalid name, "$<this>", to
        // be generated.

Response:
val dispatchReceiverParameter = function.dispatchReceiverParameter
        val outerReceiver = if (dispatchReceiverParameter != null) irTemporary(
            value = irGet(dispatchReceiverParameter),
            nameHint = "rcvr"
        ) else null

        // Create self-invoke lambda
        val parameterCount = function.valueParameters.size
        val contextParameterCount = function.contextReceiverParametersCount<|endoftext|>


Prompt:
// generic signature: ()LOutPair<Ljava/lang/CharSequence;Ljava/lang/Integer;>;

// method: A::foo3
// generic signature: ()LOutPair<LOutPair<Ljava/lang/CharSequence;Ljava/lang/Number;>;Ljava/lang/Number;>;

// method: A::foo4

Response:
// generic signature: ()LIn<Ljava/lang/String;>;

// method: A::foo5
// generic signature: ()LIn<Ljava/lang/Object;>;

// method: A::getProp1
// generic signature: ()LOutPair<Ljava/lang/String;Ljava/lang/Integer;>;

// method: A::getProp2<|endoftext|>


Prompt:
val outer = accessedProperty ?: declaration

        val manager = declaration.manager
        val language = declaration.language

        return LightMethodBuilder(
            manager, language, name,
            LightParameterListBuilder(manager, language),
            UltraLightModifierListForMember(declaration, accessedProperty, outer, forceStatic, forcePrivate, forceNonFinal)
        ).setConstructor(declaration is KtConstructor<*>)

Response:
}

    private enum class MethodType {
        REGULAR,
        GETTER,
        SETTER
    }

    private fun computeMethodName(declaration: KtDeclaration, name: String, type: MethodType): String {

        fun tryCompute(declaration: KtDeclaration, type: MethodType): String? {<|endoftext|>


Prompt:
override val hasSpecificCallablePackageNamesComputation: Boolean get() = true

    override fun computePackageNamesWithTopLevelCallables(): Set<String> =
        buildPackageNamesSetFrom(index.topLevelPropertyMap.keys, index.topLevelFunctionMap.keys)

    @Suppress("NOTHING_TO_INLINE")

Response:
private inline fun buildPackageNamesSetFrom(vararg fqNameSets: Set<FqName>): Set<String> =
        buildSet {
            for (fqNameSet in fqNameSets) {
                fqNameSet.mapTo(this, FqName::asString)
            }
        }<|endoftext|>


Prompt: 0xbfaff55bb72cfdeaUL,     0xc0072c43f4b1650aUL,     0xc0072c43f4b15e74UL,     0xc0072c43f4b16ba1UL,

Response: 0xc0056c6e7397f5aeUL,     0xc008234d7f6ecb9dUL,     0xc002d97c7f3321d2UL,     0xc008a225e5677921UL,<|endoftext|>


Prompt:
.filter { it.isNativeSourceSet.getOrThrow() }
            .associate { sourceSet -> sourceSet.name to cinteropMetadataDirectoryPath(sourceSet.name) },
        hostSpecificSourceSets = project.future { getHostSpecificSourceSets(project) }.getOrThrow()
            .filter { it in sourceSetsWithMetadataCompilations }.map { it.name }

Response:
.toSet(),
        sourceSetBinaryLayout = sourceSetsWithMetadataCompilations.keys.associate { sourceSet ->
            sourceSet.name to SourceSetMetadataLayout.chooseForProducingProject()
        },
        isPublishedAsRoot = true,
        sourceSetNames = sourceSetsWithMetadataCompilations.keys.map { it.name }.toSet(),
    )
}<|endoftext|>


Prompt:
}

class DeserializedClassDescriptor : ClassDescriptor {
    private val modality = ProtoEnumFlags.modality()

    override fun getModality() = modality
}

fun modality(): Modality = Modality.FINAL

class DeserializedClassDescriptor2 : ClassDescriptor {
    private val modality = modality()

Response:
override fun getModality() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>modality<!>
}<|endoftext|>


Prompt:
KotlinToolingVersion("1.8.0-dev----999").apply {
            assertEquals(DEV, maturity)
            assertEquals(1, major)
            assertEquals(8, minor)
            assertEquals(0, patch)
            assertEquals("dev----999", classifier)
            assertNull(classifierNumber)
            assertEquals(999, buildNumber)
        }

Response:
KotlinToolingVersion("1.6.20-dev-google-pr-510").apply {
            assertEquals(DEV, maturity)
            assertEquals(1, major)
            assertEquals(6, minor)
            assertEquals(20, patch)
            assertEquals("dev-google-pr-510", classifier)
            assertNull(classifierNumber)<|endoftext|>


Prompt:
fun indexFile(file: FirFile) {
        val location = locationForFile(file)
        index.files[file] = location
        file.accept(index.visitor(location))
    }

    fun generateFile(file: FirFile) {
        require(inModule)

        val dumpOutput = index.files[file] ?: error("No location for ${file.name}")

Response:
val dumper = HtmlFirDump(LinkResolver(dumpOutput), file.moduleData.session)
        val builder = StringBuilder()
        dumper.generate(file, builder)

        dumpOutput.writeText(builder.toString())
        packageForFile(file).apply {
            errors[file.name] = dumper.errors<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1289
package foo

import kotlin.reflect.KProperty1

class A {
    val x = 23
}

fun box(): String {
    assertEquals(true, (A::x as Any) is KProperty1<*, *>)

Response:
assertEquals(23, ((A::x as Any) as KProperty1<A, Any>)(A()))
    assertEquals(false, (23 as Any) is KProperty1<*, *>)
    assertEquals(false, ({ A().x } as Any) is KProperty1<*, *>)

    return "OK"
}<|endoftext|>


Prompt:
assertTrue(items.maxOf { it.compareTo(middle).toDouble().pow(0.5) }.isNaN())
        assertTrue(items.maxOfOrNull { it.compareTo(middle).toDouble().pow(0.5) }!!.isNaN())

        assertIsNegativeZero(items.minOf { it.compareTo(middle) * 0.0 })

Response:
assertIsNegativeZero(items.minOfOrNull { it.compareTo(middle) * 0.0 }!!)
        assertIsPositiveZero(items.maxOf { it.compareTo(middle) * 0.0 })
        assertIsPositiveZero(items.maxOfOrNull { it.compareTo(middle) * 0.0 }!!)
    }

    @Test<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1315

open class Ex0(msg: String, cs: Throwable): Throwable(msg, cs)

open class Ex1: Ex0("A", Error("fail2")) {
    override val cause = Error("B")
}

open class Ex2: Ex0("fail3", Error("C")) {
    override val message = "D"
}

Response:
open class Ex3: Ex0("fail", Error("fail")) {
    override val message get() = "O"

    override val cause get() = Error("K")
}

open class Ex4: Ex3()

class Ex5: Ex4() {
    override val message: String
        get() = "!"
}

@JsExport
open class A : Throwable("AM", Error("AC"))<|endoftext|>


Prompt:
override val reason: String get() = "Ambiguity: $name, ${candidateSymbols.map { describeSymbol(it) }}"
    override val candidateSymbols: Collection<FirBasedSymbol<*>> get() = candidates.map { it.symbol }
}

Response:
class ConeOperatorAmbiguityError(override val candidates: Collection<AbstractCandidate>) : ConeDiagnosticWithCandidates {
    override val reason: String get() = "Operator overload ambiguity. Compatible candidates: ${candidateSymbols.map { describeSymbol(it) }}"
}

object ConeVariableExpectedError : ConeDiagnostic {<|endoftext|>


Prompt:
C2581, C2582, C2583, C2584, C2585, C2586, C2587, C2588, C2589, C2590,
    C2591, C2592, C2593, C2594, C2595, C2596, C2597, C2598, C2599, C2600,

Response:
C2601, C2602, C2603, C2604, C2605, C2606, C2607, C2608, C2609, C2610,
    C2611, C2612, C2613, C2614, C2615, C2616, C2617, C2618, C2619, C2620,<|endoftext|>


Prompt:
val classifier = symbol.fir
        val classifierId = getClassifierId(classifier)
        if (classifier is FirTypeAlias) {
            builder.typeAliasName = classifierId
        } else {
            builder.className = classifierId
        }
        for (i in 0 until classifier.typeParameters.size) {
            // Next type parameter is not for this type but for an outer type.

Response:
if (classifier.typeParameters[i] !is FirTypeParameter) break
            // No explicit type argument provided. For example: `Map.Entry<K, V>` when we get to `Map`
            // it has type parameters, but no explicit type arguments are provided for it.
            if (argumentIndex >= typeArguments.size) return<|endoftext|>


Prompt:
fun interface FI2: <!MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES!>SISuper, ISuper<!> {
}

interface I2: <!MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES!>SISuper, ISuper<!> {
}

Response:
object O2: <!MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES!>SISuper, ISuper<!> {
    override suspend fun invoke() {
    }
}<|endoftext|>


Prompt:
a.foo(<!ARGUMENT_TYPE_MISMATCH!>""<!>, <!ARGUMENT_TYPE_MISMATCH!>""<!>, <!ARGUMENT_TYPE_MISMATCH!>""<!>)
    a.foo(*<!ARGUMENT_TYPE_MISMATCH!>y<!>)

Response:
// TODO: TYPE_MISMATCH_DUE_TO_TYPE_PROJECTIONS probably redundant
    a.foo(*<!ARGUMENT_TYPE_MISMATCH!>y<!>, <!ARGUMENT_TYPE_MISMATCH!>""<!>)
}<|endoftext|>


Prompt: if (classBounds.upperBounds[0].annotations.joinToString() != "@foo.TypeAnn(name=Class)") return "fail 3: ${classBounds.upperBounds[0].annotations.joinToString()}"

Response: if ((classBounds.upperBounds[0].classifier as KClass<*>).simpleName != "SimpleClass") return "fail 3.1: ${classBounds.upperBounds[0].classifier}"<|endoftext|>


Prompt:
private fun computeFunctions(name: Name) =
            computeDescriptors(
                name,
                functionProtosBytes,
                ProtoBuf.Function.PARSER,
                { c.memberDeserializer.loadFunction(it).takeIf(::isDeclaredFunctionAvailable) },
                { computeNonDeclaredFunctions(name, it) }
            )

Response:
private inline fun <M : MessageLite, D : DeclarationDescriptor> computeDescriptors(
            name: Name,
            bytesByName: Map<Name, ByteArray>,
            parser: Parser<M>,
            factory: (M) -> D?,
            computeNonDeclared: (MutableList<D>) -> Unit
        ): Collection<D> =
            computeDescriptors(<|endoftext|>


Prompt:
import org.jetbrains.kotlin.codegen.optimization.temporaryVals.TemporaryVariablesEliminationTransformer
import org.jetbrains.kotlin.codegen.optimization.transformer.CompositeMethodTransformer
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.org.objectweb.asm.MethodVisitor

Response:
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode
import org.jetbrains.org.objectweb.asm.tree.MethodNode

class OptimizationMethodVisitor(
    delegate: MethodVisitor,
    private val mandatoryTransformationsOnly: Boolean,
    private val generationState: GenerationState,<|endoftext|>


Prompt:
@kotlin.DeprecatedSinceKotlin(warningSince = "1.5")
@kotlin.SinceKotlin(version = "1.3")
@kotlin.ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly

Response:
public inline fun kotlin.UIntArray.sumBy(selector: (kotlin.UInt) -> kotlin.UInt): kotlin.UInt

@kotlin.Deprecated(message = "Use sumOf instead.", replaceWith = kotlin.ReplaceWith(expression = "this.sumOf(selector)", imports = {}))<|endoftext|>


Prompt:
override fun resolveMethodGenerics(): JavaResolveResult = JavaResolveResult.EMPTY

    override fun hasInitializer() = true
    override fun computeConstantValue() = this

    override fun getName(): String = enumEntryName

    private val _type: PsiType by lazyPub {
        withEnumEntrySymbol { enumEntrySymbol ->
            enumEntrySymbol.returnType

Response:
.asPsiType(this@SymbolLightFieldForEnumEntry, allowErrorTypes = true)
                ?: nonExistentType()
        }
    }

    override fun getType(): PsiType = _type
    override fun getInitializer(): PsiExpression? = null

    override fun isValid(): Boolean = enumEntry.isValid<|endoftext|>


Prompt:
private fun String.startsWithWords(words: String) = this.startsWith(words) &&
        (this.length == words.length || !this[words.length].isLowerCase())

    private inner class GenericTypeParameterNameMapping {
        private val elementToName = mutableMapOf<TypeParameterDescriptor, String>()

Response:
private val typeParameterNameClassOverrides = mutableMapOf<ClassDescriptor, MutableSet<String>>()

        fun getOrPut(element: TypeParameterDescriptor, nameCandidates: () -> Sequence<String>): String {
            getIfAssigned(element)?.let { return it }

            nameCandidates().forEach {
                if (tryAssign(element, it)) {
                    return it<|endoftext|>


Prompt:
return kniBridge42(location.getPointer(memScope).rawValue, file?.getPointer(memScope).rawValue, line?.getPointer(memScope).rawValue, column?.getPointer(memScope).rawValue, offset?.getPointer(memScope).rawValue)
    }
}

Response:
fun clang_getRangeStart(range: CValue<CXSourceRange>): CValue<CXSourceLocation> {
    memScoped {
        val kniRetVal = nativeHeap.alloc<CXSourceLocation>()
        try {
            kniBridge43(range.getPointer(memScope).rawValue, kniRetVal.rawPtr)
            return kniRetVal.readValue()<|endoftext|>


Prompt:
val original = descriptor.getOriginalDescriptor()
            if (!visitedDescriptors.add(original)) return
            val overridden = original.getTypedOverriddenDescriptors().map { it.getOriginalDescriptor() }

            overridden.forEach { walk(it) }
        }

Response:
asSequence().flatMap { it.getTypedOverriddenDescriptors().asSequence() }.forEach { walk(it.getOriginalDescriptor()) }
        return filter { it.getOriginalDescriptor() !in visitedDescriptors }
    }

    private fun generateBridgeMethods(descriptor: ClassDescriptor, model: JsClassModel) {<|endoftext|>


Prompt:
public inline fun <T> kotlin.sequences.Sequence<T>.none(predicate: (T) -> kotlin.Boolean): kotlin.Boolean

@kotlin.SinceKotlin(version = "1.1")

Response:
public fun <T> kotlin.sequences.Sequence<T>.onEach(action: (T) -> kotlin.Unit): kotlin.sequences.Sequence<T>

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


Prompt:
override fun visitIntersectionTypeRef(intersectionTypeRef: FirIntersectionTypeRef) = visitTypeRefWithNullability(intersectionTypeRef)

    override fun visitImplicitTypeRef(implicitTypeRef: FirImplicitTypeRef) = visitTypeRef(implicitTypeRef)

    override fun visitEffectDeclaration(effectDeclaration: FirEffectDeclaration) = visitContractElementDeclaration(effectDeclaration)

Response:
override fun visitLegacyRawContractDescription(legacyRawContractDescription: FirLegacyRawContractDescription) = visitContractDescription(legacyRawContractDescription)

    override fun visitRawContractDescription(rawContractDescription: FirRawContractDescription) = visitContractDescription(rawContractDescription)

    override fun visitResolvedContractDescription(resolvedContractDescription: FirResolvedContractDescription) = visitContractDescription(resolvedContractDescription)<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.analysis.checkers.declaration

import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.diagnostics.reportOn
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind

Response:
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.analysis.checkers.findNonInterfaceSupertype
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors
import org.jetbrains.kotlin.fir.declarations.FirRegularClass<|endoftext|>


Prompt:
private fun findParameter(param: KtParameter): FirDeclaration {
        val ownerFunction = param.ownerFunction ?: errorWithFirSpecificEntries("Unsupported compiled parameter", psi = param)
        val firDeclaration = findNonLocalDeclaration(ownerFunction)
        val firFunction = firDeclaration as? FirFunction ?: errorWithFirSpecificEntries(
            "No fir function found by ktFunction",

Response:
psi = ownerFunction,
            fir = firDeclaration
        )
        return firFunction.valueParameters.find { firElementByPsiElementChooser.isMatchingValueParameter(param, it) }
            ?: errorWithFirSpecificEntries("No fir value parameter found", psi = param, fir = firFunction)
    }<|endoftext|>


Prompt:
val deltaSubUnitDuration = delta.toDuration(subUnit)
                val mark1s = baseMark + deltaSubUnitDuration
                assertDifferentMarks(mark1s, baseMark, 1)
                assertEquals(deltaSubUnitDuration, mark1s - baseMark)
            }

            // compared saturated reading from time source and saturated time mark as a result of plus operation
            run {
                val delta = 1000

Response:
val deltaDuration = delta.toDuration(unit)
                timeSource.reading = baseReading + 1000
                val mark2 = timeSource.markNow()
                assertEquals(deltaDuration, mark2 - baseMark)
                val offset = Long.MAX_VALUE.nanoseconds
                val mark2e = mark2 + offset
                val mark2d = baseMark + offset + deltaDuration<|endoftext|>


Prompt:
when (this) {
                is SimpleCallReceiver -> builder.withReceivers(dispatchReceiverValue, extensionReceiverValue, contextReceiverValues)
                else -> call(builder)
            }
        }
    }

    private fun generateDynamicFunctionCall(
        startOffset: Int,
        endOffset: Int,
        functionDescriptor: FunctionDescriptor,
        call: CallBuilder,

Response:
dispatchReceiverValue: IntermediateValue?,
        extensionReceiverValue: IntermediateValue?,
    ): IrDynamicOperatorExpressionImpl {
        fun makeDynamicOperatorExpression(operator: IrDynamicOperator) =
            IrDynamicOperatorExpressionImpl(
                startOffset, endOffset,
                functionDescriptor.returnType!!.toIrType(),
                operator
            )<|endoftext|>


Prompt:
fun foo(s: String, p: String): String = "more args overload $s"

fun bar(s: String?): String = "initial overload $s"
fun bar(s: String): String = "non-nullable overload $s"

fun qux(s: Any): String = "initial any overload $s"
fun qux(s: String): String = "initial narrower overload $s"

Response:
// MODULE: mainLib(lib)
// FILE: mainLib.kt

val x = X()

fun lib(): String = when {
    x.foo("first") != "initial overload first" -> "fail 1"
    x.bar("second") != "initial overload second" -> "fail 2"
    x.qux("third") != "initial any overload third" -> "fail 3"<|endoftext|>


Prompt:
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS

// WITH_STDLIB
// This is a big, ugly, semi-auto generated test.
// Use corresponding 'Small' test for debug.

import kotlin.test.*

fun fn0() {}

Response:
fun fn1(x0: Any) {}
fun fn2(x0: Any, x1: Any) {}
fun fn3(x0: Any, x1: Any, x2: Any) {}
fun fn4(x0: Any, x1: Any, x2: Any, x3: Any) {}<|endoftext|>


Prompt:
mapOf(1L to "1", 2L to "2", 3L to "3"),
            longArrayOf(1, 2, 3).associateWith { it.toString() }
        )
        assertEquals(
            mapOf(1f to "1", 2f to "2", 3f to "3"),

Response:
floatArrayOf(1f, 2f, 3f).associateWith { if (it == 1f) "1" else if (it == 2f) "2" else "3" }
        )
        assertEquals(
            mapOf(1.0 to "1", 2.0 to "2", 3.0 to "3"),<|endoftext|>


Prompt:
val test4 = <!FUNCTION_CALL_EXPECTED!>Outer<Int><!>.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>Obj<!>

val test5 = Outer

val test6 = Outer.Nested

val test7 = Outer.<!NO_COMPANION_OBJECT!>Inner<!>

Response: val test8 = Outer.Obj<|endoftext|>


Prompt:
* - This function is allowed to attach data to a given [IdeaKotlinDependency]
     * - This function is not allowed to remove data from a given [IdeaKotlinBinaryDependency]
     * - This function is not supposed to modify the [sourceSet]
     *
     * @param sourceSet: The current SourceSet which shall resolve additional dependencies

Response:
* @param dependencies: The already resolved dependencies from prior stages
     */
    fun resolve(sourceSet: KotlinSourceSet, dependencies: Set<IdeaKotlinDependency>)

    @ExternalKotlinTargetApi
    companion object {
        /**
         * Empty [IdeAdditionalArtifactResolver] that will not resolve any artifact (noop)
         */<|endoftext|>


Prompt:
@OptIn(ExperimentalTypeInference::class)
fun <K : V, V : CharSequence> build7(@BuilderInference builderAction: MutableMap<K, V>.() -> MutableMap<String, V>) = mutableMapOf<String, V>()

@ExperimentalStdlibApi
fun box(): String {
    buildList {
        add("")

Response:
val x: MutableList<CharSequence> = this@buildList
    }
    buildMap {
        val x: Function2<String, Char, Char?> = ::put
    }

    build {
        get("")
        ""
    }

    build2 {
        val x: String = this.values.first()
        1
    }

    build2 {<|endoftext|>


Prompt:
private fun Printer.generateMetadata(testDataSource: TestEntityModel) {
        val dataString = testDataSource.dataString
        if (dataString != null) {
            println("@TestMetadata(\"", dataString, "\")")
        }
    }

    private fun Printer.generateTestAnnotation() {
        println("@Test")
    }

Response:
private fun Printer.generateNestedAnnotation(isNested: Boolean) {
        if (isNested) {
            println("@Nested")
        }
    }

    private fun Printer.generateTestDataPath(testClassModel: TestClassModel) {
        val dataPathRoot = testClassModel.dataPathRoot
        if (dataPathRoot != null) {<|endoftext|>


Prompt:
while (iterator.hasNext()) {
        val e = iterator.next()
        max = maxOf(max, e)
    }
    return max
}

/**
 * Returns the largest element or `null` if there are no elements.
 *
 * The operation is _terminal_.
 */
@SinceKotlin("1.4")

Response:
public fun <T : Comparable<T>> Sequence<T>.maxOrNull(): T? {
    val iterator = iterator()
    if (!iterator.hasNext()) return null
    var max = iterator.next()
    while (iterator.hasNext()) {
        val e = iterator.next()
        if (max < e) max = e
    }
    return max
}

/**<|endoftext|>


Prompt:
* and puts to the [destination] map each group key associated with a list of corresponding values.
 *
 * @return The [destination] map.
 *
 * @sample samples.collections.Collections.Transformations.groupByKeysAndValues
 */

Response:
public inline fun <K, V, M : MutableMap<in K, MutableList<V>>> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M {
    for (element in this) {
        val key = keySelector(element)
        val list = destination.getOrPut(key) { ArrayList<V>() }<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<KtAnnotationEntry>(firDiagnostic, token), KtFirDiagnostic.OverloadsInterface

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

Response:
) : KtAbstractFirDiagnostic<KtAnnotationEntry>(firDiagnostic, token), KtFirDiagnostic.OverloadsLocal

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


Prompt:
name: Name,
        vararg packageNameSegments: String,
    ): Map<IrClassifierSymbol, IrSimpleFunctionSymbol> {
        return getFunctionsByKey(
            name,
            *packageNameSegments,
            mapKey = { it.fir.returnTypeRef.toIrType(c).classifierOrNull },
            mapValue = { _, irSymbol -> irSymbol }

Response:
)
    }

    fun getNonBuiltInFunctionsWithFirCounterpartByExtensionReceiver(
        name: Name,
        vararg packageNameSegments: String,
    ): Map<IrClassifierSymbol, Pair<FirNamedFunctionSymbol, IrSimpleFunctionSymbol>> {
        return getFunctionsByKey(
            name,
            *packageNameSegments,<|endoftext|>


Prompt:
private fun lowerEnumConstructorsBody(constructor: IrConstructor) {
        IrEnumClassConstructorTransformer(constructor).transformBody()
    }

    private inner class IrEnumClassConstructorTransformer(val constructor: IrConstructor) : IrElementTransformerVoid() {
        val builder = context.createIrBuilder(constructor.symbol)

        fun transformBody() {

Response:
constructor.body?.transformChildrenVoid(this)
        }

        override fun visitEnumConstructorCall(expression: IrEnumConstructorCall) =
            builder.irDelegatingConstructorCall(expression.symbol.owner).apply {
                for (i in 0..1) {
                    putValueArgument(i, builder.irGet(constructor.valueParameters[i]))
                }<|endoftext|>


Prompt:
bar<T>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
    bar<T?>(null)

    return <!NULL_FOR_NONNULL_TYPE!>null<!>
}

fun <T> baz(): T? = null

fun <T> foobar(): T = <!NULL_FOR_NONNULL_TYPE!>null<!>

Response:
class A<F> {
    fun xyz(x: F) {}

    fun foo(): F {
        val x1: F = <!NULL_FOR_NONNULL_TYPE!>null<!>
        val x2: F? = null

        xyz(<!NULL_FOR_NONNULL_TYPE!>null<!>)
        bar<F?>(null)<|endoftext|>


Prompt:
mainFunctionDetectorFactory: MainFunctionDetector.Factory,
    sealedProvider: SealedClassInheritorsProvider,
    controlFlowInformationProviderFactory: ControlFlowInformationProvider.Factory
): StorageComponentContainer = createContainerForLazyBodyResolve(
    moduleContext,
    kotlinCodeAnalyzer,
    bindingTrace,
    platform,
    bodyResolveCache,
    analyzerServices,

Response:
languageVersionSettings,
    moduleStructureOracle,
    mainFunctionDetectorFactory,
    sealedProvider,
    controlFlowInformationProviderFactory,
    null,
    null,
)
@Deprecated(
    level = DeprecationLevel.WARNING,
    message = "consider to use createContainerForLazyBodyResolve with AbsentDescriptorHandler",
    replaceWith = ReplaceWith(
        """<|endoftext|>


Prompt:
// !WTIH_NEW_INFERENCE
// SKIP_TXT

class ExcA : Exception()
class ExcB : Exception()

fun test0(x: Int?) {
    val y = try {
        x
    } finally {

    }

    if (x != null) {
        <!DEBUG_INFO_SMARTCAST!>x<!>.inc()

Response:
y<!UNSAFE_CALL!>.<!>inc()
    }

    if (y != null) {
        x<!UNSAFE_CALL!>.<!>inc()
        <!DEBUG_INFO_SMARTCAST!>y<!>.inc()
    }
}

fun test1(x: Int?) {
    val y = try {
        x
    }<|endoftext|>


Prompt:
if (it.name == "compileKotlinJvm") {
                    it.compilerOptions.progressiveMode.set(false)
                }
            }

            with(multiplatformExtension) {
                jvm {
                    compilerOptions {
                        progressiveMode.set(true)
                    }
                }

                applyDefaultHierarchyTemplate()
            }
        }

Response:
project.evaluate()

        assertEquals(false, project.kotlinJvmTask("compileKotlinJvm").compilerOptions.progressiveMode.get())
    }

    @Test
    fun jvmLanguageSettingsOverridesTargetOptions() {
        val project = buildProjectWithMPP {
            with(multiplatformExtension) {
                jvm {
                    compilerOptions {<|endoftext|>


Prompt:
override fun getTypeArguments(): List<KtTypeProjection> = emptyList()
            override fun getTypeArgumentList(): KtTypeArgumentList? = null
            override fun getCallElement(): KtElement = KtPsiFactory(context.config.project).createExpression("COROUTINE_SUSPENDED")

Response:
override fun getCallType(): Call.CallType = Call.CallType.DEFAULT
        }

        override fun getCandidateDescriptor() = suspendPropertyDescriptor
        override fun getResultingDescriptor() = suspendPropertyDescriptor
        override fun getExtensionReceiver() = null
        override fun getDispatchReceiver() = null<|endoftext|>


Prompt: // library.kt:57 box: $i$f$foo\1\64:int=0:int, array\1:java.lang.Integer[]=java.lang.Integer[], myClass\1:MyClass=MyClass, this_\43:MyClass=MyClass, $i$f$f2\43\477:int=0:int,

Response: $i$f$test\44\491:int=0:int, testVal\44:int=1:int<|endoftext|>


Prompt:
var <!LOCAL_VARIABLE_WITH_TYPE_PARAMETERS!><A, B : A, C : B, D : C, E : D><!> x2 = 2
}

// TESTCASE NUMBER: 9

Response:
fun case_9(y: Boolean?) = when (val <!LOCAL_VARIABLE_WITH_TYPE_PARAMETERS!><T><!> x = y) {
    true -> null
    false -> null
    null -> null
}

// TESTCASE NUMBER: 10<|endoftext|>


Prompt:
// WITH_STDLIB

import kotlinx.serialization.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.builtins.*

@Serializable
data class Main(val fields: MainFields) {
    companion object  {
        fun fieldsSerializer(): KSerializer<MainFields> = MainFields.serializer()
    }
}

Response:
@Serializable
data class MainFields(val firstName: String?)

@Serializable
data class Box<T>(val boxed: T) {
    companion object {
        fun <T> serializerLike(tSer: KSerializer<T>): KSerializer<List<Box<T>>> = ListSerializer(serializer(tSer))
    }
}

fun box(): String {<|endoftext|>


Prompt:
override fun computePackageNames(): Set<String>? = providers.flatMapToNullableSet { it.getPackageNames() }

    override val hasSpecificClassifierPackageNamesComputation: Boolean = providers.any { it.hasSpecificClassifierPackageNamesComputation }

    override fun computePackageNamesWithTopLevelClassifiers(): Set<String>? =

Response:
providers.flatMapToNullableSet { it.getPackageNamesWithTopLevelClassifiers() }

    override fun computeTopLevelClassifierNames(packageFqName: FqName): Set<Name>? =
        providers.flatMapToNullableSet { it.getTopLevelClassifierNamesInPackage(packageFqName) }<|endoftext|>


Prompt:
if (descriptors.size > 1 && descriptors.any { it is ClassifierDescriptor }) {
                for (descriptor in descriptors) {
                    reportOnDeclaration(trace, descriptor) { REDECLARATION.on(it, descriptors) }
                }
            }
        }
    }

    fun checkRedeclarationsInPackages(

Response:
topLevelDescriptorProvider: TopLevelDescriptorProvider,
        topLevelFqNames: Multimap<FqName, KtElement>
    ) {
        for ((fqName, declarationsOrPackageDirectives) in topLevelFqNames.asMap()) {
            if (fqName.isRoot) continue

            // TODO: report error on expected class and actual val, or vice versa<|endoftext|>


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

Response:
}

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


Prompt:
<!CONFLICTING_OVERLOADS!>fun <T> TestTypeParameterWithMultipleIdenticalUpperBoundsAC(arg: Invariant<T>)<!> where T: UserInterfaceA, T: UserInterfaceB {}

    class TestTypeParameterWithMultipleIdenticalUpperBoundsACReverse<T> where T: UserInterfaceA, T: UserInterfaceB {

Response:
<!CONFLICTING_OVERLOADS!>constructor(arg: Invariant<T>)<!>
    }<|endoftext|>


Prompt:
* @property step the number by which the value is incremented on each step.
 */
internal class ${t}ProgressionIterator(first: $t, last: $t, val step: $incrementType) : ${t}Iterator() {
    private val finalElement: $incrementType = last$toInt
    private var hasNext: Boolean = if (step > 0) first <= last else first >= last

Response:
private var next: $incrementType = if (hasNext) first$toInt else finalElement

    override fun hasNext(): Boolean = hasNext

    override fun next$t(): $t {
        val value = next
        if (value == finalElement) {
            if (!hasNext) throw kotlin.NoSuchElementException()
            hasNext = false
        }
        else {
            next += step<|endoftext|>


Prompt:
import org.jetbrains.kotlin.backend.konan.objcexport.ObjCProperty
import org.jetbrains.kotlin.backend.konan.objcexport.swiftNameAttribute
import org.jetbrains.kotlin.objcexport.analysisApiUtils.isCompanion

Response:
import org.jetbrains.kotlin.objcexport.extras.objCTypeExtras
import org.jetbrains.kotlin.objcexport.extras.originClassId
import org.jetbrains.kotlin.objcexport.extras.requiresForwardDeclaration

/**
 * If object class has companion object it needs to have property which returns this companion.<|endoftext|>


Prompt:
override fun foo(value: String): String = value
}

// FILE: test.js
function box() {
    var a = new this["bridge_saving_after_export"].A()
    var aFoo = a.foo("ok")
    if (aFoo != "ok") return "fail 1"

    var b = new this["bridge_saving_after_export"].B()

Response:
var bFoo = b.foo("ok")
    if (bFoo != "ok") return "fail 2"

    return "OK"
}<|endoftext|>


Prompt:
+irIfThenElse(compilerContext.irBuiltIns.unitType, propNotSeenTest, ifNotSeenExpr, assignParamExpr)

                statementsAfterSerializableProperty[prop.ir]?.forEach { +it }
            }

            // Handle function-intialized interface delegates
            irClass.declarations
                .filterIsInstance<IrField>()

Response:
.filter { it.origin == IrDeclarationOrigin.DELEGATE }
                .forEach {
                    val receiver = if (!it.isStatic) irGet(thiz) else null
                    +irSetField(
                        receiver,
                        it,
                        initializerAdapter(it.initializer!!),
                        IrStatementOrigin.INITIALIZE_FIELD
                    )
                }
        }<|endoftext|>


Prompt:
if (!(4 !in 3..1) != range1.contains(4)) throw AssertionError()
    // no local optimizations
    if (element22 in 3..1 != range1.contains(element22)) throw AssertionError()
    if (element22 !in 3..1 != !range1.contains(element22)) throw AssertionError()

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

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


Prompt:
return "Wrong elements for MaxS..MaxS step 1: $list3"
    }

    val list4 = ArrayList<Long>()
    val range4 = MaxL..MaxL step 1
    for (i in range4) {
        list4.add(i)
        if (list4.size > 23) break
    }
    if (list4 != listOf<Long>(MaxL)) {

Response:
return "Wrong elements for MaxL..MaxL step 1: $list4"
    }

    val list5 = ArrayList<Char>()
    val range5 = MaxC..MaxC step 1
    for (i in range5) {
        list5.add(i)
        if (list5.size > 23) break
    }
    if (list5 != listOf<Char>(MaxC)) {<|endoftext|>


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

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

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

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


Prompt:
internal class KtFirDelegatedMemberScope(
    firScope: FirContainingNamesAwareScope,
    builder: KtSymbolByFirBuilder
) : KtFirDelegatingNamesAwareScope(firScope, builder) {

    override fun getCallableSymbols(nameFilter: KtScopeNameFilter): Sequence<KtCallableSymbol> = withValidityAssertion {

Response:
return super.getCallableSymbols(nameFilter).filter { it.origin == KtSymbolOrigin.DELEGATED }
    }

    override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> = withValidityAssertion {<|endoftext|>


Prompt:
val secondaryConstructors = members.filterIsInstanceAnd<ExportedFunction> { it.isStatic }
        val bindConstructor = JsName("__bind_constructor_", false)

        val blockStatements = mutableListOf<JsStatement>(
            JsVars(JsVars.JsVar(bindConstructor, innerClassRef.bindToThis(innerClassRef)))
        )

Response:
if (companionObject != null) {
            val companionName = companionObject.getJsNameOrKotlinName().identifier
            blockStatements.add(
                jsAssignment(
                    JsNameRef(companionName, bindConstructor.makeRef()),
                    JsNameRef(companionName, innerClassRef),
                ).makeStmt()
            )
        }

        secondaryConstructors.forEach {<|endoftext|>


Prompt:
descriptorResolver.resolveGenericBounds(function, functionDescriptor, headerScope, typeParameterDescriptors, trace)

        val receiverTypeRef = function.receiverTypeReference
        val receiverType =
            if (receiverTypeRef != null) {
                typeResolver.resolveType(headerScope, receiverTypeRef, trace, true)
            } else {

Response:
if (function is KtFunctionLiteral) expectedFunctionType.getReceiverType() else null
            }

        val contextReceivers = function.contextReceivers
        val contextReceiverTypes =
            if (function is KtFunctionLiteral) expectedFunctionType.getContextReceiversTypes()
            else contextReceivers
                .mapNotNull {<|endoftext|>


Prompt:
val IrClass.superClass: IrClass?
    get() = superTypes
        .firstOrNull { !it.isInterface() && !it.isAny() }
        ?.classOrNull
        ?.owner

// This declaration accesses IrDeclarationContainer.declarations, which is marked with this opt-in
@UnsafeDuringIrConstructionAPI
val IrClassSymbol.functions: Sequence<IrSimpleFunctionSymbol>

Response:
get() = owner.functions.map { it.symbol }

// This declaration accesses IrDeclarationContainer.declarations, which is marked with this opt-in
@UnsafeDuringIrConstructionAPI
val IrClass.constructors: Sequence<IrConstructor>
    get() = declarations.asSequence().filterIsInstance<IrConstructor>()<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER

//FILE:a.kt
package test_visibility

<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> class ProtectedClass
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> interface ProtectedTrait

Response:
<!WRONG_MODIFIER_TARGET!>protected<!> val protected_val : Int = 4
<!WRONG_MODIFIER_TARGET!>protected<!> fun protected_fun() {}

private val private_val : Int = 4
private fun private_fun() {}

val internal_val : Int = 34
fun internal_fun() {}

fun test1() {
    private_fun();<|endoftext|>


Prompt:
// FIR_IDENTICAL
interface Foo {
    val foo: suspend () -> Unit
}

interface Bar<T> {
    val bar: T
}

class Test1 : Foo {
    override val <!PROPERTY_TYPE_MISMATCH_ON_OVERRIDE!>foo<!> = {}
}

class Test2 : Foo {
    override val foo: suspend () -> Unit = {}
}

Response:
class Test3 : Bar<suspend () -> Unit> {
    override val <!PROPERTY_TYPE_MISMATCH_ON_OVERRIDE!>bar<!> = {}
}

class Test4 : Bar<suspend () -> Unit> {
    override val bar: suspend () -> Unit = {}
}<|endoftext|>


Prompt:
if (buffer >= 0) {
                        result.add(buffer)
                    }
                    buffer = ']'.toInt()
                    lexemes.next()
                }

                Lexer.CHAR_LEFT_SQUARE_BRACKET -> {
                    if (buffer >= 0) {
                        result.add(buffer)
                        buffer = -1
                    }
                    lexemes.next()

Response:
var negative = false
                    if (lexemes.currentChar == Lexer.CHAR_CARET) {
                        lexemes.next()
                        negative = true
                    }

                    if (intersection)
                        result.intersection(processRangeExpression(negative))
                    else
                        result.union(processRangeExpression(negative))
                    intersection = false
                    lexemes.next()
                }<|endoftext|>


Prompt:
// SKIP_KT_DUMP
// TARGET_BACKEND: JVM

// FILE: Java1.java
public class Java1 {
    public Void foo(){
        return null;
    }
}

// FILE: Java2.java
public interface Java2  {
    public Object foo();
}

// FILE: 1.kt
class C : Java1(), Java2

Response:
class D : Java1(), Java2 {
    override fun foo(): Void {
        return null!!
    }
}

fun test() {
    val k1: Any = C().foo()
    val k2: Void = C().foo()
    val k3: Void = D().foo()
}<|endoftext|>


Prompt:
public inline fun <T> arrayOf(vararg elements: T): Array<T> = elements.unsafeCast<Array<T>>()

/**
 * Returns an array containing the specified [Double] numbers.
 */
public inline fun doubleArrayOf(vararg elements: Double): DoubleArray = elements

/**
 * Returns an array containing the specified [Float] numbers.
 */

Response:
public inline fun floatArrayOf(vararg elements: Float): FloatArray = elements

/**
 * Returns an array containing the specified [Long] numbers.
 */
public inline fun longArrayOf(vararg elements: Long): LongArray = elements

/**
 * Returns an array containing the specified [Int] numbers.
 */
public inline fun intArrayOf(vararg elements: Int): IntArray = elements

/**<|endoftext|>


Prompt:
val mapping = state.loadCompiledModule() ?: return this.toList()

    state.incrementalCacheForThisTarget?.getObsoletePackageParts()?.forEach { internalName ->
        val qualifier = JvmClassName.byInternalName(internalName).packageFqName.asString()
        mapping.findPackageParts(qualifier)?.removePart(internalName)
    }

Response:
return (this + mapping.packageFqName2Parts.values)
        .groupBy { it.packageFqName }
        .map { (packageFqName, allOldPackageParts) ->
            PackageParts(packageFqName).apply {
                allOldPackageParts.forEach { packageParts -> this += packageParts }
            }
        }
}<|endoftext|>


Prompt: P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> R): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18) -> R>>

Response:
@ExperimentalForeignApi
@TypedIntrinsic(IntrinsicType.INTEROP_STATIC_C_FUNCTION)<|endoftext|>


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

    abstract override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?)

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

Response:
abstract override fun replaceUseSiteTarget(newUseSiteTarget: AnnotationUseSiteTarget?)

    abstract override fun replaceAnnotationTypeRef(newAnnotationTypeRef: FirTypeRef)

    abstract override fun replaceTypeArguments(newTypeArguments: List<FirTypeProjection>)

    abstract override fun replaceArgumentList(newArgumentList: FirArgumentList)<|endoftext|>


Prompt:
val dst = createTempDirectory().cleanupRecursively()

        val restrictedDir = src.resolve("1/3")
        val restrictedFile = src.resolve("7.txt")

        withRestrictedWrite(restrictedDir, restrictedFile, alsoReset = listOf(dst.resolve("1/3"), dst.resolve("7.txt"))) {

Response:
val accessDeniedFiles = mutableListOf<String>()
            src.copyToRecursively(dst, followLinks = false, onError = { _, target, exception ->
                assertIs<java.nio.file.AccessDeniedException>(exception)
                assertEquals(target.toString(), exception.file)
                accessDeniedFiles.add(target.relativePathString(dst))<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// LAMBDAS: CLASS
// SAM_CONVERSIONS: CLASS
// ^ Lambdas generated by LambdaMetafactory do not have 'enclosingMethod' or 'enclosingClass'
// WITH_REFLECT

package test

var lambda = {}

class A {
    val prop = Runnable {
        lambda = { println("") }
    }
}

Response:
fun box(): String {
    A().prop.run()

    val javaClass = lambda.javaClass

    val enclosingMethod = javaClass.getEnclosingMethod()
    if (enclosingMethod?.getName() != "run") return "enclosing method: $enclosingMethod"

    val enclosingClass = javaClass.getEnclosingClass()!!.getName()<|endoftext|>


Prompt:
.sortedBy { it.nameWithoutExtension }

        val junitCoreResourceName = JUnitCore::class.java.name.replace('.', '/') + ".class"
        val junitJar = File(
            JUnitCore::class.java.classLoader.getResource(junitCoreResourceName)!!.file
                .substringAfter("file:")
                .substringBeforeLast('!')

Response:
)

        val parcelizeRuntimeJars = System.getProperty("parcelizeRuntime.classpath")?.split(File.pathSeparator)?.map(::File)
            ?: error("Unable to get a valid classpath from 'parcelizeRuntime.classpath' property")

        val tempDir = testServices.temporaryDirectoryManager.getOrCreateTempDirectory("additionalClassFiles")
        tempDir<|endoftext|>


Prompt:
override fun getValueIfComputed(key: K): V? = map[key]?.nullValueToNull()

    override fun fixInconsistentValue(
        key: K,
        context: CONTEXT & Any,
        inconsistencyMessage: String,
        mapping: (oldValue: V, newValue: V & Any) -> V & Any,
    ): V & Any {

Response:
val newValue = createValue(key, context)
        checkWithAttachment(
            newValue != null,
            message = { "A value for requested key & context must not be null due to the contract" },
        ) {
            buildAttachments(key, context, newValue)
        }

        LOG.logErrorWithAttachment(inconsistencyMessage) {<|endoftext|>


Prompt:
companion object AbcCompanion {
        fun xyz(): String = "Companion object method OK"

        val prop: String
            get() = "Companion object property OK"
    }
}

class Foo {
    companion object {
        fun xyz(): String = "Companion object method OK"

        val prop: String
            get() = "Companion object property OK"
    }
}

Response:
sealed class MyEnum(val name: String) {
    object A: MyEnum("A")
    object B: MyEnum("B")
    object C: MyEnum("C")
}

object MyObject {
    object A {
        fun valueA() = "OK"
    }
    object B {
        fun valueB() = "OK"
    }
    object C {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
import org.jetbrains.kotlin.resolve.calls.tower.ImplicitScopeTower
import org.jetbrains.kotlin.resolve.calls.tower.NewResolutionOldInference

Response:
import org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver
import org.jetbrains.kotlin.resolve.scopes.ResolutionScope
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValueWithSmartCastInfo
import org.jetbrains.kotlin.types.KotlinType<|endoftext|>


Prompt:
append("Commits:<br>")
                    val commitsList = (JsonTreeParser.parse("{${currentBuild.commits}}") as JsonObject).getArray("commits").map {
                        it as JsonObject
                        Commit(
                                it.getPrimitive("revision").content,
                                it.getPrimitive("developer").content
                        )
                    }

Response:
val commits = if (commitsList.size > 3) commitsList.slice(0..2) else commitsList
                    commits.forEach {
                        append("${it.revision.substring(0, 7)} by ${it.developer}<br>")
                    }
                    if (commitsList.size > 3) {
                        append("...")
                    }
                }<|endoftext|>


Prompt:
fun count() {
        assertEquals(1, ubyteArrayOf(0u, 1u, 2u).count { it >= 2u })
        assertEquals(2, ushortArrayOf(0u, 1u, 2u).count { it % 2u == 0u })
        assertEquals(0, uintArrayOf(0u, 2u, 4u).count { it % 2u != 0u })

Response:
assertEquals(3, ulongArrayOf(2u, 3u, 4u).count { it > 1uL })
    }

    @Suppress("DEPRECATION")
    @Test
    fun sumBy() {
        assertEquals(3u, ubyteArrayOf(0u, 1u, 2u).sumBy { it.toUInt() })<|endoftext|>


Prompt:
inline fun <reified I : KtImportInfo> makeAllUnderImportsIndexed(imports: Collection<I>) : IndexedImports<I> =
    IndexedImports(imports.filter { it.isAllUnder }.toTypedArray())

class ExplicitImportsIndexed<I : KtImportInfo>(
    imports: Array<I>,
    storageManager: StorageManager

Response:
) : IndexedImports<I>(imports) {

    private val nameToDirectives: NotNullLazyValue<ListMultimap<Name, I>> = storageManager.createLazyValue {
        val builder = ImmutableListMultimap.builder<Name, I>()

        for (directive in imports) {
            val importedName = directive.importedName ?: continue // parse error<|endoftext|>


Prompt:
interface D1 : JA<String>, KB<String>
interface E1 : D1 {
    override fun getFoo(): String
    override fun getBar(): String
}

interface D2 : KB<String>, JA<String>
interface E2 : D2 {
    override fun getFoo(): String
    override fun getBar(): String
}

fun main(

Response:
d1: D1, e1: E1,
    d2: D2, e2: E2,
) {
    d1.foo
    d1.<!UNRESOLVED_REFERENCE!>bar<!>
    e1.foo
    e1.<!UNRESOLVED_REFERENCE!>bar<!>

    d2.foo<|endoftext|>


Prompt:
if (it.asText == "set") isGetter = false
            when (it.tokenType) {
                SET_KEYWORD -> isGetter = false
                MODIFIER_LIST -> {
                    modifiers = convertModifierList(it)
                    accessorAnnotations += convertAnnotationList(it)
                }
                TYPE_REFERENCE -> returnType = convertType(it)

Response:
VALUE_PARAMETER_LIST -> firValueParameters = convertSetterParameter(
                    it, accessorSymbol, propertyTypeRefToUse, propertyAnnotations.filterUseSiteTarget(SETTER_PARAMETER)
                )
                CONTRACT_EFFECT_LIST -> outerContractDescription = obtainContractDescription(it)
                BLOCK -> block = it
                else -> if (it.isExpression()) expression = it<|endoftext|>


Prompt:
?: throw KotlinExceptionWithAttachments("No parent KtNamedDeclaration for of type ${element.javaClass}")
                .withPsiAttachment("element.kt", element)
    return if (declaration is KtFunctionLiteral) {
        getEnclosingDescriptor(context, declaration)
    } else {
        context.get(DECLARATION_TO_DESCRIPTOR, declaration)

Response:
?: throw KotlinExceptionWithAttachments("No descriptor for named declaration of type ${declaration.javaClass}")
                .withPsiAttachment("declaration.kt", declaration)
    }
}

fun getEnclosingFunctionDescriptor(context: BindingContext, element: KtElement, skipInlineFunctionLiterals: Boolean): FunctionDescriptor? {
    var current = element
    while (true) {<|endoftext|>


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

Response:
assertEquals("The index -1 is out of the bounds of the AtomicIntArray with size 10.", ex.message)
        }
    }

    @Test fun setter() {
        val atomicIntArr = AtomicIntArray(10)
        for (i in 0 until atomicIntArr.length) {
            atomicIntArr[i] = i * 10
        }<|endoftext|>


Prompt:
typeProjection: [Error type: Unresolved type for adad<List<dd>>]<List<[Error type: Unresolved type for dd]>>
    psi: adad<List<dd>>
    type: [Error type: Unresolved type for adad<List<dd>>]<List<[Error type: Unresolved type for dd]>>
        typeParameter: null

Response:
typeProjection: List<[Error type: Unresolved type for dd]>
        psi: List<dd>
        type: List<[Error type: Unresolved type for dd]>
            typeParameter: <out E> defined in kotlin.collections.List
            typeProjection: [Error type: Unresolved type for dd]
            psi: dd<|endoftext|>


Prompt:
if (value_1.case_5_3() != null) println(<!DEBUG_INFO_SMARTCAST!>value_1<!>.length)
    if (value_1.case_5_4() == null) println(<!DEBUG_INFO_SMARTCAST!>value_1<!>.length)
}

// TESTCASE NUMBER: 6

Response:
fun case_6(value_1: Number) {
    when { value_1.case_6_1() -> println(<!DEBUG_INFO_SMARTCAST!>value_1<!>.inv()) }
    when { !value_1.case_6_2() -> println(<!DEBUG_INFO_SMARTCAST!>value_1<!>.inv()) }<|endoftext|>


Prompt:
@WasExperimental(ExperimentalStdlibApi::class)
    public operator fun rangeUntil(other: Long): LongRange =
        this until other

    /**
     * Converts this [Short] value to [Byte].
     *
     * If this value is in [Byte.MIN_VALUE]..[Byte.MAX_VALUE], the resulting `Byte` value represents
     * the same numerical value as this `Short`.

Response:
*
     * The resulting `Byte` value is represented by the least significant 8 bits of this `Short` value.
     */
    @kotlin.internal.IntrinsicConstEvaluation
    @TypedIntrinsic(IntrinsicType.INT_TRUNCATE)
    public external override fun toByte(): Byte

    /**
     * Converts this [Short] value to [Char].<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: ANDROID
//  ^ D8 merges method references with empty closure created by 'invokedynamic'

fun checkNotEqual(marker: String, x: Any, y: Any) {
    if (x == y || y == x) throw AssertionError("$marker: $x and $y should NOT be equal")
}

Response:
private fun id(f: Runnable): Any = f

fun box(): String {
    // Since 1.0, SAM wrappers for Java do not implement equals/hashCode

    fun local1() {}
    fun local2() {}

    checkNotEqual("id(::local1), id(::local1)", id(::local1), id(::local1))<|endoftext|>


Prompt:
inner <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>class ErrorInnerExn<!> : Exception()
    }
}

fun <T> genericFoo() {
    <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>class ErrorLocalExnInGenericFun<!> : Exception()

Response:
val errorkAnonymousObjectExnInGenericFun = <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>object<!> : Exception() {}
}<|endoftext|>


Prompt:
asyncProfilerControl.beforePass(pass, reportDateStr)
    }

    override fun afterPass(pass: Int) {
        asyncProfilerControl.afterPass(pass, reportDateStr)

        createReport(finalReport = pass == PASSES - 1)
        require(totalModules.isNotEmpty()) { "No modules were analyzed" }

Response:
require(okModules.isNotEmpty()) { "All of $totalModules is failed" }
    }

    protected fun formatReportTable(stream: PrintStream) {
        val total = totalPassResult
        var totalGcTimeMs = 0L
        var totalGcCount = 0L
        printTable(stream) {
            row("Name", "Time", "Count")
            separator()<|endoftext|>


Prompt:
in methodOriginsWithoutAnnotations -> false
                IrDeclarationOrigin.ENUM_CLASS_SPECIAL_MEMBER -> name.asString() == "<get-entries>"
                else -> true
            }
    }
}

private fun IrValueParameter.isSyntheticMarkerParameter(): Boolean =
    origin == IrDeclarationOrigin.DEFAULT_CONSTRUCTOR_MARKER

Response:
private fun generateParameterNames(irFunction: IrFunction, mv: MethodVisitor, config: JvmBackendConfig) {
    irFunction.extensionReceiverParameter?.let {
        mv.visitParameter(irFunction.extensionReceiverName(config), 0)
    }
    for (irParameter in irFunction.valueParameters) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.REQUIRE_KOTLIN_VERSION
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOL


Prompt:
original.dispatchReceiverParameter?.copyTo(newFunction)
        newFunction.extensionReceiverParameter =
            original.extensionReceiverParameter?.copyWithNewTypeParams(original, newFunction)

        newFunction.body = original.moveBodyTo(newFunction)
            ?.copyWithNewTypeParams(original, newFunction)

Response:
newFunction.addDecoyImplementationAnnotation(newName.asString(), original.getSignatureId())

        newFunction.valueParameters.forEach {
            it.defaultValue?.transformDefaultValue(
                originalFunction = original,
                newFunction = newFunction
            )
        }

        return newFunction
    }

    /**
     *  Expressions for default values can use other parameters.<|endoftext|>


Prompt:
val callExpression = parent as? KtCallExpression ?: return null
    val possibleQualifiedExpression = callExpression.parent

    val targetExpression = if (possibleQualifiedExpression is KtQualifiedExpression) {
        if (possibleQualifiedExpression.selectorExpression != callExpression) return null
        possibleQualifiedExpression
    } else {
        callExpression

Response:
}

    return targetExpression.topParenthesizedParentOrMe().parent as? KtBinaryExpressionWithTypeRHS
}

fun KtExpression.topParenthesizedParentOrMe(): KtExpression {
    var result: KtExpression = this
    while (KtPsiUtil.deparenthesizeOnce(result.parent as? KtExpression) == result) {<|endoftext|>


Prompt:
val initializer = declaration.initializerList?.initializers?.firstIsInstanceOrNull<KtSuperTypeCallEntry>() ?: return
        val bindingTrace = context.trace
        val visitor = Visitor(
            enumDescriptor,
            enumCompanion,
            bindingTrace.bindingContext,
            bindingTrace,

Response:
reportError = context.languageVersionSettings.supportsFeature(LanguageFeature.ProhibitAccessToEnumCompanionMembersInEnumConstructorCall)
        )
        initializer.acceptChildren(visitor)
    }

    private class Visitor(
        val enumDescriptor: ClassDescriptor,
        val companionDescriptor: ClassDescriptor,
        val context: BindingContext,<|endoftext|>


Prompt:
// test.kt:12 g
// test.kt:5 invoke
// test.kt:9 f
// test.kt:10 f
// test.kt:6 box

// EXPECTATIONS JS_IR
// test.kt:4 box
// test.kt:5 box
// test.kt:5 g$ref
// test.kt:5 box
// test.kt:9 f
// test.kt:12 g

Response:
// test.kt:10 f
// test.kt:6 box

// EXPECTATIONS WASM
// test.kt:4 $box (12, 4)
// test.kt:5 $box
// test.kt:9 $f
// test.kt:12 $g
// test.kt:10 $f
// test.kt:6 $box<|endoftext|>


Prompt:
* override suspend fun KotlinGradleProjectCheckerContext.runChecks(collector: KotlinToolingDiagnosticsCollector) {
 *      ↪   KotlinPluginLifecycle.Stage.ReadyForExecution.await()
 *      // ... run my check on fully configured project
 * }
 * ```
 * However, this approach is discouraged and shall only be used if there are no suspend functions available to express the

Response:
* requirements of this checker.
 *
 */
internal interface KotlinGradleProjectChecker {
    suspend fun KotlinGradleProjectCheckerContext.runChecks(collector: KotlinToolingDiagnosticsCollector)

    companion object {
        val extensionPoint = KotlinGradlePluginExtensionPoint<KotlinGradleProjectChecker>()
    }
}<|endoftext|>