Prompt:
"properties": {
                        "metric": { "type": "keyword" },
                        "name": { "type": "keyword" },
                        "normalizedScore": { "type": "float" }
                        "repeat": { "type": "long" },
                        "runtimeInUs": { "type": "float" },
                        "score": { "type": "float" },

Response:
"status": { "type": "keyword" },
                        "variance": { "type": "float" },
                        "warmup": { "type": "long" },
                  }
                },
                "buildNumber" : { "type" : "keyword" },
                "env" : { "type" : "nested" },
                "kotlin" : { "type" : "nested" }<|endoftext|>


Prompt:
// WITH_STDLIB

/*
 * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
 *
 * SPEC VERSION: 0.1-218
 * MAIN LINK: expressions, conditional-expression -> paragraph 1 -> sentence 2
 * PRIMARY LINKS: expressions, conditional-expression -> paragraph 4 -> sentence 2
 * NUMBER: 3
 * DESCRIPTION: if-expression: check the correct branch is evaluating
 */

Response:
fun box(): String {
    if (false) return "NOK"
    return "OK"
}<|endoftext|>


Prompt:
if (<!SENSELESS_COMPARISON!>a.x !== null<!>) {
                                                                    <!DEBUG_INFO_EXPRESSION_TYPE("otherpackage.Case8_16__1 & otherpackage.Case8_16__1?")!>a.x<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("otherpackage.Case8_16__1"), DEBUG_INFO_SMARTCAST!>a.x<!>.equals(null)
                                                                    <!DEBUG_INFO_EXPRESSION_TYPE("otherpackage.Case8_16__1"), DEBUG_INFO_SMARTCAST!>a.x<!>.propT<|endoftext|>


Prompt:
"Task info:",
            "Kotlin language version: 2.0",
            "Time metrics:",
            "Jps iteration:",
            "Compiler code analysis:",
            "Compiler code generation:"
        )

        fun testImpl() {
            assertTrue("Daemon was not enabled!", isDaemonEnabled())
            doTest()

            validateAndDeleteReportFile(

Response:
*reportMetricsList,
                "Changed files: [${workDir.resolve("src/Foo.kt").path}, ${workDir.resolve("src/main.kt").path}]"
            )

            val mainKt = File(workDir, "src/main.kt")
            change(mainKt.path, "fun main() {}")

            buildAllModules().assertSuccessful()<|endoftext|>


Prompt:
children.add(TestHierarchyBuilder(Node.Group(name)).also(builder))
    }

    fun build(): KotlinHierarchy = KotlinHierarchy(node, children.map { it.build() }.toSet())
}

private fun hierarchy(build: TestHierarchyBuilder.() -> Unit): KotlinHierarchy {

Response:
return TestHierarchyBuilder(Node.Root).also(build).build()
}<|endoftext|>


Prompt:
},
                    {
                        printer.printCollection(allBounds) { (typeParameter, bound) ->
                            " : ".separated(
                                { declarationRenderer.nameRenderer.renderName(analysisSession, typeParameter, declarationRenderer, printer) },
                                {
                                    val approximatedType = declarationRenderer.declarationTypeApproximator

Response:
.approximateType(analysisSession, bound, Variance.OUT_VARIANCE)

                                    declarationRenderer.typeRenderer.renderType(analysisSession, approximatedType, printer) }
                                ,
                            )
                        }
                    },
                )

            }
        }
    }
}<|endoftext|>


Prompt:
operator fun set(thisRef: Any?, prop: KProperty<*>, value: String) {}

    operator fun getValue(thisRef: Any?, prop: KProperty<*>): Int = 5
    operator fun setValue(thisRef: Any?, prop: KProperty<*>, value: Int) {}
}

class CustomDelegate3 {

Response:
operator fun get(thisRef: Any?, prop: KProperty<*>): String = prop.name
    operator fun set(thisRef: Any?, prop: KProperty<*>, value: String) {}
}

operator fun OkDelegate.get(thisRef: Any?, prop: KProperty<*>): Int = 4<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// ASSERTIONS_MODE: jvm
// WITH_STDLIB

package localLambda

interface Checker {
    fun checkTrue(): Boolean
    fun checkFalse(): Boolean
    fun checkTrueWithMessage(): Boolean
    fun checkFalseWithMessage(): Boolean
}

class ShouldBeDisabled : Checker {
    override fun checkTrue(): Boolean {
        var hit = false

Response:
val l = { hit = true; true }
        val local = {
            assert(l())
        }
        local()
        return hit
    }

    override fun checkFalse(): Boolean {
        var hit = false
        val l = { hit = true; false }
        val local = {
            assert(l())
        }
        local()
        return hit
    }<|endoftext|>


Prompt:
val FULL_COMPOSABLE_NAME_PREFIX = COMPOSABLE_PACKAGE_FQN.child(Name.identifier(COMPOSABLE_NAME_PREFIX)).asString()
}

object ComposableFunction : FunctionTypeKind(
    ComposableNames.COMPOSABLE_PACKAGE_FQN,
    ComposableNames.COMPOSABLE_NAME_PREFIX,

Response:
ComposableNames.MY_COMPOSABLE_ANNOTATION_CLASS_ID,
    isReflectType = false
) {
    override val prefixForTypeRender: String
        get() = "@MyComposable"

    override val serializeAsFunctionWithAnnotationUntil: String
        get() = LanguageVersion.KOTLIN_2_1.versionString<|endoftext|>


Prompt:
assertEquals("fooBAR123", "${J.nullableStringIsNotNull() + "BAR" + n}")
    assertEquals("fooBAR123", "${J.nullableStringIsNotNull()}BAR$n")
    assertEquals("BARfoo123", "BAR" + J.nullableStringIsNotNull() + n)

Response:
assertEquals("BARfoo123", "BAR${J.nullableStringIsNotNull()}$n")
    assertEquals("BARfoo123", "BAR" + (J.nullableStringIsNotNull() + n))
    assertEquals("123fooBAR", "$n${J.nullableStringIsNotNull() + "BAR"}")

    return "OK"
}<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER
// KT-10444 Do not ignore smart (unchecked) casts to the same classifier

class Base<in T>
class Qwe<T : Any>(val a: T?) {
    fun test1(obj: Any) {
        obj as Qwe<T>
        check(obj.a)
    }

Response:
fun test1(obj: Qwe<*>) {
        obj <!UNCHECKED_CAST!>as Qwe<T><!>
        check(obj.a)
    }

    fun test2(b: Base<*>) {
        b <!UNCHECKED_CAST!>as Base<Any><!>
    }

    fun check(a: T?) {
    }
}<|endoftext|>


