Prompt:
override fun getCallableSymbols(nameFilter: KtScopeNameFilter): Sequence<KtCallableSymbol> = withValidityAssertion {
        firScope.getCallableSymbols(getPossibleCallableNames().filter(nameFilter), builder)
    }

Response:
override fun getCallableSymbols(names: Collection<Name>): Sequence<KtCallableSymbol> = withValidityAssertion {
        firScope.getCallableSymbols(names, builder)
    }

    override fun getClassifierSymbols(nameFilter: KtScopeNameFilter): Sequence<KtClassifierSymbol> = withValidityAssertion {<|endoftext|>


Prompt:
propertyAnnotations: List<FirAnnotation> = property.annotations,
        backingFieldAnnotations: List<FirAnnotation> = property.backingField?.annotations.orEmpty(),
    ): AnnotationsPosition?

    object Default : FirAnnotationsPlatformSpecificSupportComponent() {
        override val requiredAnnotationsWithArguments = setOf(
            StandardClassIds.Annotations.Deprecated,

Response:
StandardClassIds.Annotations.Target,
        )

        override val requiredAnnotations = requiredAnnotationsWithArguments + setOf(
            StandardClassIds.Annotations.DeprecatedSinceKotlin,
            StandardClassIds.Annotations.SinceKotlin,
            StandardClassIds.Annotations.WasExperimental,
        )

        override val volatileAnnotations = setOf(<|endoftext|>


Prompt:
irIfThenElse(context.irBuiltIns.intType, value, irInt(1), irInt(0))
            } else {
                val conversion = parcelType.classOrNull!!.functions.first { function ->
                    function.owner.name.asString() == "toInt"
                }
                irCall(conversion).apply { dispatchReceiver = value }
            }
        )
}

Response:
// Wraps a non-null aware parceler to handle nullable types.
class IrNullAwareParcelSerializer(private val serializer: IrParcelSerializer) : IrParcelSerializer {
    override fun AndroidIrBuilder.readParcel(parcel: IrValueDeclaration): IrExpression {
        val nonNullResult = readParcelWith(serializer, parcel)
        return irIfThenElse(<|endoftext|>


Prompt:
// TODO change scope according to the bound value in the when header

        val subjectExpression = expression.subjectExpression
        val subjectVariable = expression.subjectVariable

        val subject = when {
            subjectVariable != null ->
                processVariableSubject(subjectVariable, contextBeforeSubject)

            subjectExpression != null ->
                Subject.Expression(
                    subjectExpression,

Response:
facade.getTypeInfo(subjectExpression, contextBeforeSubject),
                    components.dataFlowValueFactory
                )

            else ->
                Subject.None()
        }

        val contextAfterSubject = run {
            var result = contextBeforeSubject
            subject.scopeWithSubject?.let { result = result.replaceScope(it) }<|endoftext|>


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

            val outerThisValueParameter = buildValueParameter(this) {
                origin = JvmLoweredDeclarationOrigin.FIELD_FOR_OUTER_THIS

Response:
name = Name.identifier(AsmUtil.CAPTURED_THIS_FIELD)
                index = 0
                type = oldConstructor.parentAsClass.parentAsClass.defaultType
            }
            valueParameters = listOf(outerThisValueParameter) + oldConstructor.valueParameters.map { it.copyTo(this, index = it.index + 1) }
            metadata = oldConstructor.metadata
        }<|endoftext|>


Prompt:
return when (branchExpr) {
                    is IrWhen -> checkForPrimitiveOrPattern(branchExpr, constants)
                    is IrCall -> when (val constant = tryToExtractEqeqeqConst(branchExpr)) {
                        null -> false
                        else -> {
                            constants += constant
                            true
                        }
                    }
                    else -> false
                }
            }

Response:
if (!checkBranchIsOrPattern(thenBranch.result, thenBranch.condition)) return false
            if (!checkBranchIsOrPattern(elseBranch.condition, elseBranch.result)) return false

            return true
        }

        var caseCount = 0

