Prompt:
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>returns(null) implies (value_1 != null && value_2 != null || value_2 == ".")<!> }
    return if (value_1 != null && value_2 != null || value_2 == ".") null else true
}

// TESTCASE NUMBER: 6

Response:
fun case_6(value_1: Boolean, value_2: Int?): Boolean? {
    contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>returns(null) implies (value_2 == null && value_1 || value_2 == 0)<!> }
    return if (value_2 == null && value_1 || value_2 == 0) null else true
}<|endoftext|>


Prompt:
changesCollector.collectProtoChanges(oldMapValue?.toProtoData(className.packageFqName), newProtoData, packageProtoKey = key)
        }

        fun check(
            className: JvmClassName, classProto: ProtoBuf.Class, stringTable: JvmStringTable, changesCollector: ChangesCollector,
        ) {
            val key = className.internalName

Response:
val oldProtoData = storage[key]?.toProtoData(className.packageFqName)
            val newProtoData = ClassProtoData(classProto, stringTable.toNameResolver())
            changesCollector.collectProtoChanges(oldProtoData, newProtoData, packageProtoKey = key)
        }

        operator fun contains(className: JvmClassName): Boolean =<|endoftext|>


Prompt:
// FILE: test.kt
class Foo {
    inner class Bar {
    }
}

fun box() {
    val x = Foo()
    x.Bar()
}

// EXPECTATIONS JVM_IR
// test.kt:8 box:
// test.kt:2 <init>:
// test.kt:8 box:
// test.kt:9 box: x:Foo=Foo

Response:
// test.kt:3 <init>:
// test.kt:9 box: x:Foo=Foo
// test.kt:10 box: x:Foo=Foo

// EXPECTATIONS JS_IR
// test.kt:8 box:
// test.kt:2 <init>:
// test.kt:9 box: x=Foo
// test.kt:3 <init>:<|endoftext|>


Prompt:
if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char"), DEBUG_INFO_SMARTCAST!>a.e<!>.propAny
    if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?")!>a.e<!>.propNullableT

Response:
if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?")!>a.e<!>.propNullableAny
    if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char"), DEBUG_INFO_SMARTCAST!>a.e<!>.funT()<|endoftext|>


Prompt:
internal fun foldChars() {
        val stringLength = this.length
        val newArray = WasmCharArray(stringLength)

        var currentStartIndex = stringLength
        var currentLeftString: String? = this
        while (currentLeftString != null) {
            val currentLeftStringChars = currentLeftString._chars
            val currentLeftStringLen = currentLeftStringChars.len()

Response:
currentStartIndex -= currentLeftStringLen
            copyWasmArray(currentLeftStringChars, newArray, 0, currentStartIndex, currentLeftStringLen)
            currentLeftString = currentLeftString.leftIfInSum
        }
        check(currentStartIndex == 0)
        _chars = newArray
        leftIfInSum = null
    }

    internal inline val chars: WasmCharArray get() {<|endoftext|>


Prompt:
@Optional @OutputFile get() = if (!noPack) artifact else null

    val artifactDirectory: File?
        @Optional @OutputDirectory get() = if (noPack) artifact else null

    override val artifactSuffix: String
        @Internal get() = if (!noPack) produce.suffix(konanTarget) else ""

    override fun buildCommonArgs() = super.buildCommonArgs().apply {

Response:
addKey("-nopack", noPack)
    }

    override val produce: CompilerOutputKind get() = CompilerOutputKind.LIBRARY
    override val enableTwoStageCompilation: Boolean = false
}

abstract class KonanCompileBitcodeTask @Inject constructor(layout: ProjectLayout): KonanCompileNativeBinary(layout) {<|endoftext|>


Prompt:
override <!REDUNDANT_MODALITY_MODIFIER!>open<!> fun foo() {}
}
// Derived abstract class
abstract class AbstractDerived2 : Interface {
    // Final
    override final fun foo() {}
    // Redundant
    override <!REDUNDANT_MODALITY_MODIFIER!>open<!> val gav = 13
}

Response:
// Redundant abstract interface
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> interface AbstractInterface
// Redundant final object
<!REDUNDANT_MODALITY_MODIFIER!>final<!> object FinalObject
// Open interface<|endoftext|>


Prompt:
@file:Suppress("unused")
@file:JvmName("JvmExtensionsKt") // for stability. Probably we should drop Kt ending for easier calls from Java

package kotlin.metadata.jvm

import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
import kotlin.metadata.*

Response:
import kotlin.metadata.jvm.internal.jvm

/**
 * Metadata of local delegated properties used somewhere inside this class (but not in a nested class).
 * Note that for classes produced by the Kotlin compiler, such properties will have default accessors.
 *
 * The order of local delegated properties in this list is important. The Kotlin compiler generates the corresponding property's index<|endoftext|>


Prompt:
override fun toString(): String = "${this::class.java.simpleName} $path"
}

class ModifyContent(path: String, val dataFile: File) : Modification(path) {
    override fun perform(workDir: File, mapping: MutableMap<File, File>): File? {
        val file = File(workDir, path)

Response:
val oldLastModified = file.lastModified()
        file.delete()
        dataFile.copyTo(file)

        val newLastModified = file.lastModified()
        if (newLastModified <= oldLastModified) {
            //Mac OS and some versions of Linux truncate timestamp to nearest second
            file.setLastModified(oldLastModified + 1000)
        }<|endoftext|>


Prompt:
// DONT_TARGET_EXACT_BACKEND: JS
// ES_MODULES
// SPLIT_PER_MODULE
// EXPECTED_REACHABLE_NODES: 1290
// MODULE: lib
// FILE: lib.kt

package lib

class A(val x: Int)

fun A.foo() = 23 + x

inline fun A.baz() = 99 + x

Response:
inline fun A.callFoo() = foo()

inline fun A.buzz(): Int {
    val o = object {
        fun f() = 111 + x
    }
    return o.f()
}

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

package main

import lib.*

fun box(): String {
    val a = A(1).foo()<|endoftext|>


Prompt:
val field = expression.symbol.owner
            if (field.containsAnnotationToCheckCalls()) {
                handleFunctionWithAnnotation(field)
            }
        }

        private fun IrAnnotationContainer.containsAnnotationToCheckCalls() =
            @OptIn(UnsafeDuringIrConstructionAPI::class)
            annotations.any { it.symbol.owner.parentClassId == annotationClassId }

Response:
}
}<|endoftext|>


Prompt:
put(JVMConfigurationKeys.JDK_HOME, jdkHome)
    } else {
        configureJdkHomeFromSystemProperty()
    }

    return true
}

fun CompilerConfiguration.configureJdkHomeFromSystemProperty() {
    val javaHome = File(System.getProperty("java.home"))

Response:
messageCollector.report(LOGGING, "Using JDK home inferred from java.home: $javaHome")
    put(JVMConfigurationKeys.JDK_HOME, javaHome)
}

fun CompilerConfiguration.configureJavaModulesContentRoots(arguments: K2JVMCompilerArguments) {<|endoftext|>


Prompt:
actual interface S1 {
    fun o(): S = "O"
    val p: Boolean
        get() = true
}

actual interface S2 {
    fun k() = "K"
}

actual typealias S = String

fun box(): String {
    val b = B()
    return if (b.p) {
        b.o() + b.k()
    } else {

Response:
"FAIL"
    }
}<|endoftext|>


Prompt:
interface A {
    fun Any.equals(other: Any?): Boolean = false
    fun Any.hashCode(): Int = 0
    fun Any.toString(): String = ""
}

data class B(val x: Int) : A

fun box(): String {
    if (B(42) != B(42)) return "Fail equals"

Response:
if (B(42).hashCode() != B(42).hashCode()) return "Fail hashCode"
    if (B(42).toString() != B(42).toString()) return "Fail toString"
    return "OK"
}<|endoftext|>


Prompt:
if (x > upper_taylor_n_bound) {
                if (x > upper_taylor_2_bound) {
                    // approximation by laurent series in 1/x at 0+ order from -1 to 0
                    nativeMath.log(x) + LN2
                } else {
                    // approximation by laurent series in 1/x at 0+ order from -1 to 1

Response:
nativeMath.log(x * 2 + (1 / (x * 2)))
                }
            } else {
                nativeMath.log(x + nativeMath.sqrt(x * x + 1))
            }
        x <= -taylor_n_bound -> -asinh(-x)
        else -> {
            // approximation by taylor series in x at 0 up to order 2
            var result = x;<|endoftext|>


Prompt:
* @sample samples.collections.Arrays.ContentOperations.contentDeepToString
 */
@SinceKotlin("1.4")
public actual fun <T> Array<out T>?.contentDeepToString(): String {
    return contentDeepToStringImpl()
}

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *

Response:
* Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *<|endoftext|>


Prompt:
a[0] = 0
        a[1] = 1
        a[2] = 2
        return a
    }
    public fun <E> toArray(array: Array<E>): Array<E> {
        val asIntArray = array as Array<Int>
        asIntArray[0] = 0
        asIntArray[1] = 1
        asIntArray[2] = 2
        return array

Response:
}
}

fun box(): String {
    val collection = MyCollection(Arrays.asList(2, 3, 9)) as java.util.Collection<*>

    val array1 = collection.toArray()
    val array2 = collection.toArray(arrayOfNulls<Int>(3) as Array<Int>)<|endoftext|>


Prompt:
enum class StabilityBits(val bits: Int) {
    UNSTABLE(0b100),
    STABLE(0b000);
    fun bitsForSlot(slot: Int): Int = bits shl (1 + slot * 3)
}

/**
 * This transform determines the stability of every class, and synthesizes a StabilityInferred

Response:
* annotation on it, as well as putting a static final int of the stability to be used at runtime.
 */
class ClassStabilityTransformer(
    private val useK2: Boolean,
    context: IrPluginContext,
    symbolRemapper: DeepCopySymbolRemapper,
    metrics: ModuleMetrics,
    stabilityInferencer: StabilityInferencer,<|endoftext|>


Prompt:
private val diagnosticForTypeAliases: DiagnosticFactory3<KtElement, KotlinType, KotlinType, ClassifierDescriptor> = UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION
) {
    fun report(typeArgumentReference: KtTypeReference, substitutedBound: KotlinType) {

Response:
trace.reportDiagnosticOnce(baseDiagnostic.on(typeArgumentReference, substitutedBound, argumentType))
    }

    fun reportForTypeAliasExpansion(callElement: KtElement, substitutedBound: KotlinType) {
        trace.reportDiagnosticOnce(diagnosticForTypeAliases.on(callElement, substitutedBound, argumentType, typeParameterDescriptor))
    }
}<|endoftext|>


Prompt:
// Check that for a child class loader, a class reference would be the same as for his parent

        loadFile("$prefix/parentFirst.kt")

        class ChildClassLoader(parent: ClassLoader) : ClassLoader(parent)

        val parent = createClassLoader()

        doTest(
            parent,
            ChildClassLoader(parent)
        )
    }

    fun testKTypeEquality() {

Response:
/*
         * Check that typeOf<List<Clz>>() when clz is loaded by different classloaders
         * differs in both its `equals` and its `classifier`.
         * It is important in the face of KType caching
         */
        loadFile("$prefix/kTypeEquality.kt")
        doTest(
            createClassLoader(),
            createClassLoader()
        )
    }
}<|endoftext|>


Prompt:
override val namedNodeImpl: NameableMfvcNodeImpl = NameableMfvcNodeImpl(methodFullNameMode, nameParts, unboxMethod)

    override val leavesCount: Int
        get() = 1

    init {
        requireSameClasses(
            field?.parentAsClass?.takeUnless { unboxMethod.parentAsClass.isCompanion },
            unboxMethod.parentAsClass,

Response:
(unboxMethod.dispatchReceiverParameter?.type as? IrSimpleType)?.erasedUpperBound,
        )
        validateGettingAccessorParameters(unboxMethod)
    }

    override fun createInstanceFromBox(
        scope: IrBlockBuilder,
        typeArguments: TypeArguments,
        receiver: IrExpression?,
        accessType: AccessType,<|endoftext|>


Prompt:
extractNativeTasksCommandLineArgumentsFromOutput(":linkDebugExecutableHost") {
                    assertCommandLineArgumentsContain(*(compilerCacheOrchestrationArgs + incrementalCacheArgs))
                }
            }
        }
    }

    @DisplayName("Smoke test")
    @GradleTest
    fun checkIncrementalCacheIsCreated(gradleVersion: GradleVersion) {

Response:
nativeProject("native-incremental-simple", gradleVersion) {
            build("linkDebugExecutableHost") {
                assertDirectoryExists(
                    getFileCache("native-incremental-simple", "src/hostMain/kotlin/main.kt")
                )
            }
        }
    }

    @DisplayName("IC works after compilation error (test 1)")
    @GradleTest<|endoftext|>


