Prompt: super<<!NOT_A_SUPERTYPE!>Unit<!>>.<!DEBUG_INFO_MISSING_UNRESOLVED!>foo<!>()

Response: <!DEBUG_INFO_MISSING_UNRESOLVED!>super<!><T><!UNRESOLVED_REFERENCE!>@B<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>foo<!>()<|endoftext|>


Prompt:
expression: KtElement,
        context: CallCheckerContext
    ) {
        val superCall = getSuperCallExpression(call)
        if (superCall != null) {
            val thisTypeForSuperCall: KotlinType =
                context.trace.get(
                    BindingContext.THIS_TYPE_FOR_SUPER_EXPRESSION,
                    superCall
                ) ?: return

Response:
val descriptor = thisTypeForSuperCall.constructor.declarationDescriptor as? DeclarationDescriptorWithVisibility ?: return

            if (!isDefinedInInlineFunction(descriptor)) {
                context.trace.report(
                    SUPER_CALL_FROM_PUBLIC_INLINE.on(
                        context.languageVersionSettings, expression.parent.parent ?: superCall, callableDescriptor<|endoftext|>


Prompt:
is RegularKotlinClassSnapshot, is JavaClassSnapshot -> {
                // Collect ClassSymbols
                if (ClassSymbol(clazz.classId).toLookupSymbol() in lookupSymbols) {
                    collector.addClass(clazz.classId)
                }

                // Collect ClassMembers

Response:
// We want to get the intersection of clazz.classMemberNames and lookupNamesInScope. However, we currently don't store
                // information about clazz.classMemberNames, so we'll take all of lookupNamesInScope (it's okay to over-approximate the
                // result).
                val lookupNamesInScope = lookupSymbols.getLookupNamesInScope(clazz.classId.asSingleFqName())<|endoftext|>


Prompt:
public inline fun kotlin.CharArray.minOf(selector: (kotlin.Char) -> kotlin.Double): kotlin.Double

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

Response:
public inline fun kotlin.CharArray.minOf(selector: (kotlin.Char) -> kotlin.Float): kotlin.Float

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


Prompt:
val result = java.util.Arrays.copyOf(this, thisSize + arraySize)
    System.arraycopy(elements, 0, result, thisSize, arraySize)
    return result
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
public actual operator fun ByteArray.plus(elements: ByteArray): ByteArray {

Response:
val thisSize = size
    val arraySize = elements.size
    val result = java.util.Arrays.copyOf(this, thisSize + arraySize)
    System.arraycopy(elements, 0, result, thisSize, arraySize)
    return result
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.jvm.diagnostics.RawSignature

class JvmMethodSignatureClashDetector(
    private val classCodegen: ClassCodegen
) : SignatureClashDetector<RawSignature, IrFunction>() {

    fun trackFakeOverrideMethod(irFunction: IrFunction) {
        if (irFunction.dispatchReceiverParameter != null) {

Response:
for (overriddenFunction in getOverriddenFunctions(irFunction as IrSimpleFunction)) {
                if (!overriddenFunction.isFakeOverride) trackDeclaration(irFunction, mapRawSignature(overriddenFunction))
            }
        } else {
            trackDeclaration(irFunction, mapRawSignature(irFunction))
        }
    }<|endoftext|>


Prompt:
@Throws(TranslationException::class)
    @JvmOverloads
    fun translate(
        reporter: JsConfig.Reporter,
        files: List<KtFile>,
        mainCallParameters: MainCallParameters,
        analysisResult: JsAnalysisResult? = null
    ): TranslationResult {
        val units = ArrayList<TranslationUnit>()
        for (file in files) {

Response:
units.add(TranslationUnit.SourceFile(file))
        }
        return translateUnits(reporter, units, mainCallParameters, analysisResult)
    }

    @Throws(TranslationException::class)
    @JvmOverloads
    fun translateUnits(
        reporter: JsConfig.Reporter,
        units: List<TranslationUnit>,
        mainCallParameters: MainCallParameters,<|endoftext|>


Prompt:
open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: String?, internal val e: Char?, public val f: Any?) {
    val x: Char? = '.'
    private val y: Unit? = kotlin.Unit
    protected val z: Int? = 12
    public val u: String? = "..."
    val s: Any?
    val v: Int?

Response:
val w: Number?
    val t: String? = if (u != null) this.u else null

    init {
        if (a != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>a<!>.equals(null)<|endoftext|>


Prompt:
if (owner.companionNeedsSerializerFactory(session)) {
                val serializerFactoryClassId = ClassId(SerializationPackages.internalPackageFqName, SERIALIZER_FACTORY_INTERFACE_NAME)
                superType(serializerFactoryClassId.constructClassLikeType(emptyArray(), false))
            }
        }

        return companion.symbol
    }

Response:
override fun FirDeclarationPredicateRegistrar.registerPredicates() {
        register(FirSerializationPredicates.annotatedWithSerializableOrMeta, FirSerializationPredicates.hasMetaAnnotation)
    }

    private val FirClassSymbol<*>.isSerializer: Boolean
        get() = name == SerialEntityNames.SERIALIZER_CLASS_NAME || isExternalSerializer<|endoftext|>


Prompt:
* Checks if index is valid and extends the `bits` array if the index exceeds its size.
     * @throws [IndexOutOfBoundsException] if [index] < 0.
     */
    private fun ensureCapacity(index: Int) {
        if (index < 0) {
            throw IndexOutOfBoundsException()
        }
        if (index >= size) {
            size = index + 1

Response:
if (index.elementIndex >= bits.size) {
                // Create a new array containing the index-th bit.
                bits = bits.copyOf(bitToElementSize(index + 1))
            }
            // Set all bits after the index to 0. TODO: We can remove it.
            clearUnusedTail()
        }
    }

    /** Set the bit specified to the specified value. */<|endoftext|>


Prompt:
dependencies = moduleDependencies.map { it.klibFile.toKlib().toDependency() },
            expectedArtifact = klibFile.toKlib()
        )

        compilation.trigger()

        updateModule(module, moduleDependencies)
    }

    private fun buildAndExecuteBinary(
        mainTestModule: TModule,
        expectedResult: String
    ) {

Response:
val latestVersion = moduleVersions.values.maxOrNull() ?: 2

        val (binarySourceDir, binaryOutputDir) = listOf(BINARY_SOURCE_DIR_NAME, BINARY_OUTPUT_DIR_NAME).map {
            buildDir.resolve(LAUNCHER_MODULE_NAME).resolve(it).apply { mkdirs() }
        }<|endoftext|>


Prompt:
val delegationCtorInTheSameClass = delegationClassDescriptor == classDescriptor
        if (!delegationCtorInTheSameClass && !classDescriptor.hasPrimaryConstructor()) {
            superCallGenerators += {
                val usageTracker = context.usageTracker()!!
                val closure = context.getClassOrConstructorClosure(classDescriptor).orEmpty().map {

Response:
usageTracker.getNameForCapturedDescriptor(it)!!.makeRef()
                }
                it += JsInvocation(Namer.getFunctionCallRef(referenceToClass), listOf(thisNameRef.deepCopy()) + closure + leadingArgs)
                        .withDefaultLocation().makeStmt()
            }
        }<|endoftext|>


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

enum class EnumerationCBC {
    ENTRY1,
    ENTRY2();
    constructor(arg: UserKlass = UserKlass())
}

enum class EnumerationCBD {
    ENTRY1 { override fun abstractFunc() { TODO("Not yet implemented") } },

Response:
ENTRY2() { override fun abstractFunc() { TODO("Not yet implemented") } };
    constructor(arg: UserKlass = UserKlass())
    abstract fun abstractFunc()
}

enum class EnumerationCCA {
    ENTRY;
    constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())
}<|endoftext|>


Prompt:
copyAttributesFrom(original)
        copyTypeParametersFrom(original)
        copyReturnTypeFrom(original)
        copyReceiversFrom(original)
        copyValueParametersFrom(original)

        if (!original.isTopLevel) {
            introduceContextParam()
        }
    }

    private fun IrFunction.introduceContextParam() = addValueParameter {

Response:
name = Name.identifier("\$super")
        type = parentAsClass.defaultType.makeNullable()
        origin = JsLoweredDeclarationOrigin.JS_SUPER_CONTEXT_PARAMETER
    }

}<|endoftext|>


Prompt:
acceptSuspend(<!COMPOSABLE_SUSPEND_FUN,TYPE_MISMATCH!>@Composable suspend fun() { }<!>)
            }
        """
        } else {
            // In K2, the frontend forbids function types with multiple kinds, so
            // `@Composable suspend` function types get turned into error types. This is the

Response:
// reason for the additional ARGUMENT_TYPE_MISMATCH errors.
            """
            import androidx.compose.runtime.Composable

            @Composable suspend fun <!COMPOSABLE_SUSPEND_FUN!>Foo<!>() {}

            fun acceptSuspend(fn: suspend () -> Unit) { print(fn) }<|endoftext|>


Prompt:
srcFile.copyTo(dstFile)
        }

        srcFile.createDirectory()
        srcFile.resolve("somefile").writeText("some content")
        dstFile.writeText("")
        assertFailsWith<FileAlreadyExistsException>("copy dir do not overwrite file") {
            srcFile.copyTo(dstFile)
        }

Response:
srcFile.copyTo(dstFile, overwrite = true)
        assertTrue(dstFile.isDirectory())
        assertTrue(dstFile.listDirectoryEntries().isEmpty(), "only directory is copied, but not its content")

        assertFailsWith<FileAlreadyExistsException>("copy dir do not overwrite dir") {
            srcFile.copyTo(dstFile)
        }<|endoftext|>


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

import org.gradle.api.file.FileCollection
import org.gradle.api.provider.ListProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.SetProperty
import org.gradle.api.tasks.*

Response:
import org.gradle.api.tasks.util.PatternFilterable
import org.gradle.work.Incremental
import org.gradle.work.NormalizeLineEndings
import org.jetbrains.kotlin.gradle.InternalKotlinGradlePluginApi
import java.io.File

@InternalKotlinGradlePluginApi
abstract class K2MultiplatformStructure {<|endoftext|>


Prompt:
contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
    return suspendCoroutineUninterceptedOrReturn { c: Continuation<T> ->
        val safe = SafeContinuation(c.intercepted())
        block(safe)
        safe.getOrThrow()
    }
}

/**
 * Returns the context of the current coroutine.
 */

Response:
@SinceKotlin("1.3")
@Suppress("WRONG_MODIFIER_TARGET")
@InlineOnly
public suspend inline val coroutineContext: CoroutineContext
    get() {
        throw NotImplementedError("Implemented as intrinsic")
    }<|endoftext|>


Prompt:
add(FirErrors.EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING) { firDiagnostic ->
        ExpectActualClassifiersAreInBetaWarningImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }

Response:
add(FirErrors.NOT_A_MULTIPLATFORM_COMPILATION) { firDiagnostic ->
        NotAMultiplatformCompilationImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }
    add(FirErrors.EXPECT_ACTUAL_OPT_IN_ANNOTATION) { firDiagnostic -><|endoftext|>


Prompt:
assertStaticTypeIs<Promise<Int>>(p.then { 1 })

        assertStaticTypeIs<Promise<Int>>(p.then({ 1 }))

        val f: (Int) -> Int = { 1 }
        val ft: (Throwable) -> Int = { 1 }

        assertStaticTypeIs<Promise<Int>>(p.then(f, ft))

Response:
assertStaticTypeIs<Promise<Int>>(
            p.then({
                       1
                   }, {
                       1
                   })
        )

        assertStaticTypeIs<Promise<Int>>(
            p.then({
                       1
                   }) {
                1
            }
        )

        assertStaticTypeIs<Promise<Int>>(
            p.then(onFulfilled = {
                1<|endoftext|>


Prompt: if (d != null || <!SENSELESS_COMPARISON!>this.d != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>d<!>.propNullableAny

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


Prompt:
KonanPrimitiveType.INT -> emptyList()
                            KonanPrimitiveType.LONG -> emptyList()
                            KonanPrimitiveType.FLOAT -> emptyList()
                            KonanPrimitiveType.DOUBLE -> emptyList()
                            KonanPrimitiveType.NON_NULL_NATIVE_PTR -> emptyList()

Response:
KonanPrimitiveType.VECTOR128 -> emptyList()
                        }
                    },
                    ifReference = {
                        return emptyList()
                    },
            )
        }
    }
}

sealed class ExtendOnCalleeSideTargetAbiInfo(private val shouldZeroExtBoolean: Boolean) : TargetAbiInfo {<|endoftext|>


Prompt:
sort(fromIndex, toIndex)
            reverse(fromIndex, toIndex)
            """
        }
    }

    val f_asList = fn("asList()") {
        include(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned)
    } builder {
        doc { "Returns a [List] that wraps the original array." }
        returns("List<T>")

Response:
on(Platform.JVM) {
            body { """return ArraysUtilJVM.asList(this)""" }
        }
        on(Platform.JS) {
            body { """return ArrayList<T>(this.unsafeCast<Array<Any?>>())""" }
        }

        val objectLiteralImpl = if (primitive in PrimitiveType.floatingPointPrimitives) """<|endoftext|>


Prompt:
}

var result = "initial"

var resumingCallback: () -> Unit = {}

suspend fun bar() {
    // Generate proper state machine
    suspendCoroutine<Unit> { cont ->
        resumingCallback = {
            cont.resume(Unit)
        }
    }

    result = "OK"
}

fun box(): String {
    run(::bar)

Response:
if (result != "initial") return "fail"

    resumingCallback()

    return result
}<|endoftext|>


Prompt:
"автомат",
"автоматизация",
"автоматизирование",
"автоматизировать",
"автоматизироваться",

Response:
"автоматизм",
"автоматика",
"автоматический",
"автоматичность",
"автоматичный",
"автоматный",<|endoftext|>


Prompt:
if (-1L in 3..1 != range1.contains(-1L)) throw AssertionError()
    if (-1L !in 3..1 != !range1.contains(-1L)) throw AssertionError()
    if (!(-1L in 3..1) != !range1.contains(-1L)) throw AssertionError()

Response:
if (!(-1L !in 3..1) != range1.contains(-1L)) throw AssertionError()
    // no local optimizations
    if (element3 in 3..1 != range1.contains(element3)) throw AssertionError()
    if (element3 !in 3..1 != !range1.contains(element3)) throw AssertionError()<|endoftext|>


Prompt:
setParent(irClass)
                addDeclarationToParent(this, irClass)
                valueParameters = conversionData.injectedValues.mapIndexed { index, injectedValue ->
                    val isMutated = injectedValue.isMutated

                    irFactory.createValueParameter(
                        UNDEFINED_OFFSET, UNDEFINED_OFFSET,

Response:
if (isMutated) IrDeclarationOrigin.SHARED_VARIABLE_IN_EVALUATOR_FRAGMENT else IrDeclarationOrigin.DEFINED,
                        Name.identifier("p$index"),
                        injectedValue.typeRef.toIrType(typeConverter),
                        isAssignable = isMutated,
                        injectedValue.irParameterSymbol,
                        index,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.tooling.core.toMutableExtras

internal fun IdeaKotlinSerializationContext.IdeaKotlinResolvedBinaryDependencyProto(
    dependency: IdeaKotlinResolvedBinaryDependency
): IdeaKotlinResolvedBinaryDependencyProto {
    return ideaKotlinResolvedBinaryDependencyProto {

Response:
this.extras = IdeaExtrasProto(dependency.extras)
        this.binaryType = dependency.binaryType
        dependency.classpath.toProto()?.let { this.classpath = it }
        dependency.coordinates?.let { this.coordinates = IdeaKotlinBinaryCoordinatesProto(it) }
    }
}<|endoftext|>


Prompt:
) : AbstractAtomicSymbols(context, moduleFragment) {
    // kotlin.concurrent.Volatile annotation class
    override val volatileAnnotationClass: IrClass
        get() = context.referenceClass(ClassId(FqName("kotlin.concurrent"), Name.identifier("Volatile")))?.owner
            ?: error("kotlin.concurrent.Volatile class is not found")

Response:
// kotlin.concurrent.AtomicIntArray
    override val atomicIntArrayClassSymbol: IrClassSymbol
        get() = context.referenceClass(ClassId(FqName("kotlin.concurrent"), Name.identifier("AtomicIntArray")))
            ?: error("kotlin.concurrent.AtomicIntArray is not found")

    // kotlin.concurrent.AtomicLongArray<|endoftext|>


Prompt:
val varargElementType = parameter.varargElementType
            if (argument == null && varargElementType != null) {
                val arrayClass = parameter.type.classOrNull!!.owner
                val primaryConstructor = arrayClass.primaryConstructor!!
                val emptyArrayCall = with(builder) {
                    irCall(primaryConstructor).apply {
                        putValueArgument(0, irInt(0))

Response:
if (primaryConstructor.typeParameters.isNotEmpty()) {
                            check(primaryConstructor.typeParameters.size == 1)
                            putTypeArgument(0, parameter.varargElementType)
                        }
                    }
                }
                expression.putValueArgument(argumentIdx, emptyArrayCall)
            }
        }
        return expression
    }<|endoftext|>


Prompt:
// Here and below we need to split such paths taking this into account.
                            interop.compilerOpts.addAll(args.splitQuotedArgs())
                        }

                        interop.compilerOpts.addAll(podBuildSettings.frameworkHeadersSearchPaths.map { "-I$it" })

Response:
interop.compilerOpts.addAll(podBuildSettings.frameworkSearchPaths.map { "-F$it" })
                    }
                }
            }
        }
    }

    private fun addPodDependencyToInterop(
        project: Project,
        cocoapodsExtension: CocoapodsExtension,
        pod: CocoapodsDependency,<|endoftext|>


Prompt:
package org.jetbrains.kotlin.analysis.api.renderer.declarations.renderers.callables

import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.renderer.declarations.KtDeclarationRenderer

Response:
import org.jetbrains.kotlin.analysis.api.symbols.KtBackingFieldSymbol
import org.jetbrains.kotlin.analysis.utils.printer.PrettyPrinter
import org.jetbrains.kotlin.lexer.KtTokens

public interface KtBackingFieldSymbolRenderer {
    public fun renderSymbol(
        analysisSession: KtAnalysisSession,<|endoftext|>


Prompt:
override val internalDisplayName: String
            get() = "protected/*protected static*/"

        override val externalDisplayName: String
            get() = "protected"
    }

    object ProtectedAndPackage : Visibility("protected_and_package", isPublicAPI = true) {
        override fun compareTo(visibility: Visibility): Int? {
            if (this == visibility) return 0

Response:
if (visibility === Visibilities.Internal) return null
            return if (Visibilities.isPrivate(visibility)) 1 else -1
        }

        override fun normalize(): Visibility {
            return Visibilities.Protected
        }

        override fun mustCheckInImports(): Boolean = false

        override val internalDisplayName: String
            get() = "protected/*protected and package*/"<|endoftext|>


Prompt:
abstract class <!CANNOT_INFER_VISIBILITY, CANNOT_INFER_VISIBILITY!>C2<!> : WithProtectedVar(), IVar
abstract class <!CANNOT_INFER_VISIBILITY, CANNOT_INFER_VISIBILITY!>D2<!> : WithInternalVar(), IVar
abstract class E2 : WithVarInternalSet(), IVar

Response:
abstract class F2 : WithVarProtectedSet(), IVar
abstract class G2 : WithVarPrivateSet(), IVar

abstract class A3 : IVal, WithVal()
abstract class B3 : IVal, WithVar()
abstract class <!CANNOT_INFER_VISIBILITY, CANNOT_INFER_VISIBILITY!>C3<!> : IVal, WithProtectedVar()<|endoftext|>


Prompt:
}

/**
 * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,
 * where key is the element itself and value is provided by the [valueSelector] function applied to that key.
 *
 * If any two elements are equal, the last one overwrites the former value in the map.
 *

Response:
* @sample samples.collections.Collections.Transformations.associateWithTo
 */
@SinceKotlin("1.4")
@kotlin.internal.InlineOnly
public inline fun <V, M : MutableMap<in Boolean, in V>> BooleanArray.associateWithTo(destination: M, valueSelector: (Boolean) -> V): M {
    for (element in this) {<|endoftext|>


Prompt:
value class IC3(val value: Int) {

}

@JvmInline
value class IC4(val value: Int) {
    override fun equals(other: Any?) = TODO()
}

@JvmInline
value class IC5(val value: Int) {
    operator fun equals(other: IC5): Nothing = TODO()
}

@JvmInline

Response:
value class IC6(val value: Int) {
    override fun equals(other: Any?): Nothing = TODO()
}

inline fun <reified T> assertThrows(block: () -> Unit): Boolean {
    try {
        block.invoke()
    } catch (t: Throwable) {
        return t is T
    }
    return false
}

fun box() = when {<|endoftext|>


Prompt:
symbol = IrSimpleFunctionSymbolImpl(),
        isTailrec = false,
        isSuspend = oldFunction.isSuspend,
        isOperator = oldFunction is IrSimpleFunction && oldFunction.isOperator,
        isInfix = oldFunction is IrSimpleFunction && oldFunction.isInfix,
        isExternal = false,
        containerSource = oldFunction.containerSource,

Response:
isFakeOverride = isFakeOverride,
    ).apply {
        parent = irParent

        val newTypeParametersFromContext = copyAndRenameConflictingTypeParametersFrom(
            typeParametersFromContext,
            oldFunction.typeParameters
        )
        val newTypeParametersFromFunction = copyTypeParametersFrom(oldFunction)
        val typeParameterMap =
            (typeParametersFromContext + oldFunction.typeParameters)<|endoftext|>


Prompt:
* [Regex.escapeReplacement] can be used if [replacement] have to be treated as a literal string.
     *
     * @param input the char sequence to find matches of this regular expression in
     * @param replacement the expression to replace found matches with
     * @return the result of replacing each occurrence of this regular expression in [input] with the result of evaluating the [replacement] expression

Response:
* @throws RuntimeException if [replacement] expression is malformed, or capturing group with specified `name` or `index` does not exist
     */
    public actual fun replace(input: CharSequence, replacement: String): String
            = replace(input) { match -> substituteGroupRefs(match, replacement) }

    /**
     * Replaces all occurrences of this regular expression in the specified [input] string with the result of<|endoftext|>


Prompt:
* Call stack the virtual machine stopped on.
             */
            val callFrames: List<CallFrame>,
            /**
             * Pause reason.
             */
            val reason: PauseReason,

            /**
             * Hit breakpoints IDs
             */
            val hitBreakpoints: List<BreakpointId> = emptyList()
        ) : Event()

        /**
         * Fired when the virtual machine resumed execution.

Response:
*
         * See [Debugger.resumed](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-resumed)
         */
        @Serializable
        object Resumed : Event()

        /**
         * Fired when virtual machine fails to parse the script.
         *<|endoftext|>


Prompt:
abstract class KtConstructor<T : KtConstructor<T>> : KtDeclarationStub<KotlinConstructorStub<T>>, KtFunction {
    protected constructor(node: ASTNode) : super(node)
    protected constructor(stub: KotlinConstructorStub<T>, nodeType: KtConstructorElementType<T>) : super(stub, nodeType)

Response:
abstract fun getContainingClassOrObject(): KtClassOrObject

    override fun isLocal() = false

    override fun getValueParameterList() = getStubOrPsiChild(KtStubElementTypes.VALUE_PARAMETER_LIST)

    override fun getValueParameters() = valueParameterList?.parameters ?: emptyList()<|endoftext|>


Prompt:
fun <T, R> T.with(f: T.() -> R) = f()

fun A.extFun1() = b.length

// fun A.extFun2() = c.length // TODO fix KT-9953

val x1 = A("").with { b.length }

// val x2 = A("").with { c.length } // TODO fix KT-9953

Response: val x3 = A.with { c.length }<|endoftext|>


Prompt:
val linuxMainTarget = CommonizerTarget(LINUX_X64, LINUX_ARM64)
                    linuxMainDependencies.forEach { dependency ->
                        assertEquals(linuxMainTarget.identityString, dependency.klibExtra?.commonizerTarget)
                    }
                }

                /* Find posix library */
                run {
                    nativeMainDependencies.assertMatches(

Response:
binaryCoordinates(Regex("org\\.jetbrains\\.kotlin\\.native:posix:.*")),
                        binaryCoordinates(Regex("org\\.jetbrains\\.kotlin\\.native:.*"))
                    )

                    linuxMainDependencies.assertMatches(<|endoftext|>


Prompt:
object timesAssign {
        operator fun invoke(x: Int): A = A
    }
    object divAssign {
        operator fun invoke(x: Int): A = A
    }
    object remAssign {
        operator fun invoke(x: Int): A = A
    }
    object unaryPlus {
        operator fun invoke(): A = A
    }
    object unaryMinus {

Response:
operator fun invoke(): A = A
    }
    object not {
        operator fun invoke(): A = A
    }
    object plus {
        operator fun invoke(x: Int): A = A
    }
    object minus {
        operator fun invoke(x: Int): A = A
    }
    object times {
        operator fun invoke(x: Int): A = A
    }
    object div {<|endoftext|>


Prompt:
val elementTransformerType = type(visitors, "IrElementTransformer")
val elementTransformerVoidType = type(visitors, "IrElementTransformerVoid", TypeKind.Class)
val typeTransformerType = type(visitors, "IrTypeTransformer")
val irTypeType = type(types, "IrType")
val irFactoryType = type(declarations, "IrFactory")

Response:
val stageControllerType = type(declarations, "StageController", TypeKind.Class)
val idSignatureType = type(util, "IdSignature", TypeKind.Class)
val irImplementationDetailType = type(tree, "IrImplementationDetail", TypeKind.Class)

val symbolType = type(symbols, "IrSymbol")<|endoftext|>


Prompt:
// FILE: 2.kt

import test.*

fun box(): String {
    if (null.foo3<Any>() != null) return "fail 1"
    if (null.foo3<Any?>() != null) return "fail 2"

    if (null.foo3<A>() != null) return "fail 3"

Response:
if (null.foo3<A?>() != null) return "fail 4"

    val a = A()

    if (a.foo3<Any>() != a) return "fail 5"
    if (a.foo3<Any?>() != a) return "fail 6"

    if (a.foo3<A>() != a) return "fail 7"<|endoftext|>


Prompt:
abstract override val moduleData: FirModuleData
    abstract val origin: FirDeclarationOrigin
    abstract val attributes: FirDeclarationAttributes

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

    @Suppress("UNCHECKED_CAST")

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

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

    abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirDeclaration
}<|endoftext|>


Prompt:
//!LANGUAGE: -ProperComputationOrderOfTailrecDefaultParameters

import kotlin.reflect.KClass

fun withEffects(): String = "OK"

const val Z = "123"

enum class EnumA {
    A
}

Response:
tailrec fun foo(i: Int = 1, c: Char = '2', s: String = "1234", b: Boolean = true, d: Double = 1.0,  l: Long =  1L,  y: String = withEffects()) {
    foo(i, c, s, b, d, l, y)
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.psi.KtNameReferenceExpression
import org.jetbrains.kotlin.psi.KtParenthesizedExpression
import org.jetbrains.kotlin.psi.KtSafeQualifiedExpression
import org.jetbrains.kotlin.resolve.calls.checkers.CallChecker

Response:
import org.jetbrains.kotlin.resolve.calls.checkers.CallCheckerContext
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.calls.model.isReallySuccess
import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver<|endoftext|>


Prompt:
// !JDK_KIND: MODIFIED_MOCK_JDK
// !CHECK_TYPE

interface A : MutableCollection<String> {
    // Override of deprecated function could be marked as deprecated too
    override fun <!OVERRIDE_DEPRECATION!>nonExistingMethod<!>(x: String) = ""
}

Response:
fun foo(x: MutableCollection<Int>, y: Collection<String>, z: A) {
    x.<!DEPRECATION!>nonExistingMethod<!>(1).checkType { _<String>() }
    y.<!DEPRECATION!>nonExistingMethod<!>("")
    z.<!DEPRECATION!>nonExistingMethod<!>("")
}<|endoftext|>


Prompt:
checkSDLError("GetCurrentDisplayMode", SDL_GetCurrentDisplayMode(0, ptr.reinterpret()))
                    Dimensions(w, h)
                }
            }
        }
    }

    override fun dispose() {
        stop()
        super.dispose()
    }

    fun start(videoSize: Dimensions) {
        stop() // To free resources from previous playbacks.

Response:
println("SDL Video: Playing output with ${videoSize.w} x ${videoSize.h} pixels")
        window = SDLRendererWindow((displaySize - videoSize) / 2, videoSize)
    }

    fun pixelFormat(): PixelFormat = window?.pixelFormat() ?: PixelFormat.INVALID

    fun nextFrame(frameData: CPointer<Uint8Var>, linesize: Int) =<|endoftext|>


Prompt:
* Adapter interface that can be implemented by phase context, input or output
 * to enable IR validation, dumping and possibly other pre- and postprocessing.
 */
interface KotlinBackendIrHolder {
    val kotlinIr: IrElement
}

private fun <Context : PhaseContext> findBackendContext(context: Context): CommonBackendContext? = when {
    context is CommonBackendContext -> context

Response:
context is BackendContextHolder<*> -> context.backendContext
    else -> null
}

private fun <Context : PhaseContext, Data> findKotlinBackendIr(context: Context, data: Data): IrElement? = when {
    data is IrElement -> data
    data is KotlinBackendIrHolder -> data.kotlinIr<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS -UNUSED_PARAMETER
fun <T> f1(l: <!UNRESOLVED_REFERENCE!>List1<!><T>): T {throw Exception()} // ERROR type here

Response:
fun <T> f1(l: <!UNRESOLVED_REFERENCE!>List2<!><T>): T {throw Exception()} // ERROR type here
fun <T> f1(c: Collection<T>): T{throw Exception()}

fun <T> test(l: List<T>) {<|endoftext|>


Prompt:
val MINIMAL_SUPPORTED_VERSION = ApiVersion.parse("1.0-M1-SNAPSHOT")!!
        val MINIMAL_VERSION_FOR_INLINE_CLASSES = ApiVersion.parse("1.1-M1-SNAPSHOT")!!
    }

    fun currentCompilerMatchRequired(): Boolean {

Response:
val current = requireNotNull(KotlinCompilerVersion.getVersion()?.let(ApiVersion.Companion::parse))
        return requireKotlinVersion == null || requireKotlinVersion <= current
    }

    fun implementationVersionMatchSupported(): Boolean {
        return implementationVersion != null && implementationVersion >= MINIMAL_SUPPORTED_VERSION
    }
}

object CommonVersionReader {<|endoftext|>


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

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


Prompt:
@SinceKotlin("1.5")
@WasExperimental(ExperimentalPathApi::class)
@kotlin.internal.InlineOnly
public inline fun URI.toPath(): Path =
    Paths.get(this)

/**
 * Returns a sequence of paths for visiting this directory and all its content.
 *

Response:
* By default, only files are visited, in depth-first order, and symbolic links are not followed.
 * If encountered, symbolic links are included in the sequence as-is, and the content of the directory they point to is not visited.
 * The combination of [options] overrides the default behavior. See [PathWalkOption].
 *
 * The order in which sibling files are visited is unspecified.
 *<|endoftext|>


Prompt:
In this case, 510 will be the buildNumber, but there is still no associated classifierNumber.
        In order to keep the regex below simple, we fast path out here, since we know that
        dev builds never carry classifier numbers
         */
        if (maturity == KotlinToolingVersion.Maturity.DEV) return null

        /*
        Classifiers with only a buildNumber assigned
         */

Response:
val buildNumberOnlyClassifierRegex = Regex("\\d+")
        if (buildNumberOnlyClassifierRegex.matches(classifier)) {
            return null
        }

        val classifierRegex = Regex("""(.+?)(\d*)?(-release)?-?(\d*)?""")<|endoftext|>


Prompt:
val livenessFrame = livenessFrames[suspensionCallBegin.index()]

            val referencesToSpill = arrayListOf<ReferenceToSpill>()
            val primitivesToSpill = arrayListOf<PrimitiveToSpill>()

            // 0 - this
            // 1 - parameter
            // ...
            // k - continuation
            // k + 1 - data
            // k + 2 - exception

Response:
for (slot in 0 until localsCount) {
                if (slot == continuationIndex || slot == dataIndex) continue
                val value = frame.getLocal(slot)
                if (value.type == null || (shouldOptimiseUnusedVariables && !livenessFrame.isAlive(slot))) continue

                if (value === StrictBasicValue.NULL_VALUE) {
                    referencesToSpill += slot to null<|endoftext|>


Prompt:
inline class InlineNonNullOuter(val z1: S) {
    @Suppress("INNER_CLASS_INSIDE_VALUE_CLASS")
    inner class Inner(val z2: S, val z3: S?) {
        val test = "$z1 $z2 $z3"
    }
}

inline class InlineNullableOuter(val z1: S?) {

Response:
@Suppress("INNER_CLASS_INSIDE_VALUE_CLASS")
    inner class Inner(val z2: S, val z3: S?) {
        val test = "$z1 $z2 $z3"
    }
}

fun box(): String {
    val z1 = S("1")
    val z2 = S("2")
    val z3 = S("3")<|endoftext|>


Prompt:
explicitReceiver: DetailedReceiver?,
    classValueReceiver: Boolean,
    collectCandidates: CandidatesCollector
): ScopeTowerProcessor<C> {
    val withoutClassValueProcessor =
        createSimpleProcessorWithoutClassValueReceiver(scopeTower, context, explicitReceiver, collectCandidates)

    if (classValueReceiver && explicitReceiver is QualifierReceiver) {

Response:
val classValue = explicitReceiver.classValueReceiverWithSmartCastInfo ?: return withoutClassValueProcessor
        return PrioritizedCompositeScopeTowerProcessor(
            withoutClassValueProcessor,
            ExplicitReceiverScopeTowerProcessor(scopeTower, context, classValue, collectCandidates)
        )
    }
    return withoutClassValueProcessor
}<|endoftext|>


Prompt: 0x001c, 0x1905, 0x0008, 0x0005, 0x18a6, 0x14a6, 0x0006, 0x0005, 0x18c5, 0x0005, 0x0011, 0x10a5, 0x0018, 0x0005, 0x18c8, 0x6308, 0x1085, 0x00c8,

Response: 0x0011, 0x0005,<|endoftext|>


Prompt:
val defaultRes = FooClass().make()
    val defaultTraitRes = FooClass().makeFromTraitImpl()
    if (explicitParam != defaultRes) return  "fail 1: ${explicitParam} != ${defaultRes}"
    if (explicitParam != "16") return  "fail 2: ${explicitParam}"

Response:
if (explicitParam != defaultTraitRes) return  "fail 3: ${explicitParam} != ${defaultTraitRes}"

    return "OK"
}<|endoftext|>


Prompt:
override abstract fun remove(x: String): Boolean
    override abstract fun removeAt(index: Int): String
}

abstract class A7 : MutableList<String>
abstract class A8 : java.util.ArrayList<String>()

interface A9 : MutableList<String> {}

abstract class A10 : MutableList<Int> {

Response:
override fun remove(x: Int): Boolean = true
    override fun removeAt(index: Int): Int = 1
}

fun box(
        a1: A1<String>,
        a2: A2,
        a3: A3,
        a4: A4,
        a5: A5,
        a6: A6,
        a7: A7,<|endoftext|>


Prompt:
get() = project.tasks.named(LockCopyTask.STORE_PACKAGE_LOCK_NAME)

    companion object {
        const val EXTENSION_NAME: String = "kotlinNpm"

        operator fun get(project: Project): NpmExtension {
            val rootProject = project.rootProject
            rootProject.plugins.apply(NodeJsRootPlugin::class.java)

Response:
return rootProject.extensions.getByName(EXTENSION_NAME) as NpmExtension
        }
    }
}<|endoftext|>


Prompt:
ulongArrayOf(1u, ULong.MAX_VALUE, ULong.MIN_VALUE).let { arr ->
            assertTrue(arr contentEquals ULongArray(arr.size, arr::get))
            assertFalse(arr contentEquals ULongArray(arr.size - 1, arr::get))
        }

Response:
ushortArrayOf(1u, UShort.MAX_VALUE, UShort.MIN_VALUE).let { arr ->
            assertTrue(arr contentEquals UShortArray(arr.size, arr::get))
            assertFalse(arr contentEquals UShortArray(arr.size - 1, arr::get))
        }<|endoftext|>


Prompt: "I9", "I10"))

Response: process(C12(), "C12", setOf("I2", "I61", "I62", "I12", "I51", "I52", "I53", "I54", "I55", "I56", "I57", "I58", "I59", "I62", "I63", "I64", "I65", "I66", "I67", "I68", "I69",<|endoftext|>


Prompt: expectFailure(linkage("Constructor 'ClassToEnum.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToEnumBazAsAny() }

Response: expectFailure(linkage("Constructor 'ClassToEnum.<init>' can not be called: Private constructor declared in module <lib1> can not be accessed in module <lib2>")) { getClassToEnumBazAsAnyInline() }<|endoftext|>


Prompt:
return ExternalOverridabilityCondition.Result.UNKNOWN
    }

    private fun parameterNamesMatch(first: FunctionDescriptor, second: FunctionDescriptor): Boolean {
        // The original Objective-C method selector is represented as
        // function name and parameter names (except first).

        if (first.valueParameters.size != second.valueParameters.size) {
            return false
        }

Response:
first.valueParameters.forEachIndexed { index, parameter ->
            if (index > 0 && parameter.name != second.valueParameters[index].name) {
                return false
            }
        }

        return true
    }

}<|endoftext|>


Prompt:
byteSeparatorLength = 0,
                bytePrefixLength = 0,
                byteSuffixLength = 0
            )
            assertEquals(Int.MAX_VALUE / 2 * 2, length)
        }
        assertFailsWith<IllegalArgumentException> {
            formattedStringLength(
                numberOfBytes = Int.MAX_VALUE,
                bytesPerLine = Int.MAX_VALUE,

Response:
bytesPerGroup = Int.MAX_VALUE,
                groupSeparatorLength = Int.MAX_VALUE,
                byteSeparatorLength = Int.MAX_VALUE,
                bytePrefixLength = Int.MAX_VALUE,
                byteSuffixLength = Int.MAX_VALUE
            )
        }
        assertFailsWith<IllegalArgumentException> {
            formattedStringLength(<|endoftext|>


Prompt:
fun ConeInferenceContext.commonSuperTypeOrNull(types: List<ConeKotlinType>): ConeKotlinType? {
    return when (types.size) {
        0 -> null
        1 -> types.first()
        else -> with(NewCommonSuperTypeCalculator) {
            commonSuperType(types) as ConeKotlinType
        }
    }
}

Response:
fun ConeInferenceContext.intersectTypesOrNull(types: List<ConeKotlinType>): ConeKotlinType? {
    return when (types.size) {
        0 -> null
        1 -> types.first()
        else -> ConeTypeIntersector.intersectTypes(this, types)
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionExpressionImpl

Response:
import org.jetbrains.kotlin.ir.types.IrSimpleType
import org.jetbrains.kotlin.ir.types.classOrNull
import org.jetbrains.kotlin.ir.util.copyTo
import org.jetbrains.kotlin.ir.util.file
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid<|endoftext|>


Prompt:
override fun init(delegate: IrModuleDeserializer) {
        val fileCount = klib.fileCount()

        val fileDeserializationStates = mutableListOf<FileDeserializationState>()

        for (i in 0 until fileCount) {
            val fileStream = klib.file(i).codedInputStream

Response:
val fileProto = ProtoFile.parseFrom(fileStream, ExtensionRegistryLite.newInstance())
            val fileReader = IrLibraryFileFromBytes(IrKlibBytesSource(klib, i))
            val file = fileReader.createFile(moduleFragment, fileProto)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.KtCallableSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtReceiverParameterSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbolOrigin

Response:
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.fir.psi
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol<|endoftext|>


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

import org.jetbrains.kotlin.fir.analysis.checkers.expression.*
import org.jetbrains.kotlin.fir.analysis.js.checkers.expression.*

Response:
import org.jetbrains.kotlin.fir.analysis.web.common.checkers.expression.FirJsCodeConstantArgumentChecker
import org.jetbrains.kotlin.fir.analysis.web.common.checkers.expression.FirJsQualifierChecker

object JsExpressionCheckers : ExpressionCheckers() {<|endoftext|>


Prompt:
.map { compilation -> Scope.create(compilation) }.toSet()
        .ifEmpty { return null }

    val interops: Set<CInteropIdentifier> = filteredCompilations
        .flatMap { compilation -> compilation.cinterops.ifEmpty { return null } }
        .map { cinterop -> cinterop.identifier }.toSet()

Response:
return CInteropCommonizerDependent(target, scopes, interops)
}

internal suspend fun CInteropCommonizerDependent.Factory.from(compilation: KotlinSharedNativeCompilation): CInteropCommonizerDependent? {
    return from(
        compilation.commonizerTarget.await() as? SharedCommonizerTarget ?: return null,<|endoftext|>


Prompt:
private fun IrClass.hasSerializableAnnotationWithArgs(): Boolean {
    val annot = getAnnotation(SerializationAnnotations.serializableAnnotationFqName)
    return annot?.getValueArgument(0) != null
}

private fun IrClass.checkSerializableOrMetaAnnotationArgs(mustDoNotHaveArgs: Boolean): Boolean {

Response:
val annot = getAnnotation(SerializationAnnotations.serializableAnnotationFqName)
    if (annot != null) { // @Serializable have higher priority
        if (!mustDoNotHaveArgs) return true
        if (annot.getValueArgument(0) != null) return false
        return true
    }
    return annotations
        .map { it.constructedClass.annotations }<|endoftext|>


Prompt:
public abstract fun toDouble(): kotlin.Double

    public abstract fun toFloat(): kotlin.Float

    public abstract fun toInt(): kotlin.Int

    public abstract fun toLong(): kotlin.Long

    public abstract fun toShort(): kotlin.Short
}

public open class NumberFormatException : kotlin.IllegalArgumentException {
    public constructor NumberFormatException()

Response:
public constructor NumberFormatException(message: kotlin.String?)
}<|endoftext|>


Prompt:
public actual fun StringBuilder.clear(): StringBuilder = apply { setLength(0) }

/**
 * Sets the character at the specified [index] to the specified [value].
 *
 * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.
 */
@kotlin.internal.InlineOnly

Response:
public actual inline operator fun StringBuilder.set(index: Int, value: Char): Unit = this.setCharAt(index, value)

/**
 * Replaces characters in the specified range of this string builder with characters in the specified string [value] and returns this instance.
 *
 * @param startIndex the beginning (inclusive) of the range to replace.
 * @param endIndex the end (exclusive) of the range to replace.<|endoftext|>


Prompt:
if (<!USELESS_IS_CHECK, USELESS_IS_CHECK!>a is Int<!>) {
            a = <!TYPE_MISMATCH!>67<!>
        }
    }

    // See KT-54664
    val value3 = myBuilder {
        accept(<!TYPE_MISMATCH!>""<!>)
        a = 45

Response:
bar(<!TYPE_MISMATCH!>::a<!>)
    }

    fun baz(t: Int) {}

    val value4 = myBuilder {
        accept("")
        a = 45
        b[0] = 123
        baz(<!TYPE_MISMATCH, TYPE_MISMATCH!>a<!>)
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.psi.psiUtil.getPrevSiblingIgnoringWhitespaceAndComments
import org.jetbrains.kotlin.psi.psiUtil.hasSuspendModifier
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes

Response:
import org.jetbrains.kotlin.resolve.PossiblyBareType.bare
import org.jetbrains.kotlin.resolve.PossiblyBareType.type
import org.jetbrains.kotlin.resolve.bindingContextUtil.recordScope
import org.jetbrains.kotlin.resolve.calls.checkers.checkCoroutinesFeature<|endoftext|>


Prompt:
<!NO_ACTUAL_FOR_EXPECT{JVM}!>expect <!EXPECTED_LATEINIT_PROPERTY!>lateinit<!> var lateinitVar: String<!>

<!NO_ACTUAL_FOR_EXPECT{JVM}!>expect val delegated: String by <!EXPECTED_DELEGATED_PROPERTY!>Delegate<!><!>

Response:
object Delegate { operator fun getValue(x: Any?, y: Any?): String = "" }

fun test(): String {
    <!WRONG_MODIFIER_TARGET!>expect<!> val localVariable: String
    localVariable = "no"
    return localVariable
}<|endoftext|>


Prompt:
private val errorTypeForCapturedTypeStub by lazy { createErrorType() }

    fun FirTypeRef.toIrType(typeOrigin: ConversionTypeOrigin = ConversionTypeOrigin.DEFAULT): IrType {
        capturedTypeCache.clear()
        return when (this) {
            !is FirResolvedTypeRef -> createErrorType()

Response:
!is FirImplicitBuiltinTypeRef -> type.toIrType(typeOrigin, annotations)
            is FirImplicitNothingTypeRef -> irBuiltIns.nothingType
            is FirImplicitUnitTypeRef -> irBuiltIns.unitType
            is FirImplicitBooleanTypeRef -> irBuiltIns.booleanType
            is FirImplicitStringTypeRef -> irBuiltIns.stringType<|endoftext|>


Prompt:
import org.jetbrains.kotlin.container.StorageComponentContainer
import org.jetbrains.kotlin.container.useInstance
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.extensions.StorageComponentContainerContributor
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter

Response:
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.parcelize.fir.FirParcelizeExtensionRegistrar
import org.jetbrains.kotlin.platform.TargetPlatform
import org.jetbrains.kotlin.platform.jvm.isJvm<|endoftext|>


Prompt:
val simpleName = if (sourceName == null || sourceName.isSpecial) {
                val count = (anonymousClassesCount[enclosingName.toUpperCaseAsciiOnly()] ?: 0) + 1
                anonymousClassesCount[enclosingName.toUpperCaseAsciiOnly()] = count
                count.toString()
            } else {
                sourceName
            }

Response:
return sanitizeNameIfNeeded("$enclosingName$$simpleName")
        }
    }
}<|endoftext|>


Prompt:
if (!!!(x !is TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>)) else {
        if (!!(x !is TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>)) else {

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


Prompt:
// Dispatch receiver type must be casted when types are different.
    override val shouldCastDispatchReceiver: Boolean = true
    override fun getBridgeOrigin(bridge: IrSimpleFunction): IrDeclarationOrigin =
        IrDeclarationOrigin.BRIDGE

    override fun transformFlat(declaration: IrDeclaration): List<IrDeclaration>? {
        if (declaration.isEffectivelyExternal()) return null

Response:
return super.transformFlat(declaration)
    }
}<|endoftext|>


Prompt:
if (funWithReturnsNotNullAndInvertCondition(value_1 is String && value_2 == null) == null) {
        <!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)

Response:
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_2?.<!UNRESOLVED_REFERENCE!>toByte<!>())
    }
    if (funWithReturnsNotNull(value_1 is Float? && value_1 != null && value_2 != null) == null) {<|endoftext|>


Prompt:
KtFirAnnotationListForDeclaration.create(firSymbol, builder)
    }

    override val generatedPrimaryConstructorProperty: KtKotlinPropertySymbol? by cached {
        val propertySymbol = firSymbol.fir.correspondingProperty?.symbol ?: return@cached null

Response:
val ktPropertySymbol = builder.variableLikeBuilder.buildPropertySymbol(propertySymbol)
        check(ktPropertySymbol is KtKotlinPropertySymbol) {
            "Unexpected symbol for primary constructor property ${ktPropertySymbol.javaClass} for fir: ${firSymbol.fir.renderWithType()}"
        }

        ktPropertySymbol
    }<|endoftext|>


Prompt:
@file:Suppress("FunctionName")

package org.jetbrains.kotlin.gradle.unitTests.compilerArgumetns

import org.jetbrains.kotlin.compilerRunner.ArgumentUtils
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension

Response:
import org.jetbrains.kotlin.gradle.plugin.CreateCompilerArgumentsContext
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.ArgumentType.*
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext.Companion.default<|endoftext|>


Prompt:
} catch (e: IOException) {
            return null
        }

        return CompositeLookupsCacheAttributes(version.intValue, components)
    }

    override fun writeVersion(values: CompositeLookupsCacheAttributes?) {
        if (values == null) {
            versionManager.writeVersion(null)
            Files.deleteIfExists(actualComponentsFile)
        } else {

Response:
versionManager.writeVersion(CacheVersion(values.version))

            Files.createDirectories(actualComponentsFile.parent)
            Files.newOutputStream(actualComponentsFile).bufferedWriter().use { it.append(values.components.joinToString("\n")) }
        }
    }<|endoftext|>


Prompt:
contractDescriptionVisitor.visitBooleanValueParameterReference(this, data)
}

class KtErroneousValueParameterReference<Type, Diagnostic>(val diagnostic: Diagnostic) : KtValueParameterReference<Type, Diagnostic>(Int.MAX_VALUE, "ERROR") {
    override val erroneous: Boolean
        get() = true

Response:
override fun <R, D> accept(contractDescriptionVisitor: KtContractDescriptionVisitor<R, D, Type, Diagnostic>, data: D): R =
        contractDescriptionVisitor.visitErroneousValueParameterReference(this, data)
}<|endoftext|>


Prompt:
"org.jetbrains.kotlin.test.kotlin-compiler-args-properties.gradle.plugin",
    )

    @TestFactory
    fun generateArtifactTests(): Stream<DynamicTest> {
        return findActualPoms().map { actual ->
            val expectedPomPath = actual.toExpectedPath()

Response:
DynamicTest.dynamicTest(expectedPomPath.fileName.toString()) {
                if ("${expectedPomPath.parent.fileName}" !in excludedProjects) {
                    if ("${expectedPomPath.parent.fileName}" !in nativeBundles) {
                        val actualString = actual.toFile().readText().replace(kotlinVersion, "ArtifactsTest.version")<|endoftext|>


Prompt:
if (calleeName != "suspend" && variableCalleeName != "suspend" && descriptor.name.asString() != "suspend") return

        when (descriptor.fqNameOrNull()) {
            KOTLIN_SUSPEND_BUILT_IN_FUNCTION_FQ_NAME -> {

Response:
if (calleeName != "suspend" || !call.hasFormOfSuspendModifierForLambdaOrFun() || call.explicitReceiver != null) {
                    context.trace.report(Errors.NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND.on(reportOn))
                }
            }
            else -> {<|endoftext|>


Prompt: WRONG_ANNOTATION_TARGET!>@A1(<!TOO_MANY_ARGUMENTS!>12<!>)<!> <!REPEATED_ANNOTATION, WRONG_ANNOTATION_TARGET!>@A2(<!ARGUMENT_TYPE_MISMATCH!>"Test"<!>)<!>  T> T.topProp: Int get() = 12

Response: class SomeClass {<|endoftext|>


Prompt:
asSucceeds("w as MutableIterable<*>") { w as MutableIterable<*> }
    asSucceeds("w as MutableMap.MutableEntry<*, *>") { w as MutableMap.MutableEntry<*, *> }

    safeAsReturnsNonNull("w as Iterator<*>") { w as? Iterator<*> }

Response:
safeAsReturnsNull("w as? MutableIterator<*>") { w as? MutableIterator<*> }
    safeAsReturnsNonNull("w as? MutableIterable<*>") { w as? MutableIterable<*> }
    safeAsReturnsNonNull("w as? MutableMap.MutableEntry<*, *>") { w as? MutableMap.MutableEntry<*, *> }<|endoftext|>


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

/*
 * TESTCASE NUMBER: 1
 * ISSUES: KT-22996
 */

Response:
fun case_1(x: Number?): Long? {
    if (x is Long?) return <!DEBUG_INFO_SMARTCAST!>x<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number?")!>x<!><|endoftext|>


Prompt:
public inline fun <T, R> kotlin.collections.Iterable<T>.fold(initial: R, operation: (acc: R, T) -> R): R

public inline fun <T, R> kotlin.Array<out T>.foldIndexed(initial: R, operation: (index: kotlin.Int, acc: R, T) -> R): R

Response:
public inline fun <R> kotlin.BooleanArray.foldIndexed(initial: R, operation: (index: kotlin.Int, acc: R, kotlin.Boolean) -> R): R

public inline fun <R> kotlin.ByteArray.foldIndexed(initial: R, operation: (index: kotlin.Int, acc: R, kotlin.Byte) -> R): R<|endoftext|>


Prompt:
receiverInfo,
                convertedArgument?.unknownIntegerType?.unwrap(),
                inferenceSession
            )

            if (!hasContradiction) {
                addResolvedKtPrimitive(resolvedAtom)
                return@runTransaction true
            }

            convertedTypeAfterSubtyping =
                TypeConversions.performCompositeConversionAfterSubtyping(

Response:
this@resolveKotlinArgument,
                    argument,
                    candidateParameter,
                    candidateExpectedType
                )?.let { prepareExpectedType(it) }

            if (convertedTypeAfterSubtyping == null) {
                addResolvedKtPrimitive(resolvedAtom)
                return@runTransaction true
            }

            false
        }<|endoftext|>


Prompt:
origin.replaceAttributes(newAttributes).wrapEnhancement(enhancement)

    override fun makeNullableAsSpecified(newNullability: Boolean): UnwrappedType =
        origin.makeNullableAsSpecified(newNullability).wrapEnhancement(enhancement.unwrap().makeNullableAsSpecified(newNullability))

Response:
override fun render(renderer: DescriptorRenderer, options: DescriptorRendererOptions): String {
        if (options.enhancedTypes) {
            return renderer.renderType(enhancement)
        }
        return origin.render(renderer, options)
    }

    override val delegate: SimpleType get() = origin.delegate

    @TypeRefinement<|endoftext|>


Prompt:
return builder
    }

    fun scriptProto(script: FirScript): ProtoBuf.Class.Builder = whileAnalysing(session, script) {
        val builder = ProtoBuf.Class.newBuilder()

        val flags = Flags.getClassFlags(
            extension.hasAdditionalAnnotations(script),
            ProtoEnumFlags.visibility(Visibilities.Public),

Response:
ProtoEnumFlags.modality(Modality.FINAL),
            ProtoEnumFlags.classKind(ClassKind.CLASS, false),
            /* inner = */ false,
            /* isData = */ false,
            /* isExternal = */ false,
            /* isExpect = */ false,
            /* isValue = */ false,
            /* isFun = */ false,<|endoftext|>


Prompt:
}
        if (test9 != "70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 " +
                "31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1") {
            return "test9 = $test9"

Response:
}

        return "OK"
    }
}

fun box(): String  {
    return A().test()
}<|endoftext|>


Prompt:
fun testConsumeMppLibraryFromNonKotlinProject() {
        val libRepo = with(transformNativeTestProject("sample-lib", gradleVersion, "new-mpp-lib-and-app")) {
            build("publish") { assertSuccessful() }
            projectDir.resolve("repo")
        }

Response:
with(transformNativeTestProject("sample-app-without-kotlin", gradleVersion, "new-mpp-lib-and-app")) {
            setupWorkingDir()
            gradleBuildScript().appendText("\nrepositories { maven { url '${libRepo.toURI()}' } }")

            build("assemble") {
                assertSuccessful()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
import org.jetbrains.kotlin.resolve.scopes.MemberScope

object NativeObjCNameOverridesChecker : DeclarationChecker {

    override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {

Response:
if (descriptor !is ClassDescriptor) return
        descriptor.defaultType.memberScope
            .getContributedDescriptors(DescriptorKindFilter.ALL, MemberScope.Companion.ALL_NAME_FILTER)
            .forEach {
                if (it !is CallableMemberDescriptor || it.kind.isReal) return@forEach
                check(declaration, it, context)<|endoftext|>


Prompt:
fragment.imports.entries.forEach { it.setValue(rename(it.value)) }

        fragment.importedModules.forEach { import ->
            import.internalName = rename(import.internalName)
            import.plainReference?.let { rename(it) }
        }

        val classes = fragment.classes.values.map { cls ->

Response:
JsClassModel(rename(cls.name), cls.superName?.let { rename(it) }).apply {
                postDeclarationBlock.statements += rename(cls.postDeclarationBlock).statements
                cls.interfaces.mapTo(interfaces) { rename(it) }
            }
        }
        fragment.classes.clear()<|endoftext|>


Prompt:
// !LANGUAGE: -AbstractClassMemberNotImplementedWithIntermediateAbstractClass

abstract class ALeft {
    abstract fun foo()
}

interface IRight {
    fun foo() {}
}

<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class CDerived<!> : ALeft(), IRight

abstract class CAbstract : ALeft(), IRight

Response:
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class CDerivedFromAbstract<!> : CAbstract()

interface ILeft {
    fun foo()
}

abstract class AILeft : ILeft

// Should be ERROR
<!MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED!>class AILeftImpl<!> : AILeft(), IRight<|endoftext|>


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

import org.jetbrains.kotlin.konan.test.blackbox.support.TestName
import org.jetbrains.kotlin.konan.test.blackbox.support.util.GTestListing
import org.junit.jupiter.api.Assertions.assertEquals

Response:
import org.junit.jupiter.api.Assertions.fail
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test

@Tag("infrastructure")
class InfrastructureGTestListingTest {
    @Test
    fun successfullyParsed() = assertEquals(
        listOf(
            "Foo.bar",
            "Foo.baz",<|endoftext|>


Prompt:
StdOut[

text4

] // root//Test
    COMPLETED FAILURE // root//Test
  COMPLETED FAILURE // root/
COMPLETED FAILURE // root
        """
        ) {
            serviceMessage(TestSuiteStarted(""))
            serviceMessage(TestStarted("Test", false, null))
            regularText("\n\ntext1\n\n")

Response:
regularText("\n\ntext2\n\n")
            serviceMessage(
                "testFailed",
                mapOf(
                    "name" to "Test",
                    "message" to "Expected <7>, actual <42>"
                )
            )
            regularText("\n\ntext3\n\n")
            regularText("\n\ntext4\n\n")<|endoftext|>


Prompt:
Arrays.copyOf(result, size)
        }
    )
}

private inline fun toArrayImpl(
    collection: Collection<*>,
    empty: () -> Array<Any?>,
    alloc: (Int) -> Array<Any?>,
    trim: (Array<Any?>, Int) -> Array<Any?>
): Array<Any?> {
    val size = collection.size

Response:
if (size == 0) return empty() // quick path on zero size
    val iter = collection.iterator() // allocate iterator for non-empty collection
    if (!iter.hasNext()) return empty() // size was > 0, but no actual elements
    var result = alloc(size) // use size as a guess to allocate result array
    var i = 0
    // invariant: iter.hasNext is true && i < result.size<|endoftext|>


Prompt:
fun <T> normal(a: IC): T = bar(a) {
    normalInline(it)
}

fun <T, R> bar(value: T, f: (T) -> R): R {
    return f(value)
}

fun box(): String {
    var res = extension<Int>(IC(40)) + 3
    if (res != 43) return "FAIL 2: $res"

Response:
res = dispatch<Int>(IC(40)) + 4
    if (res != 44) return "FAIL 3: $res"

    res = normal<Int>(IC(40)) + 5
    if (res != 45) return "FAIL 4: $res"

    return "OK"
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.builder.buildFunctionCall
import org.jetbrains.kotlin.fir.references.FirResolvedErrorReference
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
import org.jetbrains.kotlin.fir.references.builder.buildResolvedErrorReference

Response:
import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference
import org.jetbrains.kotlin.fir.resolve.ScopeSession
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
import org.jetbrains.kotlin.fir.resolve.scope<|endoftext|>


Prompt:
* Fills this array or its subrange with the specified [element] value.
 *
 * @param fromIndex the start of the range (inclusive) to fill, 0 by default.
 * @param toIndex the end of the range (exclusive) to fill, size of this array by default.
 *

Response:
* @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */
@SinceKotlin("1.3")
public expect fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size): Unit

/**<|endoftext|>


Prompt:
proto.base,
            setParent
        ) { symbol, _, startOffset, endOffset, origin, _ ->
            irFactory.createAnonymousInitializer(startOffset, endOffset, origin, symbol.checkSymbolType(fallbackSymbolKind = null)).apply {
                body = deserializeStatementBody(proto.body) as IrBlockBody? ?: irFactory.createBlockBody(startOffset, endOffset)

Response:
}
        }

    private fun deserializeIrConstructor(proto: ProtoConstructor, setParent: Boolean = true): IrConstructor =
        withDeserializedIrFunctionBase<IrConstructorSymbol, IrConstructor>(
            proto.base,
            setParent,
            CONSTRUCTOR_SYMBOL
        ) { symbol, idSig, startOffset, endOffset, origin, fcode -><|endoftext|>


Prompt:
var x: Int? = 10
    x = null
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.<!OVERLOAD_RESOLUTION_AMBIGUITY!>case_10<!>()
}

// TESTCASE NUMBER: 11

Response:
fun <T : <!FINAL_UPPER_BOUND!>String<!>> T?.case_11() = this
fun case_11() {
    var x: Int? = 10
    x = null
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>x<!>.case_11()
}<|endoftext|>


Prompt:
data class KotlinFlexibleTypeBean(val lowerBound: KotlinTypeBean, val upperBound: KotlinTypeBean) : KotlinTypeBean, FlexibleTypeMarker {
    override val nullable: Boolean
        get() = lowerBound.nullable
}

data class KotlinClassTypeBean(
    val classId: ClassId,

Response:
val arguments: List<KotlinTypeArgumentBean>,
    override val nullable: Boolean,
) : KotlinTypeBean, SimpleTypeMarker

data class KotlinTypeArgumentBean(val projectionKind: KtProjectionKind, val type: KotlinTypeBean?) : TypeArgumentMarker

data class KotlinTypeParameterTypeBean(
    val typeParameterName: String,<|endoftext|>


Prompt:
return typeArgument(type, projection.projectionKind)
    }

    private fun typeArgument(
        type: ConeKotlinType,
        projectionKind: KtProjectionKind
    ): ConeTypeProjection {
        val variance = when (projectionKind) {
            KtProjectionKind.IN -> Variance.IN_VARIANCE

Response:
KtProjectionKind.OUT -> Variance.OUT_VARIANCE
            KtProjectionKind.NONE -> Variance.INVARIANT
            KtProjectionKind.STAR -> throw AssertionError("* should not be here")
        }
        return type.toTypeProjection(variance)
    }
}

/**<|endoftext|>


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

Response:
if (element3 !in '3'..'1' != !range1.contains(element3)) throw AssertionError()
    if (!(element3 in '3'..'1') != !range1.contains(element3)) throw AssertionError()
    if (!(element3 !in '3'..'1') != range1.contains(element3)) throw AssertionError()
}<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1293
package foo

interface Base {
    abstract fun String.foo(arg: String): String
}

open class BaseImpl(val s: String) : Base {
    override fun String.foo(arg: String): String = "Int.foo ${s}:${this}:${arg}"
}

class Derived() : Base by BaseImpl("test") {

Response:
fun bar(x: String, arg: String): String = x.foo(arg)
}

fun box(): String {
    assertEquals("Int.foo test:A:B", Derived().bar("A", "B"))

    return "OK"
}<|endoftext|>


Prompt:
* DESCRIPTION: Smartcasts using Returns effects with complex (conjunction/disjunction) type checking and not-null conditions outside contract (custom condition).
 * HELPERS: contractFunctions
 */

// TESTCASE NUMBER: 1
fun case_1(value_1: Any?, value_2: Any?) {
    funWithReturns(value_1 is String && value_2 is Number)

Response:
println(<!DEBUG_INFO_SMARTCAST!>value_1<!>.length)
    println(<!DEBUG_INFO_SMARTCAST!>value_2<!>.toByte())
}

// TESTCASE NUMBER: 2
fun case_2(value_1: Any?, value_2: Any?) {<|endoftext|>


Prompt:
// WITH_STDLIB
// LANGUAGE: -ProhibitConstructorCallOnFunctionalSupertype
// ISSUE: KT-46344

abstract class A : () -> Int<!NO_CONSTRUCTOR!>()<!>
abstract class B : (() -> Int)<!NO_CONSTRUCTOR!>()<!>

Response:
abstract class C : Function0<Int><!NO_CONSTRUCTOR!>()<!>
abstract class D : suspend () -> Int<!NO_CONSTRUCTOR!>()<!>
abstract class E : (suspend () -> Int)<!NO_CONSTRUCTOR!>()<!><|endoftext|>


Prompt:
val ONE_MINUS_DST_ALPHA: Int
        val DST_COLOR: Int
        val ONE_MINUS_DST_COLOR: Int
        val SRC_ALPHA_SATURATE: Int
        val FUNC_ADD: Int
        val BLEND_EQUATION: Int
        val BLEND_EQUATION_RGB: Int

Response:
val BLEND_EQUATION_ALPHA: Int
        val FUNC_SUBTRACT: Int
        val FUNC_REVERSE_SUBTRACT: Int
        val BLEND_DST_RGB: Int
        val BLEND_SRC_RGB: Int
        val BLEND_DST_ALPHA: Int
        val BLEND_SRC_ALPHA: Int<|endoftext|>


Prompt:
@kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun plus(other: Int): Int =
        this.toInt() + other

    /** Adds the other value to this value. */
    @kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun plus(other: Long): Long =
        this.toLong() + other

Response:
/** Adds the other value to this value. */
    @kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun plus(other: Float): Float =
        this.toFloat() + other

    /** Adds the other value to this value. */
    @kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun plus(other: Double): Double =<|endoftext|>


Prompt:
}

/* Implementation */

private class CurrentBuildIdentifierImpl(private val currentBuildIdentifier: BuildIdentifier) : CurrentBuildIdentifier {
    override fun contains(project: Project): Boolean {
        return project.currentBuildId() == currentBuildIdentifier
    }

    override fun contains(id: ComponentIdentifier): Boolean {
        return id.buildOrNull == currentBuildIdentifier
    }

Response:
override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is CurrentBuildIdentifierImpl) return false
        return this.currentBuildIdentifier == other.currentBuildIdentifier
    }

    override fun hashCode(): Int {
        return currentBuildIdentifier.hashCode()
    }
}<|endoftext|>


Prompt:
// ISSUE: KT-54920

sealed interface I {
    class C : I
}

sealed interface IAbstract {
    abstract class C : IAbstract {
        class S1 : C()
        class S2 : C()
    }
}

sealed interface ISealed {
    sealed class C : ISealed {
        class S1 : C()
        class S2 : C()

Response:
}
}

fun testDoubleWhen(x: I): Int {
    val a = when (x) { is I.C -> 1 }
    val b = when (x) { <!USELESS_IS_CHECK!>is I.C<!> -> 2 }
    return a + b
}

fun testDoubleWhen(x: IAbstract): Int {<|endoftext|>


Prompt:
MPP_PLATFORMS(
        CONCAT, AllowedListAnonymizer(
            listOf(
                "common",
                "native",
                "jvm",
                "js",
                "android_x64",
                "android_x86",
                "androidJvm",
                "android_arm32",
                "android_arm64",
                "ios_arm64",

Response:
"ios_simulator_arm64",
                "ios_x64",
                "watchos_arm32",
                "watchos_arm64",
                "watchos_x64",
                "watchos_simulator_arm64",
                "watchos_device_arm64",
                "tvos_arm64",
                "tvos_x64",
                "tvos_simulator_arm64",<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// MODULE: lib
// FILE: A.java

class A {
    public A() {}

    public A(String x) {}

    public A(long l, double z) {}
}

// MODULE: main(lib)
// FILE: 1.kt

fun box(): String {
    A()
    A("")

Response:
A(0.toLong(), 0.0)
    return "OK"
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.IrComposite
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.expressions.IrConstKind
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall

Response:
import org.jetbrains.kotlin.ir.expressions.IrDelegatingConstructorCall
import org.jetbrains.kotlin.ir.expressions.IrElseBranch
import org.jetbrains.kotlin.ir.expressions.IrEnumConstructorCall
import org.jetbrains.kotlin.ir.expressions.IrExpression<|endoftext|>


Prompt:
val SHOW_DOCUMENT_FRAGMENT: Int
        val SHOW_NOTATION: Int
    }
}

/**
 * Exposes the JavaScript [DOMTokenList](https://developer.mozilla.org/en/docs/Web/API/DOMTokenList) to Kotlin
 */
public external abstract class DOMTokenList : ItemArrayLike<JsString>, JsAny {
    open var value: String

Response:
fun contains(token: String): Boolean
    fun add(vararg tokens: String)
    fun remove(vararg tokens: String)
    fun toggle(token: String, force: Boolean = definedExternally): Boolean
    fun replace(token: String, newToken: String)
    fun supports(token: String): Boolean
    override fun item(index: Int): JsString?
}<|endoftext|>


Prompt:
abstract val attributes: MapProperty<String, String>

    @get:Input
    abstract val rawStatements: ListProperty<String>

    @get:Nested
    abstract val dependencies: ListProperty<CocoapodsDependency>

    @get:Input
    abstract val artifactType: Property<ArtifactType>

    @get:OutputFile

Response:
@Suppress("LeakingThis") // should be inherited only by gradle machinery
    val outputFile: Provider<RegularFile> = specName.flatMap { specName ->
        destinationDir.file("$specName.podspec")
    }

    @TaskAction
    fun generate() {
        outputFile.get().asFile.writeText(buildString {<|endoftext|>


Prompt:
internal fun IrElement.getCompilerMessageLocation(containingFile: IrFile): CompilerMessageLocation? =
        createCompilerMessageLocation(containingFile, this.startOffset, this.endOffset)

internal fun IrBuilderWithScope.getCompilerMessageLocation(): CompilerMessageLocation? {
    val declaration = this.scope.scopeOwnerSymbol.owner as? IrDeclaration ?: return null

Response:
val file = declaration.getPackageFragment() as? IrFile ?: return null
    return createCompilerMessageLocation(file, startOffset, endOffset)
}

private fun createCompilerMessageLocation(containingFile: IrFile, startOffset: Int, endOffset: Int): CompilerMessageLocation? {
    val sourceRangeInfo = containingFile.fileEntry.getSourceRangeInfo(startOffset, endOffset)<|endoftext|>


Prompt:
// !CHECK_TYPE

fun <T : Any> Array<T?>.filterNotNull(): List<T> = throw Exception()

fun test1(a: Array<out Int?>) {
    val list = a.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>filterNotNull<!>()

Response:
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>list<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><List<Int>>() }
}

fun test2(vararg a: Int?) {<|endoftext|>


Prompt:
Framework, FatFramework, XCFramework -> vendoredFrameworks
                }

                val prefix = when (artifactTypeValue) {
                    StaticLibrary, DynamicLibrary -> "lib"
                    else -> ""
                }

                val suffix = when (artifactTypeValue) {
                    StaticLibrary -> "a"
                    DynamicLibrary -> "dylib"
                    Framework, FatFramework -> "framework"

Response:
XCFramework -> "xcframework"
                }

                val value = "$prefix${specName.get()}.$suffix"

                put(key, value)
            }
        }
    }

    private fun String.wrapInSingleQuotesIfNeeded(): String {
        return when {
            startsWith('{') ||
                    startsWith('[') ||<|endoftext|>


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

OPTIONAL_JVM_INLINE_ANNOTATION
value class Z1<T: String?>(val x: T)

OPTIONAL_JVM_INLINE_ANNOTATION

Response:
value class Z2<T: Z1<String?>>(val z: T)

OPTIONAL_JVM_INLINE_ANNOTATION
value class ZN<T: Z1<String?>?>(val z: T)

fun wrap1(x: String): Z1<String?>? = if (x.length == 0) null else Z1(x)<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KProperty1<Scope.Nested<*>, kotlin.Any?>")!>g<!>
}

fun justResolve() {
    val a = Scope.Nested<String>::key
    val b = Scope.Nested<String>::keyT
    val c = Scope.Nested<*>::keyT

Response:
val d = Scope.Nested<out Number?>::keyT
}<|endoftext|>


Prompt:
//     val managed = managed
        //     field cleaner = createCleaner(cpp) { it ->
        //          $Inner.Companion.__destroy__(it) // For general CPlusPlusClass
        //          or
        //          it.unref() // for SkiaRefCnt
        //     }
        // }

        val traceCleaners = false

Response:
val cppParam = irClass.primaryConstructor!!.valueParameters.first().also {
            assert(it.name.toString() == "cpp")
        }

        val cppType = cppParam.type
        val cppClass = cppType.classOrNull!!.owner

        val superClassFqNames = cppClass.superTypes.map {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactoryImpl
import org.jetbrains.kotlin.test.Directives
import org.jetbrains.kotlin.test.InTextDirectivesUtils.isDirectiveDefined

Response:
import org.jetbrains.kotlin.test.KotlinBaseTest
import org.jetbrains.kotlin.test.util.KtTestUtil
import org.jetbrains.kotlin.utils.addIfNotNull
import org.junit.Assert
import java.io.File
import java.util.regex.Pattern
import kotlin.reflect.jvm.javaField<|endoftext|>


Prompt:
return emptyList()
            }
            val runtimeModule = LLVMModuleCreateWithNameInContext("runtime", generationState.llvmContext)!!
            runtimeNativeLibraries.forEach {
                val failed = llvmLinkModules2(generationState, runtimeModule, it)
                if (failed != 0) {
                    throw Error("Failed to link ${it.getName()}")
                }
            }

Response:
val config = createLTOPipelineConfigForRuntime(generationState)

            // TODO: reconsider pipeline here. Module optimizations instead of LTO can make a lot of sense, but require testing
            MandatoryOptimizationPipeline(config, generationState).use {
                it.execute(runtimeModule)
            }
            LTOOptimizationPipeline(config, generationState).use {<|endoftext|>


Prompt:
* @param notRegisteredTasks An optional list of task names that should not have been registered,
 *                           it could contain task paths as well, but without the first semicolon.
 * @param environmentVariables environmental variables for build process
 * @throws AssertionError if any of the registered tasks do not match the expected task names,
 * or if any of the not-registered tasks were actually registered.
 */

Response:
@OptIn(EnvironmentalVariablesOverride::class)
fun TestProject.buildAndAssertAllTasks(
    registeredTasks: List<String> = emptyList(),
    notRegisteredTasks: List<String> = emptyList(),
    buildOptions: BuildOptions = this.buildOptions,
    environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),
) {<|endoftext|>


Prompt:
}
    }

    private inline fun <E> StringBuilder.renderWithSeparator(
        collection: Collection<E>,
        separator: String,
        render: StringBuilder.(E) -> Unit
    ) {
        collection.forEachIndexed { index, element ->
            render(element)
            if (index != collection.size - 1) {
                append(separator)
            }
        }

Response:
}
}<|endoftext|>


Prompt:
// 1 testFlattened2Flattened\(\)V(\n {3}.*)*((\n {3}.*DSTORE.*)(\n {3}.*)*){2}
// 0 testFlattened2Flattened\(\)V(\n {3}.*)*((\n {3}.*DSTORE.*)(\n {3}.*)*){3}

Response:
// 0 testBoxed2Flattened\(\)V(\n {3}.*)*((\n {3}.*box-impl .*)(\n {3}.*)*){1}
// 1 testBoxed2Flattened\(\)V(\n {3}.*)*((\n {3}.*unbox-impl.*)(\n {3}.*)*){2}<|endoftext|>


Prompt:
body = listOf(
            call("Text"),
            call("Text")
        )
    ),

    "p4" to Function(
        "p4",
        annotations = composable,
        body = listOf(
            call(
                "Row",
                lambda(
                    call("Text"),
                    call("Text")
                )
            )
        )
    ),

Response:
"p5" to Function(
        "p5",
        annotations = composable,
        body = listOf(
            call(
                "Provider",
                lambda(
                    call(
                        "Row",
                        lambda(
                            call("Text"),
                            call(
                                "Button",
                                lambda(
                                    call("Text")
                                )
                            )
                        )
                    )
                )
            )<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Nothing?")!>x<!>.hashCode()
                }
            }
        }
    }
}

/*
 * TESTCASE NUMBER: 47
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28328
 */

Response:
fun case_47(x: TypealiasNullableString, y: TypealiasNullableString, z: Nothing?) = if (x !== z && true && true && true) "1"
    else if (y != z) {
        <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><|endoftext|>


Prompt:
checkSubtype<KFunction0<Nested>>(y)
    }

    companion object {
        fun main() {
            ::Nested
            val y = A::Nested

            checkSubtype<KFunction0<A.Nested>>(y)
        }
    }
}

class B {
    fun main() {

Response:
::<!UNRESOLVED_REFERENCE!>Nested<!>
        val y = A::Nested

        checkSubtype<KFunction0<A.Nested>>(y)
    }
}<|endoftext|>


Prompt:
if (!isEmpty()) {
            root?.traverse { result.add(it.key) }
        }
        return result
    }

    // Perform the splay operation for the given key. Moves the node with
    // the given key to the top of the tree.  If no node has the given
    // key, the last node on the search path is moved to the top of the

Response:
// tree. This is the simplified top-down splaying algorithm from:
    // "Self-adjusting Binary Search Trees" by Sleator and Tarjan
    private fun splay(key: K) {
        if (isEmpty()) return
        // Create a dummy node.  The use of the dummy node is a bit
        // counter-intuitive: The right child of the dummy node will hold<|endoftext|>


Prompt: <!INAPPLICABLE_CANDIDATE!>check<!><<!CANNOT_INFER_PARAMETER_TYPE!>Long<!>>()

Response: }<|endoftext|>


Prompt:
fun @receiver:ObjCName("objCReceiverC", "swiftReceiver") Int.kotlinFunctionC(
        @ObjCName("objCParam", "swiftParam") kotlinParam: Int
    ): Int
    @ObjCName("objCFunctionD", "swiftFunctionD")

Response:
fun @receiver:ObjCName("objCReceiver", "swiftReceiver") Int.kotlinFunctionD(
        @ObjCName("objCParamD", "swiftParam") kotlinParam: Int
    ): Int
    fun @receiver:ObjCName("objCFunctionE", "swiftFunctionE") Int.kotlinFunctionE(<|endoftext|>


Prompt:
run {
            return@lambda
        }
    }
}

fun testLrmFoo1(ints: List<Int>) {
    ints.forEach lit@ {
        if (it == 0) return@lit
        print(it)
    }
}

fun testLrmFoo2(ints: List<Int>) {
    ints.forEach {

Response:
if (it == 0) return@forEach
        print(it)
    }
}<|endoftext|>


Prompt:
runAndProcessInitializers(declaration.konanLibrary) {
                declaration.acceptChildrenVoid(this)
            }
        }
    }

    //-------------------------------------------------------------------------//

    private open inner class StackLocalsScope() : InnerScopeImpl() {
        override fun onEnter() {
            functionGenerationContext.stackLocalsManager.enterScope()
        }
        override fun onExit() {

Response:
functionGenerationContext.stackLocalsManager.exitScope()
        }
    }

    private inner class LoopScope(val loop: IrLoop) : StackLocalsScope() {
        val loopExit  = functionGenerationContext.basicBlock("loop_exit", loop.endLocation)
        val loopCheck = functionGenerationContext.basicBlock("loop_check", loop.condition.startLocation)<|endoftext|>


Prompt:
fun storeVariable(variable: FirVariable, session: FirSession) {
        updateLastScope { storeVariable(variable, session) }
    }

    @OptIn(PrivateForInline::class)
    inline fun <R, S : FirInferenceSession> withInferenceSession(inferenceSession: S, block: S.() -> R): R {
        val oldSession = this.inferenceSession

Response:
this.inferenceSession = inferenceSession
        return try {
            inferenceSession.block()
        } finally {
            this.inferenceSession = oldSession
        }
    }

    @OptIn(PrivateForInline::class)
    inline fun <T> withAnonymousFunctionTowerDataContext(symbol: FirAnonymousFunctionSymbol, f: () -> T): T {<|endoftext|>


Prompt:
list += "ok"
        list += "element"

        val subList = list.subList(0, 2)
        subList.retainAll { it.length <= 2 }

        assertEquals(listOf("ok", "element"), list)

        assertFailsWith<IndexOutOfBoundsException> { list.addAll(-1, listOf()) }

Response:
compare(list.storage, list) {
            listBehavior()
        }
    }

    @Test
    fun abstractMutableSet() {
        val set = MutSet()
        set.addAll(listOf("ok", "test", "element", "test"))
        set.removeAll { it.length < 4 }

        assertEquals(2, set.size)<|endoftext|>


Prompt: contract { returns(null) implies (this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) }

Response:
return if (this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) null else true
}

// TESTCASE NUMBER: 7<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !LANGUAGE: +SuspendFunctionAsSupertype
// SKIP_TXT
// DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS

Response:
import kotlin.coroutines.*

abstract class CSuper: () -> Unit

class C: <!MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES!>CSuper(), SuspendFunction0<Unit><!> {
    override suspend fun invoke() {
    }
}<|endoftext|>


Prompt:
@OptIn(PrivateForInline::class)
    inline fun <T> forConstructorParameters(
        constructor: FirConstructor,
        owningClass: FirRegularClass?,
        holder: SessionHolder,
        f: () -> T
    ): T {
        // Default values of constructor can't access members of constructing class

Response:
// But, let them get resolved, then [FirFunctionParameterChecker] will detect and report an error
        // if an uninitialized parameter is accessed by a preceding parameter.
        return forConstructorParametersOrDelegatedConstructorCall(constructor, owningClass, holder, f)
    }

    @OptIn(PrivateForInline::class)
    inline fun <T> forDelegatedConstructorCall(<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryDependency
import org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers.IdeArtifactResolutionQuerySourcesResolver
import org.jetbrains.kotlin.gradle.plugin.ide.kotlinIdeMultiplatformImport

Response:
import org.jetbrains.kotlin.gradle.plugin.ide.kotlinIdeMultiplatformImportStatistics
import org.jetbrains.kotlin.gradle.util.*
import org.jetbrains.kotlin.gradle.utils.androidExtension
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.fail

/**<|endoftext|>


Prompt:
@MyAnnotation
    open fun foo(@MyAnnotation a: Int) { }

    @MyAnnotation
    open val a : Int = 1

    @MyAnnotation constructor(i: Int)

    open var b
        @MyAnnotation get() = 10
        @MyAnnotation set(value) {}
}

Response:
class B: Java1(1)   //Kotlin ← Java ← Kotlin

class C : Java1(1) {
    override val a: Int
        get() = 10

    override fun foo(a: Int) { }
    override var b: Int
        get() = 11
        set(value) {}
}<|endoftext|>


Prompt:
// TESTCASE NUMBER: 6
val value_6 = <!UNRESOLVED_REFERENCE!>_<!>

// TESTCASE NUMBER: 7
val value_7 = <!UNRESOLVED_REFERENCE!>_0_<!>

// TESTCASE NUMBER: 8

Response: val value_8 = <!UNRESOLVED_REFERENCE!>_9_<!><|endoftext|>


Prompt: @kotlin.Deprecated(message = "The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'any { it == element }' instead to continue using this behavior, or '.asList().contains(element: T)' to get the same search behavior as in a list.", replaceWith = kotlin.ReplaceWith(expression = "any { it == element }", imports = {}))

Response:
@kotlin.DeprecatedSinceKotlin(errorSince = "1.6", hiddenSince = "1.7", warningSince = "1.4")
public operator fun kotlin.DoubleArray.contains(element: kotlin.Double): kotlin.Boolean<|endoftext|>


Prompt:
val irDelegatingConstructorCall = CallGenerator(statementGenerator).generateDelegatingConstructorCall(
            ktDelegatingConstructorCall.startOffsetSkippingComments, ktDelegatingConstructorCall.endOffset,
            delegatingConstructorCall
        )
        irBlockBody.statements.add(irDelegatingConstructorCall)
    }

Response:
fun createStatementGenerator() = StatementGenerator(this, scope)

    fun putLoop(expression: KtLoopExpression, irLoop: IrLoop) {
        loopTable[expression] = irLoop
    }

    override fun getLoop(expression: KtExpression): IrLoop? {
        return loopTable[expression] ?: parentLoopResolver?.getLoop(expression)
    }<|endoftext|>


Prompt:
class TestTypeParameterWithMultipleIdenticalUpperBoundsAA<T> where T: UserInterfaceA, T: UserInterfaceB {
        @Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor()
    }
    fun <T> TestTypeParameterWithMultipleIdenticalUpperBoundsAA() where T: UserInterfaceA, T: UserInterfaceB {}

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


Prompt:
FirJsNameClashClassMembersChecker.Regular,
            FirJsNameClashClassMembersChecker.ForExpectClass,
        )

    override val simpleFunctionCheckers: Set<FirSimpleFunctionChecker>
        get() = setOf(
            FirJsNativeInvokeChecker,
            FirJsNativeGetterChecker,
            FirJsNativeSetterChecker,
        )

Response:
override val propertyCheckers: Set<FirPropertyChecker>
        get() = setOf(
            FirJsPropertyDelegationByDynamicChecker
        )

    override val fileCheckers: Set<FirFileChecker>
        get() = setOf(
            FirJsPackageDirectiveChecker,
            FirJsNameClashFileTopLevelDeclarationsChecker
        )
}<|endoftext|>


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

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

    private val bindingContext = MyBindingContext()

Response:
protected val mutableDiagnostics: MutableDiagnosticsWithSuppression? =
        if (filter.ignoreDiagnostics) null
        else MutableDiagnosticsWithSuppression(
            customSuppressCache ?: BindingContextSuppressCache(bindingContext),
            if (withParentDiagnostics) parentContext.diagnostics else Diagnostics.EMPTY
        )

    constructor(
        parentContext: BindingContext,<|endoftext|>


Prompt: val <!UNUSED_VARIABLE!>t<!> = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (x === null || <!SENSELESS_COMPARISON!>x == y<!> && <!SENSELESS_COMPARISON!>x === y<!>) "" else {

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString? & kotlin.String")!>x<!>.equals(null)
        <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString? & kotlin.String")!>x<!>.propT<|endoftext|>


Prompt:
visitedSupers: MutableSet<PsiClass> = mutableSetOf()
    ): Boolean {
        visitedSupers.add(this)
        val notVisitedSupers = supers.filterNot { visitedSupers.contains(it) }
        if (notVisitedSupers.any { it == baseClass }) return true
        if (!checkDeep) return false

Response:
return notVisitedSupers.any { it.hasSuper(baseClass, true, visitedSupers) }
    }

    override fun getText(): String = kotlinOrigin?.text ?: ""

    override fun getLanguage(): KotlinLanguage = KotlinLanguage.INSTANCE

    override fun getPresentation(): ItemPresentation? = ItemPresentationProviders.getItemPresentation(this)<|endoftext|>


Prompt:
public fun kotlin.Char.digitToInt(radix: kotlin.Int): kotlin.Int

@kotlin.SinceKotlin(version = "1.5")
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class})
public fun kotlin.Char.digitToIntOrNull(): kotlin.Int?

Response:
@kotlin.SinceKotlin(version = "1.5")
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class})
public fun kotlin.Char.digitToIntOrNull(radix: kotlin.Int): kotlin.Int?<|endoftext|>


Prompt:
package kotlinx.cinterop

@OptIn(ExperimentalStdlibApi::class)
@PublishedApi
internal inline fun <reified T> t() = kotlin.reflect.typeOf<T>()

inline fun <reified R> staticCFunction(noinline function: () -> R): CPointer<CFunction<() -> R>> =
        staticCFunctionImpl(
                function,

Response:
t<R>()
        )

inline fun <reified P1, reified R> staticCFunction(noinline function: (P1) -> R): CPointer<CFunction<(P1) -> R>> =
        staticCFunctionImpl(
                function,
                t<R>(), t<P1>()
        )<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>propAny

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>funAny()
    }
}

// TESTCASE NUMBER: 19
inline fun <reified T>case_19(x: Any?) {
    if (x is T !is T) {<|endoftext|>


Prompt:
return scope.collectDescendantsOfType<KtDeclaration> { it.name == name }
        .map { it.getSymbol() }
        .filterIsInstance<S>()
        .singleOrNull()
}

inline fun <reified S : KtSymbol> KtAnalysisSession.getSymbolByName(scope: KtElement, name: String): S {

Response:
return getSymbolByNameSafe(scope, name)
        ?: error("Symbol with $name was not found in scope")
}<|endoftext|>


Prompt:
if (null.<!ELEMENT(3)!><Int, List<Int>>()) return null
    if (false.<!ELEMENT(4)!>()) return null
    if (!false.<!ELEMENT(2)!>()) return null
    if (Any().<!ELEMENT(4)!>()) return null

Response:
if (!checkFunctionName(::<!ELEMENT(1)!>, "<!ELEMENT_VALIDATION(1)!>")) return null
    if (!checkFunctionName(Boolean::<!ELEMENT(2)!>, "<!ELEMENT_VALIDATION(2)!>")) return null<|endoftext|>


Prompt:
if (classId.packageFqName !in combinedPackageNames) return null

        return providers.firstNotNullOfOrNull { it.getClassLikeSymbolByClassId(classId) }
    }

    @FirSymbolProviderInternals

Response:
override fun getTopLevelCallableSymbolsTo(destination: MutableList<FirCallableSymbol<*>>, packageFqName: FqName, name: Name) {
    }

    @FirSymbolProviderInternals<|endoftext|>


Prompt:
val newArguments = type.typeArguments.map { argument ->
            if (argument == null) return@map null
            val newArgument = substituteOrSelf(argument)
            if (newArgument !== argument) {
                hasNewArguments = true
                newArgument
            } else {
                argument
            }
        }
        return runIf(hasNewArguments) {

Response:
JavaClassifierTypeStub(type, newArguments)
        }
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer.Companion.generateBinaryName
import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject
import org.jetbrains.kotlin.gradle.targets.js.subtargets.createDefaultDistribution

Response:
import org.jetbrains.kotlin.gradle.targets.js.typescript.TypeScriptValidationTask
import org.jetbrains.kotlin.gradle.tasks.configuration.KotlinJsIrLinkConfig
import org.jetbrains.kotlin.gradle.tasks.dependsOn
import org.jetbrains.kotlin.gradle.tasks.registerTask<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(get(), getIn())<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(get(), Test.foo(getIn()))<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(Test.foo(get()), Test.foo(getIn()))<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>select3(Test.foo(get()), getIn())<!>
        ""
    }
}<|endoftext|>


Prompt:
}

        fun visitValueAccess(element: IrElement, variable: IrValueDeclaration) {
            if (variable !in this.values) {
                reportError(element, "Value ${variable.render()} not accessible")
            }
        }

        fun extend(newTypeParameters: Collection<IrTypeParameter>, newValues: Collection<IrValueDeclaration>): Visibles =
            Visibles(

Response:
if (newTypeParameters.isEmpty()) typeParameters else typeParameters + newTypeParameters,
                (values + newValues).toMutableSet()
            )
    }

    inner class Checker : IrElementVisitor<Unit, Visibles> {
        override fun visitElement(element: IrElement, data: Visibles) {
            element.acceptChildren(this, data)
        }<|endoftext|>


Prompt:
fun ScriptEngine.runAndRestoreContext(f: ScriptEngine.() -> String): String {
    return try {
        saveGlobalState()
        f()
    } finally {
        restoreGlobalState()
    }
}

abstract class AbstractNashornJsTestChecker : AbstractJsTestChecker() {

    private var engineUsageCnt = 0

Response:
private var engineCache: ScriptEngineNashorn? = null

    protected val engine: ScriptEngineNashorn
        get() = engineCache ?: createScriptEngineForTest().also {
            engineCache = it
        }

    protected open fun beforeRun() {}

    override fun run(files: List<String>, f: ScriptEngine.() -> String): String {
        // Recreate the engine once in a while<|endoftext|>


Prompt:
is Fir2IrLazyClass -> {
            /*
             * Declaration list of lazy class is lazy by itself, and it will collect and store all required members
             * automatically on the first access to Fir2IrLazyClass.declarations
             */
        }
        is IrClass -> irParent.declarations += declaration
        is IrFile -> irParent.declarations += declaration

Response:
is IrExternalPackageFragment -> irParent.declarations += declaration
        is IrScript -> {
            /*
             * All declarations of the script will be added during main script conversion
             */
        }
        else -> error("Can't add declaration ${declaration.render()} to parent ${irParent.render()}")
    }
}

@OptIn(ExperimentalContracts::class)<|endoftext|>


Prompt:
*/
fun assertFilesContentEquals(expected: Path, actual: Path) {
    assertFileExists(expected)
    assertFileExists(actual)
    assertContentEquals(
        expected.readLines().asSequence(),
        actual.readLines().asSequence(),
        "Files content not equal"
    )
}

class GradleVariantAssertions(

Response:
val variantJson: JsonObject,
) {
    fun assertAttributesEquals(expected: Map<String, String>) {
        val attributesJson = variantJson.getAsJsonObject("attributes")
        val actual = attributesJson.keySet().associateWith { attributesJson.get(it).asString }<|endoftext|>


Prompt: override fun testGood(x: Any) { assertReifiedIs<Function13<*, *, *, *, *, *, *, *, *, *, *, *, *, *>>(x, type) }

Response:
override fun testBad(x: Any) { assertReifiedIsNot<Function13<*, *, *, *, *, *, *, *, *, *, *, *, *, *>>(x, type) }
}<|endoftext|>


Prompt:
public constructor(message: String?, cause: Throwable?)
    public constructor(cause: Throwable?)
}

public expect open class IllegalStateException : RuntimeException {
    public constructor()
    public constructor(message: String?)
    public constructor(message: String?, cause: Throwable?)
    public constructor(cause: Throwable?)
}

public expect open class IndexOutOfBoundsException : RuntimeException {
    public constructor()

Response:
public constructor(message: String?)
}

public expect open class ConcurrentModificationException : RuntimeException {
    public constructor()
    public constructor(message: String?)
    public constructor(message: String?, cause: Throwable?)
    public constructor(cause: Throwable?)
}

public expect open class UnsupportedOperationException : RuntimeException {
    public constructor()
    public constructor(message: String?)<|endoftext|>


Prompt:
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly
public inline operator fun Int8Array.set(index: Int, value: Byte) { asDynamic()[index] = value }

/**

Response:
* Exposes the JavaScript [Uint8Array](https://developer.mozilla.org/en/docs/Web/API/Uint8Array) to Kotlin
 */
public external open class Uint8Array : ArrayBufferView {
    constructor(length: Int)
    constructor(array: Uint8Array)
    constructor(array: Array<Byte>)<|endoftext|>