Prompt:
origin = JvmLoweredDeclarationOrigin.ENUM_MAPPINGS_FOR_ENTRIES
                isFinal = true
                isStatic = true
            }
        }
        return field
    }

    override fun generateMappingsClasses() {
        val backendContext = context
        for (klass in storage.values) {

Response:
// Use the same origin and visibility for `<clinit>` as in StaticInitializersLowering.
            val clinit = klass.irClass.addFunction(
                "<clinit>", context.irBuiltIns.unitType, visibility = JavaDescriptorVisibilities.PACKAGE_VISIBILITY,
                isStatic = true, origin = JvmLoweredDeclarationOrigin.CLASS_STATIC_INITIALIZER<|endoftext|>


Prompt:
constructor(e: T, i: Int) : this(<!ARGUMENT_TYPE_MISMATCH!>i<!>, 10)
}

class J<T> {
    constructor(e: T, i: Int) : this(i, 10)
    constructor(e: Int, i: Int)
}

class F(s: String) {

Response:
<!PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED!>constructor(i: Boolean)<!> {}
    constructor(i: Int) : <!CYCLIC_CONSTRUCTOR_DELEGATION_CALL!>this<!>(3) {}
}

class G(x: Int) {<|endoftext|>


Prompt:
fun clang_getCursorReferenced(arg0: CValue<CXCursor>): CValue<CXCursor> {
    memScoped {
        val kniRetVal = nativeHeap.alloc<CXCursor>()
        try {
            kniBridge214(arg0.getPointer(memScope).rawValue, kniRetVal.rawPtr)

Response:
return kniRetVal.readValue()
        } finally { nativeHeap.free(kniRetVal) }
    }
}

fun clang_getCursorDefinition(arg0: CValue<CXCursor>): CValue<CXCursor> {
    memScoped {
        val kniRetVal = nativeHeap.alloc<CXCursor>()
        try {<|endoftext|>


Prompt:
// FIR_IDENTICAL
@file:JsModule("foo")
package foo

@JsModule("A")
external class <!NESTED_JS_MODULE_PROHIBITED!>A<!> {
    class Nested
}

@JsModule("B")
external <!NESTED_JS_MODULE_PROHIBITED!>object B<!>

Response:
<!NESTED_JS_MODULE_PROHIBITED!>@JsModule("foo")
external fun foo(): Int<!>

<!NESTED_JS_MODULE_PROHIBITED!>@JsModule("bar")
external val bar: Int<!>

<!NESTED_JS_MODULE_PROHIBITED!>@JsNonModule
external val baz: Int<!><|endoftext|>


Prompt:
val typeParameters = typeConstructor.parameters

            // For each type parameter T, let ST be the set of all constituent types of all immediate supertypes of the owner of T.
            // If T appears as a constituent type of a simple type argument A in a generic type in ST, add an edge from T

Response:
// to U, where U is the type parameter corresponding to A, and where the edge is non-expansive if A has the form T or T?,
            // the edge is expansive otherwise.
            for (constituentType in constituentTypes(typeConstructor.supertypes)) {
                val constituentTypeConstructor = constituentType.constructor
                if (constituentTypeConstructor !in processedTypeConstructors) {<|endoftext|>


Prompt:
private fun Member.bindArguments(
    containerId: String,
    parameters: List<Type>,
    context: ValueResolveContext
): List<ValueDescriptor> {
    val bound = ArrayList<ValueDescriptor>(parameters.size)
    var unsatisfied: MutableList<Type>? = null

    for (parameter in parameters) {
        val descriptor = context.resolve(parameter)

Response:
if (descriptor == null) {
            if (unsatisfied == null)
                unsatisfied = ArrayList<Type>()
            unsatisfied.add(parameter)
        } else {
            bound.add(descriptor)
        }
    }
    if (unsatisfied != null) {<|endoftext|>


Prompt:
get() = definedExternally
        set(value) = definedExternally
}

@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly

Response:
public inline fun UIEventInit(view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): UIEventInit {
    val o = js("({})")
    o["view"] = view
    o["detail"] = detail
    o["bubbles"] = bubbles
    o["cancelable"] = cancelable<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel5 & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>x<!>.propT
        <!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel4 & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>x<!>.propAny

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel5 & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>x<!>.propNullableT
        <!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel4 & ClassLevel5 & kotlin.Any & kotlin.Any?")!>x<!>.propNullableAny<|endoftext|>


Prompt:
package org.jetbrains.kotlin.gradle.plugin.performance

import org.gradle.api.Project
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Optional
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBinary

enum class TrackableMetric { COMPILE_TIME, CODE_SIZE }

Response:
open class PerformanceExtension(private val project: Project) {
    val version: String
        get() = project.version.toString()

    var metrics = listOf(TrackableMetric.COMPILE_TIME, TrackableMetric.CODE_SIZE)

    val trackedBinaries = mutableListOf<NativeBinary>()<|endoftext|>


Prompt:
desc == "(Ljava/lang/Object;Ljava/lang/String;)V"
    }

internal fun AbstractInsnNode.isCheckExpressionValueIsNotNull() =
    isInsn<MethodInsnNode>(Opcodes.INVOKESTATIC) {
        owner == IntrinsicMethods.INTRINSICS_CLASS_NAME &&

Response:
(name == "checkExpressionValueIsNotNull" || name == "checkNotNullExpressionValue") &&
                desc == "(Ljava/lang/Object;Ljava/lang/String;)V"
    }

internal fun AbstractInsnNode.isThrowIntrinsic() =
    isInsn<MethodInsnNode>(Opcodes.INVOKESTATIC) {<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString /* = kotlin.String */ & TypealiasNullableString? /* = kotlin.String? */")!>x<!>

Response: <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString /* = kotlin.String */ & TypealiasNullableString? /* = kotlin.String? */"), DEBUG_INFO_SMARTCAST!>x<!>.equals(null)<|endoftext|>


Prompt:
if (max < e) max = e
    }
    return max
}

/**
 * Returns the largest element or `null` if there are no elements.
 */
@SinceKotlin("1.4")
public fun ByteArray.maxOrNull(): Byte? {
    if (isEmpty()) return null
    var max = this[0]
    for (i in 1..lastIndex) {

Response:
val e = this[i]
        if (max < e) max = e
    }
    return max
}

/**
 * Returns the largest element or `null` if there are no elements.
 */
@SinceKotlin("1.4")
public fun ShortArray.maxOrNull(): Short? {
    if (isEmpty()) return null
    var max = this[0]<|endoftext|>


Prompt: P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> R>> =

Response:
staticCFunctionImpl(
                function,<|endoftext|>


Prompt:
package org.jetbrains.kotlinx.serialization.compiler.fir

import org.jetbrains.kotlin.fir.extensions.predicate.*
import org.jetbrains.kotlinx.serialization.compiler.resolve.SerializationAnnotations

object FirSerializationPredicates {
    internal val serializerFor = DeclarationPredicate.create {

Response:
annotated(setOf(SerializationAnnotations.serializerAnnotationFqName)) // @Serializer(for=...)
    }
    internal val hasMetaAnnotation = DeclarationPredicate.create {
        metaAnnotated(SerializationAnnotations.metaSerializableAnnotationFqName, includeItself = false)
    }
    internal val annotatedWithSerializableOrMeta = DeclarationPredicate.create {<|endoftext|>


Prompt:
"The feature $b is out of order; its sinceVersion is ${b.sinceVersion}, yet it comes after $a, whose " +
                        "sinceVersion is ${a.sinceVersion}.\n"
            )
        }
    }
}

private fun String.ensureFileOrEndsWithSlash() =

Response: if (endsWith("/") || "." in substringAfterLast('/')) this else "$this/"<|endoftext|>


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

/*
 * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)

Response:
*
 * SPEC VERSION: 0.1-278
 * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 5
 * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 4 -> sentence 1<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION

// FILE: JavaTest.java

public class JavaTest {
    public static Number[] createNumberArray() { return null; }
}

// FILE: test.kt

fun <K> select(x: K, y: K): K = x

Response:
fun <R> foo(f: () -> R): R = f()

interface Inv<T> {
    fun createArray(): Array<T>
}

fun test(n: Number) {
    val a = select(foo { JavaTest.createNumberArray() }, emptyArray())<|endoftext|>


Prompt:
package test

public interface TwoSuperclasses {

    public interface Super1 {
        public fun <A: CharSequence> foo(a: A)
    }

    public interface Super2 {
        public fun <B: CharSequence> foo(a: B)
    }

    public interface Sub: Super1, Super2 {
        override fun <C: CharSequence> foo(a: C)
    }

Response: }<|endoftext|>


Prompt:
val objType = signature.valueParameters[1].asmType
            // output = output.writeBegin(classDesc, new KSerializer[0])
            load(outputVar, encoderType)
            load(descVar, descType)
            invokeinterface(
                encoderType.internalName, CallingConventions.begin,
                "(" + descType.descriptor +
                        ")" + kOutputType.descriptor

Response:
)
            store(outputVar, kOutputType)
            if (serializableDescriptor.isInternalSerializable) {
                val sig = StringBuilder("(${objType.descriptor}${kOutputType.descriptor}${descType.descriptor}")
                // call obj.write$Self(output, classDesc)
                load(objVar, objType)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
import org.jetbrains.kotlin.serialization.js.ModuleKind
import org.jetbrains.kotlin.util.slicedMap.BasicWritableSlice
import org.jetbrains.kotlin.util.slicedMap.RewritePolicy

@JvmField

Response:
val MODULE_KIND = BasicWritableSlice<ModuleDescriptor, ModuleKind>(RewritePolicy.DO_NOTHING).apply { setDebugName("MODULE_KIND") }

@JvmField
val LEXICAL_SCOPE_FOR_JS =
    BasicWritableSlice<ResolvedCall<out FunctionDescriptor>, LexicalScope>(RewritePolicy.DO_NOTHING).apply {<|endoftext|>


Prompt:
}
    override fun foo(t: Int?) { }
}

class D: J2<Int>(){
    override fun bar(): Int {
        return 1
    }
    override fun foo(t: Int?) { }
}

fun test() {
    val k1: Int = A().a
    val k2: Unit = A().foo(1)

Response:
val k3: Int = A().bar()
    val k4: Int = B().a
    val k5: Unit = B().foo(2)
    val k6: Int = B().bar()
    val k7: Int = C().a
    val k8: Unit = C().foo(2)
    val k9: Int = C().bar()
    val k10: Int = D().a<|endoftext|>


Prompt:
val environment = KotlinCoreEnvironment.createForTests(disposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)

        val visibilityManager = ModuleVisibilityManager.SERVICE.getInstance(environment.project)
        for (friendDir in configuration.getList(JVMConfigurationKeys.FRIEND_PATHS)) {
            visibilityManager.addFriendPath(friendDir)
        }

Response:
return environment
    }

    override fun processModule(moduleData: ModuleData): ProcessorAction {
        val disposable = Disposer.newDisposable("Disposable for ${NonFirResolveModularizedTotalKotlinTest::class.simpleName}.processModule")
        try {
            val environment = configureAndSetupEnvironment(moduleData, disposable)
            runAnalysis(environment)
        } finally {<|endoftext|>


Prompt:
irLoop.body = ktDoWhile.body?.let { ktLoopBody ->
            if (ktLoopBody is KtBlockExpression)
                generateDoWhileLoopBody(ktLoopBody)
            else
                ktLoopBody.genExpr()
        }

        irLoop.condition = ktDoWhile.condition!!.genExpr()

Response:
return IrBlockImpl(ktDoWhile.startOffsetSkippingComments, ktDoWhile.endOffset, context.irBuiltIns.unitType).apply {
            statements.add(irLoop)
        }
    }

    private fun generateWhileLoopBody(ktLoopBody: KtBlockExpression): IrExpression =
        IrBlockImpl(<|endoftext|>


Prompt:
annotation class Anno5(val s: String)

interface I

class X : @Anno1 I {
    fun f(arg: @Anno2 I): @Anno3 I = arg
    val x: @Anno4 I = this
}

fun <T> T.foo(): List<@Anno5("1") T>? = null

Response: fun <T> T.foo2(): List<List<@Anno5("1") T>>? = null<|endoftext|>


Prompt:
assertEquals("", "".trimMargin())

        assertEquals("", """
                            """.trimMargin())

        assertEquals("", """
                            |""".trimMargin())

        assertEquals("", """
                            |
                            """.trimMargin())

        assertEquals("    a", """
            |    a
        """.trimMargin())

Response:
assertEquals("    a", """
            |    a""".trimMargin())

        assertEquals("    a", """ |    a
        """.trimMargin())

        assertEquals("    a", """ |    a""".trimMargin())

        assertEquals("\u0000|ABC", "${"\u0000"}|ABC".trimMargin())
    }<|endoftext|>


Prompt:
b.set(0, 73, false)
        assertContainsOnly(b, setOf(), 73)

        b.set(0, 73)
        assertNotContainsOnly(b, setOf(), 73)
        b.clear(0, 3)
        assertNotContainsOnly(b, setOf(0, 1, 2), 73)
        b.clear(63, 66)

Response:
assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65), 73)
        b.clear(68, 71)
        assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65, 68, 69, 70), 73)
        b.clear(68, 73)<|endoftext|>


Prompt:
fun <R> List<*>.filterIsInstance2(): @kotlin.internal.NoInfer List<R> = throw Exception()

fun test(list: List<Int>) {
    list.filterIsInstance1<Int>().map { it * 2 }
    list.filterIsInstance2<Int>().filter { it > 10 }
}

Response:
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
fun <R> foo(t: R): List<@kotlin.internal.NoInfer R> = throw Exception("$t")

fun test() {
    foo(1).map { it * 2 }
}

@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")<|endoftext|>


Prompt:
class LocalNested : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component {

                        }

                        @Fun

Response:
fun localMember(): @FunType Int {

                        }

                        @Prop
                        @get:Getter
                        @set:Setter
                        @setparam:Parameter
                        var localProperty: @PropType String = 1
                    }
                }

                @Prop
                @get:Getter
                @set:Setter
                @setparam:Parameter
                var localProperty: @PropType String = 1
            }<|endoftext|>


Prompt:
@InternalKotlinGradlePluginApi
    override fun onPublicationCreated(publication: MavenPublication) {
        mavenPublicationActions.all { action -> action.execute(publication) }
    }

    private val attributeContainer = HierarchyAttributeContainer(parent = null)

    override fun getAttributes(): AttributeContainer = attributeContainer

    internal fun onCreated() {
        artifactsTask

Response:
}
}<|endoftext|>


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

/*
 * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE)
 *
 * SECTIONS: dfa

Response:
* NUMBER: 55
 * DESCRIPTION: Raw data flow analysis test
 * HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses
 */

/*
 * TESTCASE NUMBER: 1
 * ISSUES: KT-10662
 */
fun case_1(x: Any) {
    if (x is String) {<|endoftext|>


Prompt:
public external abstract class SVGMeshrowElement : SVGElement, JsAny {
    companion object {
        val ELEMENT_NODE: Short
        val ATTRIBUTE_NODE: Short
        val TEXT_NODE: Short
        val CDATA_SECTION_NODE: Short
        val ENTITY_REFERENCE_NODE: Short
        val ENTITY_NODE: Short

Response:
val PROCESSING_INSTRUCTION_NODE: Short
        val COMMENT_NODE: Short
        val DOCUMENT_NODE: Short
        val DOCUMENT_TYPE_NODE: Short
        val DOCUMENT_FRAGMENT_NODE: Short
        val NOTATION_NODE: Short
        val DOCUMENT_POSITION_DISCONNECTED: Short<|endoftext|>


Prompt:
x = doubleSetWord(d = x, hi = ix)        /* x <- |x| */
    if (ix < 0x3fe00000) {        /* x < 0.5 */
        t = x + x
        t = 0.5 * log1p(t + t * x / (one - x))
    } else

Response:
t = 0.5 * log1p((x + x) / (one - x))
    if (hx >= 0) return t; else return -t
}<|endoftext|>


Prompt:
getTypeConversionImpl(actualType.getInlinedClassNative(), expectedType.getInlinedClassNative())

private fun Context.getTypeConversionImpl(
        actualInlinedClass: IrClass?,
        expectedInlinedClass: IrClass?
): IrSimpleFunctionSymbol? {
    if (actualInlinedClass == expectedInlinedClass) return null

    return when {

Response:
actualInlinedClass != null && expectedInlinedClass == null -> getBoxFunction(actualInlinedClass)
        actualInlinedClass == null && expectedInlinedClass != null -> getUnboxFunction(expectedInlinedClass)
        else -> error("actual type is ${actualInlinedClass?.fqNameForIrSerialization}, expected ${expectedInlinedClass?.fqNameForIrSerialization}")
    }.symbol
}<|endoftext|>


Prompt:
c.extensions.forEach { it.writePackageExtensions(kmPackage, t, c) }
        c.versionRequirements.serialize()?.let {
            t.versionRequirementTable = it
        }
    }
}

public open class ModuleFragmentWriter(stringTable: StringTable, contextExtensions: List<WriteContextExtension> = emptyList()) {

Response:
protected val t: ProtoBuf.PackageFragment.Builder = ProtoBuf.PackageFragment.newBuilder()!!
    protected val c: WriteContext = WriteContext(stringTable, contextExtensions)

    public open fun writeModuleFragment(kmPackageFragment: KmModuleFragment) {
        kmPackageFragment.pkg?.let {<|endoftext|>


Prompt:
// FIR_IDENTICAL
class Foo<T>

class Bar<T> {
    fun <S : T> takeFoo(foo: Foo<in S>) {}
}

class Inv<P>

fun <K : Inv<L>, L : N, N: <!FINAL_UPPER_BOUND!>Int<!>> main() {
    val foo = Foo<K>()

Response:
Bar<Inv<Number>>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
}<|endoftext|>


Prompt: x().bar() <!CANNOT_INFER_PARAMETER_TYPE, UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><<!CANNOT_INFER_PARAMETER_TYPE!>A<T, F, String, Double, Short, Char><!>>() }

Response:
x = <!ASSIGNMENT_TYPE_MISMATCH!>foobar<Int>()<!>
            x = <!ASSIGNMENT_TYPE_MISMATCH!>z.foobar<String>()<!>

            var y = noParameters()
            y = noParameters()

            y().foo().a() checkType { _<A<T, F, Any, Double, Short, Long>>() }<|endoftext|>


Prompt:
fun box(): String {
    testYield()
    return "OK"
}

/* TESTS */

// PTV is in consuming position (yield-case)
fun testYield() {
    build {
        it.yield(this)
    }
}

/* REQUIRED DECLARATIONS */

class Buildee<CT> {
    fun yield(arg: CT) {}
}

Response:
fun <FT> build(
    instructions: UserKlass.(Buildee<FT>) -> Unit
): Buildee<FT> {
    return Buildee<FT>().apply { UserKlass().instructions(this) }
}

class UserKlass<|endoftext|>


Prompt:
import org.w3c.dom.*

public external abstract class MediaList : ItemArrayLike<JsString>, JsAny {
    open var mediaText: String
    fun appendMedium(medium: String)
    fun deleteMedium(medium: String)
    override fun item(index: Int): JsString?
}

@Suppress("UNUSED_PARAMETER")

Response:
internal fun getMethodImplForMediaList(obj: MediaList, index: Int): String? { js("return obj[index];") }

public operator fun MediaList.get(index: Int): String? = getMethodImplForMediaList(this, index)

/**
 * Exposes the JavaScript [StyleSheet](https://developer.mozilla.org/en/docs/Web/API/StyleSheet) to Kotlin
 */<|endoftext|>


Prompt:
suspend fun test() = bar().s.x
}

class Test2 {

    suspend fun foo(value: IC): IC = value

    suspend fun qux(s: String): IC = IC(I0(s))

    suspend fun quz(): String = suspendMe()

    suspend fun bar(): IC {
        return foo(qux(quz()))
    }

Response:
suspend fun test() = bar().s.x
}

class Test3 {
    suspend fun <T> foo(value: T): T = value

    suspend fun bar(): IC {
        return foo(IC(suspendMe()))
    }

    suspend fun test() = bar().s.x
}

fun box(): String {

    var result: Any = "FAIL"<|endoftext|>


Prompt:
val descendantRelativeTo = File::descendantRelativeTo.name
        val program = ProgramWithDependencyOnCompiler(
            tmpdir, """
            import org.jetbrains.kotlin.utils.fileUtils.$descendantRelativeTo
            import java.io.File

            fun main(args: Array<String>) {

Response:
println(File(args[0]).$descendantRelativeTo(File(".").absoluteFile).path)
            }
            """.trimIndent()
        )

        program.compile()

        fun doTest(cwd: File, filePath: String, expectedWithForwardSlash: String) {
            // We use "/" below for simplicity, but the actual paths in compiler messages use the system separator.<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.plugin.MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING

internal class MultiplePluginDeclarationDetector
private constructor() {
    private val pluginInMultipleProjectsHolder = KotlinPluginInMultipleProjectsHolder(
        trackPluginVersionsSeparately = false
    )

    fun detect(project: Project) {

Response:
pluginInMultipleProjectsHolder
            .addProject(project)

        if (pluginInMultipleProjectsHolder.isInMultipleProjects(project)) {
            error(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)
        }
    }

    // We can't use Kotlin object because we need new instance on each Gradle rebuild<|endoftext|>


Prompt:
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses

OPTIONAL_JVM_INLINE_ANNOTATION
value class Z(val x: Int) {
    fun test() = x
}

OPTIONAL_JVM_INLINE_ANNOTATION
value class L(val x: Long) {
    fun test() = x
}

Response:
OPTIONAL_JVM_INLINE_ANNOTATION
value class S(val x: String) {
    fun test() = x
}

fun box(): String {
    if (Z::test.let { it.invoke(Z(42)) } != 42) throw AssertionError()<|endoftext|>


Prompt:
CallableMemberDescriptor.Kind.DECLARATION -> {
                when {
                    overriddenDescriptor.annotations.hasAnnotation(PLATFORM_DEPENDENT_ANNOTATION_FQ_NAME) ->
                        return true
                    overriddenDescriptor is JavaMethodDescriptor -> {
                        val containingClass = DescriptorUtils.getContainingClass(overriddenDescriptor)

Response:
?: return false

                        if (JavaToKotlinClassMap.mapKotlinToJava(containingClass.fqNameUnsafe) != null) return true
                        if (overriddenDescriptor.overriddenDescriptors.isEmpty()) return false

                        return isOverridingOnlyDescriptorsThatCanBeImplicitlyOverridden(overriddenDescriptor, visitedDescriptors)
                    }
                    else -><|endoftext|>


Prompt:
}
        }

        // MIN_VALUE, MAX_VALUE
        assertEquals(Float.MAX_VALUE, Float.MAX_VALUE, 0.0f)
        assertEquals(Float.MIN_VALUE, Float.MIN_VALUE, 0.0f)
        assertEquals(Float.MAX_VALUE, Float.MIN_VALUE, Float.MAX_VALUE)

Response:
assertEquals(Float.MIN_VALUE, Float.MAX_VALUE, Float.MAX_VALUE)

        // POSITIVE_INFINITY, NEGATIVE_INFINITY
        assertEquals(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, 0.0f)<|endoftext|>


Prompt:
withDaemon(compilerWithScriptingId) { daemon ->
            val repl = KotlinRemoteReplCompilerClient(daemon, null, CompileService.TargetPlatform.JVM,
                                                      emptyArray(),
                                                      TestMessageCollector(),
                                                      classpathFromClassloader(),
                                                      ScriptWithNoParam::class.qualifiedName!!)

Response:
val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader)

            doReplTestWithLocalEval(repl, localEvaluator)
            repl.dispose()
        }
    }

    fun testDaemonReplLocalEvalStandardTemplate() {
        withDaemon(compilerWithScriptingId) { daemon -><|endoftext|>


Prompt:
private fun KParameter.hasTypeOf(clazz: KClass<*>): Boolean = (type.classifier as? KClass<*>)?.qualifiedName == clazz.qualifiedName

    /*************** Test run provider (for black box tests only) ***************/

    // Currently, SimpleTestRunProvider is an object, so it does not need to be cached.

Response:
fun getOrCreateSimpleTestRunProvider(): SimpleTestRunProvider = SimpleTestRunProvider

    /*************** Common ***************/

    private val ExtensionContext.testClasses: Sequence<Class<*>>
        get() = generateSequence(requiredTestClass) { it.enclosingClass }

    private val ExtensionContext.enclosingTestClass: Class<*>
        get() = testClasses.last()<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// FILE: WithVarargs.java

public class WithVarargs {
    public static String foo() {
        return new A("1", "2", "3").getProp();
    }
}

// FILE: withVarargs.kt

fun join(x: Array<out String>): String {
    var result = ""
    for (i in x) {

Response:
result += i
        result += "#"
    }

    return result
}

class A {
    val prop: String
    constructor(vararg x: String) {
        prop = join(x)
    }
}

fun box(): String {
    val a1 = WithVarargs.foo()
    if (a1 != "1#2#3#") return "fail1: ${a1}"<|endoftext|>


Prompt:
override val regularClassCheckers: Set<FirRegularClassChecker>
        get() = setOf(
            FirAnnotationClassDeclarationChecker,
            FirOptInAnnotationClassChecker,
            FirCommonConstructorDelegationIssuesChecker,
            FirDelegationSuperCallInEnumConstructorChecker,
            FirDelegationInExpectClassSyntaxChecker,

Response:
FirDelegationInInterfaceSyntaxChecker,
            FirEnumClassSimpleChecker,
            FirLocalEntityNotAllowedChecker,
            FirManyCompanionObjectsChecker,
            FirMethodOfAnyImplementedInInterfaceChecker,
            FirDataClassPrimaryConstructorChecker,
            FirDataClassNonPublicConstructorChecker,<|endoftext|>


Prompt:
if (cn.toInt() != -3) {
        return "fail9"
    }

    val f: Float = 3.6.toFloat()
    if (f.toDouble() != 3.6) {
        return "fail11"
    }
    if (f.toFloat() != 3.6.toFloat()) {
        return "fail12"
    }

Response:
if (f.toInt() != 3) {
        return "fail14"
    }

    val fn: Float = -3.6.toFloat()
    if (fn.toDouble() != -3.6) {
        return "fail16"
    }
    if (fn.toFloat() != -3.6.toFloat()) {
        return "fail17"
    }<|endoftext|>


Prompt:
<!CONFLICTING_OVERLOADS!>fun x()<!> = z { z { z { z { z { z { z { z { } } } } } } } }
<!CONFLICTING_OVERLOADS!>fun x()<!> = z { z { z { z { z { z { z { z { } } } } } } } }

Response:
<!CONFLICTING_OVERLOADS!>fun x()<!> = z { z { z { z { z { z { z { z { } } } } } } } }
<!CONFLICTING_OVERLOADS!>fun x()<!> = z { z { z { z { z { z { z { z { } } } } } } } }<|endoftext|>


Prompt:
// WITH_STDLIB
// WITH_COROUTINES
// WITH_REFLECT
// CHECK_NOT_CALLED: suspendInline_61zpoe$
// CHECK_NOT_CALLED: suspendInline_6r51u9$
// CHECK_NOT_CALLED: suspendInline
import helpers.*
import kotlin.coroutines.*

Response:
import kotlin.coroutines.intrinsics.*

class Controller {
    fun withValue(v: String, x: Continuation<String>) {
        x.resume(v)
    }

    suspend inline fun suspendInline(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
        withValue(v, x)
        COROUTINE_SUSPENDED<|endoftext|>


Prompt:
contract { returns(null) implies (value_1 != null) }
    return value_1 != null
}

fun funWithReturnsNullAndNullCheck(value_1: Number?): Boolean? {
    contract { returns(null) implies (value_1 == null) }
    return value_1 == null
}

fun funWithReturnsNotNull(cond: Boolean): Boolean? {

Response:
contract { returnsNotNull() implies (cond) }
    return cond
}

fun funWithReturnsNotNullAndInvertCondition(cond: Boolean): Boolean? {
    contract { returnsNotNull() implies (!cond) }
    return !cond
}

fun funWithReturnsNotNullAndTypeCheck(value_1: Any?): Boolean? {
    contract { returnsNotNull() implies (value_1 is String) }<|endoftext|>


Prompt:
task.kaptJars.from(project.configurations.getByName(Kapt3GradleSubplugin.KAPT_WORKER_DEPENDENCIES_CONFIGURATION_NAME))
        }
    }

    constructor(project: Project, ext: KaptExtension) : super(project, ext) {
        configureTask { task ->

Response:
val kotlinSourceDir = objectFactory.fileCollection().from(task.kotlinSourcesDestinationDir)
            val nonAndroidDslOptions = getNonAndroidDslApOptions(ext, project, kotlinSourceDir, null, null)
            task.kaptPluginOptions.add(nonAndroidDslOptions.toCompilerPluginOptions())
        }
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtTestModule
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.assertions

Response:
abstract class AbstractCompilationPeerAnalysisTest : AbstractAnalysisApiBasedTest() {
    override val configurator = AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = false)

    override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {
        val project = mainFile.project<|endoftext|>


Prompt:
fun box(): String {
    assertEquals(B::class, B::property.instanceParameter!!.type.jvmErasure)
    assertEquals(B::class.java, B::property.instanceParameter!!.type.javaType)
    assertEquals(B::class, B::function.instanceParameter!!.type.jvmErasure)

Response:
assertEquals(B::class.java, B::function.instanceParameter!!.type.javaType)

    val property = B::class.members.single { it.name == "property" }
    val function = B::class.members.single { it.name == "function" }
    assertEquals(B::class, property.instanceParameter!!.type.jvmErasure)<|endoftext|>


Prompt:
val nonNullUnboundRef = C::class.members.single { it.name == "p1" } as KMutableProperty1<C, Z>
    nonNullUnboundRef.isAccessible = true
    assertEquals(Unit, nonNullUnboundRef.setter.call(C, one))
    assertEquals(one, nonNullUnboundRef.call(C))

Response:
assertEquals(one, nonNullUnboundRef.getter.call(C))

    val nullableUnboundRef = C::class.members.single { it.name == "p2" } as KMutableProperty1<C, Z?>
    nullableUnboundRef.isAccessible = true
    assertEquals(Unit, nullableUnboundRef.setter.call(C, one))<|endoftext|>


Prompt:
total += A356.a
    total += A357.a
    total += A358.a
    total += A359.a
    total += A360.a
    total += A361.a
    total += A362.a
    total += A363.a
    total += A364.a
    total += A365.a
    total += A366.a
    total += A367.a

Response:
total += A368.a
    total += A369.a
    total += A370.a
    total += A371.a
    total += A372.a
    total += A373.a
    total += A374.a
    total += A375.a
    total += A376.a
    total += A377.a
    total += A378.a
    total += A379.a<|endoftext|>


Prompt:
assertTrue(classpath.isNotEmpty())
        classpath.remove(File("test").absoluteFile)
        assertTrue(classpath.isEmpty())
    }

    @Test
    fun `test - classpath interner`() {
        val classpath1 = IdeaKotlinClasspath()
        val classpath2 = IdeaKotlinClasspath()

        val fileAInstance1 = File("a")

Response:
val fileAInstance2 = File("a")

        classpath1.add(fileAInstance1)
        classpath2.add(fileAInstance2)

        /* Check that fileAInstance2 got interned and will re-use instance 1 */
        assertSame(classpath1.single(), classpath2.single())
    }
}<|endoftext|>


Prompt:
text = fragmentText,
                textRange = SourceCode.Range(
                    start = SourceCode.Position(fragmentStartLine, 1, fullTextLength),
                    end = SourceCode.Position(fragmentEndLine, fragmentTextLength + 1, fullTextLength + fragmentTextLength + 1)
                )
            )
            (fragmentList as MutableList<TextFragment>).add(fragment)

Response:
sb.appendLine(fragmentText)
        }
    }

    @Test
    fun `test `() {

        val fragmentedText = initFragmentedScript(params.intiCharPool, params.randomCharPool)
        val textFragments = fragmentedText.fragments()
        val includedFragments = params.fragmentsToInclude.map(textFragments::get)<|endoftext|>


Prompt: $prop") List<@Anno("nested nested receiver type $prop")String>>.explicitType(@Anno("parameter annotation $prop") param: @Anno("parameter type $prop") ListIterator<@Anno("nested parameter type $prop") List<@Anno("nested nested parameter type $prop")String>>): @Anno("explicitType return type $prop") List<@Anno("explicitType nested return

Response: type $prop") List<@Anno("explicitType nested nested return type $prop") Int>> = emptyList()<|endoftext|>


Prompt:
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
// with compiler built from your changes if you are not sure.

fun test(a: Int, b: Int): Int {

Response:
var sum = 0
    for (i in a..<b) {
        sum = sum * 10 + i
    }
    return sum
}

// 0 iterator
// 0 getStart
// 0 getEnd
// 0 getFirst
// 0 getLast
// 0 getStep

// 1 IF_ICMPGE
// 1 IF

// JVM_IR_TEMPLATES
// 6 ILOAD<|endoftext|>


Prompt:
@OptIn(FirImplementationDetail::class, ResolveStateAccess::class)
internal class FirTypeParameterImpl(
    override val source: KtSourceElement?,
    resolvePhase: FirResolvePhase,
    override val moduleData: FirModuleData,
    override val origin: FirDeclarationOrigin,
    override val attributes: FirDeclarationAttributes,
    override val name: Name,

Response:
override val symbol: FirTypeParameterSymbol,
    override val containingDeclarationSymbol: FirBasedSymbol<*>,
    override val variance: Variance,
    override val isReified: Boolean,
    override var bounds: MutableOrEmptyList<FirTypeRef>,
    override var annotations: MutableOrEmptyList<FirAnnotation>,
) : FirTypeParameter() {<|endoftext|>


Prompt:
ImportModel("org.khronos.webgl.*".toNameEntity()) // for typed arrays
            ),
            comment = null
        )

        return SourceFileModel(
            name = null,
            fileName = File(fileDeclaration.fileName).normalize().absolutePath,
            root = module,
            referencedFiles = fileDeclaration.referencedFiles
        )

    }
}

Response:
private class IDLReferenceVisitor(private val visit: (IDLDeclaration, NameEntity?) -> Unit) : IDLLowering {
    override fun lowerTopLevelDeclaration(
        declaration: IDLTopLevelDeclaration,
        owner: IDLFileDeclaration
    ): IDLTopLevelDeclaration {
        visit(declaration, owner.packageName)<|endoftext|>


Prompt:
val resultField = scriptClass.declaredFields.find { it.name == resultFieldName }?.apply { isAccessible = true }
                assert(resultField != null) { "compileResult.hasResult == true but resultField is null" }
                val resultValue: Any? = resultField!!.get(scriptInstance)

Response:
ReplEvalResult.ValueResult(resultFieldName, resultValue, compileResult.type)
            } else {
                ReplEvalResult.UnitResult()
            }
        }
    }
}

private open class HistoryActionsForNoRepeat(val state: GenericReplEvaluatorState) {<|endoftext|>


Prompt:
require(erasedUpperBounds.size == 1) { "Should only be one computed upper bound if no need to intersect all bounds" }
                return erasedUpperBounds.single()
            } else {
                @Suppress("UNCHECKED_CAST")
                return intersectTypes(erasedUpperBounds.toList().map { it.unwrap() })
            }
        }

Response:
return getDefaultType(typeAttr)
    }

    private fun TypeSubstitutor.substituteErasedUpperBounds(
        upperBounds: List<KotlinType>,
        typeAttr: ErasureTypeAttributes
    ): Set<KotlinType> = buildSet {
        for (upperBound in upperBounds) {<|endoftext|>


Prompt:
if (i != 1)
        throw IllegalStateException("Fail $n")
    i = 0
    return A()
}

fun set1Boxed(): Any? = set1()
fun test1Boxed(n: Int): Any? = test1(n)

fun box(): String {
    try {
        set1() == test1(1)
        set1Boxed() == test1(2)

Response:
set1() == test1Boxed(3)
        set1Boxed() == test1Boxed(4)
    } catch (e: IllegalStateException) {
        return e.message ?: "Fail no message"
    }
    return "OK"
}<|endoftext|>


Prompt: Out<*>>>")!>a<!>

Response: <!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, kotlin.Int, *, Out<*>, *, kotlin.collections.Map<kotlin.Float, Out<*>>>? & ClassWithSixTypeParameters<*, kotlin.Int, *, Out<*>, *, kotlin.collections.Map<kotlin.Float,<|endoftext|>


Prompt:
open class T(var value: Int) {}

fun plusAssign(): T {

    operator fun T.plusAssign(s: Int) {
        value += s
    }

    var t  = T(1)
    t += 1

    return t
}

fun box(): String {
    val result = plusAssign().value
    if (result != 2) return "fail 1: $result"

Response:
return "OK"
}<|endoftext|>


Prompt:
assertEquals(listOf<UInt>(0u, 1u, 2u, 5u, 9u, 80u, 4294967200u, UInt.MAX_VALUE), uintArray.sorted())

        val ulongArray = ulongArrayOf(5u, 2u, 1u, 9u, 80u, 0u, ULong.MAX_VALUE, ULong.MAX_VALUE - 123u)

Response:
assertEquals(listOf<ULong>(0u, 1u, 2u, 5u, 9u, 80u, ULong.MAX_VALUE - 123u, ULong.MAX_VALUE), ulongArray.sorted())
    }

    @Test
    fun sortedDescending() {
        assertTrue(uintArrayOf().sortedDescending().none())<|endoftext|>


Prompt:
package org.jetbrains.kotlin.serialization.builtins

import org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsSignatures
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl

Response:
import org.jetbrains.kotlin.descriptors.resolveClassByFqName
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.load.kotlin.computeJvmDescriptor
import org.jetbrains.kotlin.name.Name<|endoftext|>


Prompt:
@annArray(kotlin.arrayOf("a"))
fun test() = 1

annotation class ann1(val p: Deprecated = kotlin.Deprecated("aaa"))
annotation class ann2(val p: ann1 = a.b.c.ann1())

Response:
annotation class ann3(val p: A.IAnn = A.IAnn(), val p2: A.IAnn = a.b.c.A.IAnn())

annotation class annArray(val p: Array<String> = kotlin.arrayOf("a"))

class A {
    annotation class IAnn
}<|endoftext|>


Prompt:
val kotlinLibrary = (it.getCapability(KlibModuleOrigin.CAPABILITY) as? DeserializedKlibModuleOrigin)?.library
                irLinker.deserializeIrModuleHeader(it, kotlinLibrary, _moduleName = it.name.asString())
            }
        }

Response:
val irProviders = if (ideCodegenSettings.shouldStubAndNotLinkUnboundSymbols) {
            listOf(stubGenerator)
        } else {
            val stubGeneratorForMissingClasses = DeclarationStubGeneratorForNotFoundClasses(stubGenerator)
            listOf(irLinker, stubGeneratorForMissingClasses)
        }<|endoftext|>


Prompt:
class C {
            val self by lazy(mode) { this }
        }

        val self = C()
        assertEquals(self, self.self)
    }

    @Test
    fun throwException() {
        class C {
            val thrower by lazy<String>(mode) {
                error("failure")
            }
        }

        val self = C()

Response:
repeat(10) {
            assertFailsWith<IllegalStateException> {
                self.thrower
            }
        }
    }

    @Test
    fun multiThreadedInit() {
        val initializerCallCount = AtomicInt(0)

        class C {
            val data by lazy(mode) {
                initializerCallCount.getAndIncrement()
                Any()
            }
        }<|endoftext|>


Prompt:
J(<!UNINITIALIZED_ENUM_COMPANION_WARNING!>OtherEnum<!>.extensionProp.length),

    K(OtherEnum.<!UNINITIALIZED_ENUM_COMPANION_WARNING!>Companion<!>.extensionFun().length),

Response:
L(OtherEnum.<!UNINITIALIZED_ENUM_COMPANION_WARNING!>Companion<!>.extensionProp.length);

    companion object {
        val companionProp = "someString"
        fun companionFun(): String = "someString"
    }
}

fun OtherEnum.Companion.extensionFun(): String = companionFun()<|endoftext|>


Prompt:
override fun bar(o: R) {}
}

class B<R> : Java1<R>, Java3<R>() { //Kotlin ← Java1, Java2
    override fun foo(): R {
        return null!!
    }

    override fun bar(o: R) {}
}

Response:
class C<R>(override var a: R) : Java1<R>, KotlinInterface<R> {   //Kotlin ← Java, Kotlin2
    override fun foo(): R {
        return null!!
    }

    override fun bar(o: R) {}
}<|endoftext|>


Prompt:
interface P<U, Y>

class A<T> {
    class B {
        fun test() {
            class C<W>() : P<W, <!UNRESOLVED_REFERENCE!>T<!>> {

Response:
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>companion<!> object : P<<!UNRESOLVED_REFERENCE!>W<!>, <!UNRESOLVED_REFERENCE!>T<!>> {
                }

                inner class D : P<W, <!UNRESOLVED_REFERENCE!>T<!>>
            }<|endoftext|>


Prompt:
safeCallOnDispatchReceiver(this@OperatorExpressionGenerator, startOffset, endOffset) { dispatchReceiver ->
                    invokeConversionFunction(
                        startOffset, endOffset,
                        conversionFunction ?: throw AssertionError("No conversion function for $type ~> $targetType"),
                        dispatchReceiver
                    )
                }

            else ->
                invokeConversionFunction(

Response:
startOffset, endOffset,
                    conversionFunction ?: throw AssertionError("No conversion function for $type ~> $targetType"),
                    this
                )
        }
    }

    private fun invokeConversionFunction(
        startOffset: Int,
        endOffset: Int,
        functionDescriptor: FunctionDescriptor,
        receiver: IrExpression
    ): IrExpression {<|endoftext|>


Prompt:
downloadBaseUrl = downloadBaseUrl,
            ivyDependency = "google.d8:v8:${D8Platform.platform}-$edition-$version@zip",
            executable = getExecutable("d8", command, "exe"),
            dir = targetPath,
            cleanableStore = cleanableStore,
            isWindows = isWindows,
        )
    }

    companion object {

Response:
const val EXTENSION_NAME: String = "kotlinD8"
    }
}<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL -SAFE_CALL_WILL_CHANGE_NULLABILITY

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

public interface B {
    public fun <T> foo(a: T): B?
}

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

Response:
package p

public interface C : B {
    override fun <T> foo(a: T): B?

}

// MODULE: m3
// FILE: b.kt
package p

public interface B {
    public fun <T> foo(a: T): B?
}

// MODULE: m4(m3, m2)
// FILE: c.kt
import p.*<|endoftext|>


Prompt:
return "OK"
}

fun testR0xE0() {
    // with possible local optimizations
    if ((-1).toByte() in 1L..3L != range0.contains((-1).toByte())) throw AssertionError()
    if ((-1).toByte() !in 1L..3L != !range0.contains((-1).toByte())) throw AssertionError()

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


Prompt:
if (x1.equals(x2) != x1.equals(x2)) return "equals fail #3"
    if (x1.hashCode() != x1.hashCode()) return "hashCode fail"
    return "OK"
}

fun box(): String {
    val resultC = testAnyBuiltins(C(), C())
    if (resultC != "OK") return resultC

Response:
val resultD = testAnyBuiltins(D(), D())
    if (resultD != "OK") return resultD

    val resultE = testAnyBuiltins(E(), E())
    if (resultE != "OK") return resultE

    return "OK"
}<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor() : super(UserKlass())
}
fun TestFunctionVsDelegatedSuperConstructorCall() {}

class TestFunctionVsDelegatedSuperConstructorCallReverse: SuperConstructorSource {
    constructor() : super(UserKlass())
}

Response:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun TestFunctionVsDelegatedSuperConstructorCallReverse() {}

class TestIdenticalValueParameters {
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor(arg: UserKlass)
}
fun TestIdenticalValueParameters(arg: UserKlass) {}<|endoftext|>


Prompt:
attributes.getAttribute(key)
            ?: throw IllegalStateException("Failed to copy attribute. Source container is missing $key (named ${key.name}).")
    }
}

internal fun HasAttributes.copyAttributesTo(
    project: Project,
    dest: HasAttributes,
    keys: Iterable<Attribute<*>> = attributes.keySet(),
) {
    for (key in keys) {

Response:
copyAttributeTo(project, dest, key)
    }
}

internal inline fun <reified T> attributeOf(
    name: String
): Attribute<T> = Attribute.of(name, T::class.java)<|endoftext|>


Prompt:
private val randomComment: String = CharArray(6) { (('0'..'9') + ('a'..'z') + ('A'..'Z')).random() }
        .joinToString("", prefix = "/* ", postfix = " */")

    fun invokeForTestFile(source: String): String = source.replace(from, to + randomComment)

Response:
fun revertForFile(actual: String): String =
        actual.replace(to + randomComment, from).replace(randomComment, "")

    override fun apply(source: String): String = invokeForTestFile(source)
    override fun invoke(source: String): String = invokeForTestFile(source)
}<|endoftext|>


