Prompt:
superTypeUpdater(resultedTypeRefs)
        }
    }

    private fun FirClassLikeDeclaration.asResolveTarget(): LLFirSingleResolveTarget? = tryCollectDesignation()?.asResolveTarget()

    private fun resolveToSupertypePhase(target: LLFirSingleResolveTarget) {
        LLFirSuperTypeTargetResolver(
            target = target,

Response:
supertypeComputationSession = supertypeComputationSession,
            visitedElements = visitedElements,
        ).resolveDesignation()

        LLFirSupertypeLazyResolver.checkIsResolved(target.target)
    }

    /**
     * We want to apply resolved supertypes to as many designations as possible.<|endoftext|>


Prompt:
"This class has been moved from package org.jetbrains.kotlin.descriptors.konan to package org.jetbrains.kotlin.library.metadata",
    ReplaceWith("org.jetbrains.kotlin.library.metadata.KlibModuleOrigin")
)
typealias KlibModuleOrigin = org.jetbrains.kotlin.library.metadata.KlibModuleOrigin

Response:
@Deprecated(
    "This class has been moved from package org.jetbrains.kotlin.descriptors.konan to package org.jetbrains.kotlin.library.metadata",
    ReplaceWith("org.jetbrains.kotlin.library.metadata.CompiledKlibModuleOrigin")
)<|endoftext|>


Prompt:
assertEquals(listOf(listOf("s"), listOf("a")), result, "should be list + element")

        val listOfAny = listOf<Any>("a") + listOf<Any>("b")
        assertEquals(listOf("a", "b"), listOfAny,  "should be list + list")

Response:
val listOfAnyAndList = listOf<Any>("a") + listOf<Any>("b") as Any
        assertEquals(listOf("a", listOf("b")), listOfAnyAndList, "should be list + Any")
    }

    @Test fun plusAssign() {
        // lets use a mutable variable of readonly list<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.utils.errors.requireIsInstance
import org.jetbrains.kotlin.fir.correspondingProperty
import org.jetbrains.kotlin.fir.declarations.FirFunction
import org.jetbrains.kotlin.fir.renderWithType

Response:
import org.jetbrains.kotlin.fir.symbols.impl.FirValueParameterSymbol
import org.jetbrains.kotlin.fir.types.varargElementType
import org.jetbrains.kotlin.name.Name

internal class KtFirValueParameterSymbol(
    override val firSymbol: FirValueParameterSymbol,<|endoftext|>


Prompt:
val x = { <!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>x<!> }

//KT-787 AssertionError on code 'val x = x'

Response:
val z = <!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>z<!>

//KT-329 Assertion failure on local function
fun block(f : () -> Unit) = f()<|endoftext|>


Prompt:
import org.jetbrains.org.objectweb.asm.tree.MethodNode
import java.util.*

class RedundantNopsCleanupMethodTransformer : MethodTransformer() {
    override fun transform(internalClassName: String, methodNode: MethodNode) {
        LabelNormalizationMethodTransformer().transform(internalClassName, methodNode)

        val requiredNops = HashSet<AbstractInsnNode>()

Response:
// NOP instruction is required, if it is a sole bytecode instruction in a try-catch block (TCB)
        recordNopsRequiredForTryCatchBlocks(methodNode, requiredNops)

        // NOP instruction is required, if it is a sole bytecode instruction in a debugger stepping interval
        recordNopsRequiredForDebugger(methodNode, requiredNops)<|endoftext|>


Prompt:
element<!UNSAFE_CALL!>.<!>get(0)
    <!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>element!!.get(0)<!>.length
}

fun main5() {
    val list = A1.warningPlatformError()

Response:
val element = <!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>list<!>.get(0)
    element.get(0)
    element!!.get(0)<!UNSAFE_CALL!>.<!>length
}<|endoftext|>


Prompt:
override fun copy(newMode: MangleMode): IrMangleComputer =
            JvmIrManglerComputer(builder, newMode, compatibleMode)

        override fun addReturnTypeSpecialCase(function: IrFunction): Boolean = true

        override fun mangleTypePlatformSpecific(type: IrType, tBuilder: StringBuilder) {

Response:
if (type.hasAnnotation(JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION)) {
                tBuilder.append(MangleConstant.ENHANCED_NULLABILITY_MARK)
            }
        }
    }

    override fun getExportChecker(compatibleMode: Boolean): KotlinExportChecker<IrDeclaration> = JvmIrExportChecker(compatibleMode)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.statistics.MetricValueValidationFailed

/**
 * Invokes build FUS service if the reporting service is initialised and add configuration time metrics.
 *
 * New value will be present in configuration cache if BuildFusService.Parameters are not calculated yet
 * [BuildFusService.reportFusMetrics] should be called for execution time metrics
 */