        l@ for (branch in expression.branches) {
            when (val condition = branch.condition) {<|endoftext|>


Prompt:
if (!(0F in 1.0F..3.0F) != !range0.contains(0F)) throw AssertionError()
    if (!(0F !in 1.0F..3.0F) != range0.contains(0F)) throw AssertionError()
    // no local optimizations

Response:
if (element2 in 1.0F..3.0F != range0.contains(element2)) throw AssertionError()
    if (element2 !in 1.0F..3.0F != !range0.contains(element2)) throw AssertionError()<|endoftext|>


Prompt:
fun deserializeAnnotation(proto: ProtoConstructorCall): IrConstructorCall {
        val irType = IrAnnotationType()
        // TODO: use real coordinates
        return deserializeConstructorCall(proto, 0, 0, irType).also { irType.irConstructorCall = it }
    }

Response:
private fun deserializeConstructorCall(proto: ProtoConstructorCall, start: Int, end: Int, type: IrType): IrConstructorCall {
        val symbol = deserializeTypedSymbol<IrConstructorSymbol>(proto.symbol, CONSTRUCTOR_SYMBOL)
        return IrConstructorCallImpl(
            start, end, type,<|endoftext|>


Prompt:
val targetSymbol = candidate?.symbol
            ?: calleeReference.toResolvedBaseSymbol()
            ?: return null
        if (targetSymbol !is FirCallableSymbol<*>) return null
        if (targetSymbol is FirErrorFunctionSymbol || targetSymbol is FirErrorPropertySymbol) return null
        val unsubstitutedKtSignature = targetSymbol.toKtSignature()

Response:
handleCompoundAccessCall(psi, fir, resolveFragmentOfCall)?.let { return it }

        var firstArgIsExtensionReceiver = false
        var isImplicitInvoke = false

        // TODO: Ideally, we should get the substitutor from the candidate. But it seems there is no way to get the substitutor from the<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.FirExpression
import org.jetbrains.kotlin.fir.render
import org.jetbrains.kotlin.fir.types.ConeTypeVariable
import org.jetbrains.kotlin.fir.types.FirTypeProjection

Response:
import org.jetbrains.kotlin.resolve.calls.inference.model.*
import org.jetbrains.kotlin.types.model.TypeVariableMarker

class ConeDeclaredUpperBoundConstraintPosition : DeclaredUpperBoundConstraintPosition<Nothing?>(null) {
    override fun toString(): String = "DeclaredUpperBound"
}<|endoftext|>


Prompt:
import kotlin.io.path.extension
import kotlin.streams.asSequence
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.config.CompilerConfiguration

Response:
import org.jetbrains.kotlin.idea.KotlinLanguage
import kotlin.io.path.name
import kotlin.io.path.readText

object ExperimentalOptInUsageInSourceChecker {
    fun checkExperimentalOptInUsage(srcRoots: List<Path>): List<ExperimentalAnnotationUsage> {
        val project = createProjectForParsing()
        try {<|endoftext|>


Prompt:
assertEquals(true, isInstance<Long>(0.toLong()))
    assertEquals(true, isInstance<Double>(0.toDouble()))
    assertEquals(true, isInstance<Float>(0.toFloat()))

    assertEquals(true, isInstance<Number>(0))
    assertEquals(true, isInstance<Number>(0.toLong()))

Response:
assertEquals(true, isInstance<Number>(0.0))
    assertEquals(false, isInstance<Number>("0"))

    assertEquals(true, isInstance<Int?>(0), "isInstance<Int?>(0)")
    assertEquals(true, isInstance<Int?>(null), "isInstance<Int?>(null)")<|endoftext|>


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

import androidx.compose.runtime.Applier
import androidx.compose.runtime.Composer
import androidx.compose.runtime.Composition
import androidx.compose.runtime.MonotonicFrameClock
import androidx.compose.runtime.Recomposer
import kotlinx.coroutines.CoroutineScope

Response:
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.intellij.lang.annotations.Language<|endoftext|>


Prompt:
override fun getReferencedClass(symbol: IrClassSymbol): IrClassSymbol = symbol

        override fun getReferencedScript(symbol: IrScriptSymbol): IrScriptSymbol = symbol

        override fun getReferencedClassOrNull(symbol: IrClassSymbol?): IrClassSymbol? = symbol

Response:
override fun getReferencedEnumEntry(symbol: IrEnumEntrySymbol): IrEnumEntrySymbol = symbol

        override fun getReferencedVariable(symbol: IrVariableSymbol): IrVariableSymbol = symbol

        override fun getReferencedLocalDelegatedProperty(symbol: IrLocalDelegatedPropertySymbol): IrLocalDelegatedPropertySymbol = symbol<|endoftext|>


Prompt:
get() = tasks.withType(KonanCompileTask::class.java).filter { it.enableMultiplatform }

    open class RequestedCommonSourceSet @Inject constructor(private val name: String): Named {
        override fun getName() = name
    }

    override fun addCommonSourceSetToPlatformSourceSet(commonSourceSet: Named, platformProject: Project) {

Response:
val commonSourceSetName = commonSourceSet.name

        platformProject.konanMultiplatformTasks
            .filter { it.commonSourceSets.contains(commonSourceSetName) }
            .forEach { task: KonanCompileTask ->
                getKotlinSourceDirectorySetSafe(commonSourceSet)!!.srcDirs.forEach {
                    task.commonSrcDir(it)
                }<|endoftext|>


Prompt:
fun bar(p: Int): Int
}

// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
actual tailrec fun foo(p: Int): Int = foo(p)
actual tailrec fun bar(p: Int): Int = bar(p)

actual val notReport: String = "123"

actual class A {

Response:
actual tailrec fun foo(p: Int): Int = foo(p)
    actual tailrec fun bar(p: Int): Int = bar(p)
}<|endoftext|>


Prompt:
}

// TESTCASE NUMBER: 6
fun case_6() {
    checkSubtype<Byte>(<!OVERLOAD_RESOLUTION_AMBIGUITY!>-<!><!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000<!>)

Response:
checkSubtype<Short>(<!OVERLOAD_RESOLUTION_AMBIGUITY!>-<!><!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000<!>)
    checkSubtype<Int>(<!OVERLOAD_RESOLUTION_AMBIGUITY!>-<!><!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000<!>)<|endoftext|>


Prompt:
package org.jetbrains.kotlin.metadata.jvm.serialization

import org.jetbrains.kotlin.metadata.deserialization.NameResolver
import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf
import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record

Response:
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolverBase
import org.jetbrains.kotlin.metadata.jvm.deserialization.toExpandedRecordsList
import org.jetbrains.kotlin.metadata.serialization.StringTable<|endoftext|>


Prompt:
val usedLabels = HashSet<LabelNode>()
        val first = insnList.first
        if (first is LabelNode) {
            usedLabels.add(first)
        }
        val last = insnList.last
        if (last is LabelNode) {
            usedLabels.add(last)
        }

Response:
fun addCfgEdgeToLabel(from: AbstractInsnNode, label: LabelNode) {
            usedLabels.add(label)
            cfg.addNonTrivialPredecessor(label, from)
        }

        fun addCfgEdgesToLabels(from: AbstractInsnNode, labels: Collection<LabelNode>) {
            usedLabels.addAll(labels)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.util.addBuildEventsListenerRegistryMock
import org.jetbrains.kotlin.gradle.util.checkDiagnostics
import org.jetbrains.kotlin.gradle.util.setMultiplatformAndroidSourceSetLayoutVersion
import kotlin.test.*

class MultiplatformAndroidSourceSetLayoutV1Test {

Response:
private lateinit var project: ProjectInternal
    private lateinit var kotlin: KotlinMultiplatformExtension
    private lateinit var android: LibraryExtension

    @BeforeTest
    fun setup() {
        project = ProjectBuilder.builder().build() as ProjectInternal
        addBuildEventsListenerRegistryMock(project)
        project.setMultiplatformAndroidSourceSetLayoutVersion(1)<|endoftext|>


Prompt:
tree.annotations().map { TreeBasedAnnotation(it, compilationUnit, javac, containingClass) } }

    override fun findAnnotation(fqName: FqName) =
            annotations
                    .filter { it.annotation.annotationType.toString().endsWith(fqName.shortName().asString()) }

Response:
.find { it.classId.asSingleFqName() == fqName }

}<|endoftext|>


Prompt:
val result = copyOfUninitializedElements(index + 1)
    result[index] = element
    return result
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
public actual operator fun ByteArray.plus(element: Byte): ByteArray {
    val index = size
    val result = copyOfUninitializedElements(index + 1)

Response:
result[index] = element
    return result
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
public actual operator fun ShortArray.plus(element: Short): ShortArray {
    val index = size
    val result = copyOfUninitializedElements(index + 1)
    result[index] = element
    return result
}

/**<|endoftext|>


Prompt:
* Rotates the binary representation of this [UShort] number left by the specified [bitCount] number of bits.
 * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
 *
 * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:

Response:
* `number.rotateLeft(-n) == number.rotateRight(n)`
 *
 * Rotating by a multiple of [UShort.SIZE_BITS] (16) returns the same number, or more generally
 * `number.rotateLeft(n) == number.rotateLeft(n % 16)`
 */
@SinceKotlin("1.6")<|endoftext|>


Prompt:
import java.io.File
import java.util.*
import java.util.regex.MatchResult

abstract class AbstractWriteSignatureTest : CodegenTestCase() {
    override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
        val isIgnored = InTextDirectivesUtils.isIgnoredTarget(backend, wholeFile)
        compile(files)

Response:
try {
            parseExpectations(wholeFile).check()
        } catch (e: Throwable) {
            if (!isIgnored) {
                println(classFileFactory.createText())
            }
            throw e
        }
    }

    private class SignatureExpectation(
        val header: String,
        val name: String,
        val expectedJvmSignature: String?,<|endoftext|>


Prompt:
inline class SomeIC(val a: Int)

external val l: <!INLINE_CLASS_IN_EXTERNAL_DECLARATION!>SomeIC<!>

external val ll
    get(): <!INLINE_CLASS_IN_EXTERNAL_DECLARATION!>SomeIC<!> = definedExternally

Response:
external var r: <!INLINE_CLASS_IN_EXTERNAL_DECLARATION!>SomeIC<!>

external var rr: <!INLINE_CLASS_IN_EXTERNAL_DECLARATION!>SomeIC<!>
    get() = definedExternally<|endoftext|>


Prompt:
if (set.add(key))
            list.add(e)
    }
    return list
}

/**
 * Returns a set containing all elements that are contained by both this collection and the specified collection.
 *
 * The returned set preserves the element iteration order of the original collection.
 *
 * To get a set containing all elements that are contained at least in one of these collections use [union].
 */

Response:
public infix fun <T> Iterable<T>.intersect(other: Iterable<T>): Set<T> {
    val set = this.toMutableSet()
    set.retainAll(other)
    return set
}

/**
 * Returns a set containing all elements that are contained by this collection and not contained by the specified collection.
 *
 * The returned set preserves the element iteration order of the original collection.<|endoftext|>


Prompt:
suspend inline fun test(controller: Controller, c: () -> Unit =  { controller.res = "OK" }) {
    c()
}

// FILE: box.kt
import kotlin.coroutines.*
import helpers.*

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

fun box() : String {
    builder() {

Response:
test(defaultController)
    }
    return defaultController.res
}<|endoftext|>


Prompt:
// WITH_STDLIB

interface Wrapper { fun runBlock() }

inline fun crossInlineBuildWrapper(crossinline block: () -> Unit) = object : Wrapper {
    override fun runBlock() {
        block()
    }
}

class Container {
    val wrapper = crossInlineBuildWrapper {
        object { }
    }
}

fun box(): String {

Response:
Container().wrapper.runBlock()
    return "OK"
}<|endoftext|>


Prompt:
override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider) {
        notSupported()
    }

    override fun replaceValueParameters(newValueParameters: List<FirValueParameter>) {
        notSupported()
    }

    override fun replaceContractDescription(newContractDescription: FirContractDescription?) {
        notSupported()
    }

Response:
override fun replaceControlFlowGraphReference(newControlFlowGraphReference: FirControlFlowGraphReference?) {
        notSupported()
    }

    override fun replaceContextReceivers(newContextReceivers: List<FirContextReceiver>) {
        notSupported()
    }

    override fun replaceAnnotations(newAnnotations: List<FirAnnotation>) {
        notSupported()
    }<|endoftext|>


Prompt:
override fun lower(irBody: IrBody, container: IrDeclaration) {
        if (!skip(container)) {
            irBody.transformChildrenVoid(Transformer(container.symbol))
        }
    }

    private inner class Transformer(val parent: IrSymbol) : IrElementTransformerVoid() {
        override fun visitBody(body: IrBody): IrBody = body

Response:
override fun visitCall(expression: IrCall): IrExpression =
            if (expression.type.isNothing()) {
                // Replace call 'foo' of type 'kotlin.Nothing' with a block:
                //
                //  {
                //      [ call 'foo' with type: 'kotlin.Unit' ]
                //      call ThrowKotlinNothingValueException(): Nothing
                //  }: Nothing<|endoftext|>


Prompt:
@JvmField
    val LOCAL = Name.special("<local>")

    @JvmField
    val UNDERSCORE_FOR_UNUSED_VAR = Name.special("<unused var>")

    @JvmField
    val IMPLICIT_SET_PARAMETER = Name.special("<set-?>")

    @JvmField

Response:
val ARRAY = Name.special("<array>")

    @JvmField
    val RECEIVER = Name.special("<receiver>")

    /**
     * Kotlin-generated `entries` read-only property
     */
    @JvmField
    val ENUM_GET_ENTRIES = Name.special("<get-entries>")

    /**<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion
import org.jetbrains.kotlin.analysis.api.symbols.KtClassKind
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolKind
import org.jetbrains.kotlin.descriptors.Modality

Response:
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.fir.declarations.FirDeclarationStatus
import org.jetbrains.kotlin.fir.declarations.utils.*
import org.jetbrains.kotlin.fir.extensions.extensionService<|endoftext|>


Prompt:
// TODO(174715171): capture actual values for testing
            .replace(
                Regex(
                    "traceEventStart\\(-?\\d+, (%dirty|%changed|-1), (%dirty1|%changed1|-1), (.*)"
                )
            ) {
                when (truncateTracingInfoMode) {
                    TruncateTracingInfoMode.TRUNCATE_KEY ->

Response:
"traceEventStart(<>, ${it.groupValues[1]}, ${it.groupValues[2]}, <>)"

                    TruncateTracingInfoMode.KEEP_INFO_STRING ->
                        "traceEventStart(<>, ${it.groupValues[1]}, ${it.groupValues[2]}, " +
                            it.groupValues[3]
                }
            }<|endoftext|>


Prompt:
*/
public fun FloatArray.toMutableList(): MutableList<Float> {
    val list = ArrayList<Float>(size)
    for (item in this) list.add(item)
    return list
}

/**
 * Returns a new [MutableList] filled with all elements of this array.
 */
public fun DoubleArray.toMutableList(): MutableList<Double> {

Response:
val list = ArrayList<Double>(size)
    for (item in this) list.add(item)
    return list
}

/**
 * Returns a new [MutableList] filled with all elements of this array.
 */
public fun BooleanArray.toMutableList(): MutableList<Boolean> {
    val list = ArrayList<Boolean>(size)<|endoftext|>


Prompt:
val i = 348
}

fun foo() {
    if (<!UNRESOLVED_REFERENCE!>i<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>==<!> 3) <!UNRESOLVED_REFERENCE!>f<!>()
}

//FILE:d.kt
package d

import d.A.Companion.B

Response:
import d.A.Companion.C

val b : B = B()
val c : B = C

class A() {
    companion object {
        open class B() {}
        object C : B() {}
    }
}<|endoftext|>


Prompt: 0xbff921fb54442d18UL,     0xbff921fb54442d18UL,     0xbff921fb54437d2cUL,     0xbff921fb5444dd05UL,

Response: 0xbff921fb54442d18UL,     0xbff921fb54442d18UL,     0xbff921fb54442d18UL,     0xbff921fb54442d18UL,<|endoftext|>


Prompt:
open fun isOverlyWide(): Boolean = function?.isOverlyWide() == true

    override fun hashCode() = element.hashCode() * 31
    override fun equals(other: Any?) = other is InferenceNode && other.element == element
}

val IrSimpleFunctionSymbol.isGenericFunction get(): Boolean =

Response:
owner.typeParameters.isNotEmpty() || owner.dispatchReceiverParameter?.type?.let {
        it is IrSimpleType && it.arguments.isNotEmpty()
    } == true

/**
 * An [InferenceCallTargetNode] is a wrapper around an [IrCall] which represents the target of
 * the call, not the call itself. That its type is the type of the target of the call not the<|endoftext|>


Prompt:
constructor(name: JsNameRef, alias: JsName? = null) : this(Element(name, alias))

    sealed class Subject {
        class Elements(val elements: List<Element>) : Subject()
        object All : Subject()
    }

    class Element(val name: JsNameRef, val alias: JsName? = null)

Response:
override fun accept(visitor: JsVisitor) {
        visitor.visitExport(this)
    }

    override fun acceptChildren(visitor: JsVisitor) {
        if (subject is Subject.Elements) {
            subject.elements.forEach {
                visitor.accept(it.name)
            }
        }
    }<|endoftext|>


Prompt:
superMethod.valueParameters.mapTo(lambdaParameters) { superValueParameter ->
            superValueParameter.copySubstituted(lambda, typeSubstitutor, index++)
        }
        return lambdaParameters
    }

    private fun IrValueParameter.copySubstituted(
        function: IrSimpleFunction,
        substitutor: IrTypeSubstitutor,
        newIndex: Int,

Response:
newName: Name = name
    ) =
        buildValueParameter(function) {
            name = newName
            index = newIndex
            type = substitutor.substitute(this@copySubstituted.type)
        }

    private fun JvmIrBuilder.createDelegatingLambdaReference(expression: IrExpression, lambda: IrSimpleFunction): IrFunctionReference {
        return IrFunctionReferenceImpl(<|endoftext|>


Prompt:
@CompileTimeCalculation
open class A {
    open fun String.getSize() = this.length

    fun returnSizeOf(str: String) = str.getSize()
}

@CompileTimeCalculation
class B : A() {
    override fun String.getSize() = -1
}

Response:
const val a = <!EVALUATED: `4`!>A().returnSizeOf("1234")<!>
const val b = <!EVALUATED: `-1`!>B().returnSizeOf("1234")<!><|endoftext|>


Prompt:
val CXPrintingPolicy_SuppressInitializers: CXPrintingPolicyProperty get() = 6

val CXPrintingPolicy_ConstantArraySizeAsWritten: CXPrintingPolicyProperty get() = 7

val CXPrintingPolicy_AnonymousTagLocations: CXPrintingPolicyProperty get() = 8

val CXPrintingPolicy_SuppressStrongLifetime: CXPrintingPolicyProperty get() = 9

Response:
val CXPrintingPolicy_SuppressLifetimeQualifiers: CXPrintingPolicyProperty get() = 10

val CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors: CXPrintingPolicyProperty get() = 11

val CXPrintingPolicy_Bool: CXPrintingPolicyProperty get() = 12

val CXPrintingPolicy_Restrict: CXPrintingPolicyProperty get() = 13<|endoftext|>


Prompt:
private fun StringReader(string: String, offset: Int): Reader {
    val reader = StringReader(string)
    reader.skip(offset.toLong())
    return reader
}

private class AccumulatingReporter : ErrorReporter {
    var hasErrors = false
    val warnings = mutableListOf<Warning>()

Response:
override fun warning(message: String, startPosition: CodePosition, endPosition: CodePosition) {
        warnings += Warning(message, startPosition, endPosition)
    }

    override fun error(message: String, startPosition: CodePosition, endPosition: CodePosition) {
        hasErrors = true
    }<|endoftext|>


Prompt:
// test 1: PTV is in consuming position (yield-case)
        fun testYield() {
            val buildee = build {
                yield(this@ENUM_ENTRY)
            }
            checkTypeEquality(this@ENUM_ENTRY, buildee.typeArgumentValue)
        }

        // test 2: PTV is in producing position (materialize-case)

Response:
fun testMaterialize() {
            val buildee = build {
                fun <T> shareTypeInfo(from: T, to: T) {}
                shareTypeInfo(this@ENUM_ENTRY, materialize())
            }
            checkTypeEquality(this@ENUM_ENTRY, buildee.typeArgumentValue)
        }

        init {
            reference = this@ENUM_ENTRY<|endoftext|>


Prompt:
fun skipCheckingAnnotationsOfActualClassMember(actualMember: DeclarationSymbolMarker): Boolean

    fun findPotentialExpectClassMembersForActual(
        expectClass: RegularClassSymbolMarker,
        actualClass: RegularClassSymbolMarker,
        actualMember: DeclarationSymbolMarker,
    ): Map<out DeclarationSymbolMarker, ExpectActualMatchingCompatibility>

Response:
fun DeclarationSymbolMarker.getSourceElement(): SourceElementMarker

    fun TypeRefMarker.getClassId(): ClassId?

    /**
     * Callback interface to be implemented by caller of [checkAnnotationsOnTypeRefAndArguments].
     */
    fun interface AnnotationsCheckerCallback {
        /**
         * Implementation must check `expect` and `actual` annotations and report diagnostic in case of incompatibility.<|endoftext|>


Prompt:
fun setReturnType(type: CType) {
        require(!::returnType.isInitialized)
        returnType = type
    }

    fun addParameter(type: CType): CVariable {
        val result = CVariable(type, "p${counter++}")
        parameters += result
        return result
    }

    val numberOfParameters: Int get() = parameters.size

Response:
private var counter = 1

    fun getType(): CType = CTypes.function(returnType, parameters.map { it.type }, variadic)

    fun buildSignature(name: String, language: String): String =
        (if (language == "C++") "extern \"C\" const " else "") +
        returnType.render(buildString {
            append(name)
            append('(')<|endoftext|>


Prompt:
topLevelAtoms,
                postponedArguments,
                completionMode,
                topLevelType
            ) != null

            // If there aren't any postponed arguments and ready for fixation variables, then completion isn't needed: nothing to do
            if (postponedArguments.isEmpty() && !isThereAnyReadyForFixationVariable)
                break

            val postponedArgumentsWithRevisableType = postponedArguments

Response:
.filterIsInstanceWithChecker<PostponedAtomWithRevisableExpectedType> {
                    // NB: FE 1.0 does not perform this check
                    it.revisedExpectedType == null
                }
            val dependencyProvider =
                TypeVariableDependencyInformationProvider(notFixedTypeVariables, postponedArguments, topLevelType, this)

            // Stage 2: collect parameter types for postponed arguments<|endoftext|>


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

class FirOuterClassTypeParameterRefImpl @FirImplementationDetail constructor(
    override val source: KtSourceElement?,
    override val symbol: FirTypeParameterSymbol,
) : FirOuterClassTypeParameterRef() {

Response:
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {}

    override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirOuterClassTypeParameterRefImpl {
        return this
    }
}<|endoftext|>


Prompt:
suspend fun suspendHere(r: LongRange): Long = suspendCoroutineUninterceptedOrReturn { x ->
    x.resume(r.start + r.endInclusive)
    COROUTINE_SUSPENDED
}

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

fun box(): String {
    var result = 0L

Response:
builder {
        result = suspendHere(1L..getLong())
    }

    if (result != 1234567890124L) return "fail 1: $result"

    return "OK"
}<|endoftext|>


Prompt:
private const val serialVersionUID: Long = 0L
        }

        private fun readResolve(): Any = Distribution(this)
    }
}

// TODO: Move into K/N?
fun buildDistribution(konanHome: String, konanDataDir: String? = null) = Distribution(konanHome,true, null, konanDataDir = konanDataDir)

Response: fun customerDistribution(konanHome: String, konanDataDir: String? = null) = Distribution(konanHome,false, null, konanDataDir = konanDataDir)<|endoftext|>


Prompt:
c?.resume(Unit)
    if (spilledVariables != setOf("label" to "3", "Z$0" to "false", "L$0" to continuationName, "L$1" to "a2", "L$2" to "b2")) return "FAIL 5: $spilledVariables"
    c?.resume(Unit)

Response:
if (spilledVariables != setOf("label" to "3", "Z$0" to "false", "L$0" to continuationName, "L$1" to "a2", "L$2" to "b2")) return "FAIL 6: $spilledVariables"

    return "OK"
}<|endoftext|>


Prompt:
if (x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.prop_8?.prop_8?.prop_8?.prop_8 != null) {
        <!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8
        <!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8.prop_8
        <!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8.prop_8.prop_8<|endoftext|>


Prompt:
// FIR_DUMP

// explicit types
class A<in T>(t: T) {
    private val t: T = t  // PRIVATE_TO_THIS

    private val i: B = B()

    fun test() {
        val x: T = t      // Ok
        val y: T = this.t // Ok
    }

    fun foo(a: A<String>) {

Response:
val x: String = a.<!INVISIBLE_MEMBER!>t<!> // Invisible!
    }

    fun bar(a: A<*>) {
        a.<!INVISIBLE_MEMBER!>t<!> // Invisible!
    }

    inner class B {
        fun baz(a: A<*>) {
            a.i
        }
    }
}<|endoftext|>


Prompt:
get() = storage.mapTo(ArrayList()) { Z(it) }

    override fun containsKey(key: Z): Boolean = key.x in (0 until size)

    override fun containsValue(value: Z): Boolean = storage.contains(value.x)

    override fun get(key: Z) = storage.getOrNull(key.x)?.let { Z(it) }

Response:
override fun isEmpty(): Boolean = size > 0
}

fun box(): String {
    val zm = ZArrayMap(IntArray(5))

    zm.containsKey(Z(0))
    zm.containsValue(Z(0))
    zm[Z(0)]

    zm.containsKey(object {} as Any)<|endoftext|>


Prompt:
foldTo( destination = mutableMapOf(),
                initialValueSelector = { _, _ -> kotlin.jvm.internal.Ref.IntRef() },
                operation = { _, acc, e -> acc.apply { element += valueSelector(e) } })
        .mapValuesInPlace { it.value.element }
*/

@PublishedApi
@kotlin.internal.InlineOnly

Response:
@Suppress("UNCHECKED_CAST") // tricks with erased generics go here, do not repeat on reified platforms
internal inline fun <K, V, R> MutableMap<K, V>.mapValuesInPlace(f: (Map.Entry<K, V>) -> R): MutableMap<K, R> {
    entries.forEach {<|endoftext|>


Prompt:
llFirComputationSession.recordThatAnnotationsAreResolved(target)

        // 3. Create annotation transformer for targets we want to transform (under read lock)
        // Exit if another thread is already resolved this target
        val annotationTransformer = target.createAnnotationTransformer() ?: return

        // 4. Exit if there are no applicable annotations, so we can just update the phase

Response:
if (annotationTransformer.isNothingToResolve()) {
            return performCustomResolveUnderLock(target) {
                // just update deprecations
                annotationTransformer.publishResult(target)
            }
        }

        // 5. Transform annotations in the air
        annotationTransformer.transformAnnotations()

        // 6. Move some annotations to the proper positions<|endoftext|>


Prompt:
is KtValueParameterSymbol -> variable.generatedPrimaryConstructorProperty
            else -> null
        }

    override fun pointsToTheSameSymbolAs(other: KtSymbolPointer<KtSymbol>): Boolean = this === other ||
            other is KtFirPsiBasedPropertySymbolPointer &&

Response:
other.variableSymbolPointer.pointsToTheSameSymbolAs(variableSymbolPointer)
}<|endoftext|>


Prompt:
val expectedNullableUnitExplicitReturnString: () -> Unit? = <!INITIALIZER_TYPE_MISMATCH!>l@ {
    return@l ""
}<!>

fun expectedFlexibleUnitExplicitReturnString() {
    A.foo = l@ {
        return@l <!RETURN_TYPE_MISMATCH!>""<!>
    }
}

Response:
val expectedNullableUnitExplicitReturnNull: () -> Unit? = l@ {
    return@l null
}

fun expectedFlexibleUnitExplicitReturnNull() {
    A.foo = l@ {
        return@l <!NULL_FOR_NONNULL_TYPE!>null<!>
    }
}

// ============== Lambdas passed as function argument ===============

fun test() {<|endoftext|>


Prompt:
if (androidVersion != null) {
            arguments.add("-Pandroid_tools_version=${androidVersion}")
        }
        arguments.add("-Ptest_fixes_version=${TestVersions.Kotlin.CURRENT}")

        if (buildReport.isNotEmpty()) {

Response:
arguments.add("-Pkotlin.build.report.output=${buildReport.joinToString()}")
        }

        if (usePreciseJavaTracking != null) {
            arguments.add("-Pkotlin.incremental.usePreciseJavaTracking=$usePreciseJavaTracking")
        }

        if (statisticsForceValidation) {<|endoftext|>


Prompt:
configurationTimeMetrics.put(NumericalMetrics.STATISTICS_VISIT_ALL_PROJECTS_OVERHEAD, statisticOverhead)

    return configurationTimeMetrics
}

private fun addTaskMetrics(
    project: Project,
    configurationTimeMetrics: MetricContainer,
) {
    try {
        val taskNames = project.tasks.names.toList()

Response:
configurationTimeMetrics.put(NumericalMetrics.GRADLE_NUMBER_OF_TASKS, taskNames.size.toLong())
        configurationTimeMetrics.put(
            NumericalMetrics.GRADLE_NUMBER_OF_UNCONFIGURED_TASKS,
            taskNames.count { name ->
                try {<|endoftext|>


Prompt:
if (getPackageWithoutDependencies(StandardClassIds.BASE_KOTLIN_PACKAGE) != null
            || moduleData is LLFirModuleData && moduleData.ktModule is KtBuiltinsModule
        ) {
            return dependencyProvider.providers.find { it.session is LLFirBuiltinsAndCloneableSession }
        }

        return null
    }

Response:
private fun ExceptionAttachmentBuilder.withCandidates(candidates: List<FirBasedSymbol<*>>) {
    withEntry("Candidates count", candidates.size.toString())
    for ((index, candidate) in candidates.withIndex()) {
        val ktModule = candidate.llFirModuleData.ktModule
        withEntryGroup(index.toString()) {
            withClassEntry("candidateClass", candidate)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.jps.model.platform
import org.jetbrains.kotlin.jps.statistic.JpsBuilderMetricReporter
import org.jetbrains.kotlin.platform.idePlatformKind

class KotlinUnsupportedModuleBuildTarget(
    kotlinContext: KotlinCompileContext,
    jpsModuleBuildTarget: ModuleBuildTarget

Response:
) : KotlinModuleBuildTarget<BuildMetaInfo>(kotlinContext, jpsModuleBuildTarget) {
    val kind = module.platform?.idePlatformKind?.name

    private fun shouldNotBeCalled(): Nothing = error("Should not be called")

    override fun isEnabled(chunkCompilerArguments: Lazy<CommonCompilerArguments>): Boolean {
        return false
    }<|endoftext|>


Prompt:
fun getPerFileCachedLibraryName(library: KotlinLibrary): String = "${library.uniqueName}-per-file-cache"
        fun getCachedLibraryName(library: KotlinLibrary): String = getCachedLibraryName(library.uniqueName)
        fun getCachedLibraryName(libraryName: String): String = "$libraryName-cache"

Response:
private fun computeLibraryHash(library: KotlinLibrary, librariesHashes: MutableMap<String, FingerprintHash>) =
                librariesHashes.getOrPut(library.uniqueName) {
                    val hashComputer = LibraryHashComputer()
                    hashComputer.digestLibrary(library)
                    hashComputer.digest()
                }

        fun computeVersionedCacheDirectory(
                baseCacheDirectory: File,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.lazy.data.KtClassLikeInfo

interface ClassMemberDeclarationProvider : DeclarationProvider {
    val ownerInfo: KtClassLikeInfo? // is null for synthetic classes/object that don't present in the source code

    val correspondingClassOrObject: KtPureClassOrObject? get() = ownerInfo?.correspondingClassOrObject

Response:
val primaryConstructorParameters: List<KtParameter> get() = ownerInfo?.primaryConstructorParameters ?: emptyList()
    val companionObjects: List<KtObjectDeclaration> get() = ownerInfo?.companionObjects ?: emptyList()
}<|endoftext|>


Prompt:
0xe0001, 0xe0020, 0xe0100,
)
private val caseIgnorableEnd = intArrayOf(

Response: 0x0027, 0x002e, 0x003a, 0x00b7, 0x0387, 0x055f, 0x05f4, 0x2018, 0x2019, 0x2024, 0x2027, 0xfe13, 0xfe52, 0xfe55, 0xff07, 0xff0e, 0xff1a, 0x101fd, 0x102e0,<|endoftext|>


Prompt:
firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtPropertyAccessor>(firDiagnostic, token), KtFirDiagnostic.AccessorForDelegatedProperty

internal class PropertyInitializerWithExplicitFieldDeclarationImpl(
    firDiagnostic: KtPsiDiagnostic,

Response:
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtExpression>(firDiagnostic, token), KtFirDiagnostic.PropertyInitializerWithExplicitFieldDeclaration

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


Prompt:
import org.jetbrains.kotlin.fir.serialization.constant.toConstantValue
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder
import org.jetbrains.kotlin.metadata.deserialization.Flags

Response:
import org.jetbrains.kotlin.metadata.serialization.MutableVersionRequirementTable
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.protobuf.GeneratedMessageLite
import org.jetbrains.kotlin.serialization.SerializerExtensionProtocol

abstract class FirSerializerExtensionBase(<|endoftext|>


Prompt:
CreateDecoysTransformer(
                pluginContext,
                symbolRemapper,
                idSignatureBuilder,
                stabilityInferencer,
                metrics,
            ).lower(moduleFragment)

            SubstituteDecoyCallsTransformer(
                pluginContext,
                symbolRemapper,
                idSignatureBuilder,
                stabilityInferencer,
                metrics,

Response:
).lower(moduleFragment)
        }

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


Prompt:
fun <T: Any> doIn(i: In<T?>) { throw Exception("$i") }
fun <T: Any> doA(i: A<T?>) { throw Exception("$i") }

fun test(out: Out<Int>, i: In<Int>, inv: A<Int>) {
    // T? >: Int => T = Int
    doT(1)

Response:
val r = doOut(out)
    r checkType { _<Int>() }

    // T? <: Int => error
    <!CANNOT_INFER_PARAMETER_TYPE!>doIn<!>(<!ARGUMENT_TYPE_MISMATCH!>i<!>)

    // T? >: Int => error<|endoftext|>


Prompt:
?.let { replacements.getMfvcPropertyNode(it.owner.correspondingPropertySymbol!!.owner) }

private fun IrProperty.getterIfDeclared(parent: IrDeclarationContainer): IrSimpleFunction? =
    getter?.takeIf { it in parent.declarations || this in parent.declarations }

Response: private val IrProperty.backingFieldIfNotDelegate get() = backingField?.takeUnless { isDelegated }<|endoftext|>


Prompt:
val groupedSources = collectSources(configuration, input.project, messageCollector)

    val ktSourceFiles = mutableListOf<KtSourceFile>().apply {
        addAll(groupedSources.commonSources)
        addAll(groupedSources.platformSources)
    }

    return firFrontend(
            input,
            ktSourceFiles,
            fileHasSyntaxErrors = { false },

Response:
isCommonSource = { groupedSources.isCommonSourceForLt(it) },
            fileBelongsToModule = { file, it -> groupedSources.fileBelongsToModuleForLt(file, it) },
            buildResolveAndCheckFir = { session, files, diagnosticsReporter ->
                buildResolveAndCheckFirViaLightTree(session, files, diagnosticsReporter, null)
            },
    )
}<|endoftext|>


Prompt:
}.outerFoo()
}

sealed class CaseOuter {
    val v = "v"
    abstract fun outerFoo();

    abstract class CaseBase() : CaseOuter() {
        abstract fun foo(): String
    }

    class A() : CaseBase() {
        override fun foo(): String {
            return "A"
        }

Response:
override fun outerFoo() {
            println("outerFoo")
        }
    }
}

class B() : CaseOuter.CaseBase() {
    override fun foo(): String {
        return ""
    }

    override fun outerFoo() {
    }
}<|endoftext|>


Prompt:
add(FirJvmErrors.CONCURRENT_HASH_MAP_CONTAINS_OPERATOR.warningFactory) { firDiagnostic ->
        ConcurrentHashMapContainsOperatorWarningImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }

Response:
add(FirJvmErrors.SPREAD_ON_SIGNATURE_POLYMORPHIC_CALL.errorFactory) { firDiagnostic ->
        SpreadOnSignaturePolymorphicCallErrorImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }<|endoftext|>


Prompt:
val x: Int = definedExternally

    fun foo(y: Int): Int = definedExternally
}

external fun foo(y: Int): Int = definedExternally

external val bar: Int = definedExternally

external var mbar: Int = definedExternally

// FILE: b.kt
package foo

fun box(): String {
    val a = A(23)

Response:
assertEquals(23, a.x)
    assertEquals(65, a.foo(42))

    val nested = A.Nested()
    assertEquals(55, nested.y)

    assertEquals(123, B.x)
    assertEquals(265, B.foo(142))

    assertEquals(365, foo(42))
    assertEquals(423, bar)<|endoftext|>


Prompt:
.mapNotNull { generatorExtension ->
                        generatorExtension.generateTopLevelClassLikeDeclaration(classId)?.also { symbol ->
                            symbol.fir.ownerGenerator = generatorExtension
                        }
                    }
                    .onEach { it.fir.validate() }
                when (generatedClasses.size) {
                    0 -> null
                    1 -> generatedClasses.first()

Response:
else -> error("Multiple plugins generated classes with same classId $classId\n${generatedClasses.joinToString("\n") { it.fir.render() }}")
                }
            }
        }
    }

    private fun generateTopLevelFunctions(callableId: CallableId): List<FirNamedFunctionSymbol> {<|endoftext|>


Prompt:
assertEquals(4321L, sumL)

    var sumC = 0
    for (i in charRange().reversed().reversed().reversed()) {
        sumC = sumC * 10 + i.toInt() - '0'.toInt()
    }
    assertEquals(4321, sumC)

    return "OK"
}

// 0 reversed
// 0 iterator

Response:
// 0 getStart
// 0 getEnd
// 3 getFirst
// 3 getLast

// JVM_IR_TEMPLATES
// 15 ILOAD
// 9 ISTORE
// 3 IADD
// 1 ISUB
// 1 IINC<|endoftext|>


Prompt:
// it should be published in common sources. more details: KT-54413
                "iosMain" to rootModuleSources and iosX64ModuleSources and iosArm64ModuleSources,
                "iosX64Main" to iosX64ModuleSources,
                "iosArm64Main" to iosArm64ModuleSources,
                "linuxX64Main" to linuxX64ModuleSources,

Response:
"linuxArm64Main" to linuxArm64ModuleSources,
            )

            val expectedSourcePublicationLayoutBySourcesFile: Map<String, List<String>> = expectedSourcePublicationLayout
                .flatMap { (sourceSet, sources) -> sources.map { sourceSet to it } }
                .groupBy(
                    keySelector = { it.second },
                    valueTransform = { it.first }
                )<|endoftext|>


Prompt:
val mask = "0x${List(byteSize) { "FF" }.chunked(2).joinToString("_") { it.joinToString("") }}"
}

enum class ProgressionKind {
    CHAR,
    INT,
    LONG;

    val capitalized: String get() = name.lowercase().replaceFirstChar(Char::uppercase)
}

Response:
fun progressionIncrementType(kind: ProgressionKind) = when (kind) {
    CHAR -> "Int"
    else -> kind.capitalized
}

fun areEqualNumbers(v: String) = "$v == other.$v"

fun hashLong(v: String) = "($v xor ($v ushr 32))"<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T: Invariant<in UserInterface>> testTypeParameterWithVarianceDifferentUpperBoundsE() {}
    fun <T: Invariant<*>> testTypeParameterWithVarianceDifferentUpperBoundsE() {}

Response:
fun <T: Invariant<in UserInterface>> testTypeParameterWithVarianceDifferentUpperBoundsEReverse() {}
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T: Invariant<*>> testTypeParameterWithVarianceDifferentUpperBoundsEReverse() {}<|endoftext|>


Prompt:
{ document.getElementsByTagName(ROOT_NODE_NAME).elements.single() },
        valueNamed,
        multiObjects,
        multiValues
    )
}

internal fun <ParsingContext> parseKotlinSourceSetMetadata(
    getRoot: () -> ParsingContext,
    valueNamed: ParsingContext.(key: String) -> String?,

Response:
multiObjects: ParsingContext.(named: String) -> Iterable<ParsingContext>,
    multiValues: ParsingContext.(named: String) -> Iterable<String>,
): KotlinProjectStructureMetadata {
    val projectStructureNode = getRoot()

    val formatVersion = checkNotNull(projectStructureNode.valueNamed(FORMAT_VERSION_NODE_NAME))<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.toReference
import org.jetbrains.kotlin.fir.java.JavaBinarySourceElement
import org.jetbrains.kotlin.fir.modules.javaModuleResolverProvider
import org.jetbrains.kotlin.fir.packageFqName

Response:
import org.jetbrains.kotlin.fir.references.toResolvedCallableSymbol
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol<|endoftext|>


Prompt:
package org.jetbrains.kotlin.compose.compiler.gradle.testUtils

import org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile

fun BaseKotlinCompile.composeOptions() = pluginOptions.get()

Response:
.flatMap { compilerPluginConfig ->
        compilerPluginConfig.allOptions().filter { it.key == "androidx.compose.compiler.plugins.kotlin" }.values
    }
    .flatten()
    .map { it.key to it.value }

fun KotlinNativeCompile.composeOptions() = compilerPluginOptions
    .allOptions()<|endoftext|>


Prompt:
irCall(getValueGetter(enumClass).symbol, enumClass.defaultType).apply {
            putValueArgument(0, irInt(enumEntriesMap(enumClass).getValue(name).getterId))
        }
    }

}

internal class EnumClassLowering(val context: Context) : FileLoweringPass {
    private val enumsSupport = context.enumsSupport

Response:
private val symbols = context.ir.symbols
    private val createUninitializedInstance = symbols.createUninitializedInstance
    private val createEnumEntries = symbols.createEnumEntries
    private val initInstance = symbols.initInstance
    private val arrayGet = symbols.array.owner.functions.single { it.name == KonanNameConventions.getWithoutBoundCheck }.symbol<|endoftext|>


Prompt:
override val calleeDescriptor: PropertySetterDescriptor
            get() = (correspondingProperty as AccessorForPropertyDescriptor).calleeDescriptor.setter!!

        override val superCallTarget: ClassDescriptor?
            get() = (correspondingProperty as AccessorForPropertyDescriptor).superCallTarget

        init {
            initializeDefault()
        }
    }

Response: }<|endoftext|>


Prompt:
fun (<!USELESS_VARARG_ON_PARAMETER!><!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> v: Foo<!>) {}
    }
}

class B(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> val s: Foo) {

Response:
constructor(a: Int, <!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> s: Foo) : this(*s)
}<|endoftext|>


Prompt:
val thisValue = createThisValueForDelegate(thisClass, ktDelegate)
            BackingFieldLValue(
                context,
                ktDelegate.startOffsetSkippingComments, ktDelegate.endOffset,
                irDelegateField.owner.type,
                irDelegateField,
                thisValue,
                null
            )
        }
    }

Response:
private fun createThisValueForDelegate(thisClass: ClassDescriptor?, ktDelegate: KtPropertyDelegate): IntermediateValue? =
        thisClass?.let {
            generateExpressionValue(it.thisAsReceiverParameter.type.toIrType()) {
                val thisAsReceiverParameter = thisClass.thisAsReceiverParameter
                IrGetValueImpl(<|endoftext|>


Prompt:
RENDER_TYPE,
            RENDER_TYPE,
            NOT_RENDERED
        )
        map.put(
            ASSIGNMENT_TYPE_MISMATCH,
            "Assignment type mismatch: actual type is ''{1}'', but ''{0}'' was expected.",
            RENDER_TYPE,
            RENDER_TYPE,
            NOT_RENDERED
        )

Response:
map.put(
            RESULT_TYPE_MISMATCH,
            "Function return type mismatch: actual type is ''{1}'', but ''{0}'' was expected.",
            RENDER_TYPE,
            RENDER_TYPE,
        )

        map.put(ITERATOR_MISSING, "For-loop range must have an 'iterator()' method.")<|endoftext|>


Prompt:
expectedType.coneType.arrayElementType()?.toFirResolvedTypeRef()
                                    }

                                    // Enabling expectedTypeMismatchIsReportedInChecker clarifies error messages:
                                    // It will be reported single ARGUMENT_TYPE_MISMATCH on the array literal in checkApplicabilityForArgumentType
                                    // instead of several TYPE_MISMATCH for every mismatched argument.

Response:
ResolutionMode.WithExpectedType(
                                        expectedType,
                                        forceFullCompletion = false,
                                        expectedTypeMismatchIsReportedInChecker = true
                                    )
                                } else {
                                    ResolutionMode.ContextDependent
                                }

                                return@mapTo arg.transformSingle(transformer, resolutionMode)
                            }
                        }
                    )
                }<|endoftext|>


Prompt:
* Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character.
 */
public inline fun CharSequence.single(predicate: (Char) -> Boolean): Char {
    var single: Char? = null
    var found = false
    for (element in this) {
        if (predicate(element)) {

Response:
if (found) throw IllegalArgumentException("Char sequence contains more than one matching element.")
            single = element
            found = true
        }
    }
    if (!found) throw NoSuchElementException("Char sequence contains no character matching the predicate.")
    @Suppress("UNCHECKED_CAST")
    return single as Char
}

/**<|endoftext|>


Prompt:
contextReceiverParametersCount = declaration.contextReceiverParametersCount
            processAttributes(declaration)
            transformFunctionChildren(declaration)
        }

    override fun visitConstructor(declaration: IrConstructor): IrConstructor =
        declaration.factory.createConstructor(
            startOffset = declaration.startOffset,
            endOffset = declaration.endOffset,

Response:
origin = mapDeclarationOrigin(declaration.origin),
            name = declaration.name,
            visibility = declaration.visibility,
            isInline = declaration.isInline,
            isExpect = declaration.isExpect,
            returnType = declaration.returnType,
            symbol = symbolRemapper.getDeclaredConstructor(declaration.symbol),
            isPrimary = declaration.isPrimary,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.IrTypeOperator
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol
import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl

Response:
import org.jetbrains.kotlin.ir.types.classOrFail
import org.jetbrains.kotlin.ir.types.defaultType
import org.jetbrains.kotlin.ir.util.constructors
import org.jetbrains.kotlin.ir.util.defaultType
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance<|endoftext|>


Prompt:
// !LANGUAGE: +SoundSmartcastForEnumEntries
// !DIAGNOSTICS: -UNUSED_VARIABLE
// SKIP_TXT

enum class Message(val text: String?) {
    HELLO("hello"),
    WORLD("world"),
    NOTHING(null)
}

fun printMessages() {
    Message.HELLO.text!!

Response:
<!DEBUG_INFO_SMARTCAST!>Message.HELLO.text<!>.length

    Message.NOTHING.text<!UNSAFE_CALL!>.<!>length

    Message.NOTHING.text!!
    <!DEBUG_INFO_SMARTCAST!>Message.NOTHING.text<!>.length
}<|endoftext|>


Prompt:
visitBreakContinue(jump)
    }

    override fun visitCall(expression: IrCall, data: Nothing?) {
        visitCall(expression)
    }

    fun visitCall(expression: IrCall) {
        visitFunctionAccess(expression)
    }

    override fun visitCallableReference(expression: IrCallableReference<*>, data: Nothing?) {

Response:
visitCallableReference(expression)
    }

    fun visitCallableReference(expression: IrCallableReference<*>) {
        visitMemberAccess(expression)
    }

    override fun visitFunctionReference(expression: IrFunctionReference, data: Nothing?) {
        visitFunctionReference(expression)
    }

    fun visitFunctionReference(expression: IrFunctionReference) {<|endoftext|>


Prompt:
headerPaths?.let { appendText("$HEADER_SEARCH_PATHS=$it\n") }
            publicHeadersFolderPath?.let { appendText("$PUBLIC_HEADERS_FOLDER_PATH=$it\n") }
            frameworkPaths?.let { appendText("$FRAMEWORK_SEARCH_PATHS=$it") }
        }
    }

Response:
companion object {
        const val BUILD_DIR = "BUILD_DIR"
        const val CONFIGURATION = "CONFIGURATION"
        const val CONFIGURATION_BUILD_DIR = "CONFIGURATION_BUILD_DIR"
        const val PODS_TARGET_SRCROOT = "PODS_TARGET_SRCROOT"<|endoftext|>


Prompt:
* Returns `true` if all elements match the given [predicate].
 *
 * Note that if the array contains no elements, the function returns `true`
 * because there are no elements in it that _do not_ match the predicate.
 * See a more detailed explanation of this logic concept in ["Vacuous truth"](https://en.wikipedia.org/wiki/Vacuous_truth) article.
 *

Response:
* @sample samples.collections.Collections.Aggregates.all
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun UShortArray.all(predicate: (UShort) -> Boolean): Boolean {
    for (element in this) if (!predicate(element)) return false
    return true
}

/**<|endoftext|>


Prompt:
inline fun <reified T, reified K>case_12(x: Any?) {
    if (x is T) {
        if (<!USELESS_IS_CHECK!>x is T<!> is K) {
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & T")!>x<!>
        }
    }
}

Response:
// TESTCASE NUMBER: 13
inline fun <reified T, reified K>case_13(x: Any?) {
    if (x is T) {
        if (x is K) {
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & T & K")!>x<!>
        }
    }
}

// TESTCASE NUMBER: 14<|endoftext|>


Prompt:
descriptor in resolverByModuleDescriptor
        }

    override fun descriptorForModule(moduleInfo: M): ModuleDescriptorImpl {
        checkValid()
        checkModuleIsCorrect(moduleInfo)
        return doGetDescriptorForModule(moduleInfo)
    }

    override fun moduleInfoForModuleDescriptor(moduleDescriptor: ModuleDescriptor): M {
        checkValid()

Response:
return moduleInfoByDescriptor[moduleDescriptor] ?: delegateResolver.moduleInfoForModuleDescriptor(moduleDescriptor)
    }

    override fun diagnoseUnknownModuleInfo(infos: List<ModuleInfo>): Nothing {
        DiagnoseUnknownModuleInfoReporter.report(name, infos, allModules)
    }

    private fun checkModuleIsCorrect(moduleInfo: M) {<|endoftext|>


Prompt:
override val packageProvider: KotlinPackageProvider get() = providerHelper.packageProvider

        override val symbolNamesProvider: FirSymbolNamesProvider get() = providerHelper.symbolNameCache

        override val allowKotlinPackage get() = providerHelper.allowKotlinPackage

        override fun getClassLikeSymbolByClassId(classId: ClassId): FirClassLikeSymbol<*>? {

Response:
if (!providerHelper.symbolNameCache.mayHaveTopLevelClassifier(classId)) return null
            return getFirClassifierByFqName(classId)?.symbol
        }

        @FirSymbolProviderInternals
        override fun getClassLikeSymbolByClassId(classId: ClassId, classLikeDeclaration: KtClassLikeDeclaration): FirClassLikeSymbol<*>? {<|endoftext|>


Prompt:
// CHECK-WINDOWSX64: invoke i16 [[SHORT_ID_BRIDGE:@_.*_knbridge[0-9]+]](i16 {{.*}})
    short_id(0.toShort())

Response:
// CHECK-DEFAULTABI: invoke zeroext i16 [[UNSIGNED_SHORT_ID_BRIDGE:@_.*_knbridge[0-9]+]](i16 zeroext {{.*}})
    // CHECK-AAPCS: invoke i16 [[UNSIGNED_SHORT_ID_BRIDGE:@_.*_knbridge[0-9]+]](i16 {{.*}})<|endoftext|>


Prompt: 7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723,

Response: 7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742,<|endoftext|>


Prompt:
@DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.4", hiddenSince = "1.5")
@kotlin.jvm.JvmName("byteRangeContains")
public operator fun ClosedRange<Byte>.contains(value: Double): Boolean {
    return value.toByteExactOrNull().let { if (it != null) contains(it) else false }
}

Response:
/**
 * Checks if the specified [value] belongs to this range.
 */
@Deprecated("This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.")
@DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.4", hiddenSince = "1.5")
@kotlin.jvm.JvmName("shortRangeContains")<|endoftext|>


Prompt:
assertEquals("odd", js("(1 % 2 === 0)?'even':'odd'"), "?:")
    assertEquals("even", js("(4 % 2 === 0)?'even':'odd'"), "?:")
    assertEquals(3, js("1,2,3"), ", (comma)")

    if (testUtils.isLegacyBackend()) {
        var j = 0

Response:
assertEquals(1, js("j = 1"), "=")
        assertEquals(3, js("j += 2"), "+=")
        assertEquals(2, js("j -= 1"), "-=")
        assertEquals(14, js("j *= 7"), "*=")
        assertEquals(7, js("j /= 2"), "/=")<|endoftext|>


Prompt:
val result_2 = select(A(B()), A(x), A(if (true) B() else null))
    val result_3 = select(A(x), A(if (true) B() else null))

    <!DEBUG_INFO_EXPRESSION_TYPE("A<(B..B?)>")!>result_1<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("A<(B..B?)>")!>result_2<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("A<(B..B?)>")!>result_3<!>
}

fun case_2() {
    val x = Test.bar<Any>() // Any!
    val y: Any? = null<|endoftext|>


Prompt:
gradleVersion,
            buildOptions = defaultBuildOptions.copy(
                androidVersion = agpVersion,
            ),
            buildJdk = jdkVersion.location
        ) {
            removeDependencies(buildGradle)
            checkTaskCompileClasspath(
                "compileDebugKotlin",
                listOf("kotlin-stdlib"),

Response:
listOf("kotlin-stdlib-jdk7", "kotlin-stdlib-jdk8")
            )
        }
    }