Prompt:
prerequisite = [JvmIrInliner::class]
)
class CreateSeparateCallForInlinedLambdasLowering(val context: JvmBackendContext) : IrElementTransformerVoid(), FileLoweringPass {
    override fun lower(irFile: IrFile) {
        if (context.config.enableIrInliner) {
            irFile.transformChildrenVoid()
        }
    }

Response:
override fun visitContainerExpression(expression: IrContainerExpression): IrExpression {
        if (expression is IrInlinedFunctionBlock && expression.isFunctionInlining()) {
            val newCalls = expression.getOnlyInlinableArguments().map { arg -><|endoftext|>


Prompt:
data class ModuleStatus(val data: ModuleData, val targetInfo: String) {
        var compilationError: String? = null
        var jvmInternalError: String? = null
        var exceptionMessage: String = "NO MESSAGE"
    }

    private val totalModules = mutableListOf<ModuleStatus>()
    private val okModules = mutableListOf<ModuleStatus>()

Response:
private val errorModules = mutableListOf<ModuleStatus>()
    private val crashedModules = mutableListOf<ModuleStatus>()

    protected data class CumulativeTime(
        val gcInfo: Map<String, GCInfo>,
        val components: Map<String, Long>,
        val files: Int,
        val lines: Int
    ) {<|endoftext|>


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

import org.jetbrains.kotlin.fir.renderer.*
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.types.Variance

Response:
import org.jetbrains.kotlin.utils.SmartSet
import org.jetbrains.kotlin.utils.addToStdlib.popLast

val ConeKotlinType.isNullable: Boolean get() = nullability != ConeNullability.NOT_NULL
val ConeKotlinType.isMarkedNullable: Boolean get() = nullability == ConeNullability.NULLABLE<|endoftext|>


Prompt:
//   the type of property defined in the first mentioned protocol (id<Bar>), which is incompatible with property type.
@end

@interface DerivedWithPropertyOverride : Base<Bar, Foo>
// This interface does not have re-declaration of property `delegate`.
// Return type of getter `delegate()` and param type of setter `setDelegate()` are `DerivedWithPropertyOverride*`

Response:
@property (readwrite) DerivedWithPropertyOverride* delegate;
@end

// FILE: kt57640.m
#import "kt57640.h"

@implementation Base
@end

@implementation Derived
@end

@implementation DerivedWithPropertyOverride
@end

// MODULE: main(cinterop)
// FILE: main.kt<|endoftext|>


Prompt:
// MODULE: lib
// FILE: 1.kt

interface Test {
    fun test(): String {
        return "OK"
    }
}

// MODULE: main(lib)
// JVM_TARGET: 1.8
// FILE: 2.kt
class TestClass : Test {
    override fun test(): String {
        return super.test()
    }
}

fun box(): String {

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


Prompt:
assertFalse(eqShortQInt(null, 0.toInt()))
    assertFalse(eqShortQInt(null, 1.toInt()))
    assertFalse(eqShortQInt(undefined, 0.toInt()))
    assertFalse(eqShortQInt(undefined, 1.toInt()))
    assertTrue(eqShortQIntQ(0.toShort(), 0.toInt()))

Response:
assertFalse(eqShortQIntQ(0.toShort(), 1.toInt()))
    assertFalse(eqShortQIntQ(0.toShort(), null))
    assertFalse(eqShortQIntQ(0.toShort(), undefined))
    assertFalse(eqShortQIntQ(1.toShort(), 0.toInt()))<|endoftext|>


Prompt:
sealed class Case4 {
    <!NON_PRIVATE_CONSTRUCTOR_IN_SEALED!>protected<!> constructor(x: Int)
    <!NON_PRIVATE_CONSTRUCTOR_IN_SEALED!>protected<!> constructor(s: String) : this(s.length)

    class Inheritor1 : Case4(10)

Response:
class Inheritor2 : Case4("Hello")
}

sealed class Case5() {
    private constructor(x: Int) : this()
    <!NON_PRIVATE_CONSTRUCTOR_IN_SEALED!>protected<!> constructor(x: Byte) : this()<|endoftext|>


Prompt: 0x0019, 0x001c, 0x679c, 0x001c, 0x0019, 0x001c, 0x673c, 0x033c, 0x001c, 0x0019, 0x001c, 0x02d5, 0x001c, 0x0019, 0x001c, 0x02d5, 0x001c, 0x0019,

Response: 0x001c, 0x0019,<|endoftext|>


Prompt:
public infix fun <T, R> Array<out T>.zip(other: Array<out R>): List<Pair<T, R>> {
    return zip(other) { t1, t2 -> t1 to t2 }
}

/**
 * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.
 * The returned list has length of the shortest collection.

Response:
*
 * @sample samples.collections.Iterables.Operations.zipIterable
 */
public infix fun <R> ByteArray.zip(other: Array<out R>): List<Pair<Byte, R>> {
    return zip(other) { t1, t2 -> t1 to t2 }
}

/**<|endoftext|>


Prompt:
<!COMPOSE_APPLIER_CALL_MISMATCH!>M<!>()
        }
        """
    )

    @Test
    fun testUiTextAndInvalid() = check(
        """
        import androidx.compose.runtime.Composable
        import androidx.compose.runtime.ComposableTarget
        import androidx.compose.foundation.text.BasicText

Response:
@Composable @ComposableTarget("N")
        fun Invalid() { }

        @Composable
        fun UseText() {
           BasicText("Some text")
           <!COMPOSE_APPLIER_CALL_MISMATCH!>Invalid<!>()
        }
        """
    )

    @Test
    fun testOpenOverrideAttributesInheritTarget() = check(
        """<|endoftext|>


Prompt:
cLines += "${bridgeBuilder.buildCSignature(cBridgeName)} {"
    cLines += cBridgeBodyLines
    cLines += "}"

    stubs.addC(cLines)
}

private fun KotlinToCCallBuilder.buildCall(
        targetFunctionName: String,
        returnValuePassing: ValueReturning

Response:
): IrExpression = with(returnValuePassing) {
    returnValue(cCallBuilder.build(targetFunctionName))
}

internal sealed class ObjCCallReceiver {
    class Regular(val rawPtr: IrExpression) : ObjCCallReceiver()
    class Retained(val rawPtr: IrExpression) : ObjCCallReceiver()
}

internal fun KotlinStubs.generateObjCCall(<|endoftext|>


Prompt:
// We build it on the basis of "__init__" member, so drop the "placement" argugment.
        parameters.removeFirst()

        if (skipOverloads && context.isOverloading(func.fullName, parameters.map { it.type }))
            return emptyList()

        val annotations =
            if (platform == KotlinPlatform.JVM) {
                emptyList()

Response:
} else {
                if (func.isVararg) {
                    val type = KotlinTypes.any.makeNullable().toStubIrType()
                    parameters += FunctionParameterStub("variadicArguments", type, isVararg = true)
                }
                buildFunctionAnnotations(func, name) + AnnotationStub.CCall.CppClassConstructor
            }<|endoftext|>


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

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

Response:
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid<|endoftext|>


Prompt:
package org.jetbrains.kotlin.objcexport

import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.types.KtErrorType
import org.jetbrains.kotlin.analysis.api.types.KtType

Response:
import org.jetbrains.kotlin.backend.konan.objcexport.ObjCNonNullReferenceType
import org.jetbrains.kotlin.backend.konan.objcexport.ObjCNullableReferenceType
import org.jetbrains.kotlin.backend.konan.objcexport.ObjCReferenceType<|endoftext|>


Prompt:
kotlin.jvm()
        kotlin.linuxX64()

        kotlin.sourceSets.getByName("commonMain").dependencies {
            api("junit:junit:4.13.2") { setTransitive(false) }
            api(kotlin("reflect")) { setTransitive(false) }
            api(kotlin("reflect", "1.3.0"))

Response:
implementation(kotlin("reflect", "1.2.71"))
            compileOnly(kotlin("reflect", "1.2.70"))
            runtimeOnly(kotlin("reflect", "1.2.60"))
            api(project(path = ":lib", configuration = "outputConfiguration"))
        }

        project.evaluate()<|endoftext|>


Prompt:
assertTrue(regex.matches("mop--q-x----"))

        // Test error cases with &&
        // TODO: What is this check?
        regex = Regex("[&&[xyz]]")
        regex.matches("&")
        regex.matches("x")
        regex.matches("y")
        regex = Regex("[[xyz]&[axy]]")

Response:
regex.matches("x")
        regex.matches("z")
        regex.matches("&")
        regex = Regex("[abc[123]&&[345]def]")
        regex.matches("a")

        regex = Regex("[[xyz]&&]")
        regex = Regex("[[abc]&]")

        try {<|endoftext|>


Prompt:
// ISSUE: KT-63840
// CHECK_TYPE_WITH_EXACT

fun test() {
    val buildee = build {
        if (true)
            <!TYPE_MISMATCH("DifferentType; TargetType"), TYPE_MISMATCH("DifferentType; TargetType")!>replaceTypeVariable(TargetType())<!>
        else
            DifferentType()
    }

Response:
// exact type equality check — turns unexpected compile-time behavior into red code
    // considered to be non-user-reproducible code for the purposes of these tests
    checkExactType<Buildee<TargetType>>(buildee)
}

class TargetType
class DifferentType

class Buildee<TV> {<|endoftext|>


Prompt:
override fun transformFlat(declaration: IrDeclaration): List<IrDeclaration>? {
        if (declaration is IrClass && declaration.kind != ClassKind.INTERFACE) {
            val constructors = declaration.constructors

            if (constructors.any { it.isPrimary }) return null

            declaration.syntheticPrimaryConstructor = createPrimaryConstructor(declaration)
        }

Response:
return null
    }

    companion object {
        val SYNTHETIC_PRIMARY_CONSTRUCTOR by IrDeclarationOriginImpl
    }

    private val unitType = context.irBuiltIns.unitType

    private fun createPrimaryConstructor(irClass: IrClass): IrConstructor {
        val declaration = irClass.addConstructor {<|endoftext|>


Prompt:
package org.jetbrains.kotlin.analysis.api.impl.base.util

import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.StandardFileSystems
import com.intellij.openapi.vfs.VfsUtilCore
import com.intellij.openapi.vfs.VirtualFile

Response:
import com.intellij.openapi.vfs.impl.jar.CoreJarFileSystem
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiManager
import com.intellij.util.io.URLUtil
import com.intellij.util.io.URLUtil.JAR_SEPARATOR
import java.nio.file.Path<|endoftext|>


Prompt:
descriptor.findActualForExpect() as? FunctionDescriptor ?: return null
        )
    }

    private fun MemberDescriptor.findActualForExpect(): MemberDescriptor? {
        if (!isExpect) error(this)
        return findCompatibleActualsForExpected(module).singleOrNull()
    }

Response:
private fun shouldRemoveTopLevelDeclaration(declaration: IrDeclaration): Boolean {
        return doRemove && when (declaration) {
            is IrClass -> declaration.isExpect
            is IrProperty -> declaration.isExpect
            is IrFunction -> declaration.isExpect
            else -> false
        }
    }

    private fun isOptionalAnnotationClass(klass: IrClass): Boolean {<|endoftext|>


Prompt: $i$a$-suspendCoroutineUninterceptedOrReturn-TestKt$foo$2$iv$iv:int=0:int, $i$f$bar:int=0:int, c$iv$iv$iv:int=1:int, $i$a$-bar-TestKt$foo$2$1$iv$iv:int=0:int,

Response: b$iv$iv:int=2:int<|endoftext|>


Prompt:
inline fun testCompilationInline(arg: String = getStringInline()): String {
    return arg
}

fun box(): String {
    var result = testCompilation()
    if (result != "OK") return "fail1: ${result}"

    result = testCompilation("OKOK")
    if (result != "OKOK") return "fail2: ${result}"

Response:
result = testCompilationInline()
    if (result != "OK") return "fail3: ${result}"

    result = testCompilationInline("OKOK")
    if (result != "OKOK") return "fail4: ${result}"

    return "OK"
}

// FILE: test.kt
package test

inline fun getStringInline(): String {
    return "OK"
}<|endoftext|>


Prompt:
if (p > 0) {
        v = 1
        print(v)
    }
}

var global = 1

class C {
    var field = 2

    fun foo() {
        print(field)
        print(global)
    }
}

fun withDelegate() {

Response:
var <!VARIABLE_NEVER_READ!>s<!>: String by Delegates.notNull()
    <!ASSIGNED_VALUE_IS_NEVER_READ!>s<!> = ""
}<|endoftext|>


Prompt:
withEntry("ClassId.packageName", containerClassId.packageFqName) { it.asString() }
            }
        }

        val classIdPathSegment = containerClassId?.relativeClassName?.pathSegments().orEmpty()
        val path = ArrayList<FirDeclaration>(classIdPathSegment.size + 2)
        var result: FirDeclaration? = null

Response:
fun find(declarations: Iterable<FirDeclaration>, classIdPathIndex: Int): Boolean {
            val currentClassSegment = classIdPathSegment.getOrNull(classIdPathIndex)
            for (subDeclaration in declarations) {
                when {
                    currentClassSegment == null && expectedDeclarationAcceptor(subDeclaration) -> {
                        result = subDeclaration
                        return true
                    }<|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:
// TARGET_BACKEND: JVM
// WITH_STDLIB

class A<U : Number, V : U, W : V> : Set<W> {
    override val size: Int get() = 0
    override fun isEmpty(): Boolean = true
    override fun contains(o: W): Boolean = false
    override fun iterator(): Iterator<W> = emptySet<W>().iterator()

Response:
override fun containsAll(c: Collection<W>): Boolean = c.isEmpty()
}

fun expectUoe(block: () -> Any) {
    try {
        block()
        throw AssertionError()
    } catch (e: UnsupportedOperationException) {
    }
}

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


Prompt:
"абортарий",
"абортивный",
"абортировать",
"абразив",
"абразивный",
"абразионный",

Response:
"абразия",
"абракадабра",
"абреже",
"абрек",
"абрикос",
"абрикосный",
"абрикосовка",<|endoftext|>


Prompt:
val declarationIsFinal = declaration.isEffectivelyFinal(session)
    val conflictingIsFinal = conflicting.isEffectivelyFinal(session)

    if (declarationIsFinal && conflictingIsFinal) {
        val declarationIsHidden = declaration.isDeprecationLevelHidden(session)
        if (declarationIsHidden) return true

        val conflictingIsHidden = conflicting.isDeprecationLevelHidden(session)

Response:
if (conflictingIsHidden) return true
    }

    return session.declarationOverloadabilityHelper.isOverloadable(declaration, conflicting)
}

internal fun FirVariable.getDestructuredParameter(): FirValueParameterSymbol? {
    val initializer = initializer
    if (initializer !is FirComponentCall) return null<|endoftext|>


Prompt:
public final fun UTC(year: kotlin.Int, month: kotlin.Int, day: kotlin.Int, hour: kotlin.Int, minute: kotlin.Int, second: kotlin.Int, millisecond: kotlin.Number): kotlin.Double

        public final fun now(): kotlin.Double

Response:
public final fun parse(dateString: kotlin.String): kotlin.Double
    }

    public interface LocaleOptions {
        public abstract var day: kotlin.String? { get; set; }

        public abstract var era: kotlin.String? { get; set; }

        public abstract var formatMatcher: kotlin.String? { get; set; }<|endoftext|>


Prompt:
protected fun createConstBoundedForLoopGeneratorOrNull(
        codegen: ExpressionCodegen,
        forExpression: KtForExpression,
        startValue: StackValue,
        endExpression: KtExpression,
        step: Int,
        isStartInclusive: Boolean = true
    ): ForLoopGenerator? {

Response:
val endConstValue = codegen.getCompileTimeConstant(endExpression) as? IntegerValueConstant<*> ?: return null

        return when (endConstValue) {
            is ByteValue -> {
                val endIntValue = endConstValue.value.toInt()
                if (isProhibitedIntConstEndValue(step, endIntValue))
                    null
                else<|endoftext|>


Prompt:
override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: IrElement): IrElement = data

    // TODO: element-wise cast?
    override fun visitSpreadArgumentExpression(spreadArgumentExpression: FirSpreadArgumentExpression, data: IrElement): IrElement = data

    // ==================================================================================

Response:
override fun visitExpression(expression: FirExpression, data: IrElement): IrElement {
        return when (expression) {
            is FirBlock -> (data as IrContainerExpression).insertImplicitCasts()
            is FirUnitExpression -> coerceToUnitIfNeeded(data as IrExpression, irBuiltIns)
            else -> data
        }
    }<|endoftext|>


Prompt:
" Supported versions: ${AbiSignatureVersion.allSupportedByAbiReader.joinToString { it.versionNumber.toString() }}"
                )
                return
            }

            abiSignatureVersion
        } ?: run {
            val versionsSupportedByAbiReader: Map<Int, AbiSignatureVersion> = AbiSignatureVersion.allSupportedByAbiReader

Response:
.associateBy { it.versionNumber }

            val abiSignatureVersion = library.versions.irSignatureVersions
                    .map { it.number }
                    .sortedDescending()
                    .firstNotNullOfOrNull { versionsSupportedByAbiReader[it] }

            if (abiSignatureVersion == null) {
                output.logError(<|endoftext|>


Prompt:
@JvmGradlePluginTests
    @GradleTest
    fun languageVersionOverride(gradleVersion: GradleVersion) {
        project(
            "simpleProject",
            gradleVersion,
            buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)
        ) {
            enableTryNext()

            buildGradle.appendText(
                """
                |

Response:
|kotlin.compilerOptions.languageVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
                """.trimMargin()
            )

            build("compileKotlin") {
                assertTasksExecuted(":compileKotlin")<|endoftext|>


Prompt:
import org.jetbrains.kotlin.asJava.elements.KtLightField
import org.jetbrains.kotlin.asJava.elements.KtLightMethod
import org.jetbrains.kotlin.light.classes.symbol.cachedValue
import org.jetbrains.kotlin.light.classes.symbol.fields.SymbolLightField

Response:
import org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightMethodForScriptDefaultConstructor
import org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightMethodForScriptMain
import org.jetbrains.kotlin.light.classes.symbol.modifierLists.InitializedModifiersBox<|endoftext|>


Prompt:
// error goes on the non-composable function with composable calls
    @JvmField
    val COMPOSABLE_EXPECTED =
        DiagnosticFactory0.create<PsiElement>(
            Severity.ERROR
        )

    @JvmField
    val COMPOSABLE_FUNCTION_REFERENCE =
        DiagnosticFactory0.create<KtCallableReferenceExpression>(

Response:
Severity.ERROR
        )

    @JvmField
    val COMPOSABLE_PROPERTY_BACKING_FIELD =
        DiagnosticFactory0.create<PsiElement>(
            Severity.ERROR
        )

    @JvmField
    val COMPOSABLE_VAR =
        DiagnosticFactory0.create<PsiElement>(
            Severity.ERROR
        )<|endoftext|>


Prompt:
override fun getVisibility(): DescriptorVisibility = owner.visibility

    override fun isExpect(): Boolean = false

    override fun isActual(): Boolean = owner.isActual

    override fun isExternal(): Boolean = false

    override fun <R : Any?, D : Any?> accept(visitor: DeclarationDescriptorVisitor<R, D>, data: D): R =

Response:
visitor.visitTypeAliasDescriptor(this, data)

    override fun acceptVoid(visitor: DeclarationDescriptorVisitor<Void, Void>) {
        visitor.visitTypeAliasDescriptor(this, null)
    }
}

fun IrTypeAlias.toIrBasedDescriptor() = IrBasedTypeAliasDescriptor(this)<|endoftext|>


Prompt:
fun testUnusedDefaultComposableLambda(): Unit = defaultParams(
        """
        """,
        """
            inline fun Bar(unused: @Composable () -> Unit = { }) {}
            fun Foo() { Bar() }
        """
    )

    @Test
    fun testNonStaticDefaultExpressions(): Unit = defaultParams(
        """
            fun makeInt(): Int = 123

Response:
""",
        """
            @Composable
            fun Test(x: Int = makeInt()) {
                used(x)
            }
        """
    )

    @Test
    fun testEarlierParameterReferences(): Unit = defaultParams(
        """
        """,
        """
            @Composable
            fun A(a: Int = 0, b: Int = a + 1) {<|endoftext|>


Prompt:
to(Inv(take({ a, b, c, d -> }, { a, b, c, d -> })), Inv { a, b, c, d -> }),
            to(Inv(take({ a, b, c, d -> }, { a, b, c, d -> })), Inv { a, b, c, d -> }),

Response:
to(Inv(take({ a, b, c, d -> }, { a, b, c, d -> })), Inv { a, b, c, d -> }),
        )
}<|endoftext|>


Prompt:
inline fun isClassLocal(classNode: LighterASTNode, getParent: LighterASTNode.() -> LighterASTNode?): Boolean {
    var currentNode: LighterASTNode? = classNode
    while (currentNode != null) {
        val tokenType = currentNode.tokenType
        val parent = currentNode.getParent()
        val parentTokenType = parent?.tokenType

Response:
if (tokenType == PROPERTY || tokenType == FUN) {
            val grandParent = parent?.getParent()
            when {
                parentTokenType == KT_FILE -> return true
                parentTokenType == CLASS_BODY && !(grandParent?.tokenType == OBJECT_DECLARATION && grandParent?.getParent()?.tokenType == OBJECT_LITERAL) -> return true<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("In<*>? & In<*>")!>a<!>.propT
        <!DEBUG_INFO_EXPRESSION_TYPE("In<*>? & In<*>")!>a<!>.propAny

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("In<*>? & In<*>")!>a<!>.propNullableT
        <!DEBUG_INFO_EXPRESSION_TYPE("In<*>? & In<*>")!>a<!>.propNullableAny<|endoftext|>


Prompt:
if  (plusZeroAny != minusZeroAny) return "IEEE 754 quals fail 2"
    }

    return "OK"
}

fun box(): String {
    val plusZero: Double = +0.0
    val minusZero: Double = -0.0

    if (plusZero.equals(minusZero)) return "Total order fail"

Response:
if (plusZero != minusZero) return "IEEE 754 equals fail"

    val plusZeroFloat: Float = +0.0f
    val minusZeroFloat: Float = -0.0f

    if (plusZeroFloat.equals(minusZeroFloat)) return "Total order fail 2"
    if (plusZeroFloat != minusZeroFloat) return "IEEE 754 equals fail 2"<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.renderer.FirErrorExpressionExtendedRenderer
import org.jetbrains.kotlin.fir.renderer.FirRenderer
import org.jetbrains.kotlin.fir.renderer.FirResolvePhaseRenderer

Response:
import org.jetbrains.kotlin.fir.resolve.calls.FirSyntheticPropertiesScope
import org.jetbrains.kotlin.fir.resolve.defaultType
import org.jetbrains.kotlin.fir.scopes.FirContainingNamesAwareScope
import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope<|endoftext|>


Prompt:
"kotlin/ranges/LongProgression"
        )
    }

    override fun merge(v: BasicValue, w: BasicValue) =
        mergeStackValues(v, w)

    fun mergeLocalVariableValues(v: BasicValue, w: BasicValue) =
        merge(v, w, isLocalVariable = true)

Response:
fun mergeStackValues(v: BasicValue, w: BasicValue) =
        merge(v, w, isLocalVariable = false)

    private fun merge(v: BasicValue, w: BasicValue, isLocalVariable: Boolean) =
        when {
            v === StrictBasicValue.UNINITIALIZED_VALUE || w === StrictBasicValue.UNINITIALIZED_VALUE -><|endoftext|>


Prompt:
private fun incCounter() {
        cancelledTracker.andIncrement
    }

    override fun getModificationCount(): Long {
        return cancelledTracker.get()
    }

    override fun toString(): String {
        return this::class.java.name + ": " + modificationCount
    }
}

object CacheResetOnProcessCanceled {

Response:
private const val PROPERTY = "kotlin.internal.cacheResetOnProcessCanceled"
    private const val DEFAULT_VALUE = false

    var enabled: Boolean
        get() = PropertiesComponent.getInstance()?.getBoolean(PROPERTY, DEFAULT_VALUE) ?: DEFAULT_VALUE
        set(value) {<|endoftext|>


Prompt:
valueType: ConeKotlinType,
        expectedType: ConeKotlinType,
    ) =
        with(implicitCastInserter) {
            this@insertImplicitCast.insertSpecialCast(baseExpression, valueType, expectedType)
        }

    override fun visitProperty(property: FirProperty, data: Any?): IrElement = whileAnalysing(session, property) {

Response:
if (property.isLocal) return visitLocalVariable(property)
        @OptIn(UnsafeDuringIrConstructionAPI::class)
        val irProperty = declarationStorage.getCachedIrPropertySymbol(property, fakeOverrideOwnerLookupTag = null)?.owner
            ?: return IrErrorExpressionImpl(
                UNDEFINED_OFFSET, UNDEFINED_OFFSET,<|endoftext|>


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

@Target(AnnotationTarget.PROPERTY)
annotation class Anno

OPTIONAL_JVM_INLINE_ANNOTATION
value class Z<T: String>(val s: T)

class A {
    @Anno

Response:
val Z<String>.r: String get() = s
}

fun box(): String {
    with(A()) {
        return Z("OK").r
    }
}<|endoftext|>


Prompt:
if (rhs in suspendCalls && lhs.isStateMachineResult()) {
                            suspendCalls -= rhs
                        }
                    }
                }
            }
        })

        return suspendCalls.isEmpty()
    }

    private fun transformSimple() {
        val continuationParam = function.parameters.last()
        val resultVar = JsScope.declareTemporaryName("\$result")

Response:
body.replaceSpecialReferencesInSimpleFunction(continuationParam, resultVar)
        body.statements.add(0, newVar(resultVar, null).apply { synthetic = true })

        object : JsVisitorWithContextImpl() {
            override fun endVisit(x: JsExpressionStatement, ctx: JsContext<in JsStatement>) {
                if (x.expression.isSuspend) {<|endoftext|>


Prompt:
@kotlin.internal.InlineOnly
public inline fun kotlin.ShortArray.sumOf(selector: (kotlin.Short) -> kotlin.Long): kotlin.Long

@kotlin.SinceKotlin(version = "1.5")
@kotlin.OverloadResolutionByLambdaReturnType

Response:
@kotlin.jvm.JvmName(name = "sumOfUInt")
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})
@kotlin.internal.InlineOnly
public inline fun kotlin.ShortArray.sumOf(selector: (kotlin.Short) -> kotlin.UInt): kotlin.UInt<|endoftext|>


Prompt:
fun evalBinaryOp(name: String, leftType: CompileTimeType, left: Any, rightType: CompileTimeType, right: Any): Any? {
    when (leftType) {
        BOOLEAN -> when (rightType) {
            BOOLEAN -> when (name) {
                "and" -> return (left as Boolean).and(right as Boolean)

Response:
"compareTo" -> return (left as Boolean).compareTo(right as Boolean)
                "or" -> return (left as Boolean).or(right as Boolean)
                "xor" -> return (left as Boolean).xor(right as Boolean)
            }
            ANY -> when (name) {
                "equals" -> return (left as Boolean).equals(right)
            }
            else -> {}<|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:
moduleData: FirModuleData,
    index: Int,
): FirValueParameter = buildJavaValueParameter {
    source = (this@toFirValueParameter as? JavaElementImpl<*>)?.psi?.toKtPsiSourceElement()
    isFromSource = this@toFirValueParameter.isFromSource
    this.moduleData = moduleData
    containingFunctionSymbol = functionSymbol

Response:
name = this@toFirValueParameter.name ?: Name.identifier("p$index")
    returnTypeRef = type.toFirJavaTypeRef(session, source)
    isVararg = this@toFirValueParameter.isVararg
    annotationBuilder = { convertAnnotationsToFir(session, source) }
}

internal fun JavaAnnotationArgument.toFirExpression(<|endoftext|>


Prompt:
<!CONDITION_TYPE_MISMATCH, TYPE_MISMATCH!>Pair(1, 2)<!> -> 3
        <!ARGUMENT_TYPE_MISMATCH, EXPECTED_CONDITION!>in 1..10<!> -> 34
        <!CONDITION_TYPE_MISMATCH!>4<!> -> 38

Response:
<!EXPECTED_CONDITION, USELESS_IS_CHECK!>is Int<!> -> 33
        else -> 34
    }

fun cond1() = false

fun cond2() = true<|endoftext|>


Prompt:
import org.jetbrains.kotlin.builtins.PrimitiveType
import org.jetbrains.kotlin.builtins.UnsignedType
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.builders.andand
import org.jetbrains.kotlin.ir.builders.irBlock

Response:
import org.jetbrains.kotlin.ir.builders.irCall
import org.jetbrains.kotlin.ir.builders.irInt
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.IrSymbolOwner<|endoftext|>


Prompt: <!NO_ACTUAL_FOR_EXPECT{JVM}!><!DEPRECATED_MODIFIER, INCOMPATIBLE_MODIFIERS!>header<!> <!INCOMPATIBLE_MODIFIERS!>actual<!> class <!ACTUAL_WITHOUT_EXPECT, ACTUAL_WITHOUT_EXPECT{METADATA}!>Third<!><!>

Response: <!NO_ACTUAL_FOR_EXPECT{JVM}!><!DEPRECATED_MODIFIER, INCOMPATIBLE_MODIFIERS!>impl<!> <!INCOMPATIBLE_MODIFIERS!>expect<!> class <!ACTUAL_WITHOUT_EXPECT, ACTUAL_WITHOUT_EXPECT{METADATA}!>Fourth<!><!><|endoftext|>


Prompt:
else -> null
            }
        }
    }
}

fun Any?.toIrConst(irType: IrType, startOffset: Int = SYNTHETIC_OFFSET, endOffset: Int = SYNTHETIC_OFFSET): IrConst<*> =
    toIrConstOrNull(irType, startOffset, endOffset)

Response:
?: throw UnsupportedOperationException("Unsupported const element type ${irType.makeNotNull().render()}")

val IrDeclaration.parentsWithSelf: Sequence<IrDeclarationParent>
    get() = generateSequence(this as? IrDeclarationParent) { (it as? IrDeclaration)?.parent }

val IrDeclaration.parents: Sequence<IrDeclarationParent><|endoftext|>


Prompt:
target.append("[CIRCULAR REFERENCE, SEE ABOVE: ").append(shortInfo).append("]\n")
            return false
        }
        visited.asDynamic().push(this)

        var stack = this.asDynamic().stack as String?
        if (stack != null) {

Response:
val stackStart = stack.indexOf(shortInfo).let { if (it < 0) 0 else it + shortInfo.length }
            if (stackStart == 0) target.append(shortInfo).append("\n")
            if (topStack.isEmpty()) {
                topStack = stack
                topStackStart = stackStart
            } else {
                stack = dropCommonFrames(stack, stackStart)
            }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.js.backend.ast.*
import org.jetbrains.kotlin.js.parser.parseExpressionOrStatement

/**
 * Returns null if constant expression could not be parsed.
 */
fun translateJsCodeIntoStatementList(code: IrExpression, context: JsIrBackendContext?, container: IrDeclaration) =
    translateJsCodeIntoStatementList(

Response:
code,
        context,
        code.getStartSourceLocation(container) ?: container.fileOrNull?.fileEntry?.let { JsLocation(it.name, 0, 0) }
    )

/**
 * Returns null if constant expression could not be parsed.
 */
fun translateJsCodeIntoStatementList(code: IrExpression, context: JsIrBackendContext?, fileEntry: IrFileEntry) =<|endoftext|>


Prompt:
compileKotlin.getDefaultCompilerClasspath${'$'}$pluginSuffix().setFrom(files($originalPaths).toList())
                afterEvaluate {
                    kaptGenerateStubsKotlin.getDefaultCompilerClasspath${'$'}$pluginSuffix().setFrom(files($originalPaths).toList())
                }
                """.trimIndent()
            )

Response:
}

        override fun mutateProject(project: TestProject) = with(project) {
            buildGradle.modify {
                val modifiedClasspath = originalCompilerCp.map {
                    val file = File(it)
                    val newFile = projectPath.resolve(file.nameWithoutExtension + "-1.jar").toFile()
                    file.copyTo(newFile)<|endoftext|>


Prompt:
package org.jetbrains.kotlin.incremental

import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
import java.io.File

Response:
abstract class AbstractIncrementalK2PsiJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() {
    override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments =
        super.createCompilerArguments(destinationDir, testDir).apply {
            languageVersion = "2.0"
            useFirIC = false<|endoftext|>


Prompt:
doTest((3u.toUShort() downTo 5u.toUShort()).reversed(), 5u, 3u, 1, listOf())
        doTest((3uL downTo 5uL).reversed(), 5uL, 3uL, 1L, listOf())
    }

    @Test fun reversedRange() {

Response:
doTest((3..5).reversed(), 5, 3, -1, listOf(5, 4, 3))
        doTest((3.toByte()..5.toByte()).reversed(),5, 3, -1, listOf(5, 4, 3))<|endoftext|>


Prompt:
package org.jetbrains.kotlin.js.inline.clean

import org.jetbrains.kotlin.js.backend.ast.*
import org.jetbrains.kotlin.js.backend.ast.JsExpression.JsExpressionHasArguments
import org.jetbrains.kotlin.js.backend.ast.metadata.HasMetadata

Response:
import org.jetbrains.kotlin.js.backend.ast.metadata.isInlineClassBoxing
import org.jetbrains.kotlin.js.backend.ast.metadata.isInlineClassUnboxing
import org.jetbrains.kotlin.js.backend.ast.metadata.isJsCall
import org.jetbrains.kotlin.js.inline.util.isCallInvocation<|endoftext|>


Prompt:
.declarationKind(functionSymbol, capitalized = false).append(" requires")

    else ->
        append("The call site provides ").append(if (expressionValueArgumentCount > functionValueParameterCount) "more" else "less")
            .append(" value arguments (").append(expressionValueArgumentCount.toString()).append(") than the ")

Response:
.declarationKind(functionSymbol, capitalized = false).append(" requires (")
            .append(functionValueParameterCount.toString()).append(")")
}

private fun Appendable.invalidSamConversion(
    expression: IrTypeOperatorCall,
    abstractFunctionSymbols: Set<IrSimpleFunctionSymbol>,
    abstractPropertySymbol: IrPropertySymbol?,<|endoftext|>


Prompt:
typealias C = B
                    typealias X = C
                """.trimIndent()
            )

            simpleSingleSourceTarget(
                "b", """
                    typealias A = Long
                    typealias B = A
                    typealias X = B
                """.trimIndent()
            )
        }

        result.assertCommonized(
            "(a, b)", """

Response:
@UnsafeNumber(["a: kotlin.Int", "b: kotlin.Long"])
                typealias A = Int
                @UnsafeNumber(["a: kotlin.Int", "b: kotlin.Long"])
                typealias B = A
                @UnsafeNumber(["a: kotlin.Int", "b: kotlin.Long"])
                typealias X = B<|endoftext|>


Prompt:
}

@Deprecated("Use Kotlin compiler 1.4 to avoid deprecation warning.")
@DeprecatedSinceKotlin(hiddenSince = "1.4")
public inline infix fun <T> Array<out T>.contentEqualsMy(other: Array<out T>): Boolean {
    return this.contentEqualsMy(other)
}

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

Response:
import kotlin.test.*

fun box(): String {
    val arr = arrayOf(1, 2, 3)
    return if (arr contentEqualsMy arr) "OK" else "fail"
}<|endoftext|>


Prompt:
.map { (target, copy) -> target.takeUnless { it is FirLazyDelegatedConstructorCall } ?: copy }

            targetCall.replaceDelegatedConstructorCalls(newCalls)
        }
    }
}

private fun replaceLazyInitializer(target: FirVariable, copy: FirVariable) {
    if (target.initializer is FirLazyExpression) {

Response:
target.replaceInitializer(copy.initializer)
    }
}

private fun replaceLazyDelegate(target: FirVariable, copy: FirVariable) {
    if (target.delegate is FirLazyExpression) {
        target.replaceDelegate(copy.delegate)
    }
}

private fun calculateLazyBodiesForFunction(designation: FirDesignation) {<|endoftext|>


Prompt:
private fun doStaticMembersLowering(modules: Iterable<IrModuleFragment>) {
        modules.forEach { module ->
            module.files.forEach {
                it.accept(backendContext.keeper, Keeper.KeepData(classInKeep = false, classShouldBeKept = false))
            }
        }

        modules.forEach { module ->
            module.files.forEach {

Response:
StaticMembersLowering(backendContext).lower(it)
            }
        }
    }

    fun generateModule(modules: Iterable<IrModuleFragment>, modes: Set<TranslationMode>, relativeRequirePath: Boolean): CompilerResult {
        val exportData = associateIrAndExport(modules)
        doStaticMembersLowering(modules)<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>.size
                    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>.isEmpty()

Response:
<!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & M & L & K & T!!")!>x<!>[null]<!>
                }
            }
        }
    }
}

// TESTCASE NUMBER: 2<|endoftext|>


Prompt:
public object BODY_WITH_MEMBERS_OR_EMPTY_BRACES : KtClassifierBodyWithMembersRenderer() {
        override fun renderEmptyBodyForEmptyMemberScope(symbol: KtSymbolWithMembers): Boolean {
            return true
        }
    }
}

public abstract class KtClassifierBodyWithMembersRenderer : KtClassifierBodyRenderer {

Response:
public abstract fun renderEmptyBodyForEmptyMemberScope(symbol: KtSymbolWithMembers): Boolean

    public override fun renderBody(
        analysisSession: KtAnalysisSession,
        symbol: KtSymbolWithMembers,
        declarationRenderer: KtDeclarationRenderer,
        printer: PrettyPrinter,
    ) {<|endoftext|>


Prompt: doTest((MaxUB - 5u).toUByte()..MaxUB step 3, (MaxUB - 5u).toUInt(), (MaxUB - 2u).toUInt(), 3, listOf((MaxUB - 5u).toUInt(), (MaxUB - 2u).toUInt()))

Response: doTest((MaxUS - 5u).toUShort()..MaxUS step 3, (MaxUS - 5u).toUInt(), (MaxUS - 2u).toUInt(), 3, listOf((MaxUS - 5u).toUInt(), (MaxUS - 2u).toUInt()))<|endoftext|>


Prompt:
"авангард",
"авангардизм",
"авангардист",
"авангардистский",
"авангардный",
"аванзал",

Response:
"аванзальный",
"аванкамера",
"аванложа",
"аванпорт",
"аванпост",
"аванпостный",
"аванс",<|endoftext|>


Prompt:
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION, AnnotationTarget.FILE})
@kotlin.SinceKotlin(version = "1.3")
public final annotation class JsExport : kotlin.Annotation {
    public constructor JsExport()

Response:
@kotlin.js.ExperimentalJsExport
    @kotlin.annotation.Retention(value = AnnotationRetention.BINARY)
    @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR})<|endoftext|>


Prompt:
val transitiveDependsOnDependencies: List<KtModule> by lazy { computeTransitiveDependsOnDependencies(directDependsOnDependencies) }

    val directFriendDependencies: List<KtModule> by lazy(LazyThreadSafetyMode.PUBLICATION) {
        buildList {

Response:
testModule.friendDependencies.mapTo(this) { testServices.ktTestModuleStructure.getKtTestModule(it.moduleName).ktModule }
            addAll(
                librariesByRoots(configuration[JVMConfigurationKeys.FRIEND_PATHS].orEmpty().map(Paths::get))
            )
        }
    }

    protected abstract val ktModule: KtModule<|endoftext|>


Prompt:
aInt[0]--
    bInt[0]--
    if (aInt[0] != bInt[0]) return "Failed post-decrement Int: ${aInt[0]} != ${bInt[0]}"

    aInt[0]++
    bInt[0]++

Response:
if (aInt[0] != bInt[0]) return "Failed post-increment Int: ${aInt[0]} != ${bInt[0]}"

    aLong[0]--
    bLong[0]--
    if (aLong[0] != bLong[0]) return "Failed post-decrement Long: ${aLong[0]} != ${bLong[0]}"<|endoftext|>


Prompt:
private fun readLatestConfig(element: Element): KotlinFacetSettings {
    return readV2AndLaterConfig(element) { el, bean -> CompilerArgumentsDeserializerV5(bean).deserializeFrom(el) }
}

fun deserializeFacetSettings(element: Element): KotlinFacetSettings {
    val version = try {
        element.getAttribute("version")?.intValue

Response:
} catch (e: DataConversionException) {
        null
    } ?: KotlinFacetSettings.DEFAULT_VERSION
    return when (version) {
        1 -> readV1Config(element)
        2, 3, 4 -> readV2Config(element)
        KotlinFacetSettings.CURRENT_VERSION -> readLatestConfig(element)<|endoftext|>


Prompt:
package kotlin.text

/**
 * Returns `true` if this character is an ISO control character.
 *
 * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL].
 *
 * @sample samples.text.Chars.isISOControl
 */
@SinceKotlin("1.5")
public actual fun Char.isISOControl(): Boolean {

Response:
return this <= '\u001F' || this in '\u007F'..'\u009F'
}

/**
 * Returns `true` if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).
 */<|endoftext|>


Prompt:
if (a2.arg != 2) return "fail5': ${a2.arg}"
    if (sideEffects != "zero#first#second#fourth") return "fail6: ${sideEffects}"

    sideEffects = ""
    val a3 = A(false)
    if (a3.prop != "") return "fail7: ${a3.prop}"

Response:
if (a3.parentProp != "2") return "fail8: ${a3.parentProp}"
    if (a3.arg != 2) return "fail9': ${a3.arg}"
    if (sideEffects != "zero#first#second") return "fail10: ${sideEffects}"
    return "OK"
}<|endoftext|>


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

// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 2 java/lang/invoke/LambdaMetafactory

fun interface IFoo {
    fun foo(): String
}

Response:
fun foo(iFoo: IFoo) = iFoo.foo()

open class C1 {
    open fun test() = foo { "O" }
}

class C2 : C1() {
    override fun test() = foo { "K" }
}

fun box() =
    C1().test() + C2().test()<|endoftext|>


Prompt:
if (old.hasEffectType()) {
            if (old.effectType != new.effectType) return false
        }

        if (!checkEqualsEffectEffectConstructorArgument(old, new)) return false

        if (old.hasConclusionOfConditionalEffect() != new.hasConclusionOfConditionalEffect()) return false
        if (old.hasConclusionOfConditionalEffect()) {

Response:
if (!checkEquals(old.conclusionOfConditionalEffect, new.conclusionOfConditionalEffect)) return false
        }

        if (old.hasKind() != new.hasKind()) return false
        if (old.hasKind()) {
            if (old.kind != new.kind) return false
        }

        return true
    }<|endoftext|>


Prompt: 0x4007debe547f90a3UL,     0x4008d089920f1c3aUL,     0x4006aad9fbb38575UL,     0x4008f93e53990449UL,

Response:
0x400921fb54442d18UL,     0x0UL,     0x3ff921fb54442d18UL,     0x10000000000001UL,
            0x7ff8000000000000UL,     0x157a015c0bc0eef1UL,     0x3ff921fb54442d18UL,     0x3ff921fb5444011dUL,<|endoftext|>


Prompt:
val defaultParam = scope.defaultParameter

        // restartable functions get extra logic and different types of groups from
        // non-restartable functions, and lambdas get no groups at all.
        return when {
            isLambda && isTracked -> visitComposableLambda(
                declaration,
                scope,
                changedParam
            )

Response:
restartable && isTracked -> visitRestartableComposableFunction(
                declaration,
                scope,
                changedParam,
                defaultParam
            )
            else -> visitNonRestartableComposableFunction(
                declaration,
                scope,
                changedParam,
                defaultParam
            )
        }
    }

    // Currently, we make all composable functions restartable by default, unless:<|endoftext|>


Prompt:
assertSuccessful()
            assertTasksExecuted(*processResourcesTasks.toTypedArray())

            targetsWithResources.forEach {
                assertFileExists("build/processedResources/$it/main/commonMainResource.txt")
                assertFileExists("build/processedResources/$it/main/${it}MainResource.txt")
            }
        }
    }

Response:
override val defaultGradleVersion: GradleVersionRequired
        get() = gradleVersion

    @Test
    fun testSourceSetCyclicDependencyDetection() = with(Project("sample-lib", gradleVersion, "new-mpp-lib-and-app")) {
        setupWorkingDir()
        gradleBuildScript().appendText(
            "\n" + """<|endoftext|>


Prompt:
class TestAdhocComponent1(val service: TestAdhocComponentService) {

}

class TestAdhocComponent2(val service: TestAdhocComponentService) {

}

class TestIterableComponent(val components: Iterable<TestClientComponentInterface>)

interface TestGenericComponent<T>

Response:
class TestGenericClient(val component1 : TestGenericComponent<String>, val component2: TestGenericComponent<Int>)
class TestStringComponent : TestGenericComponent<String>
class TestIntComponent : TestGenericComponent<Int>

class TestImplicitGeneric<T>()
class TestImplicitGenericClient(val component: TestImplicitGeneric<String>)<|endoftext|>


Prompt:
const val CFLAGS_PROPERTY = "kotlin.native.cocoapods.cflags"
        const val HEADER_PATHS_PROPERTY = "kotlin.native.cocoapods.paths.headers"
        const val FRAMEWORK_PATHS_PROPERTY = "kotlin.native.cocoapods.paths.frameworks"

Response:
const val GENERATE_WRAPPER_PROPERTY = "kotlin.native.cocoapods.generate.wrapper"
    }
}

/**
 * Extends a KotlinArtifact with a corresponding Podspec
 *
 * Only needed in *.kts build files. In Groovy you can use the same syntax but without explicit extension import
 */<|endoftext|>


Prompt:
val root = createCirTreeRootFromSourceCode(
            """
            class X
            class Y
            typealias A = X
            typealias B = Y
            typealias C = B
            """.trimIndent()
        )

        val classifiers = CirKnownClassifiers(
            classifierIndices = TargetDependent(target to CirClassifierIndex(root)),

Response:
targetDependencies = TargetDependent(target to CirProvidedClassifiers.EMPTY),
            commonizedNodes = CirCommonizedClassifierNodes.default(),
            commonDependencies = CirProvidedClassifiers.EMPTY
        )

        val idOfX = CirEntityId.create("X")
        val idOfY = CirEntityId.create("Y")<|endoftext|>


Prompt:
override val annotations: List<AnnotationStub> = emptyList(),
                val constant: ConstantStub? = null
        ) : Getter()

        class GetConstructorParameter(
                val constructorParameter: FunctionParameterStub,
                override val annotations: List<AnnotationStub> = emptyList()
        ) : Getter()

        class ExternalGetter(

Response:
override val annotations: List<AnnotationStub> = emptyList()
        ) : Getter()

        class ArrayMemberAt(
                val offset: Long
        ) : Getter() {
            override val parameters: List<FunctionParameterStub> = emptyList()
            override val annotations: List<AnnotationStub> = emptyList()
        }

        class MemberAt(
                val offset: Long,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.sam.getAbstractMembers
import org.jetbrains.kotlin.resolve.source.getPsi

class FunInterfaceDeclarationChecker : DeclarationChecker {
    override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {
        if (declaration !is KtClass) return

Response:
if (descriptor !is ClassDescriptor || !descriptor.isFun) return

        val funKeyword = declaration.getFunKeyword() ?: return

        val abstractMembers = getAbstractMembers(descriptor)
        for (abstractMember in abstractMembers) {
            if (abstractMember !is PropertyDescriptor) continue

            val reportOnProperty = abstractMember.containingDeclaration == descriptor<|endoftext|>


Prompt:
val <!EXPOSED_PROPERTY_TYPE!>z<!> = <!INACCESSIBLE_TYPE!><!INVISIBLE_REFERENCE!>MyJavaClass<!>.<!INVISIBLE_MEMBER!>NestedClass<!>()<!>

//FILE: c.kt
package a.c

import a.<!INVISIBLE_REFERENCE!>MyJavaClass<!>

Response:
val <!EXPOSED_PROPERTY_TYPE!>mc1<!> = <!INACCESSIBLE_TYPE!><!INVISIBLE_MEMBER!>MyJavaClass<!>()<!>

val x = <!INVISIBLE_REFERENCE!>MyJavaClass<!>.<!INVISIBLE_MEMBER!>staticMethod<!>()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.classId
import org.jetbrains.kotlin.types.*

Response:
import org.jetbrains.kotlin.types.error.ErrorTypeKind
import org.jetbrains.kotlin.types.error.ErrorUtils
import org.jetbrains.kotlin.types.typeUtil.replaceArgumentsWithStarProjections

abstract class ConstantValue<out T>(open val value: T) {
    abstract fun getType(module: ModuleDescriptor): KotlinType<|endoftext|>


Prompt:
externalModule.writeAsJsModule(jsCode, file.nameWithoutExtension)
                    externalModule.canonicalPath
                }
            }
        }

        private fun verifyJsCode(stepId: Int, mainModuleName: String, jsFiles: List<String>) {
            try {
                V8IrJsTestChecker.checkWithTestFunctionArgs(
                    files = jsFiles,

Response:
testModuleName = "./$mainModuleName${projectInfo.moduleKind.extension}",
                    testPackageName = null,
                    testFunctionName = BOX_FUNCTION_NAME,
                    testFunctionArgs = "$stepId",
                    expectedResult = "OK",
                    withModuleSystem = projectInfo.moduleKind in setOf(ModuleKind.COMMON_JS, ModuleKind.UMD, ModuleKind.AMD),<|endoftext|>


Prompt:
reifiedAsSucceeds<Function5<*, *, *, *, *, *>>(
                    x, "x as Function5<*, *, *, *, *, *>")
    override fun testBad(x: Any) =
            reifiedAsFailsWithCCE<Function5<*, *, *, *, *, *>>(

Response:
x, "x as Function5<*, *, *, *, *, *>")
}

object TestFn6 : TestFnBase {
    override fun testGood(x: Any) =
            reifiedAsSucceeds<Function6<*, *, *, *, *, *, *>>(<|endoftext|>


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

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?"), DEBUG_INFO_SMARTCAST!>y<!>.funT()
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?"), DEBUG_INFO_SMARTCAST!>y<!>.funAny()<|endoftext|>


Prompt:
}

    fun register(process: Process) = processes.add(process)

    fun deregister(process: Process) = processes.remove(process)
}

private fun <T> ProcessBuilder.scoped(block: suspend CoroutineScope.(Process) -> T): T {
    val process = start()
    // Make sure the process is killed even if the jvm process is being destroyed.

Response:
// e.g. gradle --no-daemon task execution was cancelled by the user pressing ^C
    ProcessKiller.register(process)
    return try {
        val result = runBlocking(Dispatchers.IO) {
            block(process)
        }
        result
    } finally {
        // Make sure the process is killed even if the current thread was interrupted.<|endoftext|>


Prompt:
scopeTower: ImplicitScopeTower,
        resolutionCallbacks: KotlinResolutionCallbacks,
        kotlinCall: KotlinCall,
        expectedType: UnwrappedType?,
        collectAllCandidates: Boolean,
    ): CallResolutionResult {
        val candidateFactory = createFactory(scopeTower, kotlinCall, resolutionCallbacks, expectedType)

Response:
val candidates = resolveCall(scopeTower, resolutionCallbacks, kotlinCall, collectAllCandidates, candidateFactory)

        if (collectAllCandidates) {
            return kotlinCallCompleter.createAllCandidatesResult(candidates, expectedType, resolutionCallbacks)
        }

        return kotlinCallCompleter.runCompletion(candidateFactory, candidates, expectedType, resolutionCallbacks)<|endoftext|>


Prompt:
* Computes the inverse hyperbolic tangent of the value [x].
 *
 * The returned value is `y` such that `tanh(y) == x`.
 *
 * Special cases:
 *   - `tanh(NaN)` is `NaN`
 *   - `tanh(x)` is `NaN` when `x > 1` or `x < -1`

Response:
*   - `tanh(1.0)` is `+Inf`
 *   - `tanh(-1.0)` is `-Inf`
 */
@SinceKotlin("1.2")
@InlineOnly
public actual inline fun atanh(x: Double): Double = nativeAtanh(x)

/**<|endoftext|>


Prompt:
val performanceManager = moduleConfiguration[CLIConfigurationKeys.PERF_MANAGER]
    performanceManager?.notifyAnalysisStarted()

    var librariesScope = projectEnvironment.getSearchScopeForProjectLibraries()
    val rootModuleName = input.targetId.name

    val incrementalCompilationScope = createIncrementalCompilationScope(
        moduleConfiguration,
        projectEnvironment,
        incrementalExcludesScope

Response:
)?.also { librariesScope -= it }

    val extensionRegistrars = FirExtensionRegistrar.getInstances(projectEnvironment.project)

    val allSources = mutableListOf<KtSourceFile>().apply {
        addAll(input.groupedSources.commonSources)
        addAll(input.groupedSources.platformSources)
    }
    // TODO: handle friends paths<|endoftext|>


Prompt:
val thenLabel = Label()
                expressionToLabels.add(ExpressionToLabel(branch.result, thenLabel))
                callToLabels += conditions.map { CallToLabel(it, thenLabel) }
            }
        }

        // switch isn't applicable if there's no case at all, e.g., when() { else -> ... }
        if (callToLabels.size == 0)

Response:
return null

        val calls = callToLabels.map { it.call }

        // To generate a switch from a when it must be a comparison of a single
        // variable, the "subject", against a series of constants. We assume the
        // subject is the left hand side of the first condition, provided the
        // first condition is a comparison. If the first condition is of the form:
        //<|endoftext|>


Prompt:
* Returns the size of a regular file as a [Long] value of bytes or throws an exception if the file doesn't exist.
 *
 * @throws IOException if an I/O error occurred.
 * @see Files.size
 */
@SinceKotlin("1.5")
@WasExperimental(ExperimentalPathApi::class)
@Throws(IOException::class)
@kotlin.internal.InlineOnly

Response:
public inline fun Path.fileSize(): Long =
    Files.size(this)

/**
 * Deletes the existing file or empty directory specified by this path.
 *
 * @throws NoSuchFileException if the file or directory does not exist.
 * @throws DirectoryNotEmptyException if the directory exists but is not empty.
 *
 * @see Files.delete
 */
@SinceKotlin("1.5")<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor()
    constructor()
}

class TestTypeParameterWithIdenticalUpperBoundsB<T: UserInterface> {
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor(arg: T)
    constructor(arg: T)
}

Response:
class TestTypeParameterWithIdenticalUpperBoundsC<T: UserInterface> {
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor(arg: Invariant<T>)
    constructor(arg: Invariant<T>)
}

class TestTypeParameterWithMultipleIdenticalUpperBoundsAA<T> where T: UserInterfaceA, T: UserInterfaceB {<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// WITH_REFLECT
// FILE: box.kt

import kotlin.test.assertTrue
import kotlin.test.assertFalse

sealed class S {
    data class DataClass(val x: Int) : S()
    data object DataObject
    inner class InnerClass
    companion object
    object RegularObject
    fun interface FunInterface { fun invoke() }
}

Response:
@JvmInline
value class V(val value: String)

fun box(): String {
    assertTrue(S::class.isSealed)
    assertFalse(S::class.isFinal)
    assertFalse(S::class.isOpen)
    assertFalse(S::class.isAbstract)
    assertFalse(S::class.isData)
    assertFalse(S::class.isInner)<|endoftext|>


Prompt:
// CHECK_CASES_COUNT: function=crash count=2 TARGET_BACKENDS=JS
// CHECK_IF_COUNT: function=crash count=1 TARGET_BACKENDS=JS

class EncapsulatedEnum<T : Enum<T>>(val value: T)

enum class MyEnum(val value: String) {
    VALUE_A("OK"),

Response:
VALUE_B("fail"),
}

private fun crash(encapsulated: EncapsulatedEnum<*>) {
    val myEnum = encapsulated.value
    if (myEnum !is MyEnum) {
        return
    }

    when (myEnum) {
        MyEnum.VALUE_A -> res = myEnum.value<|endoftext|>


Prompt:
"@" + RenderIrElementVisitorForDiagnosticText.renderAsAnnotation(it)
    }

    @JvmField
    val MODULE_WITH_PLATFORM = Renderer<ModuleDescriptor> { module ->
        val platform = module.platform
        val moduleName = module.getCapability(ModuleInfo.Capability)?.displayedName ?: module.name.asString()

Response:
val platformNameIfAny = if (platform == null || platform.isCommon()) "" else " for " + platform.single().platformName
        moduleName + platformNameIfAny
    }
}<|endoftext|>


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

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


Prompt:
fun finally() {}

    fun case3() {
        finally()
    }
}

// TESTCASE NUMBER: 4
class Case4 {
    class finally() {}

    fun case4() {
        val c = finally()
    }
}

// TESTCASE NUMBER: 5

class Case5() {
    interface finally

    fun case5(){

Response:
val c = object :finally{}
    }
}<|endoftext|>


Prompt:
+receivers
            +field("source", sourceElementType, nullable = true, withReplace = true)
            +fieldList("nonFatalDiagnostics", coneDiagnosticType, useMutableOrEmpty = true, withReplace = true)
        }

        qualifiedErrorAccessExpression.configure {
            +field("selector", errorExpression)
            +field("receiver", expression)

Response:
}

        literalExpression.configure {
            val t = withArg("T")
            +field("kind", constKindType.withArgs(t), withReplace = true)
            +field("value", t)
        }

        functionCall.configure {
            +field("calleeReference", namedReference)
            +field("origin", functionCallOrigin)
        }<|endoftext|>


Prompt: inline fun <reified P1, reified P2, reified P3, reified P4, reified P5, reified P6, reified P7, reified P8, reified P9, reified P10, reified P11, reified P12, reified R> staticCFunction(noinline function: (P1, P2, P3, P4, P5, P6, P7,

Response: P8, P9, P10, P11, P12) -> R): CPointer<CFunction<(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) -> R>> =<|endoftext|>


Prompt:
package org.jetbrains.kotlin.contracts.model.structure

import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.types.KotlinType

sealed class ESType {
    abstract fun toKotlinType(builtIns: KotlinBuiltIns): KotlinType
}

Response:
abstract class ESBuiltInType : ESType()

object ESAnyType : ESBuiltInType() {
    override fun toKotlinType(builtIns: KotlinBuiltIns): KotlinType = builtIns.anyType
}

object ESNullableAnyType : ESBuiltInType() {
    override fun toKotlinType(builtIns: KotlinBuiltIns): KotlinType = builtIns.nullableAnyType<|endoftext|>


Prompt:
package org.jetbrains.kotlin.frontend.java.di

import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsPackageFragmentProvider

Response:
import org.jetbrains.kotlin.config.JvmAnalysisFlags
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.config.LanguageVersionSettings
import org.jetbrains.kotlin.container.*
import org.jetbrains.kotlin.context.ModuleContext<|endoftext|>


Prompt:
createEnumEntruStub(descriptor, it).insertDeclaration(data)
            }
        } else {
            symbolTable.descriptorExtension.declareClassIfNotExists(descriptor) {
                createClassStub(descriptor, it).insertDeclaration(data)
            }
        }
    }

Response:
private fun declareTypeAliasStub(descriptor: TypeAliasDescriptor, symbol: IrTypeAliasSymbol): IrTypeAlias {
        return generator.generateTypeAlias(offset, offset, IrDeclarationOrigin.DEFINED, descriptor, symbol)
    }

    override fun visitTypeAliasDescriptor(descriptor: TypeAliasDescriptor, data: IrDeclarationContainer?) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.utils.exceptions.withPsiEntry

internal class StubBasedFirDeserializationContext(
    val moduleData: FirModuleData,
    val packageFqName: FqName,
    val relativeClassName: FqName?,
    val typeDeserializer: StubBasedFirTypeDeserializer,
    val annotationDeserializer: StubBasedAnnotationDeserializer,

Response:
val containerSource: DeserializedContainerSource?,
    val outerClassSymbol: FirRegularClassSymbol?,
    val outerTypeParameters: List<FirTypeParameterSymbol>,
    val initialOrigin: FirDeclarationOrigin,
    val classLikeDeclaration: KtClassLikeDeclaration? = null
) {
    val session: FirSession get() = moduleData.session<|endoftext|>


Prompt:
* Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
     *
     * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor.
     */
    @SinceKotlin("1.1")
    @kotlin.internal.IntrinsicConstEvaluation

Response:
public inline operator fun rem(other: Short): Int =
        this.toInt() % other.toInt()

    /**
     * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
     *
     * The result is either zero or has the same sign as the _dividend_ and has the absolute value less than the absolute value of the divisor.<|endoftext|>


Prompt:
val UNNECESSARY_LATEINIT: KtDiagnosticFactory0 by warning0<KtProperty>(SourceElementPositioningStrategies.LATEINIT_MODIFIER)
    val BACKING_FIELD_IN_INTERFACE: KtDiagnosticFactory0 by error0<KtProperty>(SourceElementPositioningStrategies.DECLARATION_SIGNATURE)

Response:
val EXTENSION_PROPERTY_WITH_BACKING_FIELD: KtDiagnosticFactory0 by error0<KtExpression>()
    val PROPERTY_INITIALIZER_NO_BACKING_FIELD: KtDiagnosticFactory0 by error0<KtExpression>()<|endoftext|>


Prompt:
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
            fun set(a: String, v: Any, v2: Any)<!> {}

Response:
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeSetter
            fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}<|endoftext|>


Prompt:
val explicitApiVersion by AnalysisFlag.Delegates.Boolean

    @JvmStatic
    val ignoreDataFlowInAssert by AnalysisFlag.Delegates.Boolean

    @JvmStatic
    val explicitApiMode by AnalysisFlag.Delegates.ApiModeDisabledByDefault

    @JvmStatic
    val ideMode by AnalysisFlag.Delegates.Boolean

    @JvmStatic

Response:
val allowUnstableDependencies by AnalysisFlag.Delegates.Boolean

    @JvmStatic
    val libraryToSourceAnalysis by AnalysisFlag.Delegates.Boolean

    @JvmStatic
    val extendedCompilerChecks by AnalysisFlag.Delegates.Boolean

    @JvmStatic
    val allowKotlinPackage by AnalysisFlag.Delegates.Boolean

    @JvmStatic<|endoftext|>


Prompt:
fun case_14(x: Boolean?) {
    do {
        x ?: return
    } while(false)

    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>equals(10)

Response:
}

// TESTCASE NUMBER: 15
fun case_15(x: Boolean?) {
    do {
        x ?: return
        println(1)
    } while(false)

    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean & kotlin.Boolean?")!>x<!><|endoftext|>


Prompt:
if (!source.treeStructure.userType(lightTreeTypeArgument).toString().isUnderscore) continue

            val annotations = source.treeStructure.annotations(lightTreeTypeArgument) ?: continue

            for (annotation in annotations) {
                reporter.reportOn(
                    source.buildChildSourceElement(annotation), FirErrors.UNSUPPORTED,

Response:
"annotations on an underscored type argument", context
                )
            }
        }
    }
}<|endoftext|>


Prompt:
for ((firParameter, irParameter) in typeParameters.zip(irFunction.typeParameters)) {
                    val newBounds = irParameter.superTypes.map { it.toConeType().toFirResolvedTypeRef() }
                    firParameter.replaceBounds(newBounds)
                    firParameter.replaceAnnotations(irParameter.convertAnnotations())
                }

Response:
replaceAnnotations(irFunction.convertAnnotations())
            }
        }

        session.providedDeclarationsForMetadataService.registerDeclaration(firFunction)

        irFunction.metadata = FirMetadataSource.Function(firFunction)
    }

    override fun registerConstructorAsMetadataVisible(irConstructor: IrConstructor) {<|endoftext|>


Prompt:
val rawReturnType = lambda.returnType

        val expectedTypeForReturnArguments = when {
            c.canBeProper(rawReturnType) -> substitute(rawReturnType)

            // For Unit-coercion
            !rawReturnType.isMarkedNullable && c.hasUpperOrEqualUnitConstraint(rawReturnType) -> builtIns.unitType

            else -> null
        }

Response:
val convertedAnnotations = lambda.expectedType?.annotations?.let { annotations ->
            if (receiver != null || expectedReceiver == null) annotations
            else FilteredAnnotations(annotations, true) { it != StandardNames.FqNames.extensionFunctionType }
        }

        @Suppress("UNCHECKED_CAST")<|endoftext|>


Prompt:
package org.jetbrains.kotlin.parcelize.test.runners

import com.intellij.testFramework.TestDataPath
import org.jetbrains.kotlin.parcelize.test.services.SerializableLikeExtensionProvider
import org.jetbrains.kotlin.test.TestMetadata
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder

Response:
import org.junit.jupiter.api.Test

@TestMetadata("plugins/parcelize/parcelize-compiler/testData/box")
@TestDataPath("\$PROJECT_ROOT")
class ParcelizeIrBoxTestWithSerializableLikeExtension : AbstractParcelizeIrBoxTest() {
    @Test
    @TestMetadata("simple.kt")
    fun testSimple() {<|endoftext|>


Prompt:
* @param [operation] function that takes the index of an element, current accumulator value and the element itself,
 * and calculates the next accumulator value.
 *
 * @sample samples.collections.Collections.Aggregates.reduceOrNull
 */
@SinceKotlin("1.4")

Response:
public inline fun FloatArray.reduceIndexedOrNull(operation: (index: Int, acc: Float, Float) -> Float): Float? {
    if (isEmpty())
        return null
    var accumulator = this[0]
    for (index in 1..lastIndex) {
        accumulator = operation(index, accumulator, this[index])
    }
    return accumulator
}

/**<|endoftext|>


Prompt:
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM

// FILE: box.kt
fun box(): String {
    try {
        J().test()
        return "Fail: should throw"
    }
    catch (e: Throwable) {
        return "OK"
    }
}

// FILE: test.kt
class C {

Response:
val withAssertion = J().nullString()
}

// FILE: J.java
import org.jetbrains.annotations.NotNull;

public class J {
    public @NotNull String nullString() {
        return null;
    }

    public Object test() {
        return new C();
    }
}<|endoftext|>


Prompt: $i$a$-foo-LibraryKt$flaf$1\2\25\0$iv:int=0:int, x\2$iv:int=1:int, fooParam\5$iv:int=2:int, $i$f$foo\5\17:int=0:int, fooVar\5$iv:int=0:int, it\6$iv:int=42:int,

Response: $i$a$-foo-LibraryKt$flaf$1$2\6\30\2$iv:int=0:int, z\6$iv:int=3:int<|endoftext|>


Prompt:
package test.time

import java.util.concurrent.TimeUnit
import kotlin.test.*
import kotlin.time.*

class DurationUnitJVMTest {
    @Test
    fun conversionFromTimeUnit() {
        for (unit in DurationUnit.entries) {
            val timeUnit = unit.toTimeUnit()
            assertEquals(unit.name, timeUnit.name)

Response:
assertEquals(unit, timeUnit.toDurationUnit())
        }

        for (timeUnit in TimeUnit.entries) {
            val unit = timeUnit.toDurationUnit()
            assertEquals(timeUnit.name, unit.name)
            assertEquals(timeUnit, unit.toTimeUnit())
        }
    }
}<|endoftext|>


Prompt:
class Test3<S3 : Test3<S3, in K>, K : Any>
class Test4<S4 : Test3<S4, out Any>>

class Test5<S5 : Test5<S5, in K>, K : Any>
class Test6<S6 : Test5<S6, in Any>>

Response:
class Test7<S7 : Test7<S7, in K>, K : CharSequence>
class Test8<S8 : Test7<S8, <!UPPER_BOUND_VIOLATED!>in Any<!>>>

class Class<V : Any>
typealias Alias <V1> = (Class<V1>) -> Boolean

abstract class Base<T : Base<T>> {}<|endoftext|>


Prompt:
public fun ULongArray.sliceArray(indices: Collection<Int>): ULongArray {
    return ULongArray(storage.sliceArray(indices))
}

/**
 * Returns an array containing elements of this array at specified [indices].
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
public fun UByteArray.sliceArray(indices: Collection<Int>): UByteArray {

Response:
return UByteArray(storage.sliceArray(indices))
}

/**
 * Returns an array containing elements of this array at specified [indices].
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
public fun UShortArray.sliceArray(indices: Collection<Int>): UShortArray {
    return UShortArray(storage.sliceArray(indices))
}<|endoftext|>


Prompt:
assertEquals(null, nullToNotNullC(aif), "AIF? as? IC")
    assertEquals(null, nullToNotNullC(aij), "AIJ? as? IC")
    assertEquals(baia, nullToNotNullC(baia), "BAIA? as? IC")

Response:
assertEquals(baiaif, nullToNotNullC(baiaif), "BAIAIF? as? IC")
    assertEquals(baiaij, nullToNotNullC(baiaij), "BAIAIJ? as? IC")
    assertEquals(null, nullToNotNullC(c), "C? as? IC")<|endoftext|>


Prompt:
}
}

fun setDesiredAssertionStatus(v: Boolean): Checker {
    val loader = Checker::class.java.classLoader
    loader.setDefaultAssertionStatus(v)
    val c = loader.loadClass(if (v) "ShouldBeEnabled" else "ShouldBeDisabled")
    return c.newInstance() as Checker
}

fun box(): String {

Response:
var c = setDesiredAssertionStatus(false)
    if (c.checkTrue()) return "FAIL 0"
    if (c.checkFalse()) return "FAIL 2"
    c = setDesiredAssertionStatus(true)
    if (!c.checkTrue()) return "FAIL 4"
    try {
        c.checkFalse()
        return "FAIL 6"<|endoftext|>


Prompt:
val elementSerializer = get(elementType, elementAsmType, context, forceBoxed = true, strict = strict())
                    wrapToNullAwareIfNeeded(type, ListSetParcelSerializer(asmType, elementSerializer, context.frameMap))
                }

                className == Map::class.java.canonicalName
                        || className == SortedMap::class.java.canonicalName

Response:
|| className == NavigableMap::class.java.canonicalName
                        || className == HashMap::class.java.canonicalName
                        || className == LinkedHashMap::class.java.canonicalName
                        || className == TreeMap::class.java.canonicalName
                        || className == ConcurrentHashMap::class.java.canonicalName
                -> {<|endoftext|>


Prompt:
blockScopeVariableInfo: BlockScopeVariableInfo
    ) : VariableContext(instruction, map) {
        internal val enterInitState = initialize(variableDescriptor, blockScopeVariableInfo, `in`)
        internal val exitInitState = initialize(variableDescriptor, blockScopeVariableInfo, out)

        private fun initialize(
            variableDescriptor: VariableDescriptor?,

Response:
blockScopeVariableInfo: BlockScopeVariableInfo,
            map: VariableInitReadOnlyControlFlowInfo
        ): VariableControlFlowState? {
            val state = map.getOrNull(variableDescriptor ?: return null)
            if (state != null) return state
            return PseudocodeVariablesData.getDefaultValueForInitializers(variableDescriptor, instruction, blockScopeVariableInfo)
        }
    }<|endoftext|>


Prompt:
override var dispatchReceiverParameter: IrValueParameter? by lazyVar(stubGenerator.lock) {
        createReceiverParameter(descriptor.dispatchReceiverParameter)
    }

    override var extensionReceiverParameter: IrValueParameter? by lazyVar(stubGenerator.lock) {
        createReceiverParameter(descriptor.extensionReceiverParameter)
    }

Response:
override var valueParameters: List<IrValueParameter> by lazyVar(stubGenerator.lock) { createValueParameters() }

    override var contextReceiverParametersCount: Int = descriptor.contextReceiverParameters.size

    override var metadata: MetadataSource?
        get() = null
        set(_) = error("We should never need to store metadata of external declarations.")<|endoftext|>


Prompt:
@kotlin.ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun <R, C : kotlin.collections.MutableCollection<in R>> kotlin.UIntArray.mapIndexedTo(destination: C, transform: (index: kotlin.Int, kotlin.UInt) -> R): C

Response:
@kotlin.SinceKotlin(version = "1.3")
@kotlin.ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly<|endoftext|>


Prompt: 8072, 8073, 8074, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8084, 8085, 8086, 8087, 8088, 8089, 8090,

Response: 8091, 8092, 8093, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109,<|endoftext|>


Prompt:
operator fun A.remAssign(y: Int) { x %= y }

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

  a += 1
  if (a !== original) return "Fail 1: $a !== $original"
  if (a.x != 1) return "Fail 2: ${a.x} != 1"

  a -= 2

Response:
if (a !== original) return "Fail 3: $a !== $original"
  if (a.x != -1) return "Fail 4: ${a.x} != -1"

  a *= -10
  if (a !== original) return "Fail 5: $a !== $original"
  if (a.x != 10) return "Fail 6: ${a.x} != 10"<|endoftext|>


Prompt:
resumeIterator(value.exceptionOrNull())
    }

    // Generator implementation
    override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c ->
        computedNext = true
        nextValue = value
        nextStep = c
        resumeIterator(null)
        COROUTINE_SUSPENDED
    }
}

Response:
suspend fun <T> AsyncSequence<T>.toList(): List<T> {
    val out = arrayListOf<T>()
    for (e in this@toList) out += e // fails at this line
    return out
}

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

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


Prompt:
override fun toString(): String = x.contentToString()
}

OPTIONAL_JVM_INLINE_ANNOTATION
value class TestInlineCharArrayW(val x: InlineCharArray)

fun box(): String {
    val t1 = TestUIntArrayW(UIntArray(1)).toString()

Response:
if (!t1.startsWith("TestUIntArrayW")) throw AssertionError(t1)

    val t2 = TestInlineCharArrayW(InlineCharArray(charArrayOf('a'))).toString()
    if (!t2.startsWith("TestInlineCharArrayW")) throw AssertionError(t2)

    return "OK"
}<|endoftext|>


Prompt:
}
        reporter.reportOn(source, factory, actualTypeForComparison, expectedTypeForComparison, suffix, context)
    }
}

private fun getEnhancedTypesForComparison(
    actualType: ConeKotlinType?,
    expectedType: ConeKotlinType?,
    context: CheckerContext,
): Pair<ConeKotlinType, ConeKotlinType>? {

Response:
if (actualType == null || expectedType == null) return null
    if (actualType is ConeErrorType || expectedType is ConeErrorType) return null

    val substitutor = EnhancedForWarningConeSubstitutor(context.session.typeContext)

    val enhancedActualType = substitutor.substituteOrNull(actualType)<|endoftext|>


Prompt:
package foo.bar

/*p:foo.bar*/class A {
    operator fun plus(a: /*p:foo.bar p:foo.bar.A*/Int) = /*p:foo.bar(A)*/this
    operator fun timesAssign(a: /*p:foo.bar p:foo.bar.A*/Any?) {}

Response:
operator fun inc(): /*p:foo.bar p:foo.bar.A*/A = /*p:foo.bar(A)*/this

    operator fun get(i: /*p:foo.bar p:foo.bar.A*/Int) = 1<|endoftext|>


Prompt:
proto: ProtoBuf.Property.Builder,
        versionRequirementTable: MutableVersionRequirementTable?,
        childSerializer: DescriptorSerializer
    ) {
        descriptorFileId(descriptor)?.let { proto.setExtension(KlibMetadataProtoBuf.propertyFile, it) }

Response:
if (exportKDoc) descriptor.findKDocString()?.let { proto.setExtension(KlibMetadataProtoBuf.propertyKdoc, it) }
        super.serializeProperty(descriptor, proto, versionRequirementTable, childSerializer)
    }

    override fun serializeFunction(
        descriptor: FunctionDescriptor,<|endoftext|>


Prompt:
) : KotlinLibraryLayout, MetadataKotlinLibraryLayout, IrKotlinLibraryLayout {
    override val componentDir: File
        get() = File(unzippedDir, component)
    override val pre_1_4_manifest: File
        get() = File(unzippedDir, KLIB_MANIFEST_FILE_NAME)
}

class BaseWriterImpl(

Response:
val libraryLayout: KotlinLibraryLayoutForWriter,
    moduleName: String,
    _versions: KotlinLibraryVersioning,
    builtInsPlatform: BuiltInsPlatform,
    nativeTargets: List<String> = emptyList(),
    val nopack: Boolean = false,
    val shortName: String? = null
) : BaseWriter {

    val klibFile = libraryLayout.libFile.canonicalFile<|endoftext|>


Prompt:
*     ----------------------------------------------------------
 *	    0	       S	   C		 T
 *	    1	       C	  -S		-1/T
 *	    2	      -S	  -C		 T
 *	    3	      -C	   S		-1/T
 *     ----------------------------------------------------------
 *
 * Special cases:
 *      Let trig be any of sin, cos, or tan.

Response:
*      trig(+-INF)  is NaN, with signals;
 *      trig(NaN)    is that NaN;
 *
 * Accuracy:
 *	TRIG(x) returns trig(x) nearly rounded
 */

package kotlin.math.fdlibm

internal fun cos(x: Double): Double {
    val y: DoubleArray = DoubleArray(2)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.references.FirReference
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.declarations.IrDeclaration

Response:
import org.jetbrains.kotlin.ir.declarations.IrExternalPackageFragment
import org.jetbrains.kotlin.ir.declarations.IrMemberWithContainerSource
import org.jetbrains.kotlin.ir.objcinterop.IrObjCOverridabilityCondition
import org.jetbrains.kotlin.ir.symbols.IrSymbol<|endoftext|>


Prompt:
val previousJvmCompilation = kotlin.jvm().compilations.maybeCreate(previousSuffix.decapitalizeAsciiOnly())
                val jvmCompilation = kotlin.jvm().compilations.maybeCreate(suffix.decapitalizeAsciiOnly())
                assertEquals(jvm, jvmCompilation.defaultSourceSet)

Response:
jvmCompilation.associateWith(previousJvmCompilation)

                val previousJsCompilation = kotlin.js().compilations.maybeCreate(previousSuffix.decapitalizeAsciiOnly())
                val jsCompilation = kotlin.js().compilations.maybeCreate(suffix.decapitalizeAsciiOnly())<|endoftext|>


Prompt:
if (value_2.case_7_3() == null) println(value_2)
}

// TESTCASE NUMBER: 8
fun case_8(value_1: String?, value_2: String?) {
    when { value_1.case_8_1() -> println(value_1<!UNSAFE_CALL!>.<!>length) }

Response:
when { value_2.case_8_2() -> println(value_2) }
    when { !(value_2.case_8_3() == null) -> println(value_2) }
    when { value_2.case_8_3() == null -> println(value_2) }
}

// TESTCASE NUMBER: 9
fun case_9(value_1: Number?) {<|endoftext|>


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

Response:
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_2.<!UNRESOLVED_REFERENCE!>toByte<!>())
    }
    if (funWithReturnsNull(value_1 !is String || value_2 !is Number) != null) {<|endoftext|>


Prompt:
UiContent {
                    updatedContent()
                }
            }
        }
        """,
        extra = """
        import androidx.compose.runtime.*

        fun Defer(content: @Composable () -> Unit) { }

        fun UiContent(content: @Composable @ComposableTarget("UI") () -> Unit) { }
        """
    )

    @Test

Response:
fun testAddingComposablesToAList() = verifyGoldenComposeIrTransform(
        """
        import androidx.compose.runtime.*

        class Scope {
            private val list = IntervalList<Scope.(Int) -> (@Composable () -> Unit)>()
            fun item(content: @Composable Scope.() -> Unit) {<|endoftext|>


Prompt:
* But roots of the native source set hierarchies are only linux and ios. I.e. they don't depend on any other
     * native source set. The code below calculates exactly that:
     */
    val nativeSourceSets = sourceSets.filter { sourceSet -> sourceSet.internal.commonizerTarget.await() != null }
    val nativeSourceSetsRoots = nativeSourceSets.filter { sourceSet ->

Response:
val allVisibleSourceSets = sourceSet.dependsOn + getVisibleSourceSetsFromAssociateCompilations(sourceSet)
        allVisibleSourceSets.none { dependency ->
            dependency in nativeSourceSets
        }
    }

    nativeSourceSetsRoots.forEach { sourceSet ->
        dependencies.add(
            sourceSet.implementationConfigurationName,<|endoftext|>


Prompt:
assertEquals(false, jvmTarget.extras.jvm?.withJavaEnabled)
        assertEquals("1.8", jvmTarget.extras.jvm?.jvmTarget)
        assertNull(jvmTarget.extras.android)
        assertNull(jvmTarget.extras.js)
        assertNull(jvmTarget.extras.native)

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


Prompt:
additionalImports(checkedSafeCallSubject)
        }

        impl(checkedSafeCallSubject) {
            additionalImports(expression)
        }

        impl(resolvedQualifier) {
            // Initialize the value to true if only the companion object is present. This makes a standalone class reference expression
            // correctly resolve to the companion object. For example
            // ```
            // class A {

Response:
//   companion object
            // }
            //
            // val companionOfA = A // This standalone class reference `A` here should resolve to the companion object.
            // ```
            //
            // If this `FirResolvedQualifier` is a receiver expression of some other qualified access, the value is updated in
            // `FirCallResolver` according to the resolution result.<|endoftext|>


Prompt:
protected open fun doInitialize() { }

    protected abstract fun buildIr(): D

    val symbol by lazy { buildSymbol() }

    private val builtIr by lazy { buildIr() }
    private var initialized: Boolean = false

    fun initialize() {
        doInitialize()
        initialized = true
    }

    val ir: D
        get() {
            if (!initialized)

Response:
throw Error("Access to IR before initialization")
            return builtIr
        }
}<|endoftext|>


Prompt:
package org.jetbrains.kotlin.ir.backend.js.transformers.irToJs

import org.jetbrains.kotlin.ir.util.inlineFunction
import org.jetbrains.kotlin.ir.util.innerInlinedBlockOrThis
import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder

Response:
import org.jetbrains.kotlin.ir.backend.js.lower.ES6_DELEGATING_CONSTRUCTOR_CALL_REPLACEMENT
import org.jetbrains.kotlin.ir.backend.js.utils.JsGenerationContext
import org.jetbrains.kotlin.ir.backend.js.utils.emptyScope<|endoftext|>


Prompt:
l4@ { false }
    } while (true)
}

fun foo5() {
    l2@ l1@ do {
        l4@ { false }
    } while (true)
}

fun foo6() {
    l2@ l1@ do {
        l4@ l3@{ true }
    } while (true)
}

fun foo7() {

Response:
l3@ l2@ l1@ fun bar() {}
}

fun func(y: (Unit) -> Unit) {}

fun foo8() {
    func(l@ {})
    func(l2@ l1@ {})
    func(<!UNDERSCORE_IS_RESERVED!>_<!>@ {})
}<|endoftext|>


Prompt:
arguments = deprecated.arguments.mapValues { (argName, argValue) ->
                    if (argName == REPLACE_WITH_ARG) spoilReplaceWithAnnotationInMetadata(argValue.unwrap()).wrap() else argValue
                }
            )

        private fun spoilReplaceWithAnnotationInMetadata(replaceWith: KmAnnotation): KmAnnotation =
            replaceWith.copy(

Response:
arguments = replaceWith.arguments.filterKeys { argName -> argName != EXPRESSION_ARG }
            )

        private fun KmAnnotationArgument<*>.unwrap(): KmAnnotation = (this as KmAnnotationArgument.AnnotationValue).value<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor(arg1: UserKlassA, arg2A: UserKlassB)<!>
}

Response:
<!CONFLICTING_OVERLOADS!>fun TestMultipleDifferentlyNamedValueParametersA(arg1: UserKlassA, arg2B: UserKlassB)<!> {}

class TestMultipleDifferentlyNamedValueParametersAReverse {
    <!CONFLICTING_OVERLOADS!>constructor(arg1: UserKlassA, arg2A: UserKlassB)<!>
}<|endoftext|>


Prompt:
if (!fieldIsStatic) {
                    receiver = qualifiedAccess.findIrDispatchReceiver(explicitReceiverExpression)
                }
            }
        }
        return this
    }

    private fun FirCallableSymbol<*>.isFunctionFromAny(): Boolean {
        if (this !is FirNamedFunctionSymbol) return false
        return isMethodOfAny
    }

Response:
private fun generateErrorCallExpression(
        startOffset: Int,
        endOffset: Int,
        calleeReference: FirReference,
        type: IrType? = null,
    ): IrErrorCallExpression {
        return IrErrorCallExpressionImpl(
            startOffset, endOffset, type ?: createErrorType(),
            "Unresolved reference: ${calleeReference.render()}"
        )<|endoftext|>