Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER

inline fun <reified T> foo(x: T) {
    println(x)
}

external interface I

external class C : I

operator inline fun <reified T> C.plus(other: T) = this

fun bar() {
    foo(C())

    val c: I = C()

Response:
<!EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>foo(c)<!>
    foo<<!EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>I<!>>(C())

    <!EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT!>C() + c<!>
}<|endoftext|>


Prompt:
private object B392 { val a = B391.a + Random.nextInt(100) }
private object B393 { val a = B392.a + Random.nextInt(100) }
private object B394 { val a = B393.a + Random.nextInt(100) }
private object B395 { val a = B394.a + Random.nextInt(100) }

Response:
private object B396 { val a = B395.a + Random.nextInt(100) }
private object B397 { val a = B396.a + Random.nextInt(100) }
private object B398 { val a = B397.a + Random.nextInt(100) }
private object B399 { val a = B398.a + Random.nextInt(100) }<|endoftext|>


Prompt:
* Exposes the JavaScript [Uint8Array](https://developer.mozilla.org/en/docs/Web/API/Uint8Array) to Kotlin
 */
public external open class Uint8Array : ArrayBufferView, JsAny {
    constructor(length: Int)
    constructor(array: Uint8Array)
    constructor(array: JsArray<JsNumber>)

Response:
constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)
    open val length: Int
    override val buffer: ArrayBuffer
    override val byteOffset: Int
    override val byteLength: Int
    fun set(array: Uint8Array, offset: Int = definedExternally)<|endoftext|>


Prompt:
@NullUnmarked
        public static TargetType INSTANCE() { return new TargetType<String>(); }

    }

}

// FILE: kotlin.kt

fun <T> accept(arg: T) {}

fun test() {
    // jspecify_nullness_mismatch

Response:
accept<Any>(<!TYPE_MISMATCH!>NullMarkedType.TargetType.INSTANCE().produce()<!>)
}<|endoftext|>


Prompt:
val x14 = c.addAll14(listOf(""))
    val x15 = c.addAll15(listOf(""))
    val x16 = c.addAll16(listOf(""), listOf(""))
    val x17 = c.addAll17(listOf(""), listOf(""))
    val x18 = c.addAll18(listOf(""), listOf(""))

Response:
val x19 = c.addAll19(listOf(""), listOf(""))
    val x20 = c.addAll20(listOf(""), listOf(""))
    val x21 = c.addAll21(listOf(""), listOf(""))
    val x22 = c.addAll22(listOf(""), listOf(""))
    val x23 = c.addAll23(listOf(""), listOf(""))<|endoftext|>


Prompt:
val name = diagnostic.unresolvedName ?: return
                unresolvedNames += name
            }

            private fun processFunctionCall(functionCall: FirFunctionCall) {
                if (functionCall.dispatchedWithoutImport) return
                processErrorNameReference(functionCall)

                val referencesByName = functionCall.functionReferenceName ?: return
                saveCallable(functionCall, referencesByName)
            }