Prompt:
function.returnType.kotlinToJsAdapterIfNeeded(isReturn = true)

        if (resultAdapter == null && valueParametersAdapters.all { it == null })
            return null

        val newFun = context.irFactory.createStaticFunctionWithReceivers(
            function.parent,

Response:
name = Name.identifier(function.name.asStringStripSpecialMarkers() + "__JsExportAdapter"),
            function,
            remapMultiFieldValueClassStructure = context::remapMultiFieldValueClassStructure
        )

        newFun.valueParameters.forEachIndexed { index, newParameter ->
            val adapter = valueParametersAdapters[index]
            if (adapter != null) {<|endoftext|>


Prompt:
fun KtFirAnalysisSession.create(diagnostic: KtDiagnosticWithParameters3<A, B, C>): KtFirDiagnostic<*>
}

internal fun interface KtFirDiagnostic4Creator<A, B, C, D> : KtFirDiagnosticCreator {

Response:
fun KtFirAnalysisSession.create(diagnostic: KtDiagnosticWithParameters4<A, B, C, D>): KtFirDiagnostic<*>
}

internal class KtDiagnosticConverter(private val conversions: Map<AbstractKtDiagnosticFactory, KtFirDiagnosticCreator>) {<|endoftext|>


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

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


Prompt:
//      [ possible first receiver - ALOAD or GETSTATIC ]
                //      ALOAD v
                //      { ... call ... }
                // Try to remove a load instruction for (2), so that the safe call would look like:
                //      { ... evaluate receiver ... }
                //      ASTORE v
                //      ALOAD v
                //      DUP
                //      IFNONNULL L
                //      POP

Response:
//      { ... if null ... }
                //  L:
                //      [ possible dispatch receiver - ALOAD or GETSTATIC ]
                //      [ SWAP if there was a dispatch receiver ]
                //      { ... call ... }

                val aLoad1 = insn as VarInsnNode
                val ifNonNull = insn.next as JumpInsnNode
                val label1 = ifNonNull.label<|endoftext|>


Prompt:
suspend fun <T> foo(value: T): T = value

    suspend fun bar(): IC? {
        run {
            return foo(IC("OK"))
        }
    }

    suspend fun test() = bar()!!.s
}

fun box(): String {

    var result = "FAIL"
    builder {
        result = Test1().test()
    }

Response:
if (result != "OK") return "FAIL 1 $result"

    result = "FAIL2"

    builder {
        result = Test2().test()
    }

    if (result != "OK") return "FAIL 2 $result"

    result = "FAIL 3"

    builder {
        result = Test3().test()
    }<|endoftext|>


Prompt:
if (!(element2 in 3 until 1) != !range1.contains(element2)) throw AssertionError()
    if (!(element2 !in 3 until 1) != range1.contains(element2)) throw AssertionError()
}

fun testR1xE3() {
    // with possible local optimizations

Response:
if (-1L in 3 until 1 != range1.contains(-1L)) throw AssertionError()
    if (-1L !in 3 until 1 != !range1.contains(-1L)) throw AssertionError()
    if (!(-1L in 3 until 1) != !range1.contains(-1L)) throw AssertionError()<|endoftext|>


Prompt:
val (_: String, _) = <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>A()<!>

    val f: (A) -> Int = { (_, _) -> 1 }
    val g: (A) -> Int = { <!COMPONENT_FUNCTION_MISSING!>(_, _, _)<!> -> 2 }

Response:
val h: (A) -> Int = { (<!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>_: String<!>, _) -> 3}
}<|endoftext|>


Prompt:
fun dependencies(action: BenchmarkDependencies.() -> Unit) =
            dependencies.action()

    fun dependencies(action: Closure<*>) {
        project.configure(dependencies, action)
    }

    inner class BenchmarkDependencies  {
        public val sourceSets: NamedDomainObjectContainer<KotlinSourceSet>
            get() = project.kotlin.sourceSets

Response:
fun project(path: String): Dependency = project.dependencies.project(mapOf("path" to path))

        fun project(path: String, configuration: String): Dependency =
                project.dependencies.project(mapOf("path" to path, "configuration" to configuration))

        fun common(notation: Any) = sourceSets.commonMain.dependencies {
            implementation(notation)
        }<|endoftext|>


Prompt:
forLoopNextBlock.startOffset, forLoopNextBlock.endOffset,
            forLoopNextBlock.type,
            forLoopNextBlock.origin,
        ).apply {
            statements.add(createNegatedConditionCheck(newLoopCondition, doWhileLoop))
            if (forLoopNextBlock.statements.size >= 2)

Response:
statements.addAll(forLoopNextBlock.statements.subList(0, forLoopNextBlock.statements.lastIndex))
        }

        doWhileLoop.body = bodyBlock

        val stepStartOffset = inductionVariableUpdate.startOffset
        val stepEndOffset = inductionVariableUpdate.endOffset
        val doWhileCondition =
            IrCompositeImpl(<|endoftext|>


Prompt:
// !SKIP_JAVAC
// !LANGUAGE: +InlineClasses
// ALLOW_KOTLIN_PACKAGE
// !DIAGNOSTICS: -UNUSED_VARIABLE

package kotlin.jvm

annotation class JvmInline

@JvmInline
value class Foo(val x: Int)
@JvmInline

Response:
value class Bar(val y: String)

fun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {
    val a1 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === f2<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== f2<!><|endoftext|>


Prompt:
this(classId.packageFqName, classId.relativeClassName, callableName, classId, pathToLocal = null)

    constructor(packageName: FqName, callableName: Name) :
            this(packageName, className = null, callableName, classId = null, pathToLocal = null)

    constructor(
        callableName: Name,

Response:
// Currently, it's only used for debug info
        pathToLocal: FqName?
    ) : this(PACKAGE_FQ_NAME_FOR_LOCAL, className = null, callableName, classId = null, pathToLocal)<|endoftext|>


Prompt:
import androidx.compose.runtime.Composable

            inline class InlineClass(val value: Int)
            fun used(x: Any?) {}

            @Composable fun A() {}
            @Composable fun A(x: Int) { }
            @Composable fun B(): Boolean { return true }
            @Composable fun B(x: Int): Boolean { return true }

Response:
@Composable fun R(): Int { return 10 }
            @Composable fun R(x: Int): Int { return 10 }
            @Composable fun P(x: Int) { }
            @Composable fun Int.A() { }
            @Composable fun L(): List<Int> { return listOf(1, 2, 3) }<|endoftext|>


Prompt:
* Accumulates value starting with [initial] value and applying [operation] from left to right
 * to current accumulator value and each element with its index in the original array.
 *
 * Returns the specified [initial] value if the array is empty.
 *
 * @param [operation] function that takes the index of an element, current accumulator value
 * and the element itself, and calculates the next accumulator value.
 */

Response:
public inline fun <R> BooleanArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Boolean) -> R): R {
    var index = 0
    var accumulator = initial
    for (element in this) accumulator = operation(index++, accumulator, element)
    return accumulator
}

/**<|endoftext|>


Prompt:
.getFunctions(Name.identifier("to${targetType.lookupTag.classId.shortClassName.asString()}"))
            .singleOrNull()
            ?: error("No conversion function for $operandType ~> $targetType")
        val conversionFunctionSymbol = declarationStorage.getIrFunctionSymbol(conversionFirFunction, operandFirClass.toLookupTag())

Response:
val unsafeIrCall = IrCallImpl(
            irExpression.startOffset, irExpression.endOffset,
            conversionFirFunction.resolvedReturnType.toIrType(c),
            conversionFunctionSymbol as IrSimpleFunctionSymbol,
            valueArgumentsCount = 0,
            typeArgumentsCount = 0
        ).also {
            it.dispatchReceiver = irExpression
        }<|endoftext|>


Prompt:
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.TypealiasExpandsToArrayOfNothings

internal class OverridingFinalMemberImpl(
    override val overriddenDeclaration: KtCallableSymbol,
    override val containingClassName: Name,

Response:
firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtNamedDeclaration>(firDiagnostic, token), KtFirDiagnostic.OverridingFinalMember

internal class ReturnTypeMismatchOnInheritanceImpl(
    override val conflictingDeclaration1: KtCallableSymbol,<|endoftext|>


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

interface IBase

interface IQ : IBase {
    fun ok(): String
}

OPTIONAL_JVM_INLINE_ANNOTATION
value class X<T: IQ>(val t: T): IQ {
    override fun ok(): String = t.ok()

Response:
}

interface IFoo1 {
    fun foo(): Any
}

interface IFoo2<T : IBase> {
    fun foo(): T
}

object OK : IQ {
    override fun ok(): String = "OK"
}

class Test : IFoo1, IFoo2<IQ> {
    override fun foo(): X<IQ> = X(OK)
}

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


Prompt:
fun execLlvmUtility(project: Project, utility: String, closure: Closure<in ExecSpec>): ExecResult {
    return execLlvmUtility(project, utility) { project.configure(this, closure) }
}

fun PlatformManager.resolveLlvmUtility(utility: String) = "${hostPlatform.absoluteLlvmHome}/bin/$utility"

Response:
fun ExecOperations.execLlvmUtility(platformManager: PlatformManager, utility: String, action: Action<in ExecSpec>): ExecResult {
    return exec {
        action.execute(this)
        executable = platformManager.resolveLlvmUtility(utility)
    }
}<|endoftext|>


Prompt:
p.println("    $HASH_CODE_NAME = 31 * $HASH_CODE_NAME + ${fieldToHashCode(field, repeatedFieldValue)}")
            p.println("}")

        } else if (field.isRequired) {
            p.println("$HASH_CODE_NAME = 31 * $HASH_CODE_NAME + ${fieldToHashCode(field, fieldValue)}")

Response:
} else if (field.isOptional) {
            p.println("if ($hasMethod) {")
            p.println("    $HASH_CODE_NAME = 31 * $HASH_CODE_NAME + ${fieldToHashCode(field, fieldValue)}")
            p.println("}")
        }
    }<|endoftext|>


Prompt:
@Suppress("NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS")
@SinceKotlin("1.1") public actual typealias AssertionError = java.lang.AssertionError

@SinceKotlin("1.1") public actual typealias NoSuchElementException = java.util.NoSuchElementException

Response:
@Suppress("NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS")
@SinceKotlin("1.3") public actual typealias ConcurrentModificationException = java.util.ConcurrentModificationException

@SinceKotlin("1.1") public actual typealias Comparator<T> = java.util.Comparator<T><|endoftext|>


Prompt:
fun test(a: A, b: B, c: C, d: D, e: E, f: F) {
    a.foo("","1")
    a.foo(null)

    b.foo("","1")
    b.foo(null)

    c.foo("","1")
    d.foo("","1")
    e.foo("","1")

Response:
f.foo("","1")
}<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1293
package foo

open class A() {
    open fun c() = 2
}

class B() : A() {
    override fun c() = 3
}

fun B.t() = d() + 1

fun A.d() = c() + 3

fun box(): String {

Response:
if (A().d() == 5 && B().d() == 6 && B().t() == 7) return "OK"
    return "fail"
}<|endoftext|>


Prompt:
public fun <T, R> T.let(block_: (T) -> R): R = TODO()

// FILE: TestCase.kt
package testCase1
import libPackage.*

// TESTCASE NUMBER: 1
fun case2(s: String) {

Response:
s.<!DEBUG_INFO_CALL("fqName: libPackage.let; typeCall: extension function")!>let (block_ = { "" })<!>
    s.<!DEBUG_INFO_CALL("fqName: kotlin.let; typeCall: inline extension function")!>let (block = { "" })<!>
}<|endoftext|>


Prompt:
// MODULE: m1-common
// FILE: common.kt

expect open class Base

expect open class Foo : Base {
    fun foo(param: Int)
}

// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt

actual open class Base {
    open fun foo(): Any = ""
}

Response: actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER_WARNING!>class Foo<!> : Base() {<|endoftext|>


Prompt:
assertEquals(originalText, restoredText)
    }

    @Test(expected = NoSuchElementException::class)
    fun failure1() {
        // There is no record with number 42!
        val originalText = """
        |0 \

Response:
|1 org.sample:liba,org.sample:liba-native[2.0] #0[2.0] #2[1.0] #42[42.42]
        |${'\t'}/some/path/liba.klib
        |2 org.sample:libb,org.sample:libb-native[1.0] #0[1.0]<|endoftext|>


Prompt: testToKString(true, "bb", bytes('a'.toInt(), 'a'.toInt(), 'a'.toInt(), 0, 'b'.toInt(), 'b'.toInt(), 'b'.toInt(), 0), 5, 8)

Response: testToKString(true, "b", bytes('a'.toInt(), 'a'.toInt(), 'a'.toInt(), 0, 'b'.toInt(), 'b'.toInt(), 'b'.toInt(), 0), 6, 8)<|endoftext|>


Prompt:
override val platformType: KotlinPlatformType = KotlinPlatformType.wasm

    override fun instantiateTarget(name: String): KotlinJsIrTarget {
        if (!PropertiesProvider(project).wasmStabilityNoWarn) {
            project.reportDiagnosticOncePerBuild(KotlinToolingDiagnostics.WasmStabilityWarning())
        }

Response:
val irTarget = project.objects.newInstance(KotlinJsIrTarget::class.java, project, KotlinPlatformType.wasm)
        irTarget.isMpp = true
        irTarget.wasmTargetType = targetType

        return irTarget
    }

    override fun createKotlinTargetConfigurator(): AbstractKotlinTargetConfigurator<KotlinJsIrTarget> =<|endoftext|>


Prompt:
contextReceiverArguments.transformInplace(transformer, data)
        constructedTypeRef = constructedTypeRef.transform(transformer, data)
        transformCalleeReference(transformer, data)
        return this
    }

    override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirDelegatedConstructorCallImpl {

Response:
annotations.transformInplace(transformer, data)
        return this
    }

    override fun <D> transformDispatchReceiver(transformer: FirTransformer<D>, data: D): FirDelegatedConstructorCallImpl {
        dispatchReceiver = dispatchReceiver?.transform(transformer, data)
        return this
    }<|endoftext|>


Prompt:
0x7ff8000000000000UL,     0x0UL,     0x3ff0000000000000UL,     0x3fefffffffdd3059UL,
            0x3ff00000001167d3UL,     0x3ff0000000000000UL,     0x3ff0000000000000UL,     0x3ff0000000000000UL,

Response:
0x3ff0000000000000UL,     0x3ff0000000000000UL,     0x3fefffffffdd3059UL,     0x3ff00000001167d3UL,
            0x3ff0000000000000UL,     0x3ff0000000000000UL,     0x3ff0000000000000UL,     0x3ff0000000000000UL,<|endoftext|>


Prompt:
-Xsam-conversions=indy          Generate SAM conversions using 'invokedynamic' with 'LambdaMetafactory.metafactory'. Requires '-jvm-target 1.8' or greater.
-Xsam-conversions=class         Generate SAM conversions as explicit classes"""
    )
    var samConversions: String? = null
        set(value) {
            checkFrozen()

Response:
field = if (value.isNullOrEmpty()) null else value
        }

    @Argument(
        value = "-Xlambdas",
        valueDescription = "{class|indy}",
        description = """Select the code generation scheme for lambdas.<|endoftext|>


Prompt: fun doTheJob1() = <!CANNOT_INFER_PARAMETER_TYPE!>simpleAsync1<!> <!CANNOT_INFER_PARAMETER_TYPE!>{ <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM,

Response: TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>insideJob1()<!><|endoftext|>


Prompt:
}
        }
    }

    /**
     * Returns a [FirExpression] matching the given PSI [receiverExpression].
     *
     * @param receiverExpression a qualified expression receiver (e.g., `foo` in `foo?.bar()`, or in `foo.bar`).
     *

Response:
* The function unwraps certain receiver expressions. For instance, for safe calls direct counterpart to a [KtSafeQualifiedExpression]
     * is (FirCheckedSafeCallSubject)[org.jetbrains.kotlin.fir.expressions.FirCheckedSafeCallSubject] which requires additional unwrapping
     * to be used for call resolution.
     */<|endoftext|>


Prompt:
Display("%enabled")
                }
            ) {
                Wrap(content)
            }
        """.replace('%', '$'),
        """
            import androidx.compose.runtime.Composable

            @Composable fun Display(text: String) { }
            @Composable fun Wrap(content: @Composable () -> Unit) { }
        """
    )

    @Test

Response:
fun testComposabableLambdaInLocalDeclaration() = verifyGoldenComposeIrTransform(
        """
            import androidx.compose.runtime.Composable

            @Composable
            fun Test(enabled: Boolean) {
                val content: @Composable () -> Unit = {
                    Display("%enabled")
                }
                Wrap(content)
            }<|endoftext|>