    @AndroidGradlePluginTests
    @DisplayName("Android: kotlin-stdlib dependency is not added when disabled via properties")
    @GradleAndroidTest
    fun testStdlibDisabledAndroid(
        gradleVersion: GradleVersion,<|endoftext|>


Prompt:
override fun createDelegatingTestReportProcessor(origin: TestResultProcessor, targetName: String) =
        object : TestResultProcessor by origin {
            override fun started(test: TestDescriptorInternal, event: TestStartEvent) {
                val myTest = object : TestDescriptorInternal by test {
                    override fun getDisplayName(): String = "${test.displayName}[$targetName]"

Response:
override fun getClassName(): String? = test.className?.replace('$', '.')
                    override fun getClassDisplayName(): String? = test.classDisplayName?.replace('$', '.')
                }
                origin.started(myTest, event)
            }
        }
}<|endoftext|>


Prompt:
require(firSymbol is FirConstructorSymbol)
                    val constructor = firSymbol.unwrapCallRepresentative(c).fir as FirConstructor
                    val totalTypeParametersCount = constructor.typeParameters.size
                    val constructorTypeParametersCount = constructor.typeParameters.count { it is FirTypeParameter }
                    IrConstructorCallImpl(
                        startOffset,
                        endOffset,
                        irType,

Response:
symbol,
                        typeArgumentsCount = totalTypeParametersCount,
                        valueArgumentsCount = firSymbol.valueParametersSize(),
                        constructorTypeArgumentsCount = constructorTypeParametersCount,
                    )
                }
                is IrSimpleFunctionSymbol -> {
                    require(firSymbol is FirCallableSymbol<*>) { "Illegal symbol: ${firSymbol!!::class}" }<|endoftext|>


Prompt:
return testDataFile.withExtension(IrTextDumpHandler.DUMP_EXTENSION).takeIf { it.exists() }
        }

        override fun getFirFileToCompare(testDataFile: File): File? {
            return testDataFile.withExtension("fir.${IrTextDumpHandler.DUMP_EXTENSION}").takeIf { it.exists() }
        }