Response:
private fun processImplicitFunctionCall(implicitInvokeCall: FirImplicitInvokeCall) {
                processErrorNameReference(implicitInvokeCall)

                saveCallable(implicitInvokeCall, OperatorNameConventions.INVOKE)
            }

            private fun processPropertyAccessExpression(propertyAccessExpression: FirPropertyAccessExpression) {<|endoftext|>


Prompt:
<!CONFLICTING_OVERLOADS!>suspend fun main(vararg args: String)<!> {}
<!CONFLICTING_OVERLOADS!>suspend fun main(vararg args: String)<!> {}

// FILE: invalid_array_typealias_suspend.kt
package invalid8
typealias S = String

Response:
<!CONFLICTING_OVERLOADS!>suspend fun main(args: Array<String>)<!> {}
<!CONFLICTING_OVERLOADS!>suspend fun main(args: Array<S>)<!> {}

// ### VALID

// FILE: valid_noargs.kt
package valid1
fun main() {}

// FILE: valid_noargs2.kt
package valid1<|endoftext|>


Prompt:
"kotlin.UShortArray" -> "UShortArraySerializer"
        "kotlin.UIntArray" -> "UIntArraySerializer"
        "kotlin.ULongArray" -> "ULongArraySerializer"
        "kotlin.CharArray" -> "CharArraySerializer"
        "kotlin.FloatArray" -> "FloatArraySerializer"

Response:
"kotlin.DoubleArray" -> "DoubleArraySerializer"
        "kotlin.BooleanArray" -> "BooleanArraySerializer"
        "kotlin.time.Duration" -> "DurationSerializer"
        "java.lang.Boolean" -> "BooleanSerializer"
        "java.lang.Byte" -> "ByteSerializer"
        "java.lang.Short" -> "ShortSerializer"<|endoftext|>


Prompt:
val hash = sha256.digest(Files.readAllBytes(fullLibraryPath))
        val defaultTempDirName = buildString {
            append(fullLibraryName)
            append('_')
            hash.forEach {
                val hex = it.toUByte().toString(16)
                if (hex.length == 1)
                    append('0')
                append(hex)
            }
        }

Response:
val defaultTempDir = Paths.get(systemTmpDir, defaultTempDirName).toAbsolutePath().toString()
        val tempDir = File(createTempDirWithLibrary())
        if (tempDir.renameTo(File(defaultTempDir))) {
            File(defaultTempDir).deleteOnExit()
            File("$defaultTempDir/$fullLibraryName").deleteOnExit()
        } else {<|endoftext|>


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

@file:Suppress("DuplicatedCode")

package org.jetbrains.kotlin.fir.types.impl

import org.jetbrains.kotlin.KtSourceElement

Response:
import org.jetbrains.kotlin.fir.MutableOrEmptyList
import org.jetbrains.kotlin.fir.builder.toMutableOrEmpty
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.types.FirIntersectionTypeRef<|endoftext|>


Prompt:
fun case_4(value_1: Any?, value_2: Any?, value_3: Any?, value_4: Any?): Boolean {
    contract { returns(true) implies (value_1 is Float? && value_1 != null && value_2 != null && value_3 != null && value_4 != null) }

Response:
return value_1 is Float? && value_1 != null && value_2 != null && value_3 != null && value_4 != null
}

// FILE: main.kt

import contracts.*

// TESTCASE NUMBER: 1
class case_1 {
    val prop_1: Int? = 10
    fun case_1(value_1: Any?, value_2: Number?) {<|endoftext|>


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

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


Prompt:
it.putValueArgument(0, thisReceiver)
                    it.putValueArgument(1, messageArg)
                    it.putValueArgument(2, causeArg)
                }
            }

            return if (!context.es6mode) {
                expressionReplacement
            } else {
                JsIrBuilder.buildComposite(
                    context.irBuiltIns.unitType,
                    listOf(

Response:
IrDelegatingConstructorCallImpl(
                            expression.startOffset,
                            expression.endOffset,
                            context.irBuiltIns.anyType,
                            anyConstructor,
                            0,
                            0
                        ),
                        expressionReplacement
                    )
                )
            }
        }
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.plugin.diagnostics.KotlinToolingDiagnostics
import org.jetbrains.kotlin.gradle.plugin.diagnostics.reportDiagnostic
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType

Response:
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.FrameworkCopy.Companion.dsymFile
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport.registerSwiftExportTask
import org.jetbrains.kotlin.gradle.plugin.mpp.enabledOnCurrentHostForBinariesCompilation<|endoftext|>


Prompt:
assertEquals(setOf("A"), resolver.resolveAssociatedIds("B"))
        assertEquals(setOf("A"), resolver.resolveAssociatedIds("C"))
        assertEquals(setOf("A"), resolver.resolveAssociatedIds("E"))
        assertEquals(setOf("A"), resolver.resolveAssociatedIds("D"))
    }

    /*

Response:
Platform A:    A -> B -> C
    Platform B:    A -> D -> E
                   F -> G -> C

    Expected:  A, C
    */
    fun `test sample 9`() {
        val resolver = createCommonClassifierIdResolver(
            createCirTreeRootFromSourceCode(
                """
                    class C
                    typealias B = C
                    typealias A = B<|endoftext|>


Prompt:
outerType = null, arguments = emptyList(), isMarkedNullable = false
        )
    }

    private val cOpaqueType = listOf(createType("kotlinx/cinterop/COpaque"))
    private val objcObjectBase = listOf(createType("kotlinx/cinterop/ObjCObjectBase"))

Response:
private val objcCObject = listOf(createType("kotlinx/cinterop/ObjCObject"))

    fun CirEntityId.artificialSupertypes(): List<CirProvided.Type> {
        return when (packageName) {
            CNAMES_STRUCTS_PACKAGE -> cOpaqueType
            OBJCNAMES_CLASSES_PACKAGE -> objcObjectBase<|endoftext|>


Prompt:
"If this happens during the update of the default language version in the project, make sure that " +
                            "a version of kotlinx-metadata-jvm has been published that supports this version, and update " +
                            "\"versions.kotlinx-metadata-jvm\" in `gradle/versions.properties`.",
                    cause
                )
            }
            header
        }

        // Write out the stripped annotation

Response:
annotationVisitor.visitKotlinMetadata(newHeader)
    }

/**
 * Parse a KotlinClassHeader from an existing Kotlin Metadata annotation visitor.
 */
private fun kotlinClassHeaderVisitor(body: (Metadata) -> Unit): AnnotationVisitor =
    object : AnnotationVisitor(Opcodes.API_VERSION) {
        var kind: Int = 1<|endoftext|>


Prompt:
visitor.visitSetValue(this, data)

    override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
        value.accept(visitor, data)
    }

    override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
        value = value.transform(transformer, data)
    }

Response: }<|endoftext|>


Prompt:
?: fir.specialFunctionTypeKind(context.session)
                ?: FunctionTypeKind.Function

            return createFunctionType(
                if (callableReferenceAdaptation == null || forceReflectionType) baseFunctionTypeKind.reflectKind() else baseFunctionTypeKind.nonReflectKind(),
                parameters,
                receiverType = receiverType.takeIf { fir.receiverParameter != null },
                rawReturnType = returnType,

Response:
contextReceivers = fir.contextReceivers.map { it.typeRef.coneType }
            ) to callableReferenceAdaptation
        }
        is FirVariable -> {
            val returnType = returnTypeRef.type
            val isMutable = fir.canBeMutableReference(candidate)
            val propertyType = when {
                isMutable && returnType.hasCapture() -><|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrDelegatingConstructorCallImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
import org.jetbrains.kotlin.ir.types.defaultType

Response:
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.name.JvmStandardClassIds.JVM_OVERLOADS_FQ_NAME

// TODO: `IrValueParameter.defaultValue` property does not track default values in super-parameters. See KT-28637.
@PhaseDescription(
    name = "JvmOverloadsAnnotation",<|endoftext|>


Prompt:
descriptors.add(descriptor)

        if (state == ComponentStorageState.Initialized)
            composeDescriptors(context, items)

    }

    fun compose(context: ComponentResolveContext) {
        if (state != ComponentStorageState.Initial)
            throw ContainerConsistencyException("$containerId $myId was already composed.")

        state = ComponentStorageState.Initialized

Response:
composeDescriptors(context, descriptors)
    }

    private fun composeDescriptors(context: ComponentResolveContext, descriptors: Collection<ComponentDescriptor>) {
        if (descriptors.isEmpty()) return

        registry.addAll(descriptors)

        val implicits = inspectDependenciesAndRegisterAdhoc(context, descriptors)<|endoftext|>


Prompt:
if (asInterface2(MyFinalClass2()).test != 1) return "Fail MyFinalClass2 as Interface2 property"
    if (MyFinalClass2().test != 1) return "Fail MyFinalClass2 property"

    if (asInterface(MyFinalClass3()).test != 1) return "Fail MyFinalClass3 as Interface property"

Response:
if (MyFinalClass3().test != 1) return "Fail MyFinalClass3 property"

    if (asInterface(MyFinalClassI()).test != 1) return "Fail MyFinalClassI as Interface property"
    if (MyFinalClassI().test != 1) return "Fail MyFinalClassI property"<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.java

import org.jetbrains.kotlin.KtSourceElement
import org.jetbrains.kotlin.fir.FirAnnotationContainer
import org.jetbrains.kotlin.fir.FirElement
import org.jetbrains.kotlin.fir.FirModuleData

Response:
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.declarations.FirConstructor
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
import org.jetbrains.kotlin.fir.declarations.FirValueParameter<|endoftext|>


Prompt:
@Test fun splitToLines() = withOneCharSequenceArg { arg1 ->
        val string = arg1("first line\rsecond line\nthird line\r\nlast line")
        assertEquals(listOf("first line", "second line", "third line", "last line"), string.lines())

        val singleLine = arg1("single line")

Response:
assertEquals(listOf(singleLine.toString()), singleLine.lines())
    }

    @Test fun splitIllegalLimit() = withOneCharSequenceArg("test string") { string ->
        assertFailsWith<IllegalArgumentException> { string.split(*arrayOf<String>(), limit = -1) }<|endoftext|>


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

// TESTCASE NUMBER: 22
fun case_22(x: Boolean?) {

Response:
for (i in listOf(1, 2, 3)) {
        break && x as Boolean
    }

    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}<|endoftext|>


Prompt:
visitAnonymousFunction(anonymousFunctionExpression.anonymousFunction)
        }

        override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction) {
            annotationRenderer?.render(anonymousFunction)
            modifierRenderer?.renderModifiers(anonymousFunction)
            declarationRenderer?.render(anonymousFunction)
            print(" ")

Response:
val receiverParameter = anonymousFunction.receiverParameter
            if (receiverParameter != null) {
                receiverParameter.typeRef.accept(this)
                print(".")
            }
            print("<anonymous>")
            if (anonymousFunction.valueParameters.isEmpty() &&
                anonymousFunction.hasExplicitParameterList &&
                anonymousFunction.returnTypeRef is FirImplicitTypeRef
            ) {<|endoftext|>


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

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

Response:
fun <T: Invariant<*>> testTypeParameterWithVarianceDifferentUpperBoundsE() {}

fun <T: Invariant<in UserInterface>> testTypeParameterWithVarianceDifferentUpperBoundsEReverse() {}<|endoftext|>


Prompt:
for (string in strings) {
        result += string
    }

    return result
}

internal fun test1(): String {
    return concat()
}

internal fun test2(): String {
    return concat("a", "b", "c")
}

internal fun test3(list: Array<String>): String {
    return concat(*list)
}

Response:
// CHECK_BREAKS_COUNT: function=box count=0 TARGET_BACKENDS=JS_IR
// CHECK_LABELS_COUNT: function=box name=$l$block count=0 TARGET_BACKENDS=JS_IR
fun box(): String {
    assertEquals("", test1())
    assertEquals("abc", test2())<|endoftext|>


Prompt:
0x3da5fd7fe1796495UL,     0x3da5fd7fe1796495UL,     0x0UL,     0x0UL,
            0x0UL,     0x0UL,     0x3ff0000000000000UL,     0x3ff000000000afecUL,

Response:
0x3feffffffffea028UL,     0x3fe0000000000000UL,     0x4000000000000000UL,     0x3fd0000000000000UL,
            0x4010000000000000UL,     0x3ff0000000000000UL,     0x3feffffffffea028UL,     0x3ff000000000afecUL,<|endoftext|>


Prompt:
open val visibilityState: JsAny?
    open val focused: Boolean
    fun focus(): Promise<WindowClient>
    fun navigate(url: String): Promise<WindowClient>
}

/**
 * Exposes the JavaScript [Clients](https://developer.mozilla.org/en/docs/Web/API/Clients) to Kotlin
 */
public external abstract class Clients : JsAny {

Response:
fun get(id: String): Promise<JsAny?>
    fun matchAll(options: ClientQueryOptions = definedExternally): Promise<JsArray<Client>>
    fun openWindow(url: String): Promise<WindowClient?>
    fun claim(): Promise<Nothing?>
}

public external interface ClientQueryOptions : JsAny {
    var includeUncontrolled: Boolean? /* = false */
        get() = definedExternally<|endoftext|>


Prompt:
runSuspend { require((DPoint::suspendInlineFunctionWithLambda)(dPoint, dPoint) { it.suspended() } == dPoint) }
    runSuspend { require(dPoint.suspendInlineFunctionWithLambda(dPoint) { it.suspendedInline() } == dPoint) }

Response:
runSuspend { require((dPoint::suspendInlineFunctionWithLambda)(dPoint) { it.suspendedInline() } == dPoint) }
    runSuspend { require((DPoint::suspendInlineFunctionWithLambda)(dPoint, dPoint) { it.suspendedInline() } == dPoint) }<|endoftext|>


Prompt:
this.<!DEBUG_INFO_CALL("fqName: tests.test2.ExtendCase1.invoke; typeCall: variable&invoke")!>propVal()<!>
        <!DEBUG_INFO_CALL("fqName: tests.test2.ExtendCase1.invoke; typeCall: variable&invoke")!>propVar()<!>

Response:
this.<!DEBUG_INFO_CALL("fqName: tests.test2.ExtendCase1.invoke; typeCall: variable&invoke")!>propVar()<!>
        <!DEBUG_INFO_CALL("fqName: tests.test2.ExtendCase1.function; typeCall: function")!>function()<!><|endoftext|>


Prompt:
if (argumentType !is ConeClassLikeType) return null
    var type = argumentType
    var arrayDimensions = 0
    while (true) {
        if (type.isPrimitiveArray) break
        type = type.arrayElementType() ?: break
        arrayDimensions++
    }
    val classId = type.classId ?: return null
    return KClassValue(classId, arrayDimensions)

Response: }<|endoftext|>


Prompt:
public inline val DocumentReadyState.Companion.LOADING: DocumentReadyState get() = "loading".asDynamic().unsafeCast<DocumentReadyState>()

public inline val DocumentReadyState.Companion.INTERACTIVE: DocumentReadyState get() = "interactive".asDynamic().unsafeCast<DocumentReadyState>()

Response:
public inline val DocumentReadyState.Companion.COMPLETE: DocumentReadyState get() = "complete".asDynamic().unsafeCast<DocumentReadyState>()

/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface CanPlayTypeResult {
    companion object
}<|endoftext|>


Prompt:
val fileName = match.group(2)
                val sources = results.getOrPut(moduleName) { mutableListOf() }
                sources.add(it to fileName)
            }
        }

        val dependencyGraph = parseDependencies(testDir)

        DFS.topologicalOrder(dependencyGraph.keys) { m ->

Response:
(dependencyGraph[m] ?: error("Expected dependencies for module $m")).map { it.moduleName }
        }.reversed().mapTo(modulesOrder) { it }

        for ((moduleName, fileEntries) in results) {
            val moduleDir = File(workingDir, moduleName).apply { mkdirs() }
            val moduleSrcDir = File(moduleDir, "src")<|endoftext|>


Prompt:
origFile.copyTo(resolve("bar/barUseAB.kt"))
                origFile.deleteExisting()
            }

            build("assemble") {
                assertCompiledKotlinSources(
                    getExpectedKotlinSourcesForDefaultProject(
                        appSources = listOf("foo/fooCallUseAB.kt", "bar/barUseAB.kt")
                    ),
                    output
                )

Response:
}
        }
    }

    @DisplayName("Lib project classes became final")
    @GradleTest
    open fun testLibClassBecameFinal(gradleVersion: GradleVersion) {
        doTestLibClassBecameFinal(gradleVersion)
    }

    protected fun doTestLibClassBecameFinal(gradleVersion: GradleVersion, impactedClassInAppIsRecompiled: Boolean = true) {<|endoftext|>


Prompt:
throw IllegalArgumentException("Not applicable for $opToken, $leftType, $rightType")
            else when (opToken) {
                KtTokens.EQEQ -> PrimitiveToBoxedEquality(left, right, leftType)
                KtTokens.EXCLEQ -> Invert(PrimitiveToBoxedEquality(left, right, leftType))

Response:
else -> throw AssertionError("Unexpected opToken: $opToken")
            }

        @JvmStatic
        fun isApplicable(opToken: IElementType, leftType: Type, rightType: Type) =
            (opToken == KtTokens.EQEQ || opToken == KtTokens.EXCLEQ) &&
                    AsmUtil.isIntOrLongPrimitive(leftType) &&<|endoftext|>


Prompt:
)

    @Test
    fun `test multiple incorrect source set dependencies`() = checkDiagnostics {
        sourceSets.getByName("iosX64Test").dependsOn(sourceSets.getByName("commonMain"))
        sourceSets.getByName("androidInstrumentedTest").dependsOn(sourceSets.getByName("commonMain"))
    }.assertDiagnostics(

Response:
KotlinSourceSetTreeDependsOnMismatch(
            dependents = mapOf(
                "main" to listOf("androidDebug", "androidMain", "androidRelease", "nativeMain"),
                "instrumentedTest" to listOf("androidInstrumentedTest"),
                "test" to listOf("iosX64Test")
            ),
            dependencyName = "commonMain"
        ),
    )<|endoftext|>


Prompt:
declaration.defaultValue?.expression?.unwrapLambda()?.let {
                        inlineLambdaToParameter[it] = declaration
                    }
                }
            }

            override fun visitFunctionAccess(expression: IrFunctionAccessExpression) {
                expression.acceptChildrenVoid(this)
                val function = expression.symbol.owner
                if (function.isInlineFunctionCall(context)) {

Response:
for (parameter in function.valueParameters) {
                        if (parameter.isInlinedFunction()) {
                            expression.getValueArgument(parameter.index)
                                ?.also { inlineFunctionExpressions += it }
                                ?.unwrapLambda()
                                ?.let { inlineLambdaToParameter[it] = parameter }
                        }
                    }
                }
            }
        })
    }<|endoftext|>


Prompt:
import kotlin.reflect.KClass
import kotlin.reflect.KVisibility
import kotlin.reflect.full.memberProperties
import kotlin.reflect.jvm.javaField
import kotlin.test.fail

class CompilerArgumentsImplementationTest {

    @ParameterizedTest
    @MethodSource("implementations")

Response:
fun `test - all properties with Argument annotation - are public`(implementation: KClass<out CommonToolArguments>) {
        implementation.memberProperties.forEach { property ->
            if (property.javaField?.getAnnotation(Argument::class.java) != null) {
                if (property.visibility != KVisibility.PUBLIC) {
                    fail(<|endoftext|>


Prompt:
actual fun Any.onReceiver() {}

actual class OnClassSuper : I1

actual class OnClassSuperDifferentOrder : @Ann I2, I1

actual class OnClassSuperMoreOnActual : I1, I2

actual class OnClassSuperTypeParams<T> : I3<T>

actual fun deepInParamsTypes(arg: I3<I3<Any>>) {}

Response:
actual fun starProjection(arg: I4<*, Any>) {}

actual fun <T> typeArgWithVariance(t: I3<out T>) {}

actual fun qualifierPartsMatching(arg: WithNested<String>.Nested<@Ann String>) {}

actual fun qualifierPartsNonMatching(arg: WithNested<@Ann String>.Nested<String>) {}<|endoftext|>


Prompt:
// but, as it is the only one to required to run on MacOS
// we are running this test as a part of Native tests
// This allows us to keep CI configuration simpler.
@OsCondition(supportedOn = [OS.LINUX, OS.MAC, OS.WINDOWS], enabledOnCI = [OS.LINUX, OS.MAC, OS.WINDOWS])
@NativeGradlePluginTests

Response:
class JsSetupConfigurationCacheIT : KGPBaseTest() {

    override val defaultBuildOptions =
        super.defaultBuildOptions.copy(
            configurationCache = true,
            configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL
        )

    // hack to be run on Mac m*
    @DisplayName("Check Node.JS setup on different platforms")
    @GradleTest<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.FirImplementationDetail
import org.jetbrains.kotlin.fir.FirModuleData
import org.jetbrains.kotlin.fir.MutableOrEmptyList
import org.jetbrains.kotlin.fir.builder.toMutableOrEmpty

Response:
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.expressions.FirBlock<|endoftext|>


Prompt:
shouldNotBeEscapedFile.writeText("$PREAMBLE_MESSAGE\n${SHOULD_NOT_BE_ESCAPED.joinToString("\n")}")
            casesFile.writeText("$PREAMBLE_MESSAGE\n${cases.joinToString("\n")}")
        }
    }
}

Response:
private fun generate(testDataDirPath: String, f: TestDataBuilder.() -> Unit) {
    val builder = TestDataBuilder()
    builder.f()
    builder.generate(testDataDirPath)
}

private val DEFINITION_MARKER = "DEFINITION"
private val DECLARATION_MARKER = "DECLARATION"<|endoftext|>


Prompt:
if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>c<!>.propNullableT

        if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>c<!>.propNullableAny

Response:
if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>c<!>.funT()

        if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>c<!>.funAny()<|endoftext|>


Prompt:
"ObjC spec of method `${baseMethod.selector}` for `${baseMethod.symbol}`"
}

internal class ObjCInitMethodForKotlinConstructor(val baseMethod: BaseMethod<IrConstructorSymbol>) : ObjCMethodSpec() {
    override fun toString(): String =

Response:
"ObjC spec of method `${baseMethod.selector}` for `${baseMethod.symbol}`"
}

internal class ObjCFactoryMethodForKotlinArrayConstructor(
        val baseMethod: BaseMethod<IrConstructorSymbol>
) : ObjCMethodSpec() {
    override fun toString(): String =<|endoftext|>


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

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


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

import org.gradle.api.Action
import org.jetbrains.kotlin.gradle.plugin.KotlinExecution
import org.jetbrains.kotlin.gradle.plugin.KotlinExecution.ExecutionSource

/**
 * An execution source that aggregates other [executionSources].
 */

Response:
interface KotlinAggregateExecutionSource<AggregatedSourceType : ExecutionSource> : ExecutionSource {
    val executionSources: Iterable<AggregatedSourceType>
}

interface KotlinAggregatingExecution<
        AggregatedSourceType : ExecutionSource,
        AggregatingSourceType : KotlinAggregateExecutionSource<AggregatedSourceType>,<|endoftext|>


Prompt:
if (xs.size != 1 && (xs[0] != 1 && xs[0] != null)) throw AssertionError()
}

fun box(): String {
    booleanVararg(*booleanArrayOf(true))
    booleanVararg(*BooleanArray(1))
    booleanVararg(*BooleanArray(1) { true })

Response:
booleanVararg(xs = *booleanArrayOf(true))
    booleanVararg(xs = *BooleanArray(1))
    booleanVararg(xs = *BooleanArray(1) { true })

    byteVararg(*byteArrayOf(1))
    byteVararg(*ByteArray(1))
    byteVararg(*ByteArray(1) { 1 })<|endoftext|>


Prompt:
fun <T> dispatch(a: IC): T = bar(a) {
    it.dispatchInline()
}

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 {

Response:
var res = extension<Int>(IC(FooHolder(40))) + 3
    if (res != 43) return "FAIL 2: $res"

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

    res = normal<Int>(IC(FooHolder(40))) + 5<|endoftext|>


Prompt:
private fun maxPointsToGraphSizeOf(function: DataFlowIR.FunctionSymbol) = with(DivergenceResolutionParams) {
            // A heuristic: the majority of functions have their points-to graph size linear in number of IR (or DFG) nodes,
            // there are exceptions but it's a trade-off we have to make.

Response:
// The trick with [NegligibleSize] handles functions that basically delegate their work to other functions.
            val numberOfNodes = intraproceduralAnalysisResults[function]!!.function.body.allScopes.sumOf { it.nodes.size }
            NegligibleSize + numberOfNodes * SwellingFactor
        }<|endoftext|>


Prompt:
* Builds a [HeaderInfo] for iteration over characters in a [CharSequence].
 *
 * Note: The value for "last" can NOT be cached (i.e., stored in a variable) because the size/length can change within the loop. This means
 * that "last" is re-evaluated with each iteration of the loop.
 */
internal open class CharSequenceIterationHandler(
    context: CommonBackendContext,

Response:
canCacheLast: Boolean = false
) : IndexedGetIterationHandler(context, canCacheLast) {
    override fun matchIterable(expression: IrExpression): Boolean =
        expression.type.isSubtypeOfClass(context.ir.symbols.charSequence)<|endoftext|>


Prompt:
assertEquals("uint32_t", header.renderTypesOfSymbol("foo"))
    }

    @Test
    fun `test - number - Long`() {
        val header = header("""val foo: Long get() = error("stub")""")
        assertEquals("int64_t", header.renderTypesOfSymbol("foo"))
    }

    @Test

Response:
fun `test - number - ULong`() {
        val header = header("""val foo: ULong get() = error("stub")""")
        assertEquals("uint64_t", header.renderTypesOfSymbol("foo"))
    }

    @Test
    fun `test - number - Float`() {
        val header = header("""val foo: Float get() = error("stub")""")<|endoftext|>


Prompt:
0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,
            0x3ff0000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,

Response:
0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0xc2826dc9d8770db4UL,
            0x42826dc9d8764312UL,     0x404245465683a05eUL,     0xc04245465683a05eUL,     0x403245465683a05eUL,<|endoftext|>


Prompt:
// temporary trick with passing Any as a template and overwriting it below, TODO: fix after introducing new script definitions hierarchy
abstract class KotlinScriptDefinitionAdapterFromNewAPIBase : KotlinScriptDefinition(Any::class) {

    abstract val scriptCompilationConfiguration: ScriptCompilationConfiguration

    abstract val hostConfiguration: ScriptingHostConfiguration

Response:
open val baseClass: KClass<*> by lazy(LazyThreadSafetyMode.PUBLICATION) {
        getScriptingClass(scriptCompilationConfiguration.getOrError(ScriptCompilationConfiguration.baseClass))
    }

    override val template: KClass<*> get() = baseClass

    override val name: String<|endoftext|>


Prompt:
* MAIN LINK: expressions, prefix-expressions, prefix-increment-expression -> paragraph 4 -> sentence 1
 * PRIMARY LINKS: statements, assignments -> paragraph 3 -> sentence 2
 * NUMBER: 1
 * DESCRIPTION: check unsafe prefix increment expression call for an assignable expression
 */

// FILE: TestCase1.kt
// TESTCASE NUMBER: 1
package testPackCase1

class A() {

Response:
var i = 0

    operator fun inc(): A {
        this.i++
        return this
    }
}

fun case1() {
    var b: Case1? = Case1()
    ++b?.a
}

class Case1() {
    var a: A = A()
}

// FILE: TestCase2.kt
// TESTCASE NUMBER: 2<|endoftext|>


Prompt:
assertEquals(expected, method.parameterTypes.contentToString(), "Fail parameterTypes of $title")
    assertEquals(expected, method.genericParameterTypes.contentToString(), "Fail genericParameterTypes of $title")
}

private fun bar(p0: Long, p1: List<Long>, p2: Map<Long, Set<Long>>) = true

fun box(): String {

Response:
check("SAM-implementing lambda 1", "[class java.lang.Object]", Java.getTest { Objects.nonNull(it) })
    check("SAM-wrapped function reference 1", "[class java.lang.Object]", Java.getTest(Objects::nonNull))<|endoftext|>


Prompt:
private fun shouldCheckForMultiplatformRedeclaration(dependency: FirBasedSymbol<*>, dependent: FirBasedSymbol<*>): Boolean {
    if (dependency.moduleData !in dependent.moduleData.allDependsOnDependencies) return false

    /*
     * If one of declarations is expect and the other is not expect, ExpectActualChecker will handle this case

Response:
* All other cases (both are expect or both are not expect) should be reported as declarations conflict
     */
    return !isExpectAndNonExpect(dependency, dependent)
}

private fun FirDeclarationCollector<FirBasedSymbol<*>>.collectTopLevelConflict(
    declaration: FirBasedSymbol<*>,
    declarationPresentation: String,
    containingFile: FirFile,<|endoftext|>


Prompt:
is KtLightSourceElement -> lightTreeStrategy.isValid(element.lighterASTNode, element.treeStructure)
            else -> true
        }
    }

    private fun PositioningStrategy<*>.hackyIsValid(psi: PsiElement): Boolean {
        @Suppress("UNCHECKED_CAST")

Response:
return (this as PositioningStrategy<PsiElement>).isValid(psi)
    }
}<|endoftext|>


Prompt:
val substitutedBound = substitutor.safeSubstitute(bound, Variance.INVARIANT)

        if (!typeChecker.isSubtypeOf(argumentType, substitutedBound)) {
            if (argumentReference != null) {
                upperBoundViolatedReporter.report(argumentReference, substitutedBound)

Response:
} else if (typeAliasUsageElement != null && !substitutedBound.containsTypeAliasParameters() && !argumentType.containsTypeAliasParameters()) {
                upperBoundViolatedReporter.reportForTypeAliasExpansion(typeAliasUsageElement, substitutedBound)
            }
            return false
        }

        return true
    }
}

class UpperBoundViolatedReporter(<|endoftext|>


Prompt:
bar.obj.name = "new bar.obj"
    assertEquals("new bar.obj", bar.obj.name)

    bar.num0 = 100
    assertEquals(100, bar.num0)

    bar.str0 = "new str"
    assertEquals("new str", bar.str0)

    bar.obj.noname = "noname value"

Response:
assertEquals("noname value", bar.obj.noname)

    baz.boo = "baz"
    assertEquals("baz", baz.boo)

    return "OK"
}<|endoftext|>


Prompt:
assertEquals("I20" in interfaces, instance is I20, "$label is I20")

    assertEquals("I21" in interfaces, instance is I21, "$label is I21")
    assertEquals("I22" in interfaces, instance is I22, "$label is I22")
    assertEquals("I23" in interfaces, instance is I23, "$label is I23")

Response:
assertEquals("I24" in interfaces, instance is I24, "$label is I24")
    assertEquals("I25" in interfaces, instance is I25, "$label is I25")
    assertEquals("I26" in interfaces, instance is I26, "$label is I26")
    assertEquals("I27" in interfaces, instance is I27, "$label is I27")<|endoftext|>


Prompt:
name = Name.special("<clinit>")
            returnType = context.irBuiltIns.unitType
        }.apply {
            body = context.irFactory.createBlockBody(startOffset, endOffset)
        }
        // Should be initialized first in case some inline function call in `<clinit>` also uses assertions.
        (classInitializer.body as IrBlockBody).statements.add(0, init)

Response:
return null
    }

    private fun generateKotlinMetadataAnnotation() {
        val facadeClassName = context.multifileFacadeForPart[irClass.attributeOwnerId]
        val metadata = irClass.metadata
        val entry = irClass.fileParent.fileEntry
        val kind = when {
            facadeClassName != null -> KotlinClassHeader.Kind.MULTIFILE_CLASS_PART<|endoftext|>


Prompt:
private fun findAvailableConstructors(scope: FirScope, targetClassName: Name): List<FirFunctionSymbol<*>> {
        val classLikeSymbol = scope.findFirstClassifierByName(targetClassName) as? FirClassLikeSymbol
            ?: return emptyList()

Response:
val constructors = (classLikeSymbol as? FirClassSymbol)?.declarationSymbols?.filterIsInstance<FirConstructorSymbol>().orEmpty()
        val samConstructor = classLikeSymbol.getSamConstructor()

        return constructors + listOfNotNull(samConstructor)
    }<|endoftext|>


Response: <!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS("(@Nullable() kotlin.collections.MutableList<@Nullable() kotlin.String?>?..@Nullable() kotlin.collections.List<@Nullable() kotlin.String?>?);  This will become an error in Kotlin 2.1. See<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY

// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 java/lang/invoke/LambdaMetafactory
// 1 final class CovariantOverrideWithPrimitiveKt\$box\$test\$

fun interface IFooAny {

Response:
fun foo(): Any
}

fun interface IFooInt : IFooAny {
    override fun foo(): Int
}

fun box(): String {
    val test = IFooInt { 42 }
    if (test.foo() != 42)
        return "Failed"

    return "OK"
}<|endoftext|>


Prompt:
"return this.asDynamic().concat(arrayOf(element))"
                    else
                        "return plus(${primitive.name.lowercase()}ArrayOf(element))"
                }
            }
            on(Platform.Native) {
                body {
                    """
                    val index = size
                    val result = copyOfUninitializedElements(index + 1)
                    result[index] = element
                    return result

Response:
"""
                }
            }
            on(Platform.Common) {
                specialFor(InvariantArraysOfObjects) {
                    suppress("NO_ACTUAL_FOR_EXPECT") // TODO: KT-21937
                }
            }
        }
    }

    val f_plus_collection = fn("plus(elements: Collection<T>)") {<|endoftext|>


Prompt:
return typeParameterSymbol(referencedName!!) ?: computeClassifier(type.classId())
    }

    private fun typeArgument(projection: KtTypeProjection): ConeTypeProjection {
        if (projection.projectionKind == KtProjectionKind.STAR) {
            return ConeStarProjection
        }

        val type = type(projection.typeReference!!)

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

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


Prompt:
override fun getPossibleClassifierNames(): Set<Name> = withValidityAssertion {
        return emptySet()
    }

    override fun getConstructors(): Sequence<KtConstructorSymbol> = withValidityAssertion {
        return scope
            .getContributedDescriptors(kindFilter = DescriptorKindFilter.FUNCTIONS)
            .asSequence()

Response:
.filterIsInstance<ConstructorDescriptor>()
            .map { it.toKtConstructorSymbol(analysisContext) }
    }

}

internal open class KtFe10ScopeMember(
    override val scope: MemberScope,
    private val constructors: Collection<ConstructorDescriptor>,
    override val analysisContext: Fe10AnalysisContext
) : KtFe10ScopeResolution() {<|endoftext|>


Prompt:
var result = 1.0.test(b = {invokeOrder += "1_"; l}(), a = {invokeOrder+="0_"; i}(), c = {invokeOrder += "$captured"; "$captured"})
    if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 1: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"

    invokeOrder = "";

Response:
result = 1.0.test(b = {invokeOrder += "1_"; l}(), c = {invokeOrder += "${captured}"; "${captured}"}, a = {invokeOrder+="0_"; i}())
    if (invokeOrder != expectedInvokeOrder || result != expectedResult) return "fail 2: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult"<|endoftext|>


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

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

Response:
* MAIN LINK: type-system, type-kinds, built-in-types, kotlin.any -> paragraph 1 -> sentence 1
 * PRIMARY LINKS: type-system, introduction-1 -> paragraph 7 -> sentence 1
 * NUMBER: 2
 * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class.
 * HELPERS: checkType, functions
 */<|endoftext|>


Prompt:
class Pair(x : Int, y : Int) {
  companion object {
    fun copy(from : Pair, x : Int = from.x, y : Int = from.y) = Pair(x, y)
  }
}

// One can say:
val p = Point(1, 2)
val p1 = Point.Copy(p, x = 2)

Response:
val p2 = Point.Copy(p1, y = -1)
val p3 = Point.Copy(p)

// Such copy(...) methods can be automatically generated by the compiler
// whenever there is a primary constructor<|endoftext|>


Prompt:
//   with the same IR symbol for them
        findFunctions(kotlinPackage, Name.identifier("arrayOf")).distinct().single()
    }

    override fun getNonBuiltInFunctionsByExtensionReceiver(
        name: Name,
        vararg packageNameSegments: String,
    ): Map<IrClassifierSymbol, IrSimpleFunctionSymbol> {

Response:
return getFunctionsByKey(
            name,
            *packageNameSegments,
            mapKey = { symbol ->
                symbol.fir.receiverParameter?.typeRef?.toIrType(c)?.classifierOrNull
            },
            mapValue = { _, irSymbol -> irSymbol }
        )
    }

    override fun getNonBuiltinFunctionsByReturnType(<|endoftext|>


Prompt:
public inline fun kotlin.text.StringBuilder.appendLine(value: kotlin.CharArray): kotlin.text.StringBuilder

@kotlin.SinceKotlin(version = "1.4")
@kotlin.internal.InlineOnly
public inline fun kotlin.text.StringBuilder.appendLine(value: kotlin.CharSequence?): kotlin.text.StringBuilder

Response:
@kotlin.SinceKotlin(version = "1.9")
@kotlin.internal.InlineOnly
public inline fun kotlin.text.StringBuilder.appendLine(value: kotlin.Double): kotlin.text.StringBuilder

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


Prompt:
for(i in 0..old.andArgumentCount - 1) {
            if (!checkEquals(old.getAndArgument(i), new.getAndArgument(i))) return false
        }

        return true
    }

    open fun checkEqualsExpressionOrArgument(old: ProtoBuf.Expression, new: ProtoBuf.Expression): Boolean {

Response:
if (old.orArgumentCount != new.orArgumentCount) return false

        for(i in 0..old.orArgumentCount - 1) {
            if (!checkEquals(old.getOrArgument(i), new.getOrArgument(i))) return false
        }

        return true
    }<|endoftext|>


Prompt:
fun testBasicCase() {
        fun consume(arg: UserEnumeration) {}
        val buildee = build {
            consume(materialize())
        }
        checkExactType<Buildee<UserEnumeration>>(buildee)
    }

    fun testEnumEntry() {
        fun <T> shareTypeInfo(from: T, to: T) {}
        val buildee = build {

Response:
shareTypeInfo(UserEnumeration.ENUM_ENTRY, materialize())
        }
        checkExactType<Buildee<UserEnumeration>>(buildee)
    }

    testBasicCase()
    testEnumEntry()
}

fun box(): String {
    testYield()
    testMaterialize()
    return "OK"
}<|endoftext|>


Prompt:
BitcodeEmbeddingMode.BITCODE -> add("-Xembed-bitcode")
        else -> Unit
    }
    linkerOpts.forEach { addArg("-linker-option", it) }
    binaryOptions.forEach { (name, value) -> add("-Xbinary=$name=$value") }
    addKey("-Xstatic-framework", isStaticFramework)

Response:
addAll(buildKotlinNativeCommonArgs(toolOptions, compilerPlugins))

    exportLibraries.forEach { add("-Xexport-library=${it.absolutePath}") }
    includeLibraries.forEach { add("-Xinclude=${it.absolutePath}") }

    if (friendModules.isNotEmpty()) {<|endoftext|>


Prompt:
irConst(bitsForSlot(0b010, meta.maskSlot))
                    )
                irOrOr(
                    irAndAnd(
                        maskIsUnstableOrUncertain,
                        irChanged(
                            arg,
                            compareInstanceForFunctionTypes = false,
                            compareInstanceForUnstableValues = isMemoizedLambda
                        )
                    ),
                    irEqual(

Response:
param.irIsolateBitsAtSlot(meta.maskSlot, includeStableBit = false),
                        irConst(ParamState.Different.bitsForSlot(meta.maskSlot))
                    )
                )
            }
            else -> irChanged(
                arg,
                compareInstanceForFunctionTypes = false,
                compareInstanceForUnstableValues = isMemoizedLambda
            )
        }
    }<|endoftext|>


Prompt:
""".trimIndent()
            )

            build(":app:kaptDebugKotlin") {
                assertTasksExecuted(":app:kaptGenerateStubsDebugKotlin")
            }

            javaFile.writeText(
                //language=Java
                """
                package com.example.dagger.kotlin;

                class Utils {
                    public String oneMethod() {

Response:
return "fake!";
                    }

                    public void anotherMethod() {
                        int one = 1;
                    }
                }
                """.trimIndent()
            )

            build(":app:kaptDebugKotlin") {
                assertTasksExecuted(":app:kaptGenerateStubsDebugKotlin")
                assertOutputDoesNotContain(<|endoftext|>


Prompt:
override fun readFile(bytes: ByteArray, file: VirtualFile): KotlinMetadataStubBuilder.FileWithMetadata {
        val stream = ByteArrayInputStream(bytes)

        val version = JsMetadataVersion.readFrom(stream)
        if (!version.isCompatibleWithCurrentCompilerVersion()) {
            return KotlinMetadataStubBuilder.FileWithMetadata.Incompatible(version)
        }

Response:
JsProtoBuf.Header.parseDelimitedFrom(stream)

        val proto = ProtoBuf.PackageFragment.parseFrom(stream, JsSerializerProtocol.extensionRegistry)
        return KotlinMetadataStubBuilder.FileWithMetadata.Compatible(proto, version, JsSerializerProtocol)
    }
}<|endoftext|>


Prompt:
return getTotalFramesWeight(node.instructions.first.countInsnsWithFramesUntil(null), node) < MEMORY_LIMIT_BY_METHOD_MB
        }

        fun canBeOptimizedUsingSourceInterpreter(node: MethodNode): Boolean {
            val methodSize = node.instructions.first.countInsnsWithFramesUntil(null)

Response:
if (node.tryCatchBlocks.size > TRY_CATCH_BLOCKS_SOFT_LIMIT) {
                if (getTotalFramesWeight(getTotalTcbSize(node) * methodSize, node) > MEMORY_LIMIT_BY_METHOD_MB)
                    return false
            }<|endoftext|>


Prompt:
dataClassArrayMemberHashCodeSymbol = addBuiltinOperatorSymbol("dataClassArrayMemberHashCode", intType, "" to anyType)
            dataClassArrayMemberToStringSymbol = addBuiltinOperatorSymbol("dataClassArrayMemberToString", stringType, "" to anyNType)

            checkNotNullSymbol = run {
                val typeParameter: IrTypeParameter = irFactory.createTypeParameter(

Response:
startOffset = UNDEFINED_OFFSET,
                    endOffset = UNDEFINED_OFFSET,
                    origin = BUILTIN_OPERATOR,
                    name = Name.identifier("T0"),
                    symbol = IrTypeParameterSymbolImpl(),
                    variance = Variance.INVARIANT,
                    index = 0,
                    isReified = true
                ).apply {<|endoftext|>


Prompt:
assertEquals("Boston", o.nativeFooNWrapperN?.nativeFooN?.s)
    o.nativeFooNWrapperN = NativeFooNWrapper(null)
    assertEquals("NativeFooNWrapper(nativeFooN=null) (object)", describeValueOfProperty(o, "nativeFooNWrapperN"))

Response:
assertEquals(null, o.nativeFooNWrapperN?.nativeFooN?.s)
    o.nativeFooNWrapperN = null
    assertEquals("null (object)", describeValueOfProperty(o, "nativeFooNWrapperN"))
    assertEquals(null, o.nativeFooNWrapperN?.nativeFooN?.s)
}<|endoftext|>


Prompt:
reporter.reportOn(declaration.source, FirErrors.MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES, context)
            }
            else -> {
                reporter.reportOn(declaration.source, FirErrors.MIXING_FUNCTIONAL_KINDS_IN_SUPERTYPES, superKinds, context)
            }

Response:
}
    }
}<|endoftext|>