Prompt:
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
package test

public inline fun <T> with2(receiver: T,  body: T.() -> String) =  receiver.body()

// FILE: 2.kt
import test.*

fun <T : Any> test(item: T?, defaultLink: T.() -> String): String {
    return with2("") {

Response:
item?.defaultLink() ?: "fail"
    }
}

fun box(): String {
    return test("O") {
        this + "K"
    }
}<|endoftext|>


Prompt:
val remainderUnsignedLong: IrSimpleFunctionSymbol = javaLangLong.functionByName("remainderUnsigned")
    val toUnsignedStringLong: IrSimpleFunctionSymbol = javaLangLong.functionByName("toUnsignedString")

    val intPostfixIncrDecr = createIncrDecrFun("<int-postfix-incr-decr>")

Response:
val intPrefixIncrDecr = createIncrDecrFun("<int-prefix-incr-decr>")

    private fun createIncrDecrFun(intrinsicName: String): IrSimpleFunctionSymbol =
        irFactory.buildFun {
            name = Name.special(intrinsicName)
            origin = IrDeclarationOrigin.IR_BUILTINS_STUB<|endoftext|>


Prompt:
sourceMapProvider: () -> SourceMap?,
        val outputDir: File?
    ) {
        val specialFunctions: Map<String, SpecialFunction> by lazy(specialFunctionsProvider)

        val offsetToSourceMapping by lazy(offsetToSourceMappingProvider)

        val sourceMap: SourceMap? by lazy(sourceMapProvider)

        val wrapFunctionRegex by lazy {
            specialFunctions.entries

Response:
.singleOrNull { (_, v) -> v == SpecialFunction.WRAP_FUNCTION }?.key
                ?.let { Regex("\\s*$it\\s*\\(\\s*").toPattern() }
        }
    }

    private val moduleNameToInfo by lazy {
        val result = HashMultimap.create<String, ModuleInfo>()<|endoftext|>


Prompt:
package org.jetbrains.kotlin.backend.konan

import kotlinx.cinterop.*
import llvm.*
import org.jetbrains.kotlin.backend.common.LoggingContext
import org.jetbrains.kotlin.backend.konan.driver.PhaseContext
import org.jetbrains.kotlin.backend.konan.llvm.*

Response:
import org.jetbrains.kotlin.konan.target.*
import java.io.Closeable

enum class LlvmOptimizationLevel(val value: Int) {
    NONE(0),
    DEFAULT(1),
    AGGRESSIVE(3)
}

enum class LlvmSizeLevel(val value: Int) {
    NONE(0),
    DEFAULT(1),<|endoftext|>


Prompt:
* There was previous module, so we should save it
                     */
                    if (currentModuleName != null) {
                        finishModule(lineNumber)
                    } else {
                        finishGlobalDirectives()
                    }
                    val (moduleName, dependencies, friends, dependsOn) = splitRawModuleStringToNameAndDependencies(
                        values.joinToString(separator = " ")
                    )

Response:
currentModuleName = moduleName
                    val kind = defaultsProvider.defaultDependencyKind
                    dependencies.mapTo(dependenciesOfCurrentModule) { name ->
                        DependencyDescription(name, kind, DependencyRelation.RegularDependency)
                    }
                    friends.mapTo(dependenciesOfCurrentModule) { name ->
                        DependencyDescription(name, kind, DependencyRelation.FriendDependency)<|endoftext|>


Prompt:
isClosed = true
        }
    }

    @Test fun success() {
        val resource = Resource()
        val result = resource.use { "ok" }
        assertEquals("ok", result)
        assertTrue(resource.isClosed)
    }

    @Test fun closeFails() {
        val e = assertFails {

Response:
Resource(faultyClose = true).use { it.isClosed }
        }
        assertTrue(e is IOException)
    }

    @Test fun opFailsCloseSuccess() {
        val e = assertFails {
            Resource().use { error("op fail") }
        }
        assertTrue(e is IllegalStateException)
        assertTrue(e.suppressed.isEmpty())
    }<|endoftext|>


Prompt:
/*
 *  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with

Response:
*  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun testMultipleTypeAliasedValueParameterTypesA(arg1: UserKlassA, arg2: UserKlassB) {}
    fun testMultipleTypeAliasedValueParameterTypesA(arg1: UserKlassA, arg2: SameUserKlassB) {}

Response:
fun testMultipleTypeAliasedValueParameterTypesAReverse(arg1: UserKlassA, arg2: UserKlassB) {}
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun testMultipleTypeAliasedValueParameterTypesAReverse(arg1: UserKlassA, arg2: SameUserKlassB) {}<|endoftext|>


Prompt:
endOffset = expression.endOffset,
                    returnType = expression.type
                ) { fn ->
                    fn.body = DeclarationIrBuilder(context, fn.symbol).irBlockBody {
                        +irReturn(expression)
                    }
                }
            )
        }
    }

    private fun irChanged(value: IrExpression): IrExpression = irChanged(
        irCurrentComposer(),

Response:
value,
        inferredStable = false,
        compareInstanceForFunctionTypes = false,
        compareInstanceForUnstableValues = strongSkippingModeEnabled
    )

    private fun IrValueDeclaration.isVar(): Boolean =
        (this as? IrVariable)?.isVar == true

    private fun IrValueDeclaration.isStable(): Boolean =<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.KtEnumEntrySymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbolOrigin
import org.jetbrains.kotlin.backend.konan.objcexport.*
import org.jetbrains.kotlin.name.Name

/**

Response:
* Note: At the time of writing this function (and comment) we found it easiest
 * to construct the functions manually. Potentially, there is a way to get those functions from
 * the Analysis API by requesting the combined member scope and looking for [KtSymbolOrigin.SOURCE_MEMBER_GENERATED].
 */
context(KtAnalysisSession, KtObjCExportSession)<|endoftext|>


Prompt:
val USE_FIR_BASED_FAKE_OVERRIDE_GENERATOR = CompilerConfigurationKey.create<Boolean>(
        "Generate all fake overrides via FIR2IR instead of IR, i.e. revert to behavior before KT-61514 was resolved."
    )
}