Response:
}

    private val prettyDumpChecker = object : FirIdenticalCheckerHelper(testServices) {
        override fun getClassicFileToCompare(testDataFile: File): File? {
            return testDataFile.withExtension(IrPrettyKotlinDumpHandler.DUMP_EXTENSION).takeIf { it.exists() }
        }<|endoftext|>


Prompt:
fun <F : Number> three(p1: F, p2: N, p3: I) = Unit
            fun <F : Number> three(p1: F, p2: I, p3: N) = Unit
        }
    }

    inner class Inner<I : CharSequence>(p1: O, p2: I) {

Response:
inner class TypeParameterInSuperTypes<A> : Interface<List<List<O>>, Map<I, A>, Triple<O, I, A>>

        var O.property: O get() = TODO()
            set(_) = kotlin.Unit
        var I.property: I get() = TODO()
            set(_) = kotlin.Unit<|endoftext|>


Prompt:
package org.jetbrains.kotlin.ir.interpreter.checker

import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.*

Response:
import org.jetbrains.kotlin.ir.interpreter.*
import org.jetbrains.kotlin.ir.interpreter.preprocessor.IrInterpreterKCallableNamePreprocessor.Companion.isEnumName
import org.jetbrains.kotlin.ir.interpreter.preprocessor.IrInterpreterKCallableNamePreprocessor.Companion.isKCallableNameCall<|endoftext|>


Prompt:
assertEquals("lang", reconstructed.language)

    val info = Project2.serializer().descriptor.annotations.filterIsInstance<MySerializableWithInfo>().first()
    assertEquals(123, info.value)
    assertEquals(String::class, info.kclass)
}