Prompt: if (f != null || <!SENSELESS_COMPARISON!>this.f != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>this.f<!>.funNullableT()

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


Prompt:
* Returns a [Set] of all elements.
 *
 * The returned set preserves the element iteration order of the original array.
 */
public fun <T> Array<out T>.toSet(): Set<T> {
    return when (size) {
        0 -> emptySet()
        1 -> setOf(this[0])
        else -> toCollection(LinkedHashSet<T>(mapCapacity(size)))
    }

Response:
}

/**
 * Returns a [Set] of all elements.
 *
 * The returned set preserves the element iteration order of the original array.
 */
public fun ByteArray.toSet(): Set<Byte> {
    return when (size) {
        0 -> emptySet()
        1 -> setOf(this[0])
        else -> toCollection(LinkedHashSet<Byte>(mapCapacity(size)))
    }<|endoftext|>


Prompt:
* The insertion point is defined as the index at which the element should be inserted,
 * so that the array (or the specified subrange of array) still remains sorted.
 *
 * @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].
 */

Response:
public fun CharArray.binarySearch(element: Char, fromIndex: Int = 0, toIndex: Int = size): Int {
    return java.util.Arrays.binarySearch(this, fromIndex, toIndex, element)
}

/**
 * Checks if the two specified arrays are *deeply* equal to one another.
 *<|endoftext|>


Prompt:
val ch = this.code
    return ch in 0x0009..0x000d
            || ch in 0x001c..0x0020
            || ch == 0x00a0
            || ch > 0x1000 && (
                ch == 0x1680
                || ch in 0x2000..0x200a
                || ch == 0x2028
                || ch == 0x2029

Response:
|| ch == 0x202f
                || ch == 0x205f
                || ch == 0x3000
            )
}<|endoftext|>


Prompt:
assertEquals(listOf("3", "4"), q)

        assertTrue(q.addAll(listOf("7", "8")))
        assertEquals(listOf("3", "4", "7", "8"), q)
        assertEquals(listOf("2", "3", "4", "7", "8", "5"), s)

Response:
assertEquals(listOf("1", "2", "3", "4", "7", "8", "5", "6"), a)
    }

    @Test fun subListRemoveAt() {
        val a = ArrayList(listOf("1", "2", "3", "4", "5"))
        val s = a.subList(1, 4)<|endoftext|>


Prompt: ExpectedData(0x53c1a66d0b13003UL, 0x57466046cf6896edUL, 0x8ac37e0e8b25b0c6UL, 0x3e6074b52ad3cf18UL, 0xaa491ce7b45db297UL),

Response: ExpectedData(0xd3a2efec0f047e9UL, 0xc2dcc9758c910171UL, 0xcb5cddaeff4ddb40UL, 0x5d7cc5869baefef1UL, 0x9644c5853af9cfebUL),<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
import org.jetbrains.kotlin.ir.symbols.impl.IrConstructorSymbolImpl
import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl

Response:
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
import org.jetbrains.kotlin.name.Name<|endoftext|>


Prompt:
KotlinTarget.classActualTargets(ClassKind.ENUM_ENTRY, annotated.isInner, isCompanionObject = false, isLocalClass = false)
        )
        is FirProperty -> {
            when {
                annotated.isLocal ->
                    when {
                        annotated.name == SpecialNames.DESTRUCT -> TargetLists.T_DESTRUCTURING_DECLARATION

Response:
annotated.isCatchParameter == true -> TargetLists.T_CATCH_PARAMETER
                        else -> TargetLists.T_LOCAL_VARIABLE
                    }
                annotated.isMember ->
                    if (annotated.source?.kind == KtFakeSourceElementKind.PropertyFromParameter) {
                        TargetLists.T_VALUE_PARAMETER_WITH_VAL<|endoftext|>


Prompt:
inline fun <T> loop$atomicfu(refGetter: () -> KMutableProperty0<T>, action: (T) -> Unit) {
        while (true) {
            val cur = refGetter().get()
            action(cur)
        }
    }
    */
    override fun atomicfuLoopBody(valueType: IrType, valueParameters: List<IrValueParameter>): IrBlockBody =

Response:
irBlockBody {
            val refGetter = valueParameters[0]
            val action = valueParameters[1]
            +irWhile().apply {
                condition = irTrue()
                body = irBlock {
                    val cur = createTmpVariable(
                        atomicGetField(invokePropertyGetter(irGet(refGetter)), valueType),
                        "atomicfu\$cur", false
                    )<|endoftext|>


Prompt:
import org.jetbrains.kotlin.library.KotlinLibraryVersioning
import org.jetbrains.kotlin.library.SerializedMetadata
import org.jetbrains.kotlin.library.impl.BuiltInsPlatform
import org.jetbrains.kotlin.library.impl.buildKotlinLibrary
import org.jetbrains.kotlin.library.metadata.KlibMetadataVersion

Response:
import java.io.File

fun buildKotlinMetadataLibrary(configuration: CompilerConfiguration, serializedMetadata: SerializedMetadata, destDir: File) {
    val versions = KotlinLibraryVersioning(
        abiVersion = KotlinAbiVersion.CURRENT,
        libraryVersion = null,
        compilerVersion = KotlinCompilerVersion.getVersion(),<|endoftext|>


Prompt:
override val declarations: MutableList<FirDeclaration> = mutableListOf()
    override val annotations: MutableList<FirAnnotation> = mutableListOf()
    override lateinit var scopeProvider: FirScopeProvider
    lateinit var symbol: FirAnonymousObjectSymbol

    override fun build(): FirAnonymousObject {
        return FirAnonymousObjectImpl(
            source,
            resolvePhase,

Response:
moduleData,
            origin,
            attributes,
            typeParameters,
            status,
            deprecationsProvider,
            classKind,
            superTypeRefs,
            declarations,
            annotations.toMutableOrEmpty(),
            scopeProvider,
            symbol,
        )
    }

}

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


Prompt:
*                                     has less priority than explicitly specified enableOptimizations option in the
 *                                     build script.
 *
 *  Support for environment variables should be explicitly enabled by setting a project property:
 *      konan.useEnvironmentVariables = true.
 */

internal interface EnvironmentVariables {
    val configurationBuildDir: File?
    val debuggingSymbols: Boolean
    val enableOptimizations: Boolean
}

Response:
internal class EnvironmentVariablesUnused: EnvironmentVariables {
    override val configurationBuildDir: File?
        get() = null

    override val debuggingSymbols: Boolean
        get() = false

    override val enableOptimizations: Boolean
        get() = false
}

internal class EnvironmentVariablesImpl(val project: Project): EnvironmentVariables {
    override val configurationBuildDir: File?<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION

fun <T> foo(f: () -> T): T = f()

fun bar(): Unit {}

object Scope {
    fun bar(s: String = ""): Double = 0.0

    fun <T> foo(f: () -> T): T = f()

    object NestedScope {

Response:
fun bar(a: Int = 0): String = ""

        fun test() {
            // Despite the fact ::bar is resolved with compatibility warning, it's important not to propagate it to the outer call
            val result = <!DEBUG_INFO_CALL("fqName: Scope.foo; typeCall: function")!>foo(<!COMPATIBILITY_WARNING!>::bar<!>)<!><|endoftext|>


Prompt:
val serializationPluginClasspath = System.getProperty("kotlin.script.test.kotlinx.serialization.plugin.classpath")!!
        val out = captureOut {
            val res = evalFile(
                File("$TEST_DATA_ROOT/hello-kotlinx-serialization.main.kts"),
                compilation = {
                    compilerOptions(

Response:
"-Xplugin=$serializationPluginClasspath"
                    )
                }
            )
            assertSucceeded(res)
        }.lines()
        assertEquals(
            listOf("""{"firstName":"James","lastName":"Bond"}""", "User(firstName=James, lastName=Bond)"),
            out
        )
    }

    @Test<|endoftext|>


Prompt:
var j: Int                       get() = i;    <!WRONG_MODIFIER_TARGET!>abstract<!> set
    var j1: Int = <!PROPERTY_INITIALIZER_NO_BACKING_FIELD!>0<!>;  get() = i;    <!WRONG_MODIFIER_TARGET!>abstract<!> set

Response:
<!MUST_BE_INITIALIZED!>var k: Int<!>        <!WRONG_MODIFIER_TARGET!>abstract<!> set
    var k1: Int = 0;                 <!WRONG_MODIFIER_TARGET!>abstract<!> set<|endoftext|>


Prompt:
val parameter = newFun.valueParameters[i]
                if (parameter.isVararg) continue // Handled with WasmVarargExpressionLowering
                if (newCall.getValueArgument(i) != null) continue
                newCall.putValueArgument(
                    i,
                    IrConstImpl.defaultValueForType(UNDEFINED_OFFSET, UNDEFINED_OFFSET, parameter.type)

Response:
)
            }

            return newCall
        }
    }
}

private fun numDefaultParametersForExternalFunction(function: IrFunction): Int {
    if (function is IrSimpleFunction) {
        // Default parameters can be in overridden external functions
        val numDefaultParametersInOverrides =
            function.overriddenSymbols.maxOfOrNull {
                numDefaultParametersForExternalFunction(it.owner)<|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 Int, in V>> IntArray.associateWithTo(destination: M, valueSelector: (Int) -> V): M {
    for (element in this) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.scopes.processOverriddenFunctions
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.impl.*

Response:
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef<|endoftext|>


Prompt:
if (Case31.A.e != null) Case31.A.e.propNullableAny
    if (Case31.A.e != null) Case31.A.e.funT()
    if (Case31.A.e != null) Case31.A.e.funAny()
    if (Case31.A.e != null) Case31.A.e.funNullableT()

Response:
if (Case31.A.e != null) Case31.A.e.funNullableAny()
    if (Case31.A.e != null) Case31.A.e
    if (Case31.A.f != null) Case31.A.f.equals(null)
    if (Case31.A.f != null) Case31.A.f.propT<|endoftext|>


Prompt:
it.body = it.factory.createBlockBody(
                startOffset,
                endOffset,
                initializeStatements.let {
                    if (irScript.resultProperty == null || initializeStatements.lastOrNull()?.first?.correspondingPropertySymbol != irScript.resultProperty) it
                    else it.dropLast(1)

Response:
}.memoryOptimizedMap { (field, expression) -> createIrSetField(field, expression) }
            )
        }

        val evaluateScriptFunction = createFunction(irScript, "\$evaluateScript\$", getReturnType(irScript)).also {
            it.body = it.factory.createBlockBody(
                startOffset,
                endOffset,<|endoftext|>


Prompt:
"Unable to make PSI file from script"
        )
        ktFile.declarations.firstIsInstanceOrNull<KtScript>() == null -> failure(
            script,
            messageCollector,
            "Not a script file"
        )
        else -> ktFile.asSuccess()
    }
}

internal fun makeCompiledScript(
    generationState: GenerationState,

Response:
script: SourceCode,
    ktFile: KtFile,
    sourceDependencies: List<ScriptsCompilationDependencies.SourceDependencies>,
    getScriptConfiguration: (KtFile) -> ScriptCompilationConfiguration
): ResultWithDiagnostics<KJvmCompiledScript> {
    val scriptDependenciesStack = ArrayDeque<KtScript>()<|endoftext|>


Prompt: ExpectedData(0xa0f10149a0e538d6UL, 0x26b6689960ccf81dUL, 0x55f23b27bb9efd94UL, 0x3a17f6166dd765dbUL, 0xc891a8a62931e782UL),

Response: ExpectedData(0xfb8d9c70660b910bUL, 0x98ec31113e5e35d2UL, 0x5e4aeb853f1b9aa7UL, 0xbcf5c8fe4465b7c8UL, 0xb1ea3a8243996f15UL),<|endoftext|>


Prompt:
open fun cToBridged(expr: NativeExpression): NativeExpression = expr

    /**
     * If this info is for [TypeMirror.ByValue], then this method describes how to
     * construct pointed-type from value type.
     */
    abstract fun constructPointedType(valueType: KotlinType): KotlinClassifierType

Response:
class Primitive(override val bridgedType: BridgedType, val varClass: Classifier) : TypeInfo() {

        override fun argToBridged(expr: KotlinExpression) = expr
        override fun argFromBridged(expr: KotlinExpression, scope: KotlinScope, nativeBacked: NativeBacked) = expr<|endoftext|>


Prompt:
package org.jetbrains.kotlin.sir.util

import org.jetbrains.kotlin.sir.*
import org.jetbrains.kotlin.sir.builder.buildStruct

/**
 * A module representing the swift standard library
 */
object SirSwiftModule : SirModule() {
    override val name: String get() = "Swift"

Response:
val bool = primitive("Bool")

    val int8 = primitive("Int8")
    val int16 = primitive("Int16")
    val int32 = primitive("Int32")
    val int64 = primitive("Int64")

    val uint8 = primitive("UInt8")
    val uint16 = primitive("UInt16")
    val uint32 = primitive("UInt32")<|endoftext|>


Prompt:
|#######################
        |
        """.trimMargin()
    )
}

internal fun String.normalizeLineEndings(): String = replace("\n", System.lineSeparator())

/*
Ideally, this would've been just KotlinTestUtils.assertEqualsToFile, throwing FileComparisonException.
Normally this is actually desired, because IDEA and TC provide special support for those exceptions with

Response:
nice diff windows. However, due to shaded artifacts used in runtime of integration tests, actual thrown
exception will have FQN like org.jetbrains.kotlin.com.intellij... . This not only breaks the tooling support,
but also rendered diff will be trimmed, making working with such failures extremely inconvenient
*/
internal fun assertEqualsToFile(expectedFile: File, actualText: String) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.cli.common.output.writeAllTo
import org.jetbrains.kotlin.codegen.GeneratedClassLoader
import org.junit.After
import org.junit.AfterClass
import org.junit.Before
import org.junit.BeforeClass
import org.junit.Rule
import org.junit.rules.TemporaryFolder

Response:
private const val RUNNER_CLASS = "RunnerKt"
private const val MAIN_METHOD = "main"
private const val CONTENT_METHOD = "content"
private const val TEST_CLASS = "TestKt"

abstract class AbstractDebuggerTest(useFir: Boolean) : AbstractCodegenTest(useFir) {
    companion object {
        private lateinit var testServerProcess: Process<|endoftext|>


Prompt:
protected val defaultStateFacade: RemoteReplStateFacadeServer by lazy { createRemoteState() }

    @Suppress("DEPRECATION")
    @Deprecated("Use check(state, line) instead")
    fun check(codeLine: ReplCodeLine): ReplCheckResult = check(defaultStateFacade.state, codeLine)

    @Suppress("DEPRECATION", "UNUSED_PARAMETER")

Response:
@Deprecated("Use compile(state, line) instead")
    fun compile(codeLine: ReplCodeLine, verifyHistory: List<ReplCodeLine>?): ReplCompileResult = compile(defaultStateFacade.state, codeLine)

    fun createRemoteState(port: Int = portForServers): RemoteReplStateFacadeServer = statesLock.write {<|endoftext|>


Prompt:
exports unannotatedpackage;
}

// FILE: null_marked_module/nullunmarkedpackage/package-info.java

@NullUnmarked
package nullunmarkedpackage;

import org.jspecify.annotations.*;

// FILE: null_marked_module/nullunmarkedpackage/UnannotatedType.java

package nullunmarkedpackage;

public interface UnannotatedType {

Response:
public String unannotatedProduce();
    public void unannotatedConsume(String arg);
}

// FILE: null_marked_module/unannotatedpackage/NullUnmarkedType.java

package unannotatedpackage;

import org.jspecify.annotations.*;

@NullUnmarked
public interface NullUnmarkedType {
    public String unannotatedProduce();<|endoftext|>


Prompt:
const val equalsShort3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.toShort().equals("1")<!>
const val equalsShort4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE!>1.toShort() == "1"<!>

Response:
const val equalsInt1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>1.equals(2)<!>
const val equalsInt2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>2 == 2<!><|endoftext|>


Prompt:
val disableSwiftMemberNameMangling: Boolean
            get() = false

        val unitSuspendFunctionExport: UnitSuspendFunctionObjCExport
        val ignoreInterfaceMethodCollisions: Boolean
            get() = false
    }

    fun generateBase(): List<ObjCTopLevel>

    fun translate(file: KtFile): List<ObjCTopLevel>
}

@JvmOverloads

Response:
fun createObjCExportLazy(
    configuration: ObjCExportLazy.Configuration,
    problemCollector: ObjCExportProblemCollector,
    codeAnalyzer: KotlinCodeAnalyzer,
    typeResolver: TypeResolver,
    descriptorResolver: DescriptorResolver,
    fileScopeProvider: FileScopeProvider,
    builtIns: KotlinBuiltIns,<|endoftext|>


Prompt:
if (this.y != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?"), DEBUG_INFO_SMARTCAST!>y<!>.propAny
        if (this.y != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?")!>y<!>.propNullableT

Response:
if (this.y != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?")!>y<!>.propNullableAny
        if (this.y != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?"), DEBUG_INFO_SMARTCAST!>y<!>.funT()<|endoftext|>


Prompt:
// FILE: bar/JavaClass.java

package bar;

public class JavaClass {
    protected void foo() {}
    protected static void bar1() {}
    protected static void bar2() {}

    protected String field = "";
    protected static String CONST1 = "";
    protected static String CONST2 = "";

}

// FILE: foo/JavaClassSamePackage.java
package foo;

Response:
public class JavaClassSamePackage extends bar.JavaClass {
    protected static void bar2() {}
    protected static String CONST2 = "";
}

// FILE: foo/main.kt
package foo

import bar.JavaClass

class KotlinClass : JavaClass() {
    fun baz() {
        foo() // OK
    }
}

class KotlinClass2 : JavaClass() {<|endoftext|>


Prompt: 0xbff7dcb7c5c399ecUL,     0xbff7dcb7c5c38c03UL,     0xbff7dcb7c5c3a7d5UL,     0xbff87f17cfda0b5dUL,

Response: 0xbff69b8154baf42eUL,     0xbff8d08152eddb7aUL,     0xbff433b8a322ddd2UL,     0xbffa673ee2c4c045UL,<|endoftext|>


Prompt:
getModels<NoArg> {
                with(getModel(":")!!) {
                    assertEquals(1L, modelVersion)
                    assertEquals("noArgKt18668", name)
                    assertEquals(1, annotations.size)
                    assertTrue(annotations.contains("test.NoArg"))
                    assertTrue(presets.isEmpty())
                    assertFalse(isInvokeInitializers)

Response:
}
            }
        }
    }

    @DisplayName("Model is not available when plugin is not applied")
    @GradleTest
    fun testNonNoArgProjects(gradleVersion: GradleVersion) {
        project("kotlinProject", gradleVersion) {
            getModels<NoArg> {
                assertNull(getModel(":"))
            }
        }
    }
}<|endoftext|>


Prompt:
body.buildConstI32Symbol(context.stringPoolSize, location)
            }

            wasmSymbols.wasmArrayNewData0 -> {
                val arrayGcType = WasmImmediate.GcType(
                    context.referenceGcType(call.getTypeArgument(0)!!.getRuntimeClass(irBuiltIns).symbol)
                )

Response:
body.buildInstr(WasmOp.ARRAY_NEW_DATA, location, arrayGcType, WasmImmediate.DataIdx(0))
            }

            else -> {
                return false
            }
        }

        return true
    }

    override fun visitBlockBody(body: IrBlockBody) {
        body.statements.forEach(::generateStatement)<|endoftext|>


Prompt:
private object B24 { val a = B23.a + Random.nextInt(100) }
private object B25 { val a = B24.a + Random.nextInt(100) }
private object B26 { val a = B25.a + Random.nextInt(100) }
private object B27 { val a = B26.a + Random.nextInt(100) }

Response:
private object B28 { val a = B27.a + Random.nextInt(100) }
private object B29 { val a = B28.a + Random.nextInt(100) }
private object B30 { val a = B29.a + Random.nextInt(100) }
private object B31 { val a = B30.a + Random.nextInt(100) }<|endoftext|>


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

@file:Suppress("DuplicatedCode")

package org.jetbrains.kotlin.ir.expressions.impl

import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer

Response:
import org.jetbrains.kotlin.ir.expressions.IrConstantObject
import org.jetbrains.kotlin.ir.expressions.IrConstantValue
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
import org.jetbrains.kotlin.ir.types.IrType<|endoftext|>


Prompt:
val Number.Kilograms: Mass get() = Mass(toDouble())

// FILE: operators.kt
operator fun Volume.times(density: Density): Mass = Mass(cubicMeters * density.kilogramsPerCubicMeter)
operator fun Density.times(volume: Volume): Mass = Mass(kilogramsPerCubicMeter * volume.cubicMeters)

// MODULE: constants

Response:
// FILE: main.kt
const val TRIVIAL_PI = 3.14

// MODULE: shapes(mass,constants)
// FILE: default.kt
class Ball(private val radius: Length) {
    val surfaceArea1: SurfaceArea get() = TRIVIAL_PI * radius * radius
    val surfaceArea2: SurfaceArea get() = radius * TRIVIAL_PI * radius<|endoftext|>


Prompt:
operator fun <P: MyClass> P.provideDelegate(host: Any?, p: Any): P =
        runLogged("tdf(${this.value});") { this }

operator fun <V> V.getValue(receiver: Any?, p: Any): V =
        runLogged("get($this);") { this }

Response:
val testO by runLogged("O;") { MyClass("O") }
val testK by runLogged("K;") { "K" }
val testOK = runLogged("OK;") { testO.value + testK }

fun box(): String {
    assertEquals("O;tdf(O);K;OK;get(O);get(K);", log)
    return testOK
}<|endoftext|>


Prompt:
add(FirErrors.MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND_FUN.warningFactory) { firDiagnostic ->
        ModifierFormForNonBuiltInSuspendFunWarningImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }

Response:
add(FirErrors.RETURN_FOR_BUILT_IN_SUSPEND) { firDiagnostic ->
        ReturnForBuiltInSuspendImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }<|endoftext|>


Prompt:
package kotlin.reflect

/**
 * Represents a callable entity, such as a function or a property.
 *
 * @param R return type of the callable.
 */
public actual interface KCallable<out R> : KAnnotatedElement {
    /**
     * The name of this callable as it was declared in the source code.

Response:
* If the callable has no name, a special invented name is created.
     * Nameless callables include:
     * - constructors have the name "<init>",
     * - property accessors: the getter for a property named "foo" will have the name "<get-foo>",
     *   the setter, similarly, will have the name "<set-foo>".
     */<|endoftext|>


Prompt:
}
        println("}")
    }

    override fun visitTypeAlias(declaration: IrTypeAlias) {
        print("<<TYPEALIAS>>")
    }

    override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer) {
        println("init {")
        indented {
            declaration.body.print()
        }
        println()
        println("}")
    }

Response:
private fun IrType.renderSrc() =
        "${renderTypeAnnotations(annotations)}${renderTypeInner()}"

    private fun IrType.renderTypeInner() =
        when (this) {
            is IrDynamicType -> "dynamic"

            is IrErrorType -> "IrErrorType"

            is IrSimpleType -> buildTrimEnd {<|endoftext|>


Prompt:
public fun kotlin.Double.coerceAtMost(maximumValue: kotlin.Double): kotlin.Double

public fun kotlin.Float.coerceAtMost(maximumValue: kotlin.Float): kotlin.Float

public fun kotlin.Int.coerceAtMost(maximumValue: kotlin.Int): kotlin.Int

Response:
public fun kotlin.Long.coerceAtMost(maximumValue: kotlin.Long): kotlin.Long

public fun kotlin.Short.coerceAtMost(maximumValue: kotlin.Short): kotlin.Short

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


Prompt:
interface Test4<T : IBase> : JFooWithUpperBound<T>, IFoo

interface Test5<T : IDerived> : JFooWithUpperBoundDerived<T>, IFooDerived

class Test6<T : IBase> : JCFooWithUpperBound<T>(), IFoo

Response: class Test7<T : IDerived> : JCFooWithUpperBoundDerived<T>(), IFooDerived<|endoftext|>


Prompt:
package org.jetbrains.kotlin.codegen.range.comparison

import org.jetbrains.org.objectweb.asm.Label
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter

object LongComparisonGenerator : SignedIntegerComparisonGenerator {

Response:
override val comparedType: Type = Type.LONG_TYPE

    override fun jumpIfGreaterOrEqual(v: InstructionAdapter, label: Label) {
        v.lcmp()
        v.ifge(label)
    }

    override fun jumpIfLessOrEqual(v: InstructionAdapter, label: Label) {
        v.lcmp()
        v.ifle(label)
    }<|endoftext|>


Prompt:
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
@kotlin.internal.InlineOnly
public inline fun <R> CharSequence.maxOfWith(comparator: Comparator<in R>, selector: (Char) -> R): R {
    if (isEmpty()) throw NoSuchElementException()

Response:
var maxValue = selector(this[0])
    for (i in 1..lastIndex) {
        val v = selector(this[i])
        if (comparator.compare(maxValue, v) < 0) {
            maxValue = v
        }
    }
    return maxValue
}

/**
 * Returns the largest value according to the provided [comparator]<|endoftext|>


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

    interface KclassWithNullableTypeParameterInSignature : KtFirDiagnostic<KtNamedDeclaration> {

Response:
override val diagnosticClass get() = KclassWithNullableTypeParameterInSignature::class
        val typeParameter: KtTypeParameterSymbol
    }

    interface TypeParameterAsReified : KtFirDiagnostic<PsiElement> {
        override val diagnosticClass get() = TypeParameterAsReified::class
        val typeParameter: KtTypeParameterSymbol
    }<|endoftext|>


Prompt: p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A,

Response:
p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A
) {}

fun bar(x: Any) {}

fun test(<|endoftext|>


Prompt: if (c != null || <!SENSELESS_COMPARISON!>this.c != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>c<!>.propAny

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


Prompt:
val result2 = sequenceOf(1, 2, 4).flatMap { if (it == 2) emptyList<Int>() else it - 1..it }
        val expected = listOf(0, 1, 3, 4)
        assertEquals(expected, result1.toList())
        assertEquals(expected, result2.toList())
    }

    @Test fun flatMapIndexed() {

Response:
val result1 = sequenceOf(1, 2).flatMapIndexed { index, v -> (0..v + index).asSequence() }
        val result2 = sequenceOf(1, 2).flatMapIndexed { index, v -> 0..v + index }
        val expected = listOf(0, 1, 0, 1, 2, 3)
        assertEquals(expected, result1.toList())<|endoftext|>


Prompt:
KtTokens.MINUSEQ -> KtCompoundAccess.CompoundAssign.Kind.MINUS_ASSIGN
            KtTokens.MULTEQ -> KtCompoundAccess.CompoundAssign.Kind.TIMES_ASSIGN
            KtTokens.PERCEQ -> KtCompoundAccess.CompoundAssign.Kind.REM_ASSIGN

Response:
KtTokens.DIVEQ -> KtCompoundAccess.CompoundAssign.Kind.DIV_ASSIGN
            else -> error("unexpected operator $operationToken")
        }
        return compoundAssignKind
    }

    protected fun KtUnaryExpression.getInOrDecOperationKind(): KtCompoundAccess.IncOrDecOperation.Kind {
        val incOrDecOperationKind = when (operationToken) {<|endoftext|>


Prompt:
assertEquals(null, notNullToNotNull(f), "F as? B")
    assertEquals(null, notNullToNotNull(an), "Any as? B")
    assertEquals(null, dtoB(dyn), "dynamic as? B")

    assertEquals(null, notNullToNotNull(func), "Function is II")

Response:
assertEquals(null, notNullToNotNull(bool), "Boolean is II")
    assertEquals(null, notNullToNotNull(num), "Number is II")
    assertEquals(null, notNullToNotNull(str), "String is II")

    return "OK"
}

fun testClassCast() {
    assertEquals("OK", testClassCastN2N())<|endoftext|>


Prompt:
branch.startOffset, branch.endOffset,
            branch.condition.transform(),
            branch.result.transform()
        )

    private val transformedLoops = HashMap<IrLoop, IrLoop>()

    private fun getTransformedLoop(irLoop: IrLoop): IrLoop =
        transformedLoops.getOrDefault(irLoop, irLoop)

Response:
override fun visitWhileLoop(loop: IrWhileLoop): IrWhileLoop =
        IrWhileLoopImpl(loop.startOffset, loop.endOffset, loop.type.remapType(), mapStatementOrigin(loop.origin)).also { newLoop ->
            transformedLoops[loop] = newLoop
            newLoop.label = loop.label
            newLoop.condition = loop.condition.transform()<|endoftext|>


Prompt:
private fun createClass(descriptor: FunctionClassDescriptor, declarator: SymbolTable.((IrClassSymbol) -> IrClass) -> IrClass): IrClass =
        symbolTable.declarator { createIrClass(it, descriptor) }

Response:
private fun buildClass(descriptor: FunctionClassDescriptor, declarator: SymbolTable.((IrClassSymbol) -> IrClass) -> IrClass): IrClass =
            builtClassesMap.getOrPut(descriptor) {
                createClass(descriptor, declarator).apply {
                    val functionClass = this
                    typeParameters += descriptor.declaredTypeParameters.map { typeParameterDescriptor -><|endoftext|>


Prompt:
val butterknifeJavaClassesDir = "app/build/intermediates/javac/debug/classes/org/example/kotlin/butterknife/"
                assertFileInProjectExists(butterknifeJavaClassesDir + "SimpleActivity\$\$ViewBinder.class")

Response:
assertFileInProjectExists("app/build/tmp/kotlin-classes/debug/org/example/kotlin/butterknife/SimpleAdapter\$ViewHolder.class")
            }

            build("assembleDebug") {
                assertTasksUpToDate(":app:compileDebugKotlin", ":app:compileDebugJavaWithJavac")
            }
        }
    }<|endoftext|>


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

fun poll56(): Flow<String> {
    return flow {
        val inv = try { ::<!DEBUG_INFO_MISSING_UNRESOLVED!>Foo7<!> } catch (e: Exception) { foo7() } finally { foo7() }
        inv
    }

Response:
}

fun poll6(): Flow<String> {
    return flow {
        val inv = ::bar
        inv
    }
}

fun poll61(): Flow<String> {
    return flow {
        val inv = ::bar2
        inv
    }
}

fun poll62(): Flow<String> {
    return flow {
        val inv = ::bar3
        inv
    }
}<|endoftext|>


Prompt:
* Splits this char sequence to a sequence of strings around occurrences of the specified [delimiters].
 *
 * @param delimiters One or more characters to be used as delimiters.
 * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.
 * @param limit The maximum number of substrings to return.
 */

Response:
public fun CharSequence.splitToSequence(vararg delimiters: Char, ignoreCase: Boolean = false, limit: Int = 0): Sequence<String> =
    rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).map { substring(it) }

/**
 * Splits this char sequence to a list of strings around occurrences of the specified [delimiters].
 *<|endoftext|>


Prompt:
<!EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING!>actual<!> interface Interface

<!EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING!>actual<!> object Object

<!EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING!>actual<!> annotation class Annotation

Response:
<!EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING!>actual<!> enum class Enum

<!EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING!>actual<!> typealias ActualTypealias = ActualTypealiasImpl

class ActualTypealiasImpl

actual fun function() {}

actual val property: Clazz = null!!<|endoftext|>


Prompt:
w.test(D(C(100)), C(1))

    val q = D::class.members.single { it.name == "q" } as KMutableProperty2<D, Int, Int>
    q.test({ getExtensionDelegate(D(C(100))) as KMutableProperty1<Int, Int> }, { get(100) }, { set(100, it) })

    return "OK"

Response: }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.codegen.GenerationUtils
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.JVMConfigurationKeys
import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJavaTest
import org.jetbrains.kotlin.kotlinp.Settings

Response:
import org.jetbrains.kotlin.kotlinp.jvm.JvmKotlinp
import org.jetbrains.kotlin.kotlinp.jvm.readClassFile
import org.jetbrains.kotlin.kotlinp.jvm.readModuleFile
import org.jetbrains.kotlin.test.ConfigurationKind<|endoftext|>


Prompt:
val b = A().B().test()
    if (b != "A.amf,A.ef,A.amp,A.ep,B.mf,B.mp,B.ef,B.ep,") return "Fail $b"

    result = ""
    with(A()) {
        (::memberFunction).let { it() }
        (::aExtensionFunction).let { it() }

Response:
(::memberProperty).let { it() }
        (::aExtensionProperty).let { it() }
    }
    if (result != "A.mf,A.ef,A.mp,A.ep,") return "Fail $result"

    result = ""
    with(A()) {
        with(B()) {
            (::aMemberFunction).let { it() }<|endoftext|>


Prompt:
takeFnToAny(fun() { return Unit })
    takeFnToAny(fun(): Unit {})
    takeFnToAny(fun(): Unit { return })
    takeFnToAny(fun(): Unit { return Unit })
    takeFnToAny(fun() { if (true) return })
    takeFnToAny(fun() { if (true) return Unit })

Response:
takeFnToAny(fun() = <!UNRESOLVED_REFERENCE!>unresolved<!>())
    takeFnToAny(fun() { <!UNRESOLVED_REFERENCE!>unresolved<!>() })
    takeFnToAny(fun(): Unit { <!UNRESOLVED_REFERENCE!>unresolved<!>() })<|endoftext|>


Prompt:
}

    private fun processToolchain(
        bundleDir: File,
        project: Project,
        reinstallFlag: Boolean,
        kotlinNativeVersion: String,
        kotlinNativeBundleConfiguration: ConfigurableFileCollection,
    ) {
        val lock =

Response:
NativeDistributionCommonizerLock(bundleDir) { message -> project.logger.info("Kotlin Native Bundle: $message") }

        lock.withLock {
            val needToReinstall = KotlinToolingVersion(project.konanVersion).maturity == KotlinToolingVersion.Maturity.SNAPSHOT
            if (needToReinstall) {<|endoftext|>


Prompt:
get() = table.irFactory

    private val nameProvider: NameProvider
        get() = table.nameProvider

    private val signatureComposer: IdSignatureComposer
        get() = table.signaturer!!

Response:
private val externalPackageFragmentSlice: SymbolTableSlice<PackageFragmentDescriptor, IrExternalPackageFragment, IrExternalPackageFragmentSymbol> = SymbolTableSlice.Flat(lock)

    private val valueParameterSlice: SymbolTableSlice.Scoped<ParameterDescriptor, IrValueParameter, IrValueParameterSymbol> by threadLocal {
        SymbolTableSlice.Scoped(lock)<|endoftext|>


Prompt:
return (1..lines).fold(FragmentedText()) { frag, line ->
            frag.generateFragment(line)
        }
    }

    private fun runValidations(originalText: String, mergedText: String, includedFragments: List<FragmentedText.TextFragment>) {
        // Check that line count is the same

Response:
assertEquals("Line count differ.", originalText.lines().count(), mergedText.lines().count())
        // Check that char count is the same
        assertEquals("Char count differ.", originalText.length, mergedText.length)
        includedFragments.forEach {
            // Check that every included fragment is included in correct position
            assertEquals(
                "Incorrect fragment in position.",
                it.text,<|endoftext|>


Prompt:
super.visitReturnExpression(returnExpression)
        }

        override fun visitBreakExpression(breakExpression: FirBreakExpression) {
            if (breakExpression.target.labeledElement !in firLoopStatements) {
                firBreakExpressions.add(breakExpression)
                firLoopJumpTargets.add(breakExpression.target.labeledElement)
            }

Response:
super.visitBreakExpression(breakExpression)
        }

        override fun visitContinueExpression(continueExpression: FirContinueExpression) {
            if (continueExpression.target.labeledElement !in firLoopStatements) {
                firContinueExpressions.add(continueExpression)
                firLoopJumpTargets.add(continueExpression.target.labeledElement)
            }<|endoftext|>


Prompt:
// FIR_IDENTICAL
// MODULE: m1
// FILE: a.kt

package p

public class A
public class B {
    public val a: A = A()
}

// MODULE: m2(m1)
// FILE: b.kt

package p

class A {
    fun foo() {}
}

fun test() {
    val a: A = B().a

Response:
a.foo()
}<|endoftext|>


Prompt:
): FirBlock {
    return buildBlock {
        source = multiDeclaration.toKtPsiSourceElement()
        addDestructuringVariables(
            statements,
            c,
            moduleData,
            multiDeclaration,
            container,
            tmpVariable,
            forceLocal = false,
        )
    }
}

internal fun AbstractRawFirBuilder<*>.addDestructuringVariables(

Response:
destination: MutableList<in FirVariable>,
    c: DestructuringContext<KtDestructuringDeclarationEntry>,
    moduleData: FirModuleData,
    multiDeclaration: KtDestructuringDeclaration,
    container: FirVariable,
    tmpVariable: Boolean,
    forceLocal: Boolean,
    configure: (FirVariable) -> Unit = {}
) {<|endoftext|>


Prompt:
result.add(toStringContributedFunction)
                val toStringFunction = createSyntheticIrFunction(
                    TO_STRING,
                    toStringContributedFunction,
                    c.irBuiltIns.stringType,
                )
                declarationStorage.cacheGeneratedFunction(toStringContributedFunction, toStringFunction)
            }

Response:
val hashcodeNameContributedFunction = contributedSyntheticFunctions[HASHCODE_NAME]
            if (hashcodeNameContributedFunction != null) {
                result.add(hashcodeNameContributedFunction)
                val hashCodeFunction = createSyntheticIrFunction(
                    HASHCODE_NAME,
                    hashcodeNameContributedFunction,
                    c.irBuiltIns.intType,
                )<|endoftext|>


Prompt:
}
    return -(low + 1)  // key not found
}

@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()"))
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes

Response:
@Suppress("CONFLICTING_OVERLOADS")
public fun UIntArray.max(): UInt? {
    return maxOrNull()
}

@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()"))
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")<|endoftext|>


Prompt:
}

        override val staticCacheForDistributionLibrariesRootDir: File = File(distribution.klib)
            .resolve("cache")
            .resolve(
                computeDistroCacheDirName(
                    testTarget = kotlinNativeTargets.testTarget,
                    cacheKind = CACHE_KIND,
                    debuggable = optimizationMode == OptimizationMode.DEBUG
                )

Response:
).apply {
                assertTrue(exists()) { "The distribution libraries cache directory is not found: $this" }
                assertTrue(isDirectory) { "The distribution libraries cache directory is not a directory: $this" }
                assertTrue(list().orEmpty().isNotEmpty()) { "The distribution libraries cache directory is empty: $this" }
            }

        companion object {<|endoftext|>


Prompt:
private val defaultParameterInjectorPhase = makeIrModulePhase(
    { context -> DefaultParameterInjector(context, MaskedDefaultArgumentFunctionFactory(context), skipExternalMethods = true) },
    name = "DefaultParameterInjector",
    description = "Replace call site with default parameters with corresponding stub function",
    prerequisite = setOf(innerClassesLoweringPhase)
)

Response:
private val defaultParameterCleanerPhase = makeIrModulePhase(
    ::DefaultParameterCleaner,
    name = "DefaultParameterCleaner",
    description = "Clean default parameters up"
)

private val propertiesLoweringPhase = makeIrModulePhase<WasmBackendContext>(
    { PropertiesLowering() },
    name = "PropertiesLowering",
    description = "Move fields and accessors out from its property"
)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
import org.jetbrains.kotlin.backend.wasm.WasmBackendContext
import org.jetbrains.kotlin.config.AnalysisFlags
import org.jetbrains.kotlin.config.languageVersionSettings
import org.jetbrains.kotlin.descriptors.ClassKind

Response:
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.backend.js.lower.calls.EnumIntrinsicsUtils
import org.jetbrains.kotlin.ir.backend.js.utils.erasedUpperBound<|endoftext|>


Prompt:
inline fun <reified T: View3> findViewById6(): T = null as T
fun test6(): I = findViewById6()

fun <T: View4> findViewById7(): T = null as T
fun test7(): I = findViewById7()

inline fun <reified T: View4> findViewById8(): T = null as T
fun test8(): I = findViewById8()

Response:
fun <T> findViewById9(): T where T: View3, T: View5 = null as T
fun test9(): I = findViewById9()

inline fun <reified T> findViewById10(): T where T: View3, T: View5 = null as T
fun test10(): I = findViewById10()

fun <T: View2> findViewById11(): T = null as T<|endoftext|>


Prompt:
trace.report(INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER.on(languageVersionSettings, klass, classDescriptor, abstractInvisibleSuper))
            }

            conflictingInterfaceMembers.removeAll(conflictingReturnTypes)
            multipleImplementations.removeAll(conflictingReturnTypes)
            if (conflictingInterfaceMembers.isNotEmpty()) {

Response:
trace.report(MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED.on(klass, klass, conflictingInterfaceMembers.first()))
            } else if (multipleImplementations.isNotEmpty()) {
                trace.report(MANY_IMPL_MEMBER_NOT_IMPLEMENTED.on(klass, klass, multipleImplementations.first()))
            }
        }<|endoftext|>


Prompt:
// !LANGUAGE: +InlineClasses

inline class UInt(val value: Int)
inline class ULong(val value: Long)

fun foo(u: UInt, f: (UInt) -> ULong): ULong = f(u)

fun takeUInt(u: UInt) {}

fun test() {
    val u = UInt(0)

Response:
val l = foo(u) { // box unbox UInt
        takeUInt(it)

        ULong(0) // box ULong
    } // unbox ULong
}

// @TestKt.class:
// 1 INVOKESTATIC UInt\.box
// 2 INVOKEVIRTUAL UInt.unbox

// 1 INVOKESTATIC ULong\.box<|endoftext|>


Prompt:
object KLIB : SourceSetMetadataLayout("klib", "klib")

    override fun toString(): String = name

    companion object {
        private val values get() = listOf(METADATA, KLIB)

        fun byName(name: String): SourceSetMetadataLayout? = values.firstOrNull { it.name == name }

        fun chooseForProducingProject() =

Response:
/** A producing project will now only generate Granular source sets metadata as a KLIB */
            KLIB
    }
}

/**
 * Represents the structure of "shared" source sets within a Kotlin Project.
 * Note: This entity is designed to only list "shared" source sets.
 * No "platform" source sets will be listed.
 */
data class KotlinProjectStructureMetadata(
    @Input<|endoftext|>


Prompt:
typeTable: TypeTable = this.typeTable,
    protoContainer: ProtoContainer.Class? = this.protoContainer
): ClsStubBuilderContext = ClsStubBuilderContext(
    this.components,
    nameResolver,
    if (name != null) this.containerFqName.child(name) else this.containerFqName,

Response:
this.typeParameters.child(nameResolver, typeParameterList),
    typeTable,
    protoContainer
)<|endoftext|>


Prompt:
public inline fun <R, C : MutableCollection<in R>> UIntArray.mapTo(destination: C, transform: (UInt) -> R): C {
    for (item in this)
        destination.add(transform(item))
    return destination
}

/**
 * Applies the given [transform] function to each element of the original array
 * and appends the results to the given [destination].
 */

Response:
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun <R, C : MutableCollection<in R>> ULongArray.mapTo(destination: C, transform: (ULong) -> R): C {
    for (item in this)
        destination.add(transform(item))
    return destination
}

/**<|endoftext|>


Prompt:
package org.jetbrains.kotlin.analysis.api.descriptors.components

import org.jetbrains.kotlin.analysis.api.components.KtTypeInfoProvider
import org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession

Response:
import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent
import org.jetbrains.kotlin.analysis.api.descriptors.types.base.KtFe10Type
import org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeToken<|endoftext|>


Prompt:
is ExportedType.ImplicitlyExportedType -> {
            val typeString = type.toTypeScript("", true)
            if (isInCommentContext) {
                typeString
            } else {
                val superTypeString = exportedSupertype.toTypeScript(indent)

Response:
superTypeString.let { if (exportedSupertype is ExportedType.IntersectionType) "($it)" else it } + "/* $typeString */"
            }
        }

        is ExportedType.PropertyType -> "${container.toTypeScript(indent, isInCommentContext)}[${
            propertyName.toTypeScript(
                indent,
                isInCommentContext
            )
        }]"<|endoftext|>


Prompt:
val structPointerFromPosix = getStructPointerFromPosix()

    object MyStruct {
        val struct = getMyStructPointer()?.pointed ?: error("Missing my struct")
        val posixProperty: stat = struct.posixProperty
        val longProperty: Long = struct.longProperty
        val doubleProperty: Double = struct.doubleProperty

Response:
val int32tProperty: Int = struct.int32tProperty
        val int64TProperty: Long = struct.int64tProperty
        val windowsOnly: Boolean = struct.windowsOnlyProperty
    }

    val simple = simpleInterop()
    val p1 = WindowsMain.structFromPosix
}<|endoftext|>


Prompt:
// test.kt:19 box

// EXPECTATIONS JS_IR
// test.kt:16 box
// test.kt:9 foo
// test.kt:6 cond
// EXPECTATIONS FIR JS_IR
// test.kt:12 foo
// EXPECTATIONS JS_IR
// test.kt:13 foo
// test.kt:17 box
// test.kt:18 box
// test.kt:9 foo

Response:
// test.kt:6 cond
// test.kt:10 foo
// test.kt:6 cond
// EXPECTATIONS FIR JS_IR
// test.kt:12 foo
// EXPECTATIONS JS_IR
// test.kt:13 foo
// test.kt:19 box

// EXPECTATIONS WASM
// test.kt:16 $box
// test.kt:9 $foo (8, 8)<|endoftext|>


Prompt:
candidateCall: MutableResolvedCall<D>,
        receiverParameter: ReceiverParameterDescriptor?,
        receiverArgument: ReceiverValue?,
        isExplicitReceiver: Boolean,
        implicitInvokeCheck: Boolean,
        isDispatchReceiver: Boolean
    ): ResolutionStatus {
        if (receiverParameter == null || receiverArgument == null) return SUCCESS

Response:
val candidateDescriptor = candidateCall.candidateDescriptor
        if (TypeUtils.dependsOnTypeParameters(receiverParameter.type, candidateDescriptor.typeParameters)) return SUCCESS

        // Here we know that receiver is OK ignoring nullability and check that nullability is OK too
        // Doing it simply as full subtyping check (receiverValueType <: receiverParameterType)<|endoftext|>


Prompt:
import org.gradle.api.tasks.*
import org.gradle.process.ExecOperations
import org.gradle.work.DisableCachingByDefault
import org.jetbrains.kotlin.gradle.dsl.KotlinNativeBinaryContainer
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.Companion.kotlinPropertiesProvider

Response:
import org.jetbrains.kotlin.gradle.plugin.diagnostics.KotlinToolingDiagnostics
import org.jetbrains.kotlin.gradle.plugin.diagnostics.reportDiagnostic
import org.jetbrains.kotlin.gradle.plugin.mpp.Framework
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType<|endoftext|>


Prompt:
if (element12 in 1L..<3L != range0.contains(element12)) throw AssertionError()
    if (element12 !in 1L..<3L != !range0.contains(element12)) throw AssertionError()
    if (!(element12 in 1L..<3L) != !range0.contains(element12)) throw AssertionError()

Response:
if (!(element12 !in 1L..<3L) != range0.contains(element12)) throw AssertionError()
}

fun testR0xE13() {
    // with possible local optimizations
    if (2.toShort() in 1L..<3L != range0.contains(2.toShort())) throw AssertionError()<|endoftext|>


Prompt:
return (elements as Collection<*>).all { it is UInt && storage.contains(it.toInt()) }
    }

    override fun isEmpty(): Boolean = this.storage.size == 0
}

/**
 * Creates a new array of the specified [size], where each element is calculated by calling the specified
 * [init] function.
 *

Response:
* The function [init] is called for each array element sequentially starting from the first one.
 * It should return the value for an array element given its index.
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun UIntArray(size: Int, init: (Int) -> UInt): UIntArray {<|endoftext|>