var CompilerConfiguration.languageVersionSettings: LanguageVersionSettings

Response:
get() = get(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, LanguageVersionSettingsImpl.DEFAULT)
    set(value) = put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, value)

val LanguageVersionSettings.isLibraryToSourceAnalysisEnabled: Boolean
    get() = getFlag(AnalysisFlags.libraryToSourceAnalysis)<|endoftext|>


Prompt:
{ "Extension receiver must be not null if explicitReceiverKind is EXTENSION_RECEIVER" }
                    ) {
                        withPsiEntry("explicitReceiverPsi", explicitReceiverPsi)
                        dispatchReceiver?.let { withFirEntry("dispatchReceiver", it) }
                        withFirSymbolEntry("target", targetSymbol)
                    }

Response:
dispatchReceiverValue = dispatchReceiver?.toKtReceiverValue()
                    extensionReceiverValue =
                        KtExplicitReceiverValue(explicitReceiverPsi, extensionReceiver.resolvedType.asKtType(), false, token)
                }

                else -> {
                    errorWithAttachment("Implicit invoke call can not have no explicit receiver") {<|endoftext|>


Prompt:
// FILE: anno.kt

actual typealias Anno = Jnno

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

annotation class A(val value: String)

@Anno
fun test() {}

fun box(): String {
    // We don't need to check the contents, just check that there are no anomalities in the bytecode by loading annotations

Response:
::test.annotations.toString()

    return "OK"
}<|endoftext|>


Prompt:
// WITH_STDLIB
// WITH_COROUTINES

import helpers.*
import kotlin.coroutines.*

inline class IC(val s: Any?)

var c: Continuation<Any>? = null

suspend fun <T> suspendMe(): T = suspendCoroutine {
    @Suppress("UNCHECKED_CAST")
    c = it as Continuation<Any>
}

Response:
interface Base<T> {
    suspend fun generic(): T
}

class Derived : Base<IC> {
    override suspend fun generic(): IC = suspendMe()
}

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

fun box(): String {
    var res: String? = null
    builder {<|endoftext|>


Prompt:
// WITH_STDLIB
// FULL_JDK
package test.another

annotation class Anno(val value: String)

fun topLevelFunction(): String? = null

fun <X : CharSequence, T : List<out X>> topLevelGenericFunction(): T? {
    return null!!
}

val topLevelProperty = 2

const val topLevelConstProperty = 2

val topLevelProperty2: String

Response:
get() = ""

fun @receiver:Anno("rec") String.extensionFunction(@Anno("1") a: String, @Anno("2") b: String) {}

@Anno("extpr")
var <T: Any> @receiver:Anno("propRec") T.extensionProperty: String
    get() = ""
    set(@Anno("setparam") setParamName) {}<|endoftext|>


Prompt:
class A {
    val a: Int
        get() {
            val b: Int
            val c: Int
            42
            return <!UNINITIALIZED_VARIABLE!>b<!>
        }

    fun foo() {
        class B {
            val a: Int
                get() {
                    val b: Int
                    val c: Int
                    42

Response:
return <!UNINITIALIZED_VARIABLE!>b<!>
                }
        }
    }
}<|endoftext|>


Prompt:
require(startIndex >= 0 && endIndex <= string.length && startIndex <= endIndex)

    val bytes = ByteArray((endIndex - startIndex) * MAX_BYTES_PER_CHAR)
    var byteIndex = 0
    var charIndex = startIndex

    while (charIndex < endIndex) {
        val code = string[charIndex++].code
        when {
            code < 0x80 ->

Response:
bytes[byteIndex++] = code.toByte()
            code < 0x800 -> {
                bytes[byteIndex++] = ((code shr 6) or 0xC0).toByte()
                bytes[byteIndex++] = ((code and 0x3F) or 0x80).toByte()
            }
            code < 0xD800 || code >= 0xE000 -> {<|endoftext|>


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

Response:
import org.jetbrains.kotlin.fir.analysis.checkers.hasModifier
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors
import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration
import org.jetbrains.kotlin.fir.declarations.FirClass<|endoftext|>


Prompt:
val parameterIndex = diagnostic.parameterIndex

                val valueArgument = lambdaArgument.psiCallArgument.valueArgument

                val valueParameters = when (val argumentExpression = KtPsiUtil.deparenthesize(valueArgument.getArgumentExpression())) {
                    is KtLambdaExpression -> argumentExpression.valueParameters

Response:
is KtNamedFunction -> argumentExpression.valueParameters // for anonymous functions
                    else -> return
                }

                val parameter = valueParameters.getOrNull(parameterIndex)
                if (parameter != null) {
                    trace.report(CANNOT_INFER_PARAMETER_TYPE.on(parameter))
                }
            }

            is CompatibilityWarningOnArgument -> {<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// WITH_STDLIB
// FILE: kt24258.kt

val lazyNullString: String by lazy { J.nullString() }

fun testLazyNullString() {
    try {
        val s: String = lazyNullString
        throw Exception("'val s: String = lazyNullString' should throw NullPointerException")

Response:
} catch (e: NullPointerException) {
    }
}

fun box(): String {
    testLazyNullString()

    return "OK"
}

// FILE: J.java
public class J {
    public static String nullString() {
        return null;
    }
}<|endoftext|>


Prompt:
private fun <T : Comparable<T>> expectMinMax(min: T, max: T, elements: Array<T>) {
        assertEquals(min, elements.minOrNull())
        assertEquals(max, elements.maxOrNull())
        assertEquals(min, elements.min())
        assertEquals(max, elements.max())
    }

    @Test
    fun minMax() {

Response:
expectMinMax("a", "a", arrayOf("a"))
        expectMinMax("a", "bcd", arrayOf("a", "bcd"))
        expectMinMax("a", "e", arrayOf("a", "bcd", "e"))
        expectMinMax(1, Int.MAX_VALUE, arrayOf(1, 2, Int.MAX_VALUE))<|endoftext|>


Prompt:
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})
public fun kotlin.ULong.coerceIn(minimumValue: kotlin.ULong, maximumValue: kotlin.ULong): kotlin.ULong

@kotlin.SinceKotlin(version = "1.5")

Response:
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})
public fun kotlin.ULong.coerceIn(range: kotlin.ranges.ClosedRange<kotlin.ULong>): kotlin.ULong

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


Prompt:
import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.*
import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilationResult.Companion.assertSuccess
import org.jetbrains.kotlin.konan.test.blackbox.support.group.FirPipeline

Response:
import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestExecutable
import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunCheck
import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunChecks<|endoftext|>


Prompt:
return fooPrivate()
    }

    fun testFinal(): String {
        return fooFinal()
    }
}

// FILE: 2.kt

import test.*

fun box() : String {
    val p = P()

    if (p.testPrivate() != "OK") return "fail 1 ${p.testPrivate()}"

Response:
if (p.testFinal() != "OK") return "fail 2 ${p.testFinal()}"
    return "OK"
}<|endoftext|>


Prompt:
if (toStringFloat3.id() != "1.5")     return "Fail 2.3"

    // START_EVALUATION_CHECKS
    val localDoubleToString = 1.0.<!EVALUATED{IR}("1.0")!>toString()<!>

Response:
val localFloatToString = 1.0f.<!EVALUATED{IR}("1.0")!>toString()<!>
    // STOP_EVALUATION_CHECKS

    if (localDoubleToString.id() != toStringDouble1)    return "Fail 3.1"
    if (localFloatToString.id() != toStringFloat1)      return "Fail 3.2"<|endoftext|>


Prompt:
<!SUPER_NOT_AVAILABLE!>super<!>.foo()
    <!SUPER_NOT_AVAILABLE!>super<Nothing><!>.foo()
}

class A {
    fun act() {
        <!UNRESOLVED_REFERENCE!>println<!>("Test")
    }

    fun String.fact() {

Response:
<!UNRESOLVED_REFERENCE!>println<!>("Fest")
    }
}<|endoftext|>


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

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


Prompt:
super@KotlinInterfaceIndirectInheritance.property
            }
        }
    }

    val propertyyy: String
        get() {
            super.test()
            super.property

            object  {
                fun run () {
                    super@KotlinInterfaceIndirectInheritance.test()
                    super@KotlinInterfaceIndirectInheritance.property
                }
            }

Response:
return ""
        }
}