fun testMetaSerializableOnProperty() {

Response:
val info = Wrapper.serializer().descriptor.getElementAnnotations(0).filterIsInstance<MySerializableWithInfo>().first()
    assertEquals(234, info.value)
    assertEquals(Int::class, info.kclass)
}

fun testSerializableAndMetaAnnotation() {<|endoftext|>


Prompt:
<!OPT_IN_USAGE_ERROR!>newFunExperimentalInThePast<!>()
    <!OPT_IN_USAGE_ERROR!>newValExperimentalInThePast<!>
    <!OPT_IN_USAGE_ERROR!>NewClassExperimentalInThePast<!>()
}

@OptIn(Marker::class)
fun use2(

Response:
c2: NewClassExperimentalInThePast,
    t2: TypeAliasToNewClass
) {
    <!UNRESOLVED_REFERENCE!>newPublishedFun<!>()
    newFunExperimentalInThePast()
    newValExperimentalInThePast
    NewClassExperimentalInThePast()
}

@Marker
fun use3(<|endoftext|>


Prompt:
if (value_8 != 0b110001 || value_8 != 49) return null
    if (value_9 != 0b01100011 || value_9 != 99) return null
    if (value_10 != 0B0 || value_10 != 0) return null
    if (value_11 != 0b1 || value_11 != 1) return null

Response:
if (value_12 != 0b100000 || value_12 != 32) return null
    if (value_13 != 0B1000001 || value_13 != 65) return null
    if (value_14 != 0B0000000 || value_14 != 0) return null
    if (value_15 != 0b0000001000000 || value_15 != 64) return null<|endoftext|>


Prompt:
if (scope.isScopeForClass() && base.isScopeForClass()) {
            val classContainingFrom = from.findClassOrObjectParent() ?: return@any false
            return@any scope.isScopeForClassCloserThanAnotherScopeForClass(base, classContainingFrom)
        }
        base.isWiderThan(scope)
    }

    /**

Response:
* Returns true if [containingFile] has a [KtImportDirective] whose imported FqName is the same as [classId] but references a different
     * symbol.
     */
    private fun importDirectiveForDifferentSymbolWithSameNameIsPresent(classId: ClassId): Boolean {<|endoftext|>


Prompt:
assertFalse(data.remove("foo"))
        assertEquals(1, data.size)
        assertTrue(data.contains("bar"))

        val nullableSet = createEmptyMutableSetWithNullableValues()
        nullableSet.add(null)

        assertTrue(nullableSet.remove(null))
        assertFalse(nullableSet.remove(null))
    }

    @Test