Response:
internal fun Project.addConfigurationMetrics(reportAction: (MetricContainer) -> Unit) {
    project.gradle.sharedServices.registrations.findByName(BuildFusService.serviceName)?.also {
        val parameters = it.parameters as BuildFusService.Parameters
        parameters.configurationMetrics.add(project.provider {
            val configurationTimeMetrics = MetricContainer()<|endoftext|>


Prompt:
class TypeVariableDirectionCalculator(
    private val c: VariableFixationFinder.Context,
    private val postponedKtPrimitives: List<PostponedResolvedAtomMarker>,
    topLevelType: KotlinTypeMarker
) {
    enum class ResolveDirection {
        TO_SUBTYPE,
        TO_SUPERTYPE,
        UNKNOWN
    }

Response:
data class NodeWithDirection(val variableWithConstraints: VariableWithConstraints, val direction: ResolveDirection) {
        override fun toString() = "$variableWithConstraints to $direction"
    }

    private val directions = HashMap<Variable, ResolveDirection>()

    init {
        setupDirections(topLevelType)
    }<|endoftext|>


Prompt:
ENTRY1,
    ENTRY2;
    constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())
}

enum class EnumerationADC(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {
    ENTRY1,
    ENTRY2();

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

enum class EnumerationADD(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {
    ENTRY1 { override fun abstractFunc() { TODO("Not yet implemented") } },<|endoftext|>


Prompt:
private fun FirTypeRef.extractTypeParametersTo(result: MutableCollection<FirTypeParameterRef>) {
        if (this is FirResolvedTypeRef) {
            type.extractTypeParametersTo(result)
        }
    }

    private fun ConeKotlinType.extractTypeParametersTo(result: MutableCollection<FirTypeParameterRef>) {
        when (this) {

Response:
is ConeFlexibleType -> lowerBound.extractTypeParametersTo(result)
            is ConeDefinitelyNotNullType -> original.extractTypeParametersTo(result)
            is ConeTypeParameterType -> {
                result += lookupTag.typeParameterSymbol.fir
            }
            is ConeClassLikeType -> typeArguments.forEach {<|endoftext|>


Prompt:
interface Inv<T>
interface In<in I>
interface Out<out O>

val foo: Inv<out In<out Out<out Int>>> = null!!
/*
psi: Inv<out In<out Out<out Int>>>
type: Inv<out In<out Out<out Int>>>
    typeParameter: <T> defined in Inv
    typeProjection: out In<out Out<out Int>>

Response:
psi: In<out Out<out Int>>
    type: In<out Out<out Int>>
        typeParameter: <in I> defined in In
        typeProjection: out Out<out Int>
        psi: Out<out Int>
        type: Out<out Int>
            typeParameter: <out O> defined in Out
            typeProjection: out Int
            psi: Int
            type: Int<|endoftext|>


Prompt:
property.transformBackingField(this, data)
            }

            calculateDeprecations(property)
        } as FirStatement
    }

    private fun FirProperty.moveJavaDeprecatedAnnotationToBackingField() {
        val newPosition = session.annotationPlatformSupport.extractBackingFieldAnnotationsFromProperty(this, session) ?: return

Response:
this.replaceAnnotations(newPosition.propertyAnnotations)
        backingField?.replaceAnnotations(newPosition.backingFieldAnnotations)
    }

    override fun transformSimpleFunction(
        simpleFunction: FirSimpleFunction,
        data: Nothing?
    ): FirSimpleFunction {
        if (!shouldTransformDeclaration(simpleFunction)) return simpleFunction<|endoftext|>


Prompt:
info, explicitReceiverValue, parentGroup,
            ExplicitReceiverKind.EXTENSION_RECEIVER,
        )

        // Member scope of expression receiver
        processLevel(
            explicitReceiverValue.toMemberScopeTowerLevel(), info, parentGroup.Member, ExplicitReceiverKind.DISPATCH_RECEIVER
        )

        enumerateTowerLevels(

Response:
parentGroup = parentGroup,
            onScope = { scope, _, group ->
                processScopeForExplicitReceiver(
                    scope,
                    explicitReceiverValue,
                    info,
                    group
                )
            },
            onImplicitReceiver = { implicitReceiverValue, group ->
                // Member extensions
                processLevel(<|endoftext|>


Prompt:
* Special case:
 *   - `NaN.sign` is `NaN`
 */
@SinceKotlin("1.2")
@InlineOnly
public actual inline val Double.sign: Double get() = nativeSign(this)

/**
 * Returns this value with the sign bit same as of the [sign] value.
 *
 * If [sign] is `NaN` the sign of the result is undefined.
 */

Response:
@SinceKotlin("1.2")
public actual fun Double.withSign(sign: Double): Double {
    val thisSignBit = doubleSignBit(this)
    val newSignBit = doubleSignBit(sign)
    return if (thisSignBit == newSignBit) this else -this
}

/**
 * Returns this value with the sign bit same as of the [sign] value.
 */<|endoftext|>


Prompt:
override fun getLength(): Long = attributes.size()

    override fun refresh(asynchronous: Boolean, recursive: Boolean, postRunnable: Runnable?) {}

    override fun getInputStream(): InputStream =
        VfsUtilCore.inputStreamSkippingBOM(Files.newInputStream(path).buffered(), this)

    override fun getModificationStamp(): Long = 0

Response:
override fun equals(other: Any?): Boolean =
        other is CoreJrtVirtualFile && path == other.path && fileSystem == other.fileSystem

    override fun hashCode(): Int =
        path.hashCode()
}<|endoftext|>


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

    abstract override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider)

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

    abstract override fun replaceControlFlowGraphReference(newControlFlowGraphReference: FirControlFlowGraphReference?)

Response:
abstract override fun replaceValueParameters(newValueParameters: List<FirValueParameter>)

    abstract override fun replaceBody(newBody: FirBlock?)

    abstract override fun replaceContractDescription(newContractDescription: FirContractDescription?)

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


Prompt:
public actual open class FastArrayList<E> internal constructor(
    var array: Array<Any?>,
    var _size: Int = array.size,
    var arrayCapacity: Int = array.size,
) : AbstractMutableList<E>(), MutableListEx<E>, RandomAccess {
    public actual constructor() : this(arrayOfNulls(16), 0) {}

Response:
public actual constructor(initialCapacity: Int) : this(arrayOfNulls(initialCapacity), 0) {}
    public actual constructor(elements: Collection<E>) : this(elements.toTypedArray<Any?>()) {}

    public actual fun trimToSize() {}
    public actual fun ensureCapacity(minCapacity: Int) {}
    actual override val size: Int get() = _size<|endoftext|>


Prompt:
if (this.w != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Number?")!>w<!>.propNullableAny
        if (this.w != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Number?"), DEBUG_INFO_SMARTCAST!>w<!>.funT()

Response:
if (this.w != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Number?"), DEBUG_INFO_SMARTCAST!>w<!>.funAny()
        if (this.w != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Number?")!>w<!>.funNullableT()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression
import org.jetbrains.kotlin.fir.expressions.UnresolvedExpressionTypeAccess
import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.fir.visitors.FirTransformer

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

@OptIn(UnresolvedExpressionTypeAccess::class)
internal class FirVarargArgumentsExpressionImpl(
    override val source: KtSourceElement?,
    @property:UnresolvedExpressionTypeAccess<|endoftext|>


Prompt:
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
            if (predicate(classOrObject)) {
                val interfaceClass = kotlinAsJavaSupport.getLightClass(classOrObject) ?: continue
                val implsClass = interfaceClass.findInnerClassByName(syntheticName, false) ?: continue
                answer.add(implsClass)
            }
        }
    }

Response:
override fun getClassNames(psiPackage: PsiPackage, scope: GlobalSearchScope): Set<String> {
        val packageFQN = FqName(psiPackage.qualifiedName)

        val declarations = kotlinAsJavaSupport.findClassOrObjectDeclarationsInPackage(packageFQN, scope)

        val answer = hashSetOf<String>()<|endoftext|>


Prompt:
@Suppress("INAPPLICABLE_JVM_NAME")
@kotlin.jvm.JvmName("sumOfBigDecimal")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun UByteArray.sumOf(selector: (UByte) -> java.math.BigDecimal): java.math.BigDecimal {

Response:
var sum: java.math.BigDecimal = 0.toBigDecimal()
    for (element in this) {
        sum += selector(element)
    }
    return sum
}

/**
 * Returns the sum of all values produced by [selector] function applied to each element in the array.
 */
@SinceKotlin("1.4")<|endoftext|>


Prompt:
* Exposes the JavaScript [HTMLInputElement](https://developer.mozilla.org/en/docs/Web/API/HTMLInputElement) to Kotlin
 */
public external abstract class HTMLInputElement : HTMLElement, JsAny {
    open var accept: String
    open var alt: String
    open var autocomplete: String
    open var autofocus: Boolean
    open var defaultChecked: Boolean

Response:
open var checked: Boolean
    open var dirName: String
    open var disabled: Boolean
    open val form: HTMLFormElement?
    open val files: FileList?
    open var formAction: String
    open var formEnctype: String
    open var formMethod: String
    open var formNoValidate: Boolean
    open var formTarget: String
    open var height: Int<|endoftext|>


Prompt:
OPTIONAL_JVM_INLINE_ANNOTATION
value class Str<T: String>(val string: T)

OPTIONAL_JVM_INLINE_ANNOTATION
value class Obj<T: Any>(val obj: T)

fun box(): String {
    var xz = Z(0)
    var xl = L(0L)
    var xs = Str("")

Response:
var xo = Obj("")

    run {
        xz = Z(42)
        xl = L(1234L)
        xs = Str("abc")
        xo = Obj("def")
    }

    if (xz.int != 42) throw AssertionError()
    if (xl.long != 1234L) throw AssertionError()<|endoftext|>


Prompt:
internal val commonizerClasspath: ConfigurableFileCollection = objectFactory.fileCollection()

    @get:Input
    internal val customJvmArgs: ListProperty<String> = objectFactory
        .listProperty<String>()
        .chainedFinalizeValueOnRead()

    private val kotlinCompilerArgumentsLogLevel = project.kotlinPropertiesProvider.kotlinCompilerArgumentsLogLevel

Response:
private val konanHome = project.file(project.konanHome)
    private val commonizerLogLevel = project.commonizerLogLevel
    private val additionalCommonizerSettings = project.additionalCommonizerSettings

    data class CInteropCommonizerDependencies(
        val commonizerTarget: CommonizerTarget,
        val dependencies: FileCollection,
    )

    /**<|endoftext|>


Prompt:
package androidx.compose.compiler.plugins.kotlin

import org.intellij.lang.annotations.Language

abstract class AbstractControlFlowTransformTests(
    useFir: Boolean
) : AbstractIrTransformTest(useFir) {
    protected fun controlFlow(
        @Language("kotlin")
        source: String,
        dumpTree: Boolean = false,

Response:
) = verifyGoldenComposeIrTransform(
        """
            import androidx.compose.runtime.Composable
            import androidx.compose.runtime.ReadOnlyComposable
            import androidx.compose.runtime.key
            import androidx.compose.runtime.NonRestartableComposable

            $source
        """.trimIndent(),
        """<|endoftext|>


Prompt:
override fun visitExpressionStatement(x: JsExpressionStatement) {
                val expression = x.expression
                val assignment = JsAstUtils.decomposeAssignmentToVariable(expression)
                if (assignment != null) {
                    val (name, value) = assignment
                    handleDefinition(name, value, x)
                } else {
                    if (handleExpression(expression)) {

Response:
invalidateTemporaries()
                    }
                }
            }

            override fun visitVars(x: JsVars) {
                for (v in x.vars) {
                    val initializer = v.initExpression
                    if (initializer != null) {
                        handleDefinition(v.name, initializer, v)
                    }
                }
            }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.config.LanguageVersionSettings
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.diagnostics.DiagnosticFactory0

Response:
import org.jetbrains.kotlin.diagnostics.Errors.*
import org.jetbrains.kotlin.incremental.KotlinLookupLocation
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.hasActualModifier<|endoftext|>


Prompt:
fun CompiledProject.assertNoWarnings(sanitize: (String) -> String = { it }) {
        val clearedOutput = sanitize(output)
        val warnings = "w: .*".toRegex().findAll(clearedOutput).map { it.groupValues[0] }

        if (warnings.any()) {

Response:
val message = (listOf("Output should not contain any warnings:") + warnings).joinToString(SYSTEM_LINE_SEPARATOR)
            throw IllegalStateException(message)
        }
    }

    fun CompiledProject.fileInWorkingDir(path: String) = File(File(workingDir, project.projectName), path)<|endoftext|>


Prompt:
print(") ")
            bracedBlock {
                body?.acceptVoid(this@IrSourcePrinterVisitor)
            }
        }
    }

    override fun visitLocalDelegatedPropertyReference(
        expression: IrLocalDelegatedPropertyReference
    ) {
        print("::")
        print(expression.delegate.owner.name)
    }

Response:
override fun visitLoop(loop: IrLoop) {
        print("<<LOOP>>")
    }

    override fun visitPropertyReference(expression: IrPropertyReference) {
        val property = expression.symbol.owner
        expression.printExplicitReceiver()
        print("::")
        print(property.name)
    }

    override fun visitSpreadElement(spread: IrSpreadElement) {<|endoftext|>


Prompt:
expect open class Base() {}

actual abstract <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE!>class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS{JVM}!>Foo<!><!> : Base(), I {
    // In non-KMP world, these two f/o would squash into a single f/o final fun foo()

Response:
// f/o abstract fun foo(): Unit in intermediate
    // f/o final fun foo(): Unit in platform
}

// MODULE: main()()(intermediate)
actual open class Base {
    fun foo() {}
}<|endoftext|>


Prompt:
assertFalse(byteArrayOf().iterator().hasNext())
    assertTrue(assertFails { byteArrayOf().iterator().next() } is NoSuchElementException)

    assertTrue(eqShort(shortArrayOf(0), ShortArray(1)))
    assertTrue(eqShort(shortArrayOf(1, 2, 3), ShortArray(3) { (it + 1).toShort() }))

Response:
assertTrue(eqShort(shortArrayOf(1), shortArrayOf(1).copyOf()))
    assertTrue(eqShort(shortArrayOf(1, 0), shortArrayOf(1).copyOf(2)))
    assertTrue(eqShort(shortArrayOf(1), shortArrayOf(1, 2).copyOf(1)))<|endoftext|>


Prompt:
suspend fun dummy() {}

val c: suspend () -> Unit = {
    dummy()
    dummy()
}

fun blackhole(a: Any) {}

class A {
    suspend fun foo(a: A, s: String = "", block: suspend A.() -> Unit) {
        block()
        block()
        blackhole(this)
        blackhole(a)

Response:
blackhole(s)
        blackhole(block)
    }
}

// BEs generate continuation classes differently, JVM_IR generates more correctly

// foo, c's lambda and foo's continuation
// 3 LOCALVARIABLE \$result Ljava/lang/Object;

// foo x 3 since we split the local over restore code for the two calls to block(), and <init><|endoftext|>


Prompt:
x.z.x.propNullableAny
                x.z.x.funT()
                x.z.x.funAny()
                x.z.x.funNullableT()
                x.z.x.funNullableAny()
            }
            if (x.z.y != null && x.z.z != null) {
                x.z.y
                x.z.z

Response:
x.z.y.equals(null)
                x.z.y.propT
                x.z.y.propAny
                x.z.y.propNullableT
                x.z.y.propNullableAny
                x.z.y.funT()
                x.z.y.funAny()
                x.z.y.funNullableT()<|endoftext|>


Prompt:
if (typeArgument is IrSimpleType) {
                if (typeArgument.checkTypeArgumentsHasSelf(itselfClass)) return true
            }
        }

        return false
    }

    fun IrBuilderWithScope.serializerInstance(
        serializerClassOriginal: IrClassSymbol?,
        pluginContext: SerializationPluginContext,
        kType: IrType,

Response:
genericIndex: Int? = null,
        rootSerializableClass: IrClass? = null,
        genericGetter: ((Int, IrType) -> IrExpression)? = null,
    ): IrExpression? {
        val nullableSerClass = compilerContext.referenceProperties(SerialEntityNames.wrapIntoNullableCallableId).single()
        if (serializerClassOriginal == null) {<|endoftext|>


Prompt:
override fun hasNext() = index != array.size
    override fun nextShort() = if (index != array.size) array[index++] else throw NoSuchElementException("$index")
}

internal inline fun createShortArray(size: Int, init: (Int) -> Short): ShortArray {
    if (size < 0) throw IllegalArgumentException("Negative array size")

Response:
val result = WasmShortArray(size)
    result.fill(size, init)
    return ShortArray(result)
}

/**
 * An array of ints.
 * @constructor Creates a new array of the specified [size], with all elements initialized to zero.
 * @throws RuntimeException if the specified [size] is negative.
 */
public class IntArray(size: Int) {<|endoftext|>


Prompt:
?: error("The generated atomic array field [${it.render()}] should've already be initialized." + CONSTRAINTS_MESSAGE)
                    it.initializer = null
                    initBlock.updateFieldInitialization(atomicArrayField.symbol, it.symbol, initExpr, initExprIndex)
                }
            } else {
                val arraySize = initializer.getArraySizeArgument()

Response:
return irAtomicArrayField(
                    atomicArrayField.name,
                    atomicSymbols.getAtomicArrayClassByAtomicfuArrayType(atomicArrayField.type),
                    atomicArrayField.isStatic,
                    atomicArrayField.annotations,
                    arraySize,
                    (initializer as IrFunctionAccessExpression).dispatchReceiver,
                    parentContainer
                )
            }
        }

        /**<|endoftext|>


Prompt:
import org.junit.jupiter.api.io.TempDir
import java.nio.file.Path
import kotlin.io.path.writeText
import kotlin.test.assertEquals

/**
 * ## Test Scope
 * This test is intended to verify mapping and translation of types.
 * It therefore tests only a subset of the [ObjCExportHeaderGeneratorTest], but is more specialized and should be convenient

Response:
* for identifying and debugging issues in type mapping.
 *
 * The test is running with K1 as well as the Analysis-Api based implementation (using the injected [HeaderGenerator])
 */
class ObjCExportTypeTranslationTest(
    private val headerGenerator: HeaderGenerator,
) {

    @TempDir
    lateinit var tempDir: Path

    @Test
    fun `test - function return type`() {<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.resolve.providers.impl

import org.jetbrains.kotlin.descriptors.SourceElement
import org.jetbrains.kotlin.fir.FirModuleData
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.ThreadSafeMutableState

Response:
import org.jetbrains.kotlin.fir.caches.*
import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
import org.jetbrains.kotlin.fir.deserialization.*
import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolNamesProvider<|endoftext|>


Prompt:
fun <T: (Float) -> Unit> selectNumber(vararg x: T) = x[0]

fun foo6(x: Int) {}
fun foo6(x: Float) {}
fun foo6(x: Number) {}

fun main() {
    select(::foo, { <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>it<!> })

Response: select(id(::foo), { x: Number -> }, { <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>it<!> })<|endoftext|>


Prompt:
val values = arrayOf("ac", "aD", "aba")
        val indices = values.indices.toList().toIntArray()

        assertEquals(listOf(1, 2, 0), indices.sortedBy { values[it] })
    }

    @Test fun sortByStable() {
        val keyRange = 'A'..'D'

Response:
for (size in listOf(10, 100, 2000)) {
            val array = Array(size) { index -> Sortable(keyRange.random(), index) }

            array.sortedBy { it.key }.assertStableSorted()
            array.sortedByDescending { it.key }.assertStableSorted(descending = true)

            array.sortBy { it.key }<|endoftext|>


Prompt:
"$taskPath task compiler arguments contains $notExpectedArgument. Actual content: $compilerArguments"
    }
}

/**
 * Asserts environment variables of the given K/N compiler for given tasks' paths
 *
 * Note: Log level of output must be set to [LogLevel.INFO].
 *
 * @param tasksPaths tasks' paths, for which command line arguments should be checked with give assertions.

Response:
* @param toolName name of build tool
 * @param assertions assertions, with will be applied to each command line arguments of each given task
 */
fun BuildResult.assertNativeTasksCustomEnvironment(
    vararg tasksPaths: String,
    toolName: NativeToolKind = NativeToolKind.KONANC,
    assertions: (Map<String, String>) -> Unit,<|endoftext|>


Prompt:
// FIR_IDENTICAL
// DUMP_IR
// This test checks that unresolved typealias in an abbreviated type does not crash the compiler or result in a compilation error.
// Apparently, there's some demand for this behavior, see KT-45308, KT-58335.

// MODULE: a
// FILE: a.kt
package a

typealias A = String

// MODULE: b(a)
// FILE: b.kt

Response:
package b

import a.A

fun foo(f: () -> A): A = f()

// MODULE: main(b)
// FILE: c.kt
import b.foo

fun box(): String = foo { "OK" }<|endoftext|>


Prompt:
aNotNullNullNotNull: TypeArgumentsFromParameterBounds<Test, Test?, Test>,
    aNotNullNullNull: TypeArgumentsFromParameterBounds<Test, Test?, Test?>,
    a: A, b: B
): Unit {
    a.bar(aNotNullNotNullNotNull)
    // jspecify_nullness_mismatch

Response:
a.bar(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>aNotNullNotNullNull<!>)
    // jspecify_nullness_mismatch
    a.bar(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>aNotNullNullNotNull<!>)<|endoftext|>


Prompt:
fun testDumpFileReadHistory() {
        val sourceOutputDir = Files.createTempDirectory("kaptRunner").toFile()
        val fileReadOutputFile = File.createTempFile("kapt_read_history", ".txt")
        try {
            doAnnotationProcessing(
                File(TEST_DATA_DIR, "Simple.java"),
                simpleProcessor(),
                sourceOutputDir,

Response:
fileReadOutput = fileReadOutputFile
            )
            assertTrue(fileReadOutputFile.exists())
            assertTrue(fileReadOutputFile.readText().contains("generated/MyMethodMyAnnotation.java"))
            assertTrue(fileReadOutputFile.readText().contains("java/lang/Enum.class"))
        } finally {
            sourceOutputDir.deleteRecursively()<|endoftext|>


Prompt:
@MyNonnull
    public static JJJ staticNNN;
}

// FILE: k.kt
fun test() {
    val a = J.staticN <!USELESS_ELVIS_RIGHT_IS_NULL!>?: null<!>
    foo(a)
    val b = JJ.staticNN <!USELESS_ELVIS_RIGHT_IS_NULL!>?: null<!>

Response:
foo(b)
    val c = JJJ.staticNNN <!USELESS_ELVIS_RIGHT_IS_NULL!>?: null<!>
    foo(c)
}

fun foo(a: Any?) {
}<|endoftext|>


Prompt:
interface ValueClassCannotHaveContextReceivers : KtFirDiagnostic<KtDeclaration> {
        override val diagnosticClass get() = ValueClassCannotHaveContextReceivers::class
    }

    interface AnnotationOnIllegalMultiFieldValueClassTypedTarget : KtFirDiagnostic<KtAnnotationEntry> {

Response:
override val diagnosticClass get() = AnnotationOnIllegalMultiFieldValueClassTypedTarget::class
        val name: String
    }

    interface NoneApplicable : KtFirDiagnostic<PsiElement> {
        override val diagnosticClass get() = NoneApplicable::class
        val candidates: List<KtSymbol>
    }<|endoftext|>


Prompt:
* This is an awful hack required to keep K1 compatibility.
             * See [convertToNonRawVersionAfterApproximationInK2].
             */
            return type.captureStatus(ctx) == CaptureStatus.FROM_EXPRESSION && with(ctx) { type.hasRawSuperType() }
        }
    }

    object TypeArgumentApproximation : AbstractCapturedTypesApproximation(null) {

Response:
override val integerLiteralConstantType: Boolean get() = true
        override val integerConstantOperatorType: Boolean get() = true
        override val intersectionTypesInContravariantPositions: Boolean get() = true
    }

    object IntegerLiteralsTypesApproximation : AllFlexibleSameValue() {
        override val integerLiteralConstantType: Boolean get() = true<|endoftext|>


Prompt:
@kotlin.internal.InlineOnly
public inline fun ceil(x: kotlin.Float): kotlin.Float

@kotlin.SinceKotlin(version = "1.2")
@kotlin.internal.InlineOnly
public inline fun cos(x: kotlin.Double): kotlin.Double

@kotlin.SinceKotlin(version = "1.2")

Response:
@kotlin.internal.InlineOnly
public inline fun cos(x: kotlin.Float): kotlin.Float

@kotlin.SinceKotlin(version = "1.2")
@kotlin.internal.InlineOnly
public inline fun cosh(x: kotlin.Double): kotlin.Double

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


Prompt:
package samples.collections

import samples.*

@RunWith(Enclosed::class)
class Iterables {

    class Building {

        @Sample
        fun iterable() {
            val iterable = Iterable {
                iterator {
                    yield(42)
                    yieldAll(1..5 step 2)
                }
            }

Response:
val result = iterable.mapIndexed { index, value -> "$index: $value" }
            assertPrints(result, "[0: 42, 1: 1, 2: 3, 3: 5]")

            // can be iterated many times
            repeat(2) {
                val sum = iterable.sum()
                assertPrints(sum, "51")
            }
        }

    }<|endoftext|>


Prompt:
val missingDeclarationSymbol: IrSymbol
    ) : PartialLinkageCase

    /**
     * Expression refers an IR declaration with a signature that uses an unusable (partially linked) classifier symbol.
     *
     * Applicable to: Expressions.
     */
    class ExpressionHasDeclarationWithUnusableClassifier(
        val expression: IrExpression,
        val referencedDeclarationSymbol: IrSymbol,

Response:
val cause: ExploredClassifier.Unusable
    ) : PartialLinkageCase

    /**
     * Expression refers an IR declaration with the wrong type.
     * Example: An [IrEnumConstructorCall] that refers an [IrConstructor] of a regular class.
     *
     * Applicable to: Expressions.
     */
    class ExpressionHasWrongTypeOfDeclaration(<|endoftext|>


Prompt:
package org.jetbrains.kotlin.generators.builtins.numbers.primitives

import org.jetbrains.kotlin.generators.builtins.PrimitiveType

internal const val END_LINE = "\n"
internal const val intrinsicConstEvaluationAnnotation = "kotlin.internal.IntrinsicConstEvaluation"

Response:
internal fun PrimitiveType.castToIfNecessary(otherType: PrimitiveType): String {
    if (this !in PrimitiveType.onlyNumeric || otherType !in PrimitiveType.onlyNumeric) {
        throw IllegalArgumentException("Cannot cast to non-numeric type")
    }

    if (this == otherType) return ""<|endoftext|>


Prompt:
*   - `log(x, b)` is `NaN` if either `x` or `b` are `NaN`
 *   - `log(x, b)` is `NaN` when `x < 0` or `b <= 0` or `b == 1.0`
 *   - `log(+Inf, +Inf)` is `NaN`

Response:
*   - `log(+Inf, b)` is `+Inf` for `b > 1` and `-Inf` for `b < 1`
 *   - `log(0.0, b)` is `-Inf` for `b > 1` and `+Inf` for `b > 1`
 *
 * See also logarithm functions for common fixed bases: [ln], [log10] and [log2].<|endoftext|>


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

import org.gradle.api.Project
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtensionOrNull

Response:
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinDependency
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.plugin.ide.IdeDependencyResolver<|endoftext|>


Prompt:
// It looks like in general this can only be decided by constructing a constraint system and checking
        // if it has a contradiction. Currently we use a heuristic that may not work ideally in all cases.
        // TODO: use constraint system to check if candidateKCallableType can be a subtype of expectedType
        val substituteDontCare = makeConstantSubstitutor(candidateTypeParameters, TypeUtils.DONT_CARE)

Response:
val subTypeSubstituted = substituteDontCare.substitute(subType, Variance.INVARIANT) ?: return true
        return ErrorTypesAreEqualToAnything.isSubtypeOf(subTypeSubstituted, superType)
    }

    private fun CallCandidateResolutionContext<*>.checkVisibilityWithoutReceiver() = checkAndReport {<|endoftext|>


Prompt:
a.<!FUNCTION_CALL_EXPECTED, VARIABLE_EXPECTED!>hashCode<!> = 99
        if (arg is String) {
            a = arg
        }
    }

Response:
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value.a?.<!UNRESOLVED_REFERENCE!>count<!> { <!UNRESOLVED_REFERENCE!>it<!> in 'l' .. 'q' })
}<|endoftext|>


Prompt:
override val size: Int
    override fun isEmpty(): Boolean
    override fun contains(element: @UnsafeVariance E): Boolean
    override fun iterator(): Iterator<E>

    // Bulk Operations
    override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean

    // Positional Access Operations
    /**
     * Returns the element at the specified index in the list.

Response:
*/
    public operator fun get(index: Int): E

    // Search Operations
    /**
     * Returns the index of the first occurrence of the specified element in the list, or -1 if the specified
     * element is not contained in the list.
     */
    public fun indexOf(element: @UnsafeVariance E): Int

    /**<|endoftext|>


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

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

Response:
transformer.transformCallableDeclaration(this, data) as E

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

    abstract override fun replaceStatus(newStatus: FirDeclarationStatus)

    abstract fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef)

    abstract fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?)<|endoftext|>


Prompt: 0x3fe921fb54442d18UL,     0x3ff1b6e192eba7deUL,     0x3fddac67056161b7UL,     0x3ff5368c951e8fcfUL,

Response: 0x3fcf5b75f92c1775UL,     0x4002d97c7f332fd2UL,     0x4002d97c7f3321d2UL,     0x4002d97c7f333dd2UL,<|endoftext|>


Prompt:
"kotlinx/serialization/builtins/BuiltinSerializersKt", "getNullable",
        "(" + kSerializerType.descriptor + ")" + kSerializerType.descriptor, false
    )

fun <T> InstructionAdapter.fillArray(type: Type, args: List<T>, onEach: (Int, T) -> Unit) {
    iconst(args.size)

Response:
newarray(type)
    args.forEachIndexed { i, arg ->
        dup()
        iconst(i)
        onEach(i, arg)
        astore(type)
    }
}

//
// ======= Serializers Resolving =======
//

class JVMSerialTypeInfo(
    property: SerializableProperty,
    val type: Type,
    nn: String,<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>x<!>.propNullableT
        <!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>x<!>.propNullableAny

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>x<!>.funT()
        <!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>x<!>.funAny()<|endoftext|>


Prompt:
assertEquals(listOf(2, 5, 8), intList)

    val longList = mutableListOf<Long>()
    for (i in ((1L until 11L).reversed() step 2L).reversed() step 3L) {
        longList += i
    }
    assertEquals(listOf(2L, 5L, 8L), longList)

Response:
val charList = mutableListOf<Char>()
    for (i in (('a' until 'k').reversed() step 2).reversed() step 3) {
        charList += i
    }
    assertEquals(listOf('b', 'e', 'h'), charList)

    return "OK"
}<|endoftext|>


Prompt:
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)

        enableMetaInfoHandler()
    }
}

open class AbstractJvmIrInterpreterTest(frontendKind: FrontendKind<*>) : AbstractIrInterpreterTest(frontendKind, TargetBackend.JVM_IR) {
    override fun configure(builder: TestConfigurationBuilder) {
        super.configure(builder)

Response:
with(builder) {
            globalDefaults {
                targetPlatform = JvmPlatforms.defaultJvmPlatform
            }

            defaultDirectives {
                +JvmEnvironmentConfigurationDirectives.FULL_JDK
                +JvmEnvironmentConfigurationDirectives.NO_RUNTIME
                +LanguageSettingsDirectives.ALLOW_KOTLIN_PACKAGE
            }<|endoftext|>


Prompt:
LLVMMoveBasicBlockAfter(block, this.entryBb)
    }

    fun alloca(type: LLVMTypeRef?, name: String = "", variableLocation: VariableDebugLocation? = null): LLVMValueRef {
        if (isObjectType(type!!)) {
            appendingTo(localsInitBb) {

Response:
val slotAddress = gep(type, slotsPhi!!, llvm.int32(slotCount), name)
                variableLocation?.let {
                    slotToVariableLocation[slotCount] = it
                }
                slotCount++
                return slotAddress
            }
        }

        appendingTo(prologueBb) {
            val slotAddress = LLVMBuildAlloca(builder, type, name)!!<|endoftext|>


Prompt:
public fun <T> kotlin.Array<out T>.asSequence(): kotlin.sequences.Sequence<T>

public fun kotlin.BooleanArray.asSequence(): kotlin.sequences.Sequence<kotlin.Boolean>

public fun kotlin.ByteArray.asSequence(): kotlin.sequences.Sequence<kotlin.Byte>

Response:
public fun kotlin.CharArray.asSequence(): kotlin.sequences.Sequence<kotlin.Char>

public fun kotlin.DoubleArray.asSequence(): kotlin.sequences.Sequence<kotlin.Double>

public fun kotlin.FloatArray.asSequence(): kotlin.sequences.Sequence<kotlin.Float><|endoftext|>


Prompt:
value class FooStarProjectedArray(val x: Array<*>, val y: Array<*>)

@JvmInline
value class FooStarProjectedArray2(val x: Array<Array<*>>, val y: Array<Array<*>>)

@JvmInline

Response:
value class Bar(val u: <!VALUE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE!>Unit<!>, val y: <!VALUE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE!>Unit<!>)

@JvmInline
value class BarNullable(val u: Unit?, val y: Unit?)

@JvmInline<|endoftext|>


Prompt:
fun foo() = warning
             }
           }
         }
       }

       Nothing is suppressed at foo, so we look above. While looking above we went up to the root (once) and propagated
       all the suppressors down, so now we have:

          foo  - suppress(Y) from C
          C    - suppress(Y) from C
          B    - suppress(X) from A

Response:
A    - suppress(X) from A
          Root - suppress() from Root

       Next time we look up anything under foo, we try the Y-suppressor and then immediately the X-suppressor, then to the empty
       suppressor at the root. All the intermediate empty nodes are skipped, because every suppressor remembers its definition point.

       This way we need no more lookups than the number of suppress() annotations from here to the root.<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.services.ServiceRegistrationData
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.compilerConfigurationProvider
import org.jetbrains.kotlin.test.services.service

Response:
class Fir2IrJvmResultsConverter(
    testServices: TestServices
) : Frontend2BackendConverter<FirOutputArtifact, IrBackendInput>(
    testServices,
    FrontendKinds.FIR,
    BackendKinds.IrBackend
) {
    override val additionalServices: List<ServiceRegistrationData><|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_JS_STDLIB_DOM_API_INCLUDED
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_JS_YARN


Prompt:
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.ir.backend.js.JsFactories
import org.jetbrains.kotlin.ir.backend.js.serializeModuleIntoKlib

Response:
import org.jetbrains.kotlin.js.test.utils.JsIrIncrementalDataProvider
import org.jetbrains.kotlin.js.test.utils.jsIrIncrementalDataProvider
import org.jetbrains.kotlin.library.KotlinAbiVersion
import org.jetbrains.kotlin.storage.LockBasedStorageManager<|endoftext|>


Prompt:
if (this is Collection && size <= 1) return toList()
            val list = toMutableList()
            list.reverse()
            return list
            """
        }

        body(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) {
            """
            if (isEmpty()) return emptyList()
            val list = toMutableList()
            list.reverse()
            return list

Response:
"""
        }

        specialFor(CharSequences, Strings) {
            returns("SELF")
            doc { "Returns a ${f.collection} with characters in reversed order." }
        }
        body(CharSequences) { "return StringBuilder(this).reverse()" }
        specialFor(Strings) { inlineOnly() }<|endoftext|>


Prompt:
x.<!UNRESOLVED_REFERENCE!>length<!>
        runWithoutContract {
            x.<!UNRESOLVED_REFERENCE!>length<!>
        }
        x = 10
    }
}

fun test8() {
    var x: Any? = materialize()
    require(x is String)
    exactlyOnce {
        x.length

Response:
exactlyOnce {
            <!SMARTCAST_IMPOSSIBLE!>x<!>.length
        }
        x = 10
    }
}

fun test9() {
    var x: Any? = materialize()
    require(x is String)
    atLeastOnce {
        x.<!UNRESOLVED_REFERENCE!>length<!>
        atLeastOnce {<|endoftext|>


Prompt:
actual var <!ACTUAL_WITHOUT_EXPECT!>v3<!>: Boolean = false
    private set

actual open class C {
    actual var <!ACTUAL_WITHOUT_EXPECT!>foo<!>: Boolean = false
        protected set
}

open class C2Typealias {
    var foo: Boolean = false
        protected set
}

Response: actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>C2<!> = C2Typealias<|endoftext|>


Prompt:
@Test3<String, C<String>>(Test1(93))
@Test4([Test3<Int, C<Int>>(Test1(44)), Test3<Int, C<Int>>(Test1(55)), Test3<Int, C<Int>>(Test1(66))])

Response:
//@Test5<ARG>(*arrayOf(Test3(Test1(77))), *arrayOf(Test3(Test1(88)))) <-- KT-45414
class K {
    fun test(): String = "K"
}

fun box(): String = O().test() + K().test()<|endoftext|>


Prompt:
it.convertPathsToSystemIndependent()
        val compilerArgumentsXml = CompilerArgumentsSerializerV5(it).serializeTo(element)
        compilerArgumentsXml.dropVersionsIfNecessary(it)
    }
}

private fun saveElementsList(element: Element, elementsList: List<String>, rootElementName: String, elementName: String) {

Response:
if (elementsList.isNotEmpty()) {
        element.addContent(
            Element(rootElementName).apply {
                val singleModule = elementsList.singleOrNull()
                if (singleModule != null) {
                    addContent(singleModule)
                } else {
                    elementsList.map { addContent(Element(elementName).apply { addContent(it) }) }
                }
            }
        )<|endoftext|>


Prompt:
listOfNotNull("org.jetbrains.kotlin:kotlin-$artifactBaseName:$version", classifier).joinToString(":")

@JvmOverloads
fun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): Any {
    return if (kotlinBuildProperties.useBootstrapStdlib)

Response:
kotlinDep(listOfNotNull("stdlib", suffix).joinToString("-"), bootstrapKotlinVersion, classifier)
    else
        dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"), classifier)
}

/**
 * Use this function to declare a dependency on kotlin-test project artifacts.
 *<|endoftext|>


Prompt:
)
            }
        }

        private fun IrDeclarationContainer.getOrBuildInlineLoopFunction(
            functionName: String,
            valueType: IrType,
            isArrayReceiver: Boolean
        ): IrSimpleFunction {
            val parent = this
            val mangledName = mangleAtomicExtensionName(functionName, isArrayReceiver)
            findDeclaration<IrSimpleFunction> {

Response:
// check the type of the receiver here
                it.name.asString() == mangledName && it.checkSyntheticParameterTypes(isArrayReceiver, valueType)
            }?.let { return it }
            return pluginContext.irFactory.buildFun {
                name = Name.identifier(mangledName)
                isInline = true
                visibility = DescriptorVisibilities.PRIVATE<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>x<!>.<!UNRESOLVED_REFERENCE!>toByte<!>()
    }
}

// TESTCASE NUMBER: 3
fun case_3(x: Any?) {

Response:
if (x is Boolean || <!USELESS_IS_CHECK!>x !is Boolean is Boolean<!>) {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>.<!UNRESOLVED_REFERENCE!>prop_1<!><|endoftext|>


Prompt:
fun invokeMethodWithArguments(resolvedCall: ResolvedCall<*>, receiver: StackValue, codegen: ExpressionCodegen): StackValue {
        // it's important to use unsubstituted return type here to unbox value if it comes from type variable
        return StackValue.functionCall(returnType, returnKotlinType ?: resolvedCall.resultingDescriptor.original.returnType) {

Response:
codegen.invokeMethodWithArguments(this, resolvedCall, receiver)
        }
    }

    fun afterReceiverGeneration(v: InstructionAdapter, frameMap: FrameMap, state: GenerationState) {
    }

}<|endoftext|>


Prompt:
getterAnnotations: List<FirAnnotation>? = getter?.annotations,
    setter: FirFunction?,
    setterAnnotations: List<FirAnnotation>? = setter?.annotations,
): DeprecationAnnotationInfoPerUseSiteStorage = buildDeprecationAnnotationInfoPerUseSiteStorage {

Response:
val setterDeprecations = setter?.extractDeprecationInfoPerUseSite(session, customAnnotations = setterAnnotations)
    setterDeprecations?.storage?.forEach { (useSite, infos) ->
        if (useSite == null) {
            add(AnnotationUseSiteTarget.PROPERTY_SETTER, infos)
        } else {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.frontend.fir.Fir2IrJsResultsConverter
import org.jetbrains.kotlin.test.frontend.fir.FirFrontendFacade
import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact

Response:
import org.jetbrains.kotlin.test.model.Frontend2BackendConverter
import org.jetbrains.kotlin.test.model.FrontendFacade
import org.jetbrains.kotlin.test.model.FrontendKind
import org.jetbrains.kotlin.test.model.FrontendKinds<|endoftext|>


Prompt:
// CHECK-DEFAULTABI: [[SHORT_ID_PTR:%[0-9]+]] = load i16 (i16)*, i16 (i16)** @{{.*short_id}}
// CHECK-DEFAULTABI: call signext i16 [[SHORT_ID_PTR]](i16 signext %0)

Response:
// CHECK-AAPCS: i16 [[SHORT_ID_BRIDGE]](i16 %0)
// CHECK-AAPCS: [[SHORT_ID_PTR:%[0-9]+]] = load i16 (i16)*, i16 (i16)** @{{.*short_id}}<|endoftext|>


Prompt:
assertEquals(emptySet(), node.closure { it.children })
    }

    @Test
    fun `closureSequence with only self reference`() {
        val node = Node("a")
        node.children.add(node)
        assertEquals(emptyList(), node.closureSequence { it.children }.toList())
    }

    @Test
    fun `closure on List`() {

Response:
val a = Node("a")
        val b = Node("b")
        val c = Node("c")
        val d = Node("d")
        val e = Node("e")
        val f = Node("f")
        val g = Node("g")

        // a -> (b, c)
        // c -> (d)
        a.children.add(b)<|endoftext|>


Prompt:
override fun onLoad(project: JpsProject, settings: CompilerSettings) {
        project.kotlinCompilerSettings = settings
    }
}

internal class KotlinJpsPluginSettingsSerializer : BaseJpsCompilerSettingsSerializer<JpsPluginSettings>(
    SettingConstants.KOTLIN_JPS_PLUGIN_SETTINGS_SECTION, ::JpsPluginSettings
) {

Response:
override fun onLoad(project: JpsProject, settings: JpsPluginSettings) {
        project.kotlinJpsPluginSettings = settings
    }
}

internal class KotlinCommonCompilerArgumentsSerializer : BaseJpsCompilerSettingsSerializer<CommonCompilerArguments.DummyImpl>(<|endoftext|>


Prompt:
typeParameters = typeParameters,
                members = members,
                nestedClasses = emptyList(),
                ir = declaration
            )
        }

        val parentFqName = declaration.getFqNameWithJsNameWhenAvailable(shouldIncludePackage = true).parentOrNull()

        return ExportedNamespace(

Response:
name = "$NOT_EXPORTED_NAMESPACE${parentFqName?.asString()?.takeIf { it.isNotEmpty() }?.let { ".$it" }.orEmpty()}",
            declarations = listOf(exportedDeclaration),
            isPrivate = true
        )
    }

    private val IrClassifierSymbol.isInterface<|endoftext|>


Prompt:
private fun checkBoundsIndexes(startIndex: Int, endIndex: Int, size: Int) {
    if (startIndex < 0 || endIndex > size) {
        throw IndexOutOfBoundsException("startIndex: $startIndex, endIndex: $endIndex, size: $size")
    }
    if (startIndex > endIndex) {

Response:
throw IllegalArgumentException("startIndex: $startIndex > endIndex: $endIndex")
    }
}

@ExperimentalForeignApi
public class MemScope : ArenaBase() {

    public val memScope: MemScope
        get() = this

    public val <T: CVariable> CValues<T>.ptr: CPointer<T><|endoftext|>


Prompt:
uintArrayOf(1u, 2u, 3u).associateWith { it.toString() }
        )
        assertEquals(
            mapOf(1.toUByte() to "1", 2.toUByte() to "2", 3.toUByte() to "3"),
            ubyteArrayOf(1u, 2u, 3u).associateWith { it.toString() }
        )

Response:
assertEquals(
            mapOf(1.toUShort() to "1", 2.toUShort() to "2", 3.toUShort() to "3"),
            ushortArrayOf(1u, 2u, 3u).associateWith { it.toString() }
        )
        assertEquals(
            mapOf(1UL to "1", 2UL to "2", 3UL to "3"),<|endoftext|>


Prompt:
assertFalse((-6).toShort() in range)

        assertTrue((-5).toShort() in range)
        assertTrue((-4).toShort() in range)
        assertTrue(0.toShort() in range)
        assertTrue(3.toShort() in range)
        assertTrue(8.toShort() in range)
        assertTrue(9.toShort() in range)

Response:
assertFalse(10.toShort() in range)
        assertFalse(239.toShort() in range)

        assertFalse(range.isEmpty())

        assertTrue(1.toByte() in range)
        assertTrue(1.toInt() in range)
        assertTrue(1.toLong() in range)

        assertFalse(Long.MAX_VALUE in range)<|endoftext|>


Prompt:
val target = JvmTarget.values().find { it.description == definedTarget }
            if (target == null) {
                messageCollector.report(
                    CompilerMessageSeverity.STRONG_WARNING, "Unknown JVM target \"$definedTarget\", using default"
                )
            } else {
                put(JVMConfigurationKeys.JVM_TARGET, target)
            }
        }

Response:
val jdkHomeFromConfigurations = scriptCompilationConfiguration[ScriptCompilationConfiguration.jvm.jdkHome]
            // TODO: check if this is redundant and/or incorrect since the default is now taken from the host configuration anyway (the one linked to the compilation config)
            ?: hostConfiguration[ScriptingHostConfiguration.jvm.jdkHome]
        if (jdkHomeFromConfigurations != null) {<|endoftext|>


Prompt:
fun runTestPipeline(moduleStructure: TestModuleStructure, services: TestServices) {
        val globalMetadataInfoHandler = testConfiguration.testServices.globalMetadataInfoHandler
        globalMetadataInfoHandler.parseExistingMetadataInfosFromAllSources()

        val modules = moduleStructure.modules
        val dependencyProvider = DependencyProviderImpl(services, modules)

Response:
services.registerDependencyProvider(dependencyProvider)

        testConfiguration.preAnalysisHandlers.forEach { preprocessor ->
            preprocessor.preprocessModuleStructure(moduleStructure)
        }

        testConfiguration.preAnalysisHandlers.forEach { preprocessor ->
            withAssertionCatching(WrappedException::FromPreAnalysisHandler) {<|endoftext|>


Prompt:
assert(f5.toString() == "F5(x=4294967294)") { f5.toString() }
    assert(f6.toString() == "F6(x=678)") { f6.toString() }

Response: val aStr = "A(f1=F1(x=1), f2=F2(x=4294967295), f3=F3(x=F1(x=1), y=F2(x=4294967295)), f4=F4(x=5), f5=F5(x=4294967294), f6=F6(x=678), f7=9,<|endoftext|>


Prompt:
return psiAnnotations.map { it.asSingleFqName() }.toSet()
    }

    private fun annotationsOnOuterDeclarations(declaration: FirDeclaration): Set<AnnotationFqn> {
        return getOwnersOfDeclaration(declaration)?.flatMap { annotationsOnDeclaration(it.fir) }.orEmpty().toSet()
    }
}

Response:
private class FirOwnersStorage(private val declarationToOwner: Map<FirDeclaration, List<FirBasedSymbol<*>>>) {
    fun getOwners(declaration: FirDeclaration): List<FirBasedSymbol<*>>? = declarationToOwner[declaration]

    companion object {
        fun collectOwners(file: FirFile): FirOwnersStorage {<|endoftext|>


Prompt:
.split(",")
                .map { it.trim() }
                .filter { it.isNotEmpty() }
                .toSet()
        }

        /**
         * In case [Project.findProperty] can throw exception, this version catch it and return null
         */
        private fun Project.findPropertySafe(propertyName: String): Any? =
            try {
                findProperty(propertyName)

Response:
} catch (ex: Exception) {
                logger.warn("Error getting property $propertyName", ex)
                null
            }

        fun findMainKaptConfiguration(project: Project) = project.findKaptConfiguration(SourceSet.MAIN_SOURCE_SET_NAME)

        fun createAptConfigurationIfNeeded(project: Project, sourceSetName: String): Configuration {<|endoftext|>


Prompt:
expectAnyFailure { cache.getById(i2.id) }

            cache.removeById(i2.id)

            assertEquals(i1, cache.getByString(i1.str.toLowerCase()))
            assertEquals(i1, cache.getByString(i1.str.toUpperCase()))

Response:
assertEquals(i1, cache.getById(i1.id))
            expectAnyFailure { cache.getByString(i2.str.toLowerCase()) }
            expectAnyFailure { cache.getByString(i2.str.toUpperCase()) }
            expectAnyFailure { cache.getById(i2.id) }

            cache.removeById(i1.id)<|endoftext|>


Prompt:
} else {
            staticsAndCompanion
        }

        val forMembersResolution = forConstructorHeader
            .addReceiver(labelName, towerElementsForClass.thisReceiver)
            .addContextReceiverGroup(towerElementsForClass.contextReceivers)

        /*
         * Scope for enum entries is equal to initial scope for constructor header
         *

Response:
* The only difference is that we add value parameters to local scope for constructors
         *   and should not do this for enum entries
         */

        @Suppress("UnnecessaryVariable")
        val scopeForEnumEntries = forConstructorHeader

        val newTowerDataContextForStaticNestedClasses =
            if ((owner as? FirRegularClass)?.classKind?.isSingleton == true)<|endoftext|>


Prompt:
BINARY_SIG
    }

    companion object RootTypes {
        val OnlyBinary: Set<RootType> = EnumSet.of(RootType.BINARY, RootType.BINARY_SIG)
        val OnlySource: Set<RootType> = EnumSet.of(RootType.SOURCE)

Response:
val SourceAndBinary: Set<RootType> = EnumSet.of(RootType.BINARY, RootType.BINARY_SIG, RootType.SOURCE)
    }
}<|endoftext|>


Prompt:
public inline fun IntArray.dropLastWhile(predicate: (Int) -> Boolean): List<Int> {
    for (index in lastIndex downTo 0) {
        if (!predicate(this[index])) {
            return take(index + 1)
        }
    }
    return emptyList()
}

/**
 * Returns a list containing all elements except last elements that satisfy the given [predicate].
 *

Response:
* @sample samples.collections.Collections.Transformations.drop
 */
public inline fun LongArray.dropLastWhile(predicate: (Long) -> Boolean): List<Long> {
    for (index in lastIndex downTo 0) {
        if (!predicate(this[index])) {
            return take(index + 1)
        }
    }
    return emptyList()
}

/**<|endoftext|>


Prompt:
* Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *

Response:
* @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals
 */
@SinceKotlin("1.4")
public actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean {
    if (this === other) return true
    if (this === null || other === null) return false
    if (size != other.size) return false<|endoftext|>


Prompt:
fun <R> select(vararg x: R) = x[0]

fun poll0(): Flow<String> {
    return flow {
        val inv = select({}, {})
        inv()
    }
}

fun poll01(): Flow<String> {
    return flow {
        val inv = select({ 1 }, { 1f })
        inv()
    }
}

Response:
fun poll1(flag: Boolean): Flow<String> {
    return flow {
        val inv = if (flag) { {} } else { {} }
        inv()
    }
}

fun poll11(flag: Boolean): Flow<String> {
    return flow {
        val inv = if (flag) { { 1 } } else { { 1f } }
        inv()
    }
}<|endoftext|>


Prompt:
postLinkageSteps.add {
                    irConstructor.body = irBuiltIns.createIrBuilder(irConstructor.symbol, SYNTHETIC_OFFSET, SYNTHETIC_OFFSET).irBlockBody {
                        +IrDelegatingConstructorCallImpl.fromSymbolOwner(
                                startOffset, endOffset,
                                context.irBuiltIns.unitType, symbols.managedTypeConstructor

Response:
).also {
                                it.putTypeArgument(0, irConstructor.valueParameters[0].type)
                                it.putValueArgument(0, irGet(irConstructor.valueParameters[0]))
                        }
                        +irInstanceInitializer(symbolTable.descriptorExtension.referenceClass(irClass.descriptor))
                    }
                }
            }
        }
    }<|endoftext|>


Prompt:
arguments.add(visitor.convertToIrExpression(argument))
                        }
                    }
                }
            }

            is IrDynamicOperatorExpression -> apply {
                if (call == null) return@apply
                val (valueParameters, argumentMapping, substitutor) = extractArgumentsMapping(call)

Response:
if (argumentMapping != null && (visitor.annotationMode || argumentMapping.isNotEmpty())) {
                    if (valueParameters != null) {
                        val dynamicCallVarargArgument = argumentMapping.keys.firstOrNull() as? FirVarargArgumentsExpression
                            ?: error("Dynamic call must have a single vararg argument")
                        for (argument in dynamicCallVarargArgument.arguments) {<|endoftext|>


Prompt:
return this.scheduler.release(ID_DEVICE_B)
        }
    }

    override fun toString(): String {
        return "IdleTask"
    }
}

/**
 * A task that suspends itself after each time it has been run to simulate
 * waiting for data from an external device.
 * @param {Scheduler} scheduler the scheduler that manages this task

Response:
* @constructor
 */
class DeviceTask(var scheduler: Scheduler): Task {
    var v1: Packet? = null

    override fun run(packet: Packet?): TaskControlBlock? {
        if (packet == null) {
            if (this.v1 == null) return this.scheduler.suspendCurrent()
            val v = this.v1<|endoftext|>


Prompt:
synchronized(cacheEntryValue) { // Needs synchronization as CacheEntryValue is not thread-safe
                val value = cacheEntryValue.get() ?: valueProvider(key)
                cacheEntryValue.setStrongReference(value, currentTimePeriod.get())
                value
            }
        }
    }

    fun evictEntries() {

Response:
writeLock { // Write lock so that other threads don't read/write the cache while this thread is updating it
            val lowestTimePeriodToKeepStrongRefs = currentTimePeriod.get() - maxTimePeriodsToKeepStrongReferences + 1
            val lowestTimePeriodToKeepSoftRefs = lowestTimePeriodToKeepStrongRefs - maxTimePeriodsToKeepSoftReferences<|endoftext|>


Prompt:
MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING !in exception.message.orEmpty(),
            "Expected no classpath warning in the error message, since this cast was not failing because of isolated classloaders"
        )
    }

    @Test
    fun `test downcast - with isolated classpath`() {
        class BImpl : B

Response:
val isolatedBInstance = isolatedClassLoader.loadClass(BImpl::class.java.name).constructors.single().newInstance()

        run {
            val exception = assertThrows<IsolatedKotlinClasspathClassCastException>(
                "Expected 'ClassCastException' because of classloader isolation"
            ) { isolatedBInstance.castIsolatedKotlinPluginClassLoaderAware<A>() }<|endoftext|>


Prompt:
<!CANNOT_INFER_PARAMETER_TYPE!>takeE<!>(<!ARGUMENT_TYPE_MISMATCH!>id(value)<!>)

    if (value != null) {
        takeV(value)
        takeE(value)
        takeE(id(value))
    }
}

Response:
fun <V : Any> SLRUMap<V>.getOrPutNN(value: V, l: List<V>) {
    takeV(value)
    takeVList(l)

    takeE(value)
    takeEList(l)
    takeE(id(value))
}<|endoftext|>


Prompt:
}
    else -> when (value_3) {
        true -> 1
        false -> 2
        null -> 3
    }
}

// TESTCASE NUMBER: 7
fun case_7(value_1: Int, value_2: Int, value_3: Boolean?) {
    when {
        value_1 == 1 -> if (value_2 > 1000) "1"

Response:
value_1 == 2 -> if (value_2 > 1000) "1"
            else "2"
        value_1 == 3 -> if (value_2 < 100) "1"
            else if (value_2 < 10) "2"
            else "4"
        value_1 == 4 -> if (value_3 == null) "1"
            else if (value_3) "2"<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.funT()
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.funAny()

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

/*
 * TESTCASE NUMBER: 2<|endoftext|>


Prompt:
val z1a: A<String> = z1
    val z1b: B<String, Int> = z1
    val z2a: A<String> = z2
    val z2b: B<String, Int> = z2
    return when {
        z1.foo("", 0)  != "Z1" -> "Fail #1"

Response:
z1a.foo("", 0) != "Z1" -> "Fail #2"
        z1b.foo("", 0) != "Z1" -> "Fail #3" //FAIL
        z2.foo("", 0)  != "Z2" -> "Fail #4"
        z2a.foo("", 0) != "Z2" -> "Fail #5"<|endoftext|>


Prompt:
package sample.win32

import kotlinx.cinterop.*
import platform.windows.*

fun main() {
    val message = StringBuilder()
    memScoped {
      val buffer = allocArray<UShortVar>(MAX_PATH)
      GetModuleFileNameW(null, buffer, MAX_PATH)

Response:
val path = buffer.toKString().split("\\").dropLast(1).joinToString("\\")
      message.append("Я нахожусь в $path\n")
    }<|endoftext|>


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

Response:
if (element22 !in emptyCharSequence.indices != !range1.contains(element22)) throw AssertionError()
    if (!(element22 in emptyCharSequence.indices) != !range1.contains(element22)) throw AssertionError()
    if (!(element22 !in emptyCharSequence.indices) != range1.contains(element22)) throw AssertionError()
}<|endoftext|>


Prompt:
@Deprecated("Use other sorting functions from the Standard Library")
@DeprecatedSinceKotlin(warningSince = "1.6")
@kotlin.internal.InlineOnly
public inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int): Unit {
    nativeSort(comparison)
}

/**

Response:
* Sorts the array in-place according to the order specified by the given [comparison] function.
 */
@Deprecated("Use other sorting functions from the Standard Library")
@DeprecatedSinceKotlin(warningSince = "1.6")
@kotlin.internal.InlineOnly
public inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit {<|endoftext|>


Prompt:
interface Id<T> {
    val id: T
}

data class Actor (
        override val id: Int,
        val firstName: String,
        val lastName: String
) : Id<Int>

fun box(): String {
    val a1 = Actor(1, "Jeff", "Bridges")

    val a1c = a1.copy()

Response:
if (a1c.id != a1.id) return "Failed: a1.copy().id==${a1c.id}"

    val a2 = Actor(2, "Jeff", "Bridges")
    if (a2 == a1) return "Failed: a2==a1"

    // Assume that our hashCode is good enough for this test :)<|endoftext|>


Prompt:
const val appendInFun = <!EVALUATED: `1 2 3`!>appendVararg("1", " ", "2", " ", "3")<!>

const val length1 = <!EVALUATED: `1`!>StringBuilder(3).append("1").length<!>

Response:
const val length2 = <!EVALUATED: `9`!>StringBuilder().append("123456789").length<!>
const val get0 = <!EVALUATED: `1`!>StringBuilder().append("1234556789").get(0)<!><|endoftext|>


Prompt:
// !CHECK_TYPE

class G<T>

fun foo(p: <!UNRESOLVED_REFERENCE!>P<!>) {
    val v = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>p<!> as <!NO_TYPE_ARGUMENTS_ON_RHS!>G?<!>

Response:
checkSubtype<G<*>>(v!!)
}<|endoftext|>


Prompt:
private const val P4 = -1.65339022054652515390e-06 /* 0xBEBBBD41, 0xC5D26BF1 */
private const val P5 = 4.13813679705723846039e-08 /* 0x3E663769, 0x72BEA4D0 */

Response:
internal fun __ieee754_exp(_x: Double): Double    /* default IEEE double exp */ {
    var x: Double = _x
    var y: Double
    var hi: Double = 0.0
    var lo: Double = 0.0
    var c: Double
    var t: Double
    var k: Int = 0
    var xsb: Int
    var hx: UInt<|endoftext|>


Prompt:
val inv = when (flag) { true -> ::Foo6 false -> ::Foo6 }
        inv
    }
}

fun poll36(flag: Boolean): Flow<String> {
    return flow {

Response:
val inv = when (flag) { true -> ::<!CANNOT_INFER_PARAMETER_TYPE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!> false -> foo7() }
        inv
    }
}

fun poll4(): Flow<String> {
    return flow {
        val inv = try { ::bar } finally { ::foo }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.readSourceFileWithMapping
import kotlin.reflect.KFunction2

fun FirSession.buildFirViaLightTree(
    files: Collection<KtSourceFile>,
    diagnosticsReporter: DiagnosticReporter? = null,
    reportFilesAndLines: ((Int, Int) -> Unit)? = null
): List<FirFile> {

Response:
val firProvider = (firProvider as FirProviderImpl)
    val sourcesToPathsMapper = sourcesToPathsMapper
    val builder = LightTree2Fir(this, firProvider.kotlinScopeProvider, diagnosticsReporter)
    val shouldCountLines = (reportFilesAndLines != null)
    var linesCount = 0
    val firFiles = files.map { file -><|endoftext|>


Prompt:
open class OpenKlassOptInApiInheritorD: OpenKlassOptInApi()

open class OpenKlassOptInApiInheritorE: OpenKlassOptInApiInheritorB() // inheritance opt-in isn't propagated

Response: open class OpenKlassOptInApiInheritorF: <!OPT_IN_USAGE_ERROR!>OpenKlassOptInApiInheritorC<!>() // inheritance opt-in is propagated<|endoftext|>


Prompt:
return ValueOrClosed<String>("OK") as R
    }

    public final override suspend fun receiveOrClosed(): ValueOrClosed<E> {
        return receiveSuspend()
    }
}

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

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

Response:
val channel: Channel<String> = AbstractChannel<String>()
        res = channel.receiveOrClosed().holder as String
    }
    TailCallOptimizationChecker.checkStateMachineIn("receiveOrClosed")
    return res
}<|endoftext|>


Prompt:
open val inBandMetadataTrackDispatchType: String
    open var mode: TextTrackMode
    open val cues: TextTrackCueList?
    open val activeCues: TextTrackCueList?
    open var oncuechange: ((Event) -> Unit)?
    open val sourceBuffer: SourceBuffer?
    fun addCue(cue: TextTrackCue)
    fun removeCue(cue: TextTrackCue)

Response:
}

public external abstract class TextTrackCueList : JsAny {
    open val length: Int
    fun getCueById(id: String): TextTrackCue?
}

@Suppress("UNUSED_PARAMETER")
internal fun getMethodImplForTextTrackCueList(obj: TextTrackCueList, index: Int): TextTrackCue? { js("return obj[index];") }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapParser
import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapSuccess
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.metadata.DebugProtoBuf

Response:
import org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf
import org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf
import org.jetbrains.kotlin.metadata.jvm.deserialization.BitEncoding
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion<|endoftext|>


Prompt:
import org.jetbrains.kotlin.build.report.metrics.GradleBuildPerformanceMetric
import org.jetbrains.kotlin.build.report.metrics.GradleBuildTime
import org.jetbrains.kotlin.build.report.metrics.measure
import org.jetbrains.kotlin.incremental.*


Prompt:
private val context: CommonBackendContext,
    private val headerInfoBuilder: HeaderInfoBuilder,
    private val scopeOwnerSymbol: () -> IrSymbol
) {

    private val symbols = context.ir.symbols

    /**
     * Extracts information for building the for-loop (as a [ForLoopHeader]) from the given
     * "header" statement that stores the iterator into the loop variable

Response:
* (e.g., `val it = someIterable.iterator()`).
     *
     * Returns null if the for-loop cannot be lowered.
     */
    fun extractHeader(variable: IrVariable): ForLoopHeader? {
        // Verify the variable type is a subtype of Iterator<*>.
        assert(variable.origin == IrDeclarationOrigin.FOR_LOOP_ITERATOR)<|endoftext|>


Prompt:
enableGradleDaemonMemoryLimitInMb,
        enableKotlinDaemonMemoryLimitInMb,
        gradleVersion,
        kotlinDaemonDebugPort
    )
    val gradleRunnerForBuild = gradleRunner
        .also { if (forceOutput) it.forwardOutput() }

Response:
.also { if (environmentVariables.environmentalVariables.isNotEmpty()) it.withEnvironment(System.getenv() + environmentVariables.environmentalVariables) }
        .withDebug(enableGradleDebug)
        .withArguments(allBuildArguments)
    withBuildSummary(allBuildArguments) {
        val buildResult = gradleRunnerForBuild.build()<|endoftext|>


Prompt:
fun testDataFlowInfo1(a: Int?, b: Int?) {
    val c: Int = a ?: b!!
    doInt(c)
    // b is nullable if a != null
    b <!UNSAFE_OPERATOR_CALL!>+<!> 1
}

fun testDataFlowInfo2(a: Int?, b: Int?) {
    doInt(a ?: b!!)

Response:
// b is nullable if a != null
    b <!UNSAFE_OPERATOR_CALL!>+<!> 1
}

fun testTypeMismatch(a: String?, b: Any) {
    doInt(<!TYPE_MISMATCH!>a ?: b<!>)
}<|endoftext|>


Prompt:
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class, kotlin.ExperimentalStdlibApi::class})
@kotlin.internal.InlineOnly
public inline fun kotlin.UInt.countLeadingZeroBits(): kotlin.Int

@kotlin.SinceKotlin(version = "1.5")

Response:
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class, kotlin.ExperimentalStdlibApi::class})
@kotlin.internal.InlineOnly
public inline fun kotlin.ULong.countLeadingZeroBits(): kotlin.Int

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


Prompt:
assertFalse(eqByteQDouble(0.toByte(), 1.toDouble()))
    assertFalse(eqByteQDouble(1.toByte(), 0.toDouble()))
    assertTrue(eqByteQDouble(1.toByte(), 1.toDouble()))
    assertFalse(eqByteQDouble(null, 0.toDouble()))
    assertFalse(eqByteQDouble(null, 1.toDouble()))

Response:
assertFalse(eqByteQDouble(undefined, 0.toDouble()))
    assertFalse(eqByteQDouble(undefined, 1.toDouble()))
    assertTrue(eqByteQDoubleQ(0.toByte(), 0.toDouble()))
    assertFalse(eqByteQDoubleQ(0.toByte(), 1.toDouble()))
    assertFalse(eqByteQDoubleQ(0.toByte(), null))<|endoftext|>


Prompt:
package org.jetbrains.kotlin.library.metadata

import org.jetbrains.kotlin.builtins.BuiltInsPackageFragment
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.library.KotlinLibrary
import org.jetbrains.kotlin.metadata.ProtoBuf

Response:
import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.DeserializationComponents<|endoftext|>


Prompt:
* @param moduleName The name of the module being serialized to be written into the KLIB header.
 * @param irModuleFragment The IR to be serialized into the KLIB being produced, or `null` if this is going to be a metadata-only KLIB.
 * @param configuration Used to determine certain serialization parameters and enable/disable serialization diagnostics.

Response:
* @param diagnosticReporter Used for reporting serialization-time diagnostics, for example, about clashing IR signatures.
 * @param compatibilityMode The information about KLIB ABI.
 * @param cleanFiles In the case of incremental compilation, the list of files that were not changed and therefore don't need to be
 *     serialized again.
 * @param dependencies The list of KLIBs that the KLIB being produced depends on.<|endoftext|>


Prompt:
val bodyBlock = convertToBlock(bodyStatement)
        jsCondition = JsBooleanLiteral(true)

        if (doWhile) {
            // translate to: tmpSecondRun = false;
            // do { if(tmpSecondRun) { <expr> if(!tmpExprVar) break; } else tmpSecondRun=true; <body> } while(true)

Response:
val secondRun = context.defineTemporary(JsBooleanLiteral(false).source(expression))
            conditionBlock.statements.add(breakIfConditionIsFalseStatement)
            val ifStatement = JsIf(secondRun, conditionBlock, assignment(secondRun, JsBooleanLiteral(true)).source(expression).makeStmt())<|endoftext|>


Prompt:
private fun testMultipleFrameworksImpl(testName: String, freeCompilerArgs: List<String>, checks: TestRunChecks) {
        Assumptions.assumeTrue(targets.testTarget.family.isAppleFamily)

        val testDir = testSuiteDir.resolve("multiple")
        val framework1Dir = testDir.resolve("framework1")

Response:
val sharedDir = testDir.resolve("shared")
        val moduleNameFirst = "First"
        val testCase1 = generateObjCFrameworkTestCase(
            TestKind.STANDALONE_NO_TR, extras, moduleNameFirst,
            listOf(
                framework1Dir.resolve("first.kt"),
                framework1Dir.resolve("test.kt"),<|endoftext|>


Prompt:
project.tasks.whenObjectAdded { throw TestException() }
        assertFails { project.evaluate() }

        /* Project has failed: Lifecycle finished. We can still access futures! */
        run {
            /* Failure state is still in 'EvaluateBuildscript' Stage */
            assertEquals(EvaluateBuildscript, project.kotlinPluginLifecycle.stage)

Response:
/* None of the coroutines before was executed */
            assertEquals(emptyList(), executed)

            /* Access configurationResult future as .getOrThrow */
            val result = project.configurationResult.getOrThrow()
            assertIsInstance<ProjectConfigurationResult.Failure>(result)

            /* Access configurationResult future as .future {} */<|endoftext|>


Prompt:
0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,
            0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff0000000000000UL,     0xfff0000000000000UL,

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


Prompt:
// test 1: PTV is in consuming position (yield-case)
fun testYield() {
    fun testTypeInfoOriginInsideLocalClass() {
        val buildee = build {
            class Local<T> {
                fun localOnlyFunc(): T = UserKlass() as T

                fun initialize() {
                    reference = Local<T>()

                    val arg: Local<T> = Local()

Response:
yield(arg)
                }
            }
            Local<UserKlass>().initialize()
        }
        val result = buildee.typeArgumentValue.localOnlyFunc()
        <!DEBUG_INFO_EXPRESSION_TYPE("T")!>result<!>
    }

    fun testThisExpression() {
        val buildee = build {
            class Local<T> {<|endoftext|>


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

/*

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

/*
 * TESTCASE NUMBER: 1
 * ISSUES: KT-8819
 */<|endoftext|>


Prompt:
fun <T> Case1.emptyArray(): Array<T> = TODO()

public fun <T> emptyArray(): Array<T> = TODO()

// FILE: TestCase2.kt
// TESTCASE NUMBER: 2
package testsCase2
import libPackageCase2.*
import libPackageCase2Explicit.emptyArray

class Case2(){

Response:
fun <T> emptyArray(): Array<T> = TODO()

    val emptyArray: A
        get() = A()

    fun case1() {
        fun <T> Case2.emptyArray(): Array<T> = TODO()<|endoftext|>


Prompt:
class A {
    val a = 1
    fun calc () : Int {
        class B() {
            val b = 2
            inner class C {
                val c = 3
                fun calc() = this@A.a + this@B.b + this.c
            }
        }
        return B().C().calc()
    }
}

fun box() : String {

Response:
return if (A().calc() == 6) "OK" else "fail"
}<|endoftext|>


Prompt:
is FirEnumEntrySymbol -> {
                        KtEnumEntryAnnotationValue(resolvedSymbol.callableId, sourcePsi)
                    }

                    else -> null
                }
            }

            is FirPropertyAccessExpression -> {
                val reference = calleeReference as? FirResolvedNamedReference ?: return null
                when (val resolvedSymbol = reference.resolvedSymbol) {

Response:
is FirEnumEntrySymbol -> {
                        KtEnumEntryAnnotationValue(resolvedSymbol.callableId, sourcePsi)
                    }

                    else -> null
                }
            }

            is FirEnumEntryDeserializedAccessExpression -> KtEnumEntryAnnotationValue(CallableId(enumClassId, enumEntryName), sourcePsi)

            is FirGetClassCall -> {<|endoftext|>


Prompt:
for (delegated in delegatedConstructor.delegatedConstructorCalls) {
            if (delegated is FirLazyDelegatedConstructorCall) {
                return true
            }
        }
    }
    return false
}

private fun calculateLazyBodiesForField(designation: FirDesignation) {
    val field = designation.target as FirField

Response:
require(field.initializer is FirLazyExpression)

    // 'designation.path.last()' cannot be used here, as for dangling files designation target may be in a different file
    val psi = field.psi?.getStrictParentOfType<KtClassOrObject>()

    val newField = revive<FirField>(designation, psi)<|endoftext|>


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

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


Prompt:
import org.jetbrains.kotlin.gradle.plugin.mpp.*
import org.jetbrains.kotlin.gradle.plugin.usesPlatformOf
import org.jetbrains.kotlin.gradle.targets.KotlinTargetSideEffect

Response:
import org.jetbrains.kotlin.gradle.targets.native.internal.CInteropKlibLibraryElements.cinteropKlibLibraryElements
import org.jetbrains.kotlin.gradle.tasks.CInteropProcess
import org.jetbrains.kotlin.gradle.utils.*
import org.jetbrains.kotlin.gradle.utils.createConsumable<|endoftext|>


Prompt:
} else {
                    lastVariableIfCanCacheLast = null
                    lastExpression = last
                }

                val (tmpStepVar, tmpStepExpression) =
                    createLoopTemporaryVariableIfNecessary(
                        ensureNotNullable(headerInfo.step.asStepType()),
                        nameHint = "step",
                        irType = stepClass.defaultType
                    )

Response:
stepVariable = tmpStepVar
                stepExpression = tmpStepExpression
            }
        }
    }

    private fun DeclarationIrBuilder.ensureNotNullable(expression: IrExpression) =
        if (expression.type is IrSimpleType && expression.type.isNullable()) {
            irImplicitCast(expression, expression.type.makeNotNull())
        } else {
            expression
        }<|endoftext|>


Prompt:
BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> descriptorExtension.declareSimpleFunctionFromLinker(descriptor as FunctionDescriptor, idSignature) { s: IrSimpleFunctionSymbol ->
                    generateIrIfNeeded(s, file)
                    s.owner
                }

Response:
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> descriptorExtension.declarePropertyFromLinker(descriptor as PropertyDescriptor, idSignature) { s: IrPropertySymbol ->
                    generateIrIfNeeded(s, file)
                    s.owner
                }
                // TODO: better error message?<|endoftext|>


Prompt:
v.pop() // -> size, parcel, arr, index
        v.dup2X1() // -> size, arr, index, parcel, arr, index
        v.invokevirtual(asmType.internalName, "valueAt", "(I)${valueType.descriptor}", false) // -> size, arr, index, parcel, value
        valueSerializer.writeValue(v) // -> size, arr, index

Response:
v.aconst(1) // -> size, arr, index, (1)
        v.add(Type.INT_TYPE) // -> size, arr, (index + 1)
        v.dup2X1() // -> arr, (index + 1), size, arr, (index + 1)
        v.pop2() // -> arr, (index + 1), size<|endoftext|>


Prompt:
shouldBeSerializable: Boolean,
        requiredBridges: Collection<IrSimpleFunction>,
        dynamicCall: IrCall
    ): IrCall {
        val samMethodType = jvmOriginalMethodType(samMethodSymbol)
        val implFunRawRef = irRawFunctionReference(context.irBuiltIns.anyType, implFunSymbol)
        val instanceMethodType = jvmOriginalMethodType(instanceMethodSymbol)

Response:
var bootstrapMethod = jdkMetafactoryHandle
        val bootstrapMethodArguments = arrayListOf<IrExpression>(
            samMethodType,
            implFunRawRef,
            instanceMethodType
        )
        var bridgeMethodTypes = emptyList<IrExpression>()

        var flags = 0

        if (shouldBeSerializable) {
            flags += LambdaMetafactory.FLAG_SERIALIZABLE<|endoftext|>


Prompt: fun clang_indexSourceFileFullArgv(arg0: CXIndexAction?, client_data: CXClientData?, index_callbacks: CValuesRef<IndexerCallbacks>?, index_callbacks_size: Int, index_options: Int, source_filename: String?, command_line_args: CValuesRef<CPointerVar<ByteVar>>?, num_command_line_args: Int, unsaved_files:

Response: CValuesRef<CXUnsavedFile>?, num_unsaved_files: Int, out_TU: CValuesRef<CXTranslationUnitVar>?, TU_options: Int): Int {<|endoftext|>


Prompt:
status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)

                                    val delegatedEntrySelfType = buildResolvedTypeRef {
                                        type =
                                            ConeClassLikeTypeImpl(
                                                this@buildAnonymousObject.symbol.toLookupTag(),
                                                emptyArray(),
                                                isNullable = false
                                            )
                                    }

Response:
registerSelfType(delegatedEntrySelfType)

                                    superTypeRefs += delegatedEnumSelfTypeRef
                                    val superTypeCallEntry = superTypeListEntries.firstIsInstanceOrNull<KtSuperTypeCallEntry>()
                                    val correctedEnumSelfTypeRef = buildResolvedTypeRef {<|endoftext|>


Prompt:
private fun getArrayOfSymbol(arrayOfName: Name): FirNamedFunctionSymbol? {
        return session.symbolProvider
            .getTopLevelFunctionSymbols(StandardNames.BUILT_INS_PACKAGE_FQ_NAME, arrayOfName)
            .firstOrNull() // TODO: it should be single() after KTIJ-26465 is fixed
    }

Response:
fun resolveCallableReferenceWithSyntheticOuterCall(
        callableReferenceAccess: FirCallableReferenceAccess,
        expectedTypeRef: FirTypeRef?,
        context: ResolutionContext,
        resolutionMode: ResolutionMode,
    ): FirCallableReferenceAccess {
        val argumentList = buildUnaryArgumentList(callableReferenceAccess)

        val parameterTypeRef =
            when {<|endoftext|>


Prompt:
* Retains only elements of this [MutableCollection] that are contained in the given [elements] sequence.
 */
public fun <T> MutableCollection<in T>.retainAll(elements: Sequence<T>): Boolean {
    val list = elements.toList()
    if (list.isNotEmpty())
        return retainAll(list)
    else
        return retainNothing()
}

Response:
private fun MutableCollection<*>.retainNothing(): Boolean {
    val result = isNotEmpty()
    clear()
    return result
}

/**
 * Removes all elements from this [MutableIterable] that match the given [predicate].
 *
 * @return `true` if any element was removed from this collection, or `false` when no elements were removed and collection was not modified.
 */<|endoftext|>


Prompt:
expression.typeOperand = transformType(expression, expression.typeOperand, data)
        return super.visitTypeOperator(expression, data)
    }

    override fun visitVararg(expression: IrVararg, data: D): IrExpression {
        expression.varargElementType = transformType(expression, expression.varargElementType, data)
        return super.visitVararg(expression, data)

Response:
}
}<|endoftext|>


Prompt:
public val Double.days: Duration get() = toDuration(DurationUnit.DAYS)

/** Returns a duration whose value is the specified [duration] value multiplied by this number. */
@SinceKotlin("1.6")
@WasExperimental(ExperimentalTime::class)
@kotlin.internal.InlineOnly
public inline operator fun Int.times(duration: Duration): Duration = duration * this

/**

Response:
* Returns a duration whose value is the specified [duration] value multiplied by this number.
 *
 * The operation may involve rounding when the result cannot be represented exactly with a [Double] number.
 *
 * @throws IllegalArgumentException if the operation results in a `NaN` value.
 */
@SinceKotlin("1.6")
@WasExperimental(ExperimentalTime::class)<|endoftext|>


Prompt:
*   This exception is passed to [onError] for handling.
 * @throws FileSystemException if the source subtree contains an entry with an illegal name such as "." or "..".
 *   This exception is passed to [onError] for handling.
 * @throws FileSystemLoopException if the recursive copy reaches a cycle.
 *   This exception is passed to [onError] for handling.

Response:
* @throws SecurityException if a security manager is installed and access is not permitted to an entry in the source or target subtree.
 *   This exception is passed to [onError] for handling.
 */
@ExperimentalPathApi
@SinceKotlin("1.8")
public fun Path.copyToRecursively(
    target: Path,<|endoftext|>


Prompt:
if (values.any { value -> value.kind == SYNTHESIZED && value.containingClass?.isData == true }) {
            return null
        }

        val returnType = returnTypeCommonizer(values) ?: return null

        val unsafeNumberAnnotation = createUnsafeNumberAnnotationIfNecessary(
            classifiers.classifierIndices.targets, settings,

Response:
inputDeclarations = values,
            inputTypes = values.map { it.returnType },
            commonizedType = returnType,
        )

        val annotations = AnnotationsCommonizer.commonize(values.map { it.annotations }).orEmpty()
            .plus(listOfNotNull(unsafeNumberAnnotation))

        return FunctionOrProperty(
            name = values.first().name,<|endoftext|>


Prompt:
js("{ var a = ${ONE}; }")
    js("{ var a = ${UONE}; }")
    js("{ var a = ${HALF}; }")
    js("{ var a = ${TRUE}; }")
    js("{ var a = '${STR}'; }")
    js("{ var a = '${CHAR}'; }")
}

fun testArithmeticOperations() {

Response:
js("{ var a = ${1 + 2}; }")
    js("{ var a = ${1 - 2}; }")
    js("{ var a = ${1 * 2}; }")
    js("{ var a = ${1 / 2}; }")
    js("{ var a = ${1 % 2}; }")
    js("{ var a = ${1.1 + 2.1}; }")<|endoftext|>


Prompt:
+field("dispatchReceiver", expression, nullable = true, withReplace = true).withTransform()
            +field("calleeReference", reference, withReplace = true)
            +field("source", sourceElementType, nullable = true, withReplace = true)
            generateBooleanFields("this", "super")
        }

        multiDelegatedConstructorCall.configure {

Response:
+fieldList("delegatedConstructorCalls", delegatedConstructorCall, withReplace = true).withTransform()
        }

        valueParameter.configure {
            +symbol("FirValueParameterSymbol")
            +field("defaultValue", expression, nullable = true, withReplace = true)
            +field("containingFunctionSymbol", functionSymbolType.withArgs(TypeRef.Star)).apply {<|endoftext|>


Prompt:
if (x.statement is JsLoop) {
                    statementsLabels[x.statement] = x
                }
                return true
            }

            override fun visit(x: JsLoop, ctx: JsContext<JsNode>): Boolean {
                loopOrSwitchStack.push(x)
                return true
            }

Response:
override fun visit(x: JsSwitch, ctx: JsContext<JsNode>): Boolean {
                loopOrSwitchStack.push(x)
                return true
            }

            fun endVisitLoopOrSwitch(x: JsStatement, ctx: JsContext<JsNode>) {
                val top = loopOrSwitchStack.pop()
                assert(top === x)<|endoftext|>


Prompt:
*   - If the argument is infinite, then the result is an infinity with the same sign as the argument.
 *   - If the argument is zero, then the result is a zero with the same sign as the argument.
 */
@SinceKotlin("1.8")
@WasExperimental(ExperimentalStdlibApi::class)
public expect fun cbrt(x: Float): Float

// extensions

/**

Response:
* Raises this value to the power [x].
 *
 * Special cases:
 *   - `b.pow(0.0)` is `1.0`
 *   - `b.pow(1.0) == b`
 *   - `b.pow(NaN)` is `NaN`<|endoftext|>


Prompt:
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.diagnostics.impl.BaseDiagnosticsCollector
import org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory
import org.jetbrains.kotlin.psi

Response:
import org.jetbrains.kotlin.scripting.definitions.MessageReporter
import kotlin.reflect.KMutableProperty1
import kotlin.reflect.jvm.javaField
import kotlin.script.experimental.api.ResultWithDiagnostics
import kotlin.script.experimental.api.ScriptDiagnostic
import kotlin.script.experimental.api.SourceCode<|endoftext|>


Prompt:
val addedBenchmarks = report.addedBenchmarks
        val removedBenchmarks = report.removedBenchmarks
        if (failedBenchmarks.isEmpty()) {
            append("All benchmarks passed!")
        }
        if (!failedBenchmarks.isEmpty() || !addedBenchmarks.isEmpty() || !removedBenchmarks.isEmpty()) {
            printBucketInfo(failedBenchmarks, "Failed benchmarks")

Response:
printBucketInfo(addedBenchmarks, "Added benchmarks")
            printBucketInfo(removedBenchmarks, "Removed benchmarks")
        }
        append("Total becnhmarks number: ${report.benchmarksNumber}")
        append()
    }

    fun renderPerformanceSummary(report: SummaryBenchmarksReport) {<|endoftext|>


Prompt: manyFoo(s = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>a<!>)

Response: manyFoo(v = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>a as Int<!>)<|endoftext|>


Prompt:
} else {
                    elementFactory.createTypeFromText(
                        /* text = */ "${StandardClassIds.EnumEntries.asFqNameString()}<${enumClass.qualifiedName}>",
                        /* context = */ enumClass,
                    )
                }
                type.annotate { arrayOf(makeNotNullAnnotation(enumClass)) }
            }
        }
    }

Response:
private val parameterList = LightParameterListBuilder(manager, language).apply {
        if (kind == Kind.VALUE_OF) {
            val stringType = PsiType.getJavaLangString(manager, GlobalSearchScope.allScope(project))
            val valueParameter =
                object : LightParameter(
                    DEFAULT_VALUE_PARAMETER.identifier,
                    stringType,
                    this,
                    language,<|endoftext|>


Prompt:
@Suppress("DEPRECATION")
    @Deprecated("Use toolOptions to configure the task")
    @get:Internal
    val languageSettings: LanguageSettings = compilation.defaultSourceSet.languageSettings

    @Suppress("unused")
    @get:Input
    protected val konanCacheKind: Provider<NativeCacheKind> = objectFactory.providerWithLazyConvention {

Response:
project.getKonanCacheKind(konanTarget)
    }

    @Suppress("unused")
    @get:Input
    internal val useEmbeddableCompilerJar: Boolean = project.nativeUseEmbeddableCompilerJar

    @Suppress("unused", "UNCHECKED_CAST")
    @Deprecated(
        "Use toolOptions.freeCompilerArgs",<|endoftext|>


Prompt:
fun testDefaultSourceSetsDsl() = with(Project("sample-lib", gradleVersion, "new-mpp-lib-and-app")) {
        setupWorkingDir()

        val testOutputPrefix = "# default source set "
        val testOutputRegex = Regex("${Regex.escape(testOutputPrefix)} (.*?) (.*?) (.*)")

        gradleBuildScript().appendText(

Response:
"\n" + """
            kotlin.targets.each { target ->
                target.compilations.each { compilation ->
                    println "$testOutputPrefix ${'$'}{target.name} ${'$'}{compilation.name} ${'$'}{compilation.defaultSourceSet.name}"
                }
            }
            """.trimIndent()
        )

        build {<|endoftext|>


Prompt:
//       disclaimer in the documentation and/or other materials provided
//       with the distribution.
//     * Neither the name of Google Inc. nor the names of its
//       contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

Response:
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<|endoftext|>


Prompt:
isStringExtension && symbol.fir.valueParameters.singleOrNull { it.returnTypeRef.coneType.isNullableAny } != null
        }
        findFunction(firFunction)
    }

    override val memberStringPlus: IrSimpleFunctionSymbol by lazy {
        val firFunction = findFirMemberFunctions(StandardClassIds.String, OperatorNameConventions.PLUS).single {

Response:
it.fir.valueParameters.singleOrNull()?.returnTypeRef?.coneType?.isNullableAny == true
        }
        findFunction(firFunction)
    }

    override val arrayOf: IrSimpleFunctionSymbol by lazy {
        // distinct() is needed because we can get two Fir symbols for arrayOf function (from builtins and from stdlib)<|endoftext|>


Prompt:
fun foo()
fun @[a] foo()
fun @[a] T.foo()
fun @[a] T.foo(a : foo) : bar
fun @[a()] T.foo<T :  (a) -> b>(a : foo) : bar

fun foo();
fun @[a] foo();
fun @[a] T.foo();

Response:
fun @[a] T.foo(a : foo) : bar;
fun @[a()] T.foo<T :  (a) -> b>(a : foo) : bar;

fun foo() {}
fun @[a] foo() {}
fun @[a] T.foo() {}
fun @[a] T.foo(a : foo) : bar {}<|endoftext|>


Prompt:
while (nextIndex != -1 && count < expectedRepetitionTimes + 1) {
        count++
        currentOffset = nextIndex + expectedSubString.length
        nextIndex = output.indexOf(expectedSubString, currentOffset)
    }

    assert(count == expectedRepetitionTimes) {
        printBuildOutput()
        "Build output contains \"$expectedSubString\" $count times"
    }
}

Response:
/**
 * Asserts Gradle output does not contain [notExpectedSubString] string.
 *
 * @param wrappingCharsCount amount of chars to include before and after [notExpectedSubString] occurrence
 */
fun BuildResult.assertOutputDoesNotContain(
    notExpectedSubString: String,
    wrappingCharsCount: Int = 100,
) {<|endoftext|>


Prompt:
// This file was generated automatically. See compiler/ir/ir.tree/tree-generator/ReadMe.md.
// DO NOT MODIFY IT MANUALLY.

package org.jetbrains.kotlin.ir.expressions

import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor

Response:
/**
 * Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.throw]
 */
abstract class IrThrow : IrExpression() {
    abstract var value: IrExpression

    override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
        visitor.visitThrow(this, data)<|endoftext|>


Prompt:
val b = <!DEBUG_INFO_EXPRESSION_TYPE("Inv<out Out<Out<Out<Out<Out<kotlin.Int?>?>?>?>?>?>? & Inv<out Out<Out<Out<Out<Out<kotlin.Int?>?>?>?>?>?>")!>a<!>.get()
        if (b != null) {

Response:
val c = <!DEBUG_INFO_EXPRESSION_TYPE("Out<Out<Out<Out<Out<kotlin.Any?>?>?>?>?>? & Out<Out<Out<Out<Out<kotlin.Any?>?>?>?>?>")!>b<!>.get()
            if (c != null) {<|endoftext|>