open class KotlinClass : KInterface {
    fun foo() {
        super.test()
        super.property

        object  {
            fun run () {
                super@KotlinClass.test()
                super@KotlinClass.property
            }
        }
    }

    val xproperty: String
        get() {
            super.test()<|endoftext|>


Prompt:
@<!UNRESOLVED_REFERENCE!><!SYNTAX!><!>myAnnotation<!> <!WRONG_MODIFIER_TARGET!>public<!>
package illegal_modifiers

abstract class A() {

Response:
<!INCOMPATIBLE_MODIFIERS!>abstract<!> <!INCOMPATIBLE_MODIFIERS!>final<!> fun f()
    abstract <!REDUNDANT_MODIFIER!>open<!> fun g()<|endoftext|>


Prompt:
typeConversion: (FirTypeRef) -> ConeKotlinType? = FirTypeRef::coneTypeSafe
): String = buildString {
    if (customName != null) {
        append(customName)
    } else {
        if (this@computeJvmDescriptor is FirSimpleFunction) {
            append(name.asString())
        } else {
            append("<init>")

Response:
}
    }

    append("(")
    for (parameter in valueParameters) {
        typeConversion(parameter.returnTypeRef)?.let { coneType ->
            try {
                appendConeType(coneType, typeConversion, mutableSetOf())
            } catch (e: ConcurrentModificationException) {
                errorWithAttachment("CME from appendConeType", cause = e) {<|endoftext|>


Prompt:
val FRAGMENT_SHADER: Int
        val VERTEX_SHADER: Int
        val MAX_VERTEX_ATTRIBS: Int
        val MAX_VERTEX_UNIFORM_VECTORS: Int
        val MAX_VARYING_VECTORS: Int
        val MAX_COMBINED_TEXTURE_IMAGE_UNITS: Int

Response:
val MAX_VERTEX_TEXTURE_IMAGE_UNITS: Int
        val MAX_TEXTURE_IMAGE_UNITS: Int
        val MAX_FRAGMENT_UNIFORM_VECTORS: Int
        val SHADER_TYPE: Int
        val DELETE_STATUS: Int
        val LINK_STATUS: Int
        val VALIDATE_STATUS: Int<|endoftext|>


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

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


Prompt:
@file:Suppress("PackageDirectoryMismatch") // Old package for compatibility
package org.jetbrains.kotlin.gradle.utils

import org.gradle.api.Project
import org.gradle.api.artifacts.repositories.ArtifactRepository
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileTree

Response:
import org.gradle.api.logging.Logger
import org.gradle.api.provider.ValueSource
import org.gradle.api.provider.ValueSourceParameters
import org.jetbrains.kotlin.compilerRunner.KotlinNativeToolRunner
import org.jetbrains.kotlin.compilerRunner.konanDataDir<|endoftext|>


Prompt:
ext.syntheticMethodForDelegate = delegateMethod?.run { JvmMethodSignature(c[name], c[desc]) }
    }

    override fun readConstructorExtensions(kmConstructor: KmConstructor, proto: ProtoBuf.Constructor, c: ReadContext) {
        val ext = kmConstructor.jvm

Response:
ext.signature = JvmProtoBufUtil.getJvmConstructorSignature(proto, c.strings, c.types)?.wrapAsPublic()
    }

    override fun readTypeParameterExtensions(kmTypeParameter: KmTypeParameter, proto: ProtoBuf.TypeParameter, c: ReadContext) {
        val ext = kmTypeParameter.jvm<|endoftext|>


Prompt:
"warn:" -> LanguageFeature.State.ENABLED_WITH_WARNING
            else -> error("Unknown mode for language feature: $mode")
        }
        val name = matcher.group(2)
        val feature = LanguageFeature.fromString(name) ?: error("Language feature with name \"$name\" not found")
        specificFeatures[feature] = mode
    }

Response:
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE", "HIDDEN")
    private fun <T : Any> analysisFlag(flag: AnalysisFlag<T>, value: @kotlin.internal.NoInfer T?): Pair<AnalysisFlag<T>, T>? =
        value?.let(flag::to)<|endoftext|>


Prompt:
import testPackCase3.Case.E

operator fun Case.E.plus(value: Int) = Inv()
operator fun Case.Inv.invoke(i: Int) = 1

// FILE: TestCase3.kt
// TESTCASE NUMBER: 3, 4
package testPackCase3
import libPackage.plus
import libPackage.*
import libPackage.invoke

class Case() {

Response:
class E(val plus: Inv? = null) {
        operator fun plus(value: Int) = Case()
    }

    class Inv() {
        operator fun invoke(value: Int) = Case()
    }

    fun foo(e: E) {
        operator fun E.plus(value: Int) = Case()

        run {
            operator fun E.plus(value: Int) = Case()<|endoftext|>


Prompt:
x<!UNSAFE_CALL!>.<!>length // bad (x#0 is String, x#1 is Nothing?, this is either)
    }
}

fun unoverriddenEquals(a: Any?) {
    val c = C(1)
    var b: Any?
    b = c
    if (b == c.also { b = a }) {

Response:
a.<!UNRESOLVED_REFERENCE!>x<!> // bad (b#0 is C, b#1 = a)
        <!SMARTCAST_IMPOSSIBLE!>b<!>.x // bad (b#0 is C, this is b#1)
        if (b is C) { // b#1<|endoftext|>


Prompt:
testToKString(true, "При", bytes(-48, -97, -47, -128, -48, -72, 0, -48, -78, 0, -48, -75, -47, -126))
        testToKString(true, "\uD800\uDC00", bytes(-16, -112, -128, -128))

Response:
testToKString(true, "\uD800\uDC00", bytes(-16, -112, -128, -128, 0, -16, -112, -128, -128))
        testToKString(true, "", bytes())
        testToKString(true, "", bytes(0, 'H'.toInt()))

        // Incorrect UTF-8 lead character.<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
import org.jetbrains.kotlin.gradle.utils.filesProvider
import org.jetbrains.kotlin.gradle.utils.listProperty

internal fun interface KotlinCompilationAssociator {

Response:
fun associate(target: KotlinTarget, auxiliary: InternalKotlinCompilation<*>, main: InternalKotlinCompilation<*>)
}

internal object DefaultKotlinCompilationAssociator : KotlinCompilationAssociator {
    override fun associate(target: KotlinTarget, auxiliary: InternalKotlinCompilation<*>, main: InternalKotlinCompilation<*>) {<|endoftext|>


Prompt:
// TESTCASE NUMBER: 16
val value_16 = 999999999.0

// TESTCASE NUMBER: 17
val value_17 = 0000000000.1234567890

// TESTCASE NUMBER: 18
val value_18 = 123456789.23456789

// TESTCASE NUMBER: 19
val value_19 = 2345678.345678

Response:
// TESTCASE NUMBER: 20
val value_20 = 34567.4567

// TESTCASE NUMBER: 21
val value_21 = 456.56

// TESTCASE NUMBER: 22
val value_22 = 5.65

// TESTCASE NUMBER: 23
val value_23 = 654.7654

// TESTCASE NUMBER: 24<|endoftext|>


Prompt:
package foo

import bar.*
/*p:baz(C)*/import baz.C

/*p:foo*/val a = /*p:bar p:foo*/A()

Response: /*p:foo*/var b: /*p:bar p:foo p:java.lang p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.jvm p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/baz./*p:baz*/B<|endoftext|>


Prompt:
if (psiExpression is KtSuperExpression) {
                    trace.report(SUPER_CANT_BE_EXTENSION_RECEIVER.on(psiExpression, psiExpression.text))
                }
            }

            is StubBuilderInferenceReceiver -> {
                val stubType = callReceiver.receiver.receiverValue.type as? StubTypeForBuilderInference

Response:
val originalTypeParameter = stubType?.originalTypeVariable?.originalTypeParameter

                trace.report(
                    BUILDER_INFERENCE_STUB_RECEIVER.on(
                        callReceiver.psiExpression ?: call.callElement,
                        originalTypeParameter?.name ?: SpecialNames.NO_NAME_PROVIDED,<|endoftext|>


Prompt: }<!>, id<(B) -> Unit> { x -> x })<!>

Response: val x18: (C) -> Unit = <!TYPE_MISMATCH!>select(id <!TYPE_MISMATCH, TYPE_MISMATCH!>{ <!DEBUG_INFO_EXPRESSION_TYPE("C")!>it<!> }<!>, <!TYPE_MISMATCH!>{ <!DEBUG_INFO_EXPRESSION_TYPE("C")!>it<!><|endoftext|>


Prompt:
operator fun get(id: O1.Id) = "O1 getter"
    operator fun get(id: O2.Id) = "O2 getter"
}

fun box(): String {
    var service = Service()
    if (service[Bar.Id(12)] != "Bar getter") return "Fail with /**/Bar overload"

Response:
if (service[Foo.Id(6)] != "Foo getter") return "Fail with Foo overload"
    if (service[E1.Id.A] != "E1 getter") return "Fail with E1 overload"
    if (service[E2.Id.A] != "E2 getter") return "Fail with E2 overload"<|endoftext|>


Prompt:
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName

Response:
import org.jetbrains.kotlin.name.StandardClassIds
import org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.serialization.deserialization.IncompatibleVersionErrorData<|endoftext|>


Prompt:
internal actual fun ulongDivide(v1: ULong, v2: ULong): ULong {
    val dividend = v1.toLong()
    val divisor = v2.toLong()
    if (divisor < 0) { // i.e., divisor >= 2^63:
        return if (v1 < v2) ULong(0) else ULong(1)
    }

Response:
// Optimization - use signed division if both dividend and divisor < 2^63
    if (dividend >= 0) {
        return ULong(dividend / divisor)
    }

    // Otherwise, approximate the quotient, check, and correct if necessary.
    val quotient = ((dividend ushr 1) / divisor) shl 1<|endoftext|>


Prompt:
x.resume("OK")
        COROUTINE_SUSPENDED
    }

    suspend fun myfun(): String {
        var result = "fail"
        builder {
            result = a()
        }

        return result
    }
}

fun box(): String {
    var result = ""

    builder {
        result = A().myfun()
    }

    return result

Response: }<|endoftext|>


Prompt:
contract { returns(false) implies (value_1 is String) }
    return value_1 is String
}

fun funWithReturnsFalseAndInvertTypeCheck(value_1: Any?): Boolean {
    contract { returns(false) implies (value_1 !is String) }
    return value_1 !is String
}

fun funWithReturnsFalseAndNotNullCheck(value_1: Number?): Boolean {

Response:
contract { returns(false) implies (value_1 != null) }
    return value_1 != null
}

fun funWithReturnsFalseAndNullCheck(value_1: Number?): Boolean {
    contract { returns(false) implies (value_1 == null) }
    return value_1 == null
}

fun funWithReturnsNull(cond: Boolean): Boolean? {<|endoftext|>


Prompt:
if (!checkClassTypeParametersWithUpperBounds(
            A::class,
            listOf(
                Pair("K", listOf("kotlin.collections.List<out org.jetbrains.`true`.`true`<out kotlin.String>>"))
            )
        )) return null

    if (!checkClassTypeParametersWithUpperBounds(
            B::class,
            listOf(

Response:
Pair("T", listOf("org.jetbrains.`true`.A<kotlin.collections.List<out org.jetbrains.`true`.`true`<kotlin.String>>>"))
            )
        )) return null

    if (!checkCallableTypeParametersWithUpperBounds(
            `false`::f3,
            listOf(<|endoftext|>


Prompt:
result.addAll(getContributedFunctions(descriptorName, NoLookupLocation.FROM_BACKEND))
        result.addAll(getContributedVariables(descriptorName, NoLookupLocation.FROM_BACKEND))

        return result
    }

Response:
private fun lookupTopLevelDescriptors(nameSegments: List<String>, packageFqName: FqName): Collection<DeclarationDescriptor> {
        val declarationName = nameSegments[0]
        val isLeaf = nameSegments.size == 1
        return when (lookupMode) {
            LookupMode.MODULE_WITH_DEPENDENCIES -> {
                moduleDescriptor<|endoftext|>


Prompt:
<!SENSELESS_NULL_IN_WHEN!>null<!> -> "false"
        }
    }
}

/*
 * TESTCASE NUMBER: 8
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-17694
 */
fun case_8(x: Any?) {
    val y: Any
    when (x) {

Response:
is Boolean? -> y = <!NO_ELSE_IN_WHEN!>when<!>(x) {
            true -> "true"
            false -> "false"
            null -> "false"
        }
        else -> y = Any()
    }

}

// TESTCASE NUMBER: 9
fun case_9(x: Any?): String {
    if (x is Boolean) {<|endoftext|>


Prompt:
override fun f(i1: Int) = x + i1
}

interface Outer {
    @JvmInline
    value class DefaultImpls(val x: Int) {
        fun f(i1: Int = 1) = x + i1
    }
}

fun box(): String {
    val unbounded1 = IC::f

Response:
assertEquals(3, unbounded1.callBy(mapOf(unbounded1.instanceParameter!! to IC(2))))
    assertEquals(7, unbounded1.callBy(mapOf(unbounded1.instanceParameter!! to IC(2), unbounded1.parameters[1] to 5)))

    val bounded1 = IC(2)::f<|endoftext|>


Prompt:
val ATTRIBUTE_NODE: Short
        val TEXT_NODE: Short
        val CDATA_SECTION_NODE: Short
        val ENTITY_REFERENCE_NODE: Short
        val ENTITY_NODE: Short
        val PROCESSING_INSTRUCTION_NODE: Short
        val COMMENT_NODE: Short
        val DOCUMENT_NODE: Short

Response:
val DOCUMENT_TYPE_NODE: Short
        val DOCUMENT_FRAGMENT_NODE: Short
        val NOTATION_NODE: Short
        val DOCUMENT_POSITION_DISCONNECTED: Short
        val DOCUMENT_POSITION_PRECEDING: Short
        val DOCUMENT_POSITION_FOLLOWING: Short
        val DOCUMENT_POSITION_CONTAINS: Short<|endoftext|>


Prompt:
assertEquals(BigInteger("-4"), -a shl 1)
        assertEquals(BigInteger("-1"), -a shr 1)
        assertEquals(BigInteger("-1"), -a shr 2)

        assertEquals(BigInteger("2"), 2.toBigInteger())
        assertEquals(BigInteger("-3"), -3L.toBigInteger())

Response:
assertEquals(BigDecimal("2"), a.toBigDecimal())
        assertEquals(BigDecimal("0.02"), a.toBigDecimal(2))
        assertEquals(BigDecimal("2E+2"), a.toBigDecimal(-2))<|endoftext|>


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

// TESTCASE NUMBER: 9

Response:
fun <T>case_9(x: MutableMap<T, out T>) = select(x.values.first(), x.keys.first())

fun case_9() {
    val x = case_9(mutableMapOf(null to 10))

    if (x != null) {<|endoftext|>


Prompt:
fun box(): String {
    KlassA({})
    KlassB()
    return "OK"
}

class KlassA(arg: (() -> Unit)?) {
    var func: (() -> Unit)? = arg
    init {
        if (func != null) {
            <!UNSAFE_IMPLICIT_INVOKE_CALL!>func<!>()
        }
    }
}

Response:
class KlassB {
    var func: (() -> Unit)?
    init {
        if (true) {
            func = {}
            <!UNSAFE_IMPLICIT_INVOKE_CALL!>func<!>()
        } else {
            func = null
        }
    }
}<|endoftext|>


Prompt:
0x3da5fd7fe1796495UL,     0x0UL,     0x0UL,     0x0UL,
            0x0UL,     0x0UL,     0x3da5fd7fe1796495UL,     0x3da5fd7fe1796495UL,

Response:
0x0UL,     0x0UL,     0x0UL,     0x0UL,
            0x3ff0000000000000UL,     0x3ff000000000afecUL,     0x3feffffffffea028UL,     0x3fe0000000000000UL,<|endoftext|>