Response:
fun addAll() {
        val data = createTestMutableSet()
        assertTrue(data.addAll(arrayListOf("foo", "bar", "baz", "boo")))
        assertEquals(4, data.size)
        assertFalse(data.addAll(arrayListOf("foo", "bar", "baz", "boo")))
        assertEquals(4, data.size)<|endoftext|>


Prompt:
if (!iterator.hasNext()) return maxElem
    var maxValue = selector(maxElem)
    do {
        val e = iterator.next()
        val v = selector(e)
        if (maxValue < v) {
            maxElem = e
            maxValue = v
        }
    } while (iterator.hasNext())
    return maxElem
}

/**

Response:
* Returns the first element yielding the largest value of the given function or `null` if there are no elements.
 *
 * The operation is _terminal_.
 *
 * @sample samples.collections.Collections.Aggregates.maxByOrNull
 */
@SinceKotlin("1.4")<|endoftext|>


Prompt:
private val parentLoopResolver: LoopResolver?
) : GeneratorWithScope, LoopResolver {

    val scopeOwner: DeclarationDescriptor get() = scopeOwnerSymbol.descriptor

    private val typeTranslator = context.typeTranslator
    private fun KotlinType.toIrType() = typeTranslator.translateType(this)

    override val scope = Scope(scopeOwnerSymbol)

Response:
private val loopTable = HashMap<KtLoopExpression, IrLoop>()

    fun generateFunctionBody(ktBody: KtExpression): IrBody {
        val irBlockBody = context.irFactory.createBlockBody(ktBody.startOffsetSkippingComments, ktBody.endOffset)

        if (context.configuration.skipBodies) {
            val irBody =<|endoftext|>


Prompt:
private set

    var z6: Private = Private(35, 36)
        internal set

    companion object {
        var staticX1: Public = Public(-1, -2)
        internal var staticX2: Public = Public(-3, -4)
        private var staticX3: Public = Public(-5, -6)

        var staticX4: Public = Public(-7, -8)

Response:
private set
        internal var staticX5: Public = Public(-9, -10)
            private set

        var staticX6: Public = Public(-11, -12)
            internal set

        var staticY1: Internal = Internal(-13, -14)
        internal var staticY2: Internal = Internal(-15, -16)
        private var staticY3: Internal = Internal(-17, -18)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.builders.declarations.*
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrDelegatingConstructorCallImpl

Response:
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.*<|endoftext|>


Prompt:
* Outputs are written as json and protobufs
 */
@DisableCachingByDefault(because = "Used for debugging/diagnostic purpose.")
internal open class IdeResolveDependenciesTask : DefaultTask() {

    @TaskAction
    fun resolveDependencies() {
        val outputDirectory = project.layout.buildDirectory.dir("ide/dependencies").get().asFile
        outputDirectory.deleteRecursively()

Response:
val gson = GsonBuilder().setLenient().setPrettyPrinting()
            .registerTypeHierarchyAdapter(IdeDependencyResolver::class.java, IdeDependencyResolverAdapter)
            .registerTypeHierarchyAdapter(Extras::class.java, ExtrasAdapter)<|endoftext|>


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

    override fun generateClassSyntheticParts(codegen: ImplementationBodyCodegen) {

        val parcelableClass = codegen.descriptor

        if (!parcelableClass.isParcelableClassDescriptor) return

Response:
val propertiesToSerialize = getPropertiesToSerialize(codegen, parcelableClass)

        val parcelerObject = parcelableClass.companionObjectDescriptor?.takeIf {
            TypeUtils.getAllSupertypes(it.defaultType).any { it.isParceler }
        }

        with (parcelableClass) {
            if (hasSyntheticDescribeContents()) {<|endoftext|>


Prompt:
nullTask?.input<!NO_SET_METHOD!><!UNRESOLVED_REFERENCE!>[<!>0, 0, 0<!UNRESOLVED_REFERENCE!>]<!><!> = StringProperty("Fail")

    // a?.b[c] += d

Response: <!OPERATOR_MODIFIER_REQUIRED!>task.input<!NO_SET_METHOD!>[<!TOO_MANY_ARGUMENTS!>0<!>]<!><!> += StringProperty("Fail")<|endoftext|>


Prompt:
assertTrue(jsBoolTrue != false.toJsBoolean())
    assertTrue(jsRepresentation(jsBoolTrue) == "boolean:true")

    // JsArray
    val jsArray: JsArray<JsString> = JsArray()
    repeat(3) {
        jsArray[it] = "element$it".toJsString()
    }

Response:
assertTrue(jsArray.length == 3)
    assertTrue(jsArray[1] == "element1".toJsString())
    assertTrue(jsRepresentation(jsArray) == "object:element0,element1,element2")

    // JsReference
    val jsReference: JsReference<Int> = 10.toJsReference()
    assertTrue(jsReference.get() == 10)<|endoftext|>


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

fun test(uis: UIntArray): UInt {
    var s = 0U
    for (ui in uis) {
        s += ui
    }
    return s

Response:
}

// 0 iterator
// 0 getStart
// 0 getEnd
// 0 getFirst
// 0 getLast
// 1 IF_ICMPGE
// 0 IF_ICMPGT
// 0 IF_ICMPLE
// 1 IF

// JVM_IR_TEMPLATES
// 6 ILOAD
// 5 ISTORE
// 1 IADD
// 0 ISUB
// 1 IINC<|endoftext|>


Prompt:
private val classifierIds = CommonizerSet<CirEntityId>(initialCapacity)

    operator fun invoke(tree: CirTreeRoot) {
        tree.modules.forEach { module -> this(module) }
    }

    operator fun invoke(module: CirTreeModule) {
        module.packages.forEach { pkg -> this(pkg) }
    }

Response:
operator fun invoke(pkg: CirTreePackage) {
        pkg.typeAliases.forEach { typeAlias -> this(typeAlias) }
        pkg.classes.forEach { clazz -> this(clazz) }
    }

    operator fun invoke(typeAlias: CirTreeTypeAlias) {
        classifierIds.add(typeAlias.id)<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// LAMBDAS: CLASS

import java.util.Date

fun assertGenericSuper(expected: String, function: Any?) {
    val clazz = (function as java.lang.Object).getClass()!!
    val genericSuper = clazz.getGenericInterfaces()[0]!!
    if ("$genericSuper" != expected)

Response:
throw AssertionError("Fail, expected: $expected, actual: $genericSuper")
}

val unitFun = { }
val intFun = { 42 }
val stringParamFun = { x: String -> }
val listFun = { l: List<String> -> l }
val mutableListFun = fun (l: MutableList<Double>): MutableList<Int> = null!!<|endoftext|>


Prompt:
} catch (e: NullPointerException) {
        "Null"
    }
}

const val a1 = <!EVALUATED: `Value isn't null`!>notNullAssertion(1)<!>
const val a2 = <!EVALUATED: `Value is null`!>notNullAssertion(null)<!>

Response:
const val b1 = <!EVALUATED: `Value isn't null`!>notNullAssertionForObject(A())<!>
const val b2 = <!EVALUATED: `Value is null`!>notNullAssertionForObject(null)<!><|endoftext|>


Prompt:
fun testReadOnlyInterfaceProperties() {
    val o = makeTestInterfaceInstance()

    o.intWrapper = IntWrapper(42)
    assertEquals(42, o.readOnlyIntWrapper.value)

    assertEquals(null, o.readOnlyIntWrapperN?.value)
    o.intWrapperN = IntWrapper(100)

Response:
assertEquals(100, o.readOnlyIntWrapperN?.value)

    o.intNWrapper = IntNWrapper(23)
    assertEquals(23, o.readOnlyIntNWrapper.value)
    o.intNWrapper = IntNWrapper(null)
    assertEquals(null, o.readOnlyIntNWrapper.value)<|endoftext|>


Prompt:
if (!(4.toShort() in emptyIntArray.indices) != !range2.contains(4.toShort())) throw AssertionError()
    if (!(4.toShort() !in emptyIntArray.indices) != range2.contains(4.toShort())) throw AssertionError()
    // no local optimizations

Response:
if (element21 in emptyIntArray.indices != range2.contains(element21)) throw AssertionError()
    if (element21 !in emptyIntArray.indices != !range2.contains(element21)) throw AssertionError()
    if (!(element21 in emptyIntArray.indices) != !range2.contains(element21)) throw AssertionError()<|endoftext|>


Prompt:
val commonizedClassifier = classifiers.commonizedNodes.classNode(classifierId)?.commonDeclaration?.invoke()
            ?: classifiers.commonizedNodes.typeAliasNode(classifierId)?.commonDeclaration?.invoke()

        return when (commonizedClassifier) {
            is CirClass -> CirClassType.createInterned(
                classId = classifierId,

Response:
outerType = outerType,
                arguments = arguments,
                isMarkedNullable = isMarkedNullable
            )

            is CirTypeAlias -> CirTypeAliasType.createInterned(
                typeAliasId = classifierId,
                arguments = arguments,
                isMarkedNullable = isMarkedNullable,
                underlyingType = commonizedClassifier.underlyingType<|endoftext|>


Prompt:
override fun get(index: Int): Z = Z(storage[index])

    override fun indexOf(element: Z): Int = storage.indexOf(element.x)

    override fun lastIndexOf(element: Z): Int = storage.lastIndexOf(element.x)

    override fun listIterator(): ListIterator<Z> = ZArrayIterator(storage)

Response:
override fun listIterator(index: Int): ListIterator<Z> = ZArrayIterator(storage, index)

    override fun subList(fromIndex: Int, toIndex: Int): List<Z> = TODO()

    private class ZArrayIterator(val storage: IntArray, var index: Int = 0): ListIterator<Z> {
        override fun hasNext(): Boolean = index < storage.size<|endoftext|>


Prompt:
package org.jetbrains.kotlin.analysis.project.structure

import org.jetbrains.kotlin.extensions.ProjectExtensionDescriptor

/**
 * A service which can return extensions which are registered for some module
 */
public abstract class KtCompilerPluginsProvider {

    public enum class CompilerPluginType {
        ASSIGNMENT
    }

    /**

Response:
* Returns a list of extensions of a base [extensionType] which are registered for [module]
     *
     * These extensions are used in addition to those provided by the extension descriptor's [ProjectExtensionDescriptor.getInstances].
     */
    public abstract fun <T : Any> getRegisteredExtensions(module: KtSourceModule, extensionType: ProjectExtensionDescriptor<T>): List<T><|endoftext|>


Prompt:
val stubs = preComputedStubs.filter {
            irClass.symbol.isStrictSubtypeOfClass(it.readOnlyClass) && !irClass.symbol.isSubtypeOfClass(it.mutableClass)
        }
        return stubs.filter {

Response:
stubs.none { other -> it.readOnlyClass != other.readOnlyClass && other.readOnlyClass.isSubtypeOfClass(it.readOnlyClass) }
        }
    }
}

interface StubsForCollectionClass {
    val readOnlyClass: IrClassSymbol
    val mutableClass: IrClassSymbol
    val candidatesForStubs: Collection<IrSimpleFunction>
}<|endoftext|>


Prompt:
assertPrints(array.contentEquals(doubleArrayOf(1.0, 0.0, Double.NaN)), "false")
        }

        @Sample
        fun contentDeepEquals() {
            val identityMatrix = arrayOf(
                intArrayOf(1, 0),
                intArrayOf(0, 1)
            )
            val reflectionMatrix = arrayOf(
                intArrayOf(1, 0),

Response:
intArrayOf(0, -1)
            )

            // the elements at index [1][1] are not equal
            assertPrints(identityMatrix.contentDeepEquals(reflectionMatrix), "false")

            reflectionMatrix[1][1] = 1
            assertPrints(identityMatrix.contentDeepEquals(reflectionMatrix), "true")
        }
    }<|endoftext|>


Prompt:
package kotlin.collections

/**
 * Returns the array if it's not `null`, or an empty array otherwise.
 * @sample samples.collections.Arrays.Usage.arrayOrEmpty
 */
public actual inline fun <reified T> Array<out T>?.orEmpty(): Array<out T> = this ?: emptyArray<T>()

Response:
internal fun checkCopyOfRangeArguments(fromIndex: Int, toIndex: Int, size: Int) {
    if (toIndex > size)
        throw IndexOutOfBoundsException("toIndex ($toIndex) is greater than size ($size).")
    if (fromIndex > toIndex)
        throw IllegalArgumentException("fromIndex ($fromIndex) is greater than toIndex ($toIndex).")
}<|endoftext|>


Prompt:
public fun ByteArray.toHexString(format: HexFormat = HexFormat.Default): String = toHexString(0, size, format)

/**
 * Formats bytes in this array using the specified [HexFormat].
 *
 * Note that only [HexFormat.upperCase] and [HexFormat.BytesHexFormat] affect formatting.
 *

Response:
* @param startIndex the beginning (inclusive) of the subrange to format, 0 by default.
 * @param endIndex the end (exclusive) of the subrange to format, size of this array by default.
 * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.
 *<|endoftext|>


Prompt:
builder.multiLineComment = JsAstProtoBuf.MultiLineComment.newBuilder().setMessage(comment.text).build()
            }
        }

        withComments(statement, { visitor.builder.addBeforeComments(it) }, { visitor.builder.addAfterComments(it) }) {
            withLocation(statement, { visitor.builder.fileId = it }, { visitor.builder.location = it }) {

Response:
statement.accept(visitor)
            }
        }

        if (statement is HasMetadata && statement.synthetic) {
            visitor.builder.synthetic = true
        }

        if (visitor.builder.statementCase == JsAstProtoBuf.Statement.StatementCase.STATEMENT_NOT_SET) {
            error("Unknown statement type: ${statement::class.qualifiedName}")<|endoftext|>


Prompt:
<!DEBUG_INFO_MISSING_UNRESOLVED!>inv<!>()
    }
}

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

Response: val inv = if (flag) { <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::<!DEBUG_INFO_MISSING_UNRESOLVED!>Foo6<!><!><|endoftext|>


Prompt:
@Suppress("DEPRECATION")
                curChar = high.toInt()
            }
        } else {
            @Suppress("DEPRECATION")
            curChar = testString[index].toInt()
        }

        return curChar
    }

    override fun first(set: AbstractSet): Boolean {
        return if (set is DecomposedCharSet)

Response:
set.decomposedChar.contentEquals(decomposedChar)
        else
            true
    }

    override fun hasConsumed(matchResult: MatchResultImpl): Boolean = true
}<|endoftext|>


Prompt:
}

    override fun visitFile(file: FirFile, data: Nothing?) {
        withAnnotationContainer(file) {
            visitWithFile(file)
        }
    }

    override fun visitAnonymousInitializer(anonymousInitializer: FirAnonymousInitializer, data: Nothing?) {
        withElement(anonymousInitializer) {
            visitWithDeclaration(anonymousInitializer)
        }

Response:
}

    override fun visitBlock(block: FirBlock, data: Nothing?) {
        if (block is FirContractCallBlock) {
            insideContractBody {
                visitExpression(block, data)
            }
        } else {
            visitExpression(block, data)
        }
    }

    override fun visitContractDescription(contractDescription: FirContractDescription, data: Nothing?) {<|endoftext|>


Prompt:
<!NO_TAIL_CALLS_FOUND!>tailrec<!> fun h2(x : Any) {
            this@B.h2("no recursion") // keep vigilance
        }

    }

    fun makeC() : C = C()

    fun h2(x : Any) {
    }
}

fun box() : String {

Response:
B().makeC().h(1000000)
    B().makeC().h2(0)
    return "OK"
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTestFramework
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinTestRunnerCliArgs
import org.jetbrains.kotlin.gradle.utils.getFile
import org.jetbrains.kotlin.gradle.utils.getValue

Response:
import java.nio.file.Path

class KotlinMocha(@Transient override val compilation: KotlinJsIrCompilation, private val basePath: String) :
    KotlinJsTestFramework {
    @Transient
    private val project: Project = compilation.target.project
    private val npmProject = compilation.npmProject<|endoftext|>


Prompt:
* Returns the single element, or throws an exception if the array is empty or has more than one element.
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun UIntArray.single(): UInt {
    return storage.single().toUInt()
}

/**

Response:
* Returns the single element, or throws an exception if the array is empty or has more than one element.
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun ULongArray.single(): ULong {
    return storage.single().toULong()
}

/**<|endoftext|>


Prompt:
val (allExportStatements, restStatements) = allExportRelatedStatements.partitionIsInstance<JsStatement, JsExport>()
            val (currentModuleExportStatements, restExportStatements) = allExportStatements.partition { it.fromModule == null }
            val exportedElements = currentModuleExportStatements.takeIf { it.isNotEmpty() }
                ?.asSequence()

Response:
?.flatMap { (it.subject as JsExport.Subject.Elements).elements }
                ?.distinctBy { it.alias?.ident ?: it.name.ident }
                ?.toList()

            val oneLargeExportStatement = exportedElements?.let { JsExport(JsExport.Subject.Elements(it)) }<|endoftext|>


Prompt:
val nested1 = CirName.create("Nested1")
        val nested2 = CirName.create("Nested2")

        listOf(
            "",
            "/",
            "foo/",
            "foo/bar/",
            "Outer",
            "/Outer",
            "foo/Outer",
            "foo/bar/Outer",
            "Outer.Nested",

Response:
"/Outer.Nested",
            "foo/Outer.Nested",
            "foo/bar/Outer.Nested"
        ).forEach { rawEntityId ->
            val entityId = CirEntityId.create(rawEntityId)
            val n1 = entityId.createNestedEntityId(nested1)
            assertSame(entityId.packageName, n1.packageName)<|endoftext|>


Prompt:
memScoped {
        return interpretCPointer<COpaque>(kniBridge296(C.getPointer(memScope).rawValue))
    }
}

fun clang_EvalResult_getKind(E: CXEvalResult?): CXEvalResultKind {
    return CXEvalResultKind.byValue(kniBridge297(E.rawValue))
}

Response:
fun clang_EvalResult_getAsInt(E: CXEvalResult?): Int {
    return kniBridge298(E.rawValue)
}

fun clang_EvalResult_getAsLongLong(E: CXEvalResult?): Long {
    return kniBridge299(E.rawValue)
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.stringRepresentation
import org.jetbrains.kotlin.analysis.api.renderer.declarations.impl.KtDeclarationRendererForSource
import org.jetbrains.kotlin.analysis.api.renderer.declarations.modifiers.renderers.KtRendererKeywordFilter

Response:
import org.jetbrains.kotlin.analysis.api.scopes.KtScope
import org.jetbrains.kotlin.analysis.api.scopes.KtTypeScope
import org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRenderer
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest<|endoftext|>


Prompt:
//        "ℳ" to 8499,
//        "∾" to 8766,
//        "Μ" to 924,
//        "μ" to 956,
//        "⊸" to 8888,
//        "⊸" to 8888,
//        "∇" to 8711,
//        "Ń" to 323,

Response:
//        "ń" to 324,
//        "∠⃒" to 8736,
//        "≉" to 8777,
//        "⩰̸" to 10864,
//        "≋̸" to 8779,
//        "ŉ" to 329,
//        "≉" to 8777,
//        "♮" to 9838,<|endoftext|>


Prompt:
@JvmStatic fun test1() = b

        @JvmStatic fun test2() = b

        @JvmStatic fun String.test3() = this + b
    }
}

fun box(): String {
    if (Test.test1() != "OK") return "fail 1"

    if (Test.test2() != "OK") return "fail 2"

Response:
if (Test.test3() != "JAVAOK") return "fail 3"

    if (Test.test4() != "OK") return "fail 4"

    return "OK"
}<|endoftext|>


Prompt:
directLibsSequence(givenPath) + repoLibs
            }
        }
        return sequence.filterNotNull()
    }

    private fun Sequence<File>.filterOutPre_1_4_libraries(): Sequence<File> = this.filter {
        if (it.isPre_1_4_Library) {

Response:
logger.warning("KLIB resolver: Skipping '$it'. This is a pre 1.4 library.")
            false
        } else {
            true
        }
    }

    // Default libraries could be resolved several times during findLibraries and resolveDependencies.
    // Store already resolved libraries.
    private inner class ResolvedLibrary(val library: L?)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.codegen.range.forLoop.ForInDefinitelySafeSimpleProgressionLoopGenerator
import org.jetbrains.kotlin.codegen.range.forLoop.ForLoopGenerator
import org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator

Response:
import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator
import org.jetbrains.kotlin.codegen.range.inExpression.InFloatingPointRangeLiteralExpressionGenerator
import org.jetbrains.kotlin.codegen.range.inExpression.InIntegralContinuousRangeExpressionGenerator<|endoftext|>


Prompt:
package Jet87

open class A() {
  fun foo() : Int = 1
}

interface B {
  fun bar() : Double = 1.0;
}

interface G<X> {
    val <<!TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER!>X<!>> boo: Double  where X : A, X : B

Response: val <<!TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER!>A<!>> bal: Double  where A : B<|endoftext|>


Prompt:
}
    }

    override fun processPackagePart(sourceFile: File, packagePartMetadata: ByteArray, binaryAst: ByteArray, inlineData: ByteArray) {
        rpcProfiler.withMeasure(this) {
            facade.incrementalResultsConsumer_processPackagePart(sourceFile.path, packagePartMetadata, binaryAst, inlineData)
        }
    }

Response:
private class JsInlineFunction(val sourceFilePath: String, val fqName: String, val inlineFunction: FunctionWithSourceInfo)

    private val deferInlineFuncs = mutableListOf<JsInlineFunction>()

    override fun processInlineFunction(sourceFile: File, fqName: String, inlineFunction: Any, line: Int, column: Int) {<|endoftext|>


Prompt:
*   - `truncate(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.
 */
@SinceKotlin("1.2")
public actual fun truncate(x: Float): Float = when {
    x.isNaN() || x.isInfinite() -> x
    x > 0 -> floor(x)

Response:
else -> ceil(x)
}

/**
 * Rounds the given value [x] towards the closest integer with ties rounded towards even integer.
 *
 * Special cases:
 *   - `round(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.
 */
@SinceKotlin("1.2")<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression
import org.jetbrains.kotlin.fir.psi
import org.jetbrains.kotlin.fir.analysis.checkers.fullyExpandedClassId
import org.jetbrains.kotlin.fir.types.ConeFlexibleType

Response:
import org.jetbrains.kotlin.fir.types.classId
import org.jetbrains.kotlin.fir.types.isMarkedNullable
import org.jetbrains.kotlin.fir.types.resolvedType
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.StandardClassIds<|endoftext|>


Prompt:
internal open class CategoryRangesWriter(protected val strategy: RangesWritingStrategy) : RangesWriter {

    override fun write(rangeStart: List<Int>, rangeEnd: List<Int>, rangeCategory: List<Int>, writer: FileWriter) {
        beforeWritingRanges(writer)

        writeRangeStart(rangeStart, writer)
        writeRangeCategory(rangeCategory, writer)

Response:
writeInit(rangeStart, rangeEnd, rangeCategory, writer)

        afterWritingRanges(writer)
    }

    protected open fun beforeWritingRanges(writer: FileWriter) {
        strategy.beforeWritingRanges(writer)
    }

    protected open fun afterWritingRanges(writer: FileWriter) {
        strategy.afterWritingRanges(writer)

        writer.appendLine()<|endoftext|>


Prompt:
val LINEAR_MIPMAP_NEAREST: Int
        val NEAREST_MIPMAP_LINEAR: Int
        val LINEAR_MIPMAP_LINEAR: Int
        val TEXTURE_MAG_FILTER: Int
        val TEXTURE_MIN_FILTER: Int
        val TEXTURE_WRAP_S: Int
        val TEXTURE_WRAP_T: Int

Response:
val TEXTURE_2D: Int
        val TEXTURE: Int
        val TEXTURE_CUBE_MAP: Int
        val TEXTURE_BINDING_CUBE_MAP: Int
        val TEXTURE_CUBE_MAP_POSITIVE_X: Int
        val TEXTURE_CUBE_MAP_NEGATIVE_X: Int<|endoftext|>


Prompt:
+JsEnvironmentConfigurationDirectives.NO_COMMON_FILES
    }
    useAdditionalSourceProviders(::JsSteppingTestAdditionalSourceProvider)
    jsArtifactsHandlersStep {
        useHandlers(::JsDebugRunner.bind(false))
    }
}

fun TestConfigurationBuilder.configureJsTypeScriptExportTest() {
    defaultDirectives {

Response:
+JsEnvironmentConfigurationDirectives.GENERATE_DTS
        if (getBoolean("kotlin.js.updateReferenceDtsFiles")) +JsEnvironmentConfigurationDirectives.UPDATE_REFERENCE_DTS_FILES
    }
    configureJsArtifactsHandlersStep {
        useHandlers(::JsDtsHandler)
    }
}<|endoftext|>


Prompt:
// CHECK_BREAKS_COUNT: function=localWithoutCapture count=0 TARGET_BACKENDS=JS_IR
// CHECK_LABELS_COUNT: function=localWithoutCapture name=$l$block count=0 TARGET_BACKENDS=JS_IR
internal fun localWithoutCapture(a: Int, b: Int): Int {
    var mult = 0

    repeatAction(a) {

Response:
inline fun inc(x: Int): Int {
            return x + 1
        }

        repeatAction(b) {
            mult = inc(mult)
        }
    }

    return mult
}

// CHECK_BREAKS_COUNT: function=localWithCapture count=0 TARGET_BACKENDS=JS_IR<|endoftext|>


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

fun test(d: dynamic) {
    d.<!DEBUG_INFO_DYNAMIC!>onAnyVal<!>
    d.<!DEBUG_INFO_DYNAMIC!>onAnyVal<!> = 1

Response:
d?.<!DEBUG_INFO_DYNAMIC!>onAnyVal<!>
    d?.<!DEBUG_INFO_DYNAMIC!>onAnyVal<!> = 1

    run {
        d!!.<!DEBUG_INFO_DYNAMIC!>onAnyVal<!>
    }
    run {<|endoftext|>


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

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


Prompt:
var insnNode: AbstractInsnNode? = instructions.first
            while (insnNode != null) {
                if (isReturnOpcode(insnNode.opcode)) {
                    val labelName = getMarkedReturnLabelOrNull(insnNode)
                    val returnType = getReturnType(insnNode.opcode)

                    val isLocalReturn = labelName == null || labelName in returnLabels

Response:
val jumpTarget = returnLabels[labelName] ?: endLabel

                    if (isLocalReturn && labelName != null) {
                        // remove non-local return flag
                        instructions.remove(insnNode.previous)
                    }

                    if (isLocalReturn && jumpTarget != null) {<|endoftext|>


Prompt:
public operator fun <T : JsAny?> JsArray<T>.set(index: Int, value: T) {
    jsArraySet(this, index, value)
}

@Suppress("RedundantNullableReturnType", "UNUSED_PARAMETER")
private fun <T : JsAny?> jsArrayGet(array: JsArray<T>, index: Int): T? =

Response:
js("array[index]")

@Suppress("UNUSED_PARAMETER")
private fun <T : JsAny?> jsArraySet(array: JsArray<T>, index: Int, value: T) {
    js("array[index] = value")
}<|endoftext|>


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

import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.diagnostics.reportOn

Response:
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker<|endoftext|>


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

Response:
if (element4 in 1uL..3uL != range0.contains(element4)) throw AssertionError()
    if (element4 !in 1uL..3uL != !range0.contains(element4)) throw AssertionError()
    if (!(element4 in 1uL..3uL) != !range0.contains(element4)) throw AssertionError()<|endoftext|>


Prompt:
val nativeTarget = metadata.projectTargets.single { it.platformType == "native" }
        assertEquals("org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests", nativeTarget.target)
        val nativeExtras = assertNotNull(nativeTarget.extras.native)

Response:
assertEquals("linux_x64", nativeExtras.konanTarget)
        assertEquals("1.5-dev-17775", nativeExtras.konanVersion)
        assertEquals("1.4.2", nativeExtras.konanAbiVersion)
        assertNull(nativeTarget.extras.android)
        assertNull(nativeTarget.extras.jvm)<|endoftext|>


Prompt:
e + (e - acc)
            }
        }

        expect(null, { arg1("").reduceIndexedOrNull { _, _, _ -> '\n' } })
    }

    @Test fun reduceRightIndexed() = withOneCharSequenceArg { arg1 ->
        // get the 3rd character

Response:
assertEquals('c', arg1("bacfd").reduceRightIndexed { index, c, v -> if (index == 2) c else v })

        expect('c') {
            "ab".reduceRightIndexed { index, e, acc ->
                assertEquals(0, index)
                assertEquals('b', acc)
                assertEquals('a', e)<|endoftext|>


Prompt:
val prefix = (projectName + "Project_" + taskName + "_").takeUnless { shortenTempRootName }
                subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), prefix)
                systemProperty("java.io.tmpdir", subProjectTempRoot.toString())
            }
        }

        val fs = project.serviceOf<FileSystemOperations>()
        doLast {

Response:
subProjectTempRoot?.let {
                try {
                    fs.delete {
                        delete(it)
                    }
                } catch (e: Exception) {
                    logger.warn("Can't delete test temp root folder $it", e.printStackTrace())
                }
            }
        }

        if (parallel && jUnitMode != JUnitMode.JUnit5) {<|endoftext|>


Prompt: if (<!SENSELESS_COMPARISON!>v != null<!> || <!SENSELESS_COMPARISON!>this.v != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>v<!>.funNullableAny()

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


Prompt:
val VAL_WITH_SETTER by error<KtPropertyAccessor>()
        val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error<KtElement>(PositioningStrategy.CONST_MODIFIER)
        val CONST_VAL_WITH_GETTER by error<KtElement>()

Response:
val CONST_VAL_WITH_DELEGATE by error<KtExpression>()
        val TYPE_CANT_BE_USED_FOR_CONST_VAL by error<KtProperty>(PositioningStrategy.CONST_MODIFIER) {
            parameter<ConeKotlinType>("constValType")
        }<|endoftext|>


Prompt:
assertEquals(true, 65.0f == shortX.toFloat())
    assertEquals(true, 65L == shortX.toLong())
    assertEquals(true, 65 == shortX.toInt())
    assertEquals(true, 65.toShort() == shortX.toShort())
    assertEquals(true, 65.toByte() == shortX.toByte())

Response:
assertEquals(true, 'A' == shortX.toChar())

    val byteX: Byte = 65.toByte()
    assertEquals(true, 65.0 == byteX.toDouble())
    assertEquals(true, 65.0f == byteX.toFloat())
    assertEquals(true, 65L == byteX.toLong())<|endoftext|>


Prompt:
PropertyLine(line.split("; ").map { it.trim() })
    }

    val derivedCorePropertiesLines = readLines(derivedCorePropertiesUrl).filterNot(String::isEmptyOrComment).map { line ->
        PropertyLine(line.split("; ").map { it.trim() })
    }

Response:
val categoryRangesGenerators = mutableListOf<RangesGenerator>()
    val otherLowercaseGenerators = mutableListOf<OtherLowercaseRangesGenerator>()
    val otherUppercaseGenerators = mutableListOf<OtherUppercaseRangesGenerator>()

    fun addRangesGenerators(generatedDir: File, target: KotlinTarget) {<|endoftext|>


Prompt:
package samples.random

import samples.*
import kotlin.math.sin
import kotlin.random.Random
import kotlin.test.assertTrue

class Randoms {
    @Sample
    fun defaultRandom() {
        val randomValues = List(10) { Random.nextInt(0, 100) }
        // prints new sequence every time
        println(randomValues)

Response:
val nextValues = List(10) { Random.nextInt(0, 100) }
        println(nextValues)
        assertTrue(randomValues != nextValues)
    }

    @Sample
    fun seededRandom() {
        fun getRandomList(random: Random): List<Int> =
            List(10) { random.nextInt(0, 100) }<|endoftext|>


Prompt:
OperatorNameConventions.GET_VALUE,
            Checks.memberOrExtension,
            Checks.noDefaultAndVarargs, Checks.ValueParametersCount.atLeast(2),
            Checks.isKProperty,
            Checks.nonSuspend,
        )
        checkFor(
            OperatorNameConventions.SET_VALUE,
            Checks.memberOrExtension,

Response:
Checks.noDefaultAndVarargs, Checks.ValueParametersCount.atLeast(3),
            Checks.isKProperty,
            Checks.nonSuspend,
        )
        checkFor(
            OperatorNameConventions.PROVIDE_DELEGATE,
            Checks.memberOrExtension,
            Checks.noDefaultAndVarargs, Checks.ValueParametersCount.exactly(2),<|endoftext|>