Prompt:
}

        override fun nondeterministicJump(label: List<Label>, element: KtElement) {
            //todo
            //handleJumpInsideTryFinally(label);
            add(NondeterministicJumpInstruction(element, label, currentScope, null))
        }

        override fun jumpToError(element: KtElement) {
            handleJumpInsideTryFinally(error)

Response:
add(UnconditionalJumpInstruction(element, error, currentScope))
        }

        override fun enterTryFinally(trigger: GenerationTrigger) {
            allBlocks.push(TryFinallyBlockInfo(trigger))
        }

        override fun throwException(throwExpression: KtThrowExpression, thrownValue: PseudoValue) {
            handleJumpInsideTryFinally(error)<|endoftext|>


Prompt:
typeArguments,
    )
}

fun IrBuilderWithScope.irConstantObject(
    clazz: IrClass,
    arguments: List<IrConstantValue>,
    typeArguments: List<IrType> = emptyList()
): IrConstantValue {
    return irConstantObject(clazz.primaryConstructor?.symbol!!, arguments, typeArguments)
}

Response:
fun IrBuilderWithScope.irConstantObject(
    clazz: IrClass,
    elements: Map<String, IrConstantValue>,
    typeArguments: List<IrType> = emptyList()
): IrConstantValue {
    return irConstantObject(
        clazz,
        clazz.primaryConstructor!!.symbol.owner.valueParameters.also {<|endoftext|>


Prompt:
TestBuilder(10 to 1).reversed().step(2).reversed().step(3).expectValues(9, 6, 3),
            Function.DOWN_TO,
            subdir = "reversed"
        )
        generateTestsForRangeToAndUntil(
            "stepThenReversed.kt",

Response:
TestBuilder(1 to 8).step(2).reversed().expectValues(7, 5, 3, 1),
            subdir = "reversed"
        )
        generateTestsForFunction(
            "stepThenReversed.kt",
            TestBuilder(8 to 1).step(2).reversed().expectValues(2, 4, 6, 8),
            Function.DOWN_TO,<|endoftext|>


Prompt:
interface ReturnTypeMismatchOnOverride : KtFirDiagnostic<KtNamedDeclaration> {
        override val diagnosticClass get() = ReturnTypeMismatchOnOverride::class
        val function: KtCallableSymbol
        val superFunction: KtCallableSymbol
    }

    interface PropertyTypeMismatchOnOverride : KtFirDiagnostic<KtNamedDeclaration> {

Response:
override val diagnosticClass get() = PropertyTypeMismatchOnOverride::class
        val property: KtCallableSymbol
        val superProperty: KtCallableSymbol
    }

    interface VarTypeMismatchOnOverride : KtFirDiagnostic<KtNamedDeclaration> {
        override val diagnosticClass get() = VarTypeMismatchOnOverride::class<|endoftext|>


Prompt:
import org.gradle.api.logging.Logger
import org.gradle.api.provider.ValueSource
import org.gradle.api.provider.ValueSourceParameters
import org.jetbrains.kotlin.compilerRunner.KotlinNativeToolRunner
import org.jetbrains.kotlin.compilerRunner.konanDataDir

Response:
import org.jetbrains.kotlin.compilerRunner.konanHome
import org.jetbrains.kotlin.compilerRunner.konanVersion
import org.jetbrains.kotlin.gradle.logging.kotlinInfo
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider<|endoftext|>


Prompt:
for (testFile in module.files) {
                val text = testServices.sourceFileProvider.getContentOfSourceFile(testFile)
                addFileToJar(testFile.relativePath, text, jarOutputStream)
            }
        }

        return librarySourcesPath
    }

    private fun buildExtraClasspath(
        module: TestModule,
        dependencyBinaryRoots: Collection<Path>,

Response:
testServices: TestServices,
    ): List<String> = buildList {
        addAll(buildPlatformExtraClasspath(module, testServices))
        dependencyBinaryRoots.mapTo(this) { it.pathString }
    }

    protected open fun buildPlatformExtraClasspath(module: TestModule, testServices: TestServices): List<String> = emptyList()<|endoftext|>


Prompt: // library.kt:57 box: $i$f$foo\56\65:int=0:int, array\56:java.lang.Integer[]=java.lang.Integer[], myClass\56:MyClass=MyClass, this_\98:MyClass=MyClass, $i$f$f2\98\563:int=0:int,

Response: $i$a$-f2-LibraryKt$foo$11\100\579\56:int=0:int, $i$f$test\101\563:int=0:int, testVal\101:int=1:int<|endoftext|>


Prompt:
/* Types */
    sealed interface Type: AnyType {
        override val isMarkedNullable: Boolean
    }

    sealed interface ClassOrTypeAliasType : Type, AnyClassOrTypeAliasType {
        override val classifierId: CirEntityId
        val arguments: List<TypeProjection>
    }

    data class TypeParameterType(
        val index: Int,

Response:
override val isMarkedNullable: Boolean
    ) : Type

    data class ClassType(
        override val classifierId: CirEntityId,
        override val arguments: List<TypeProjection>,
        override val isMarkedNullable: Boolean,
        val outerType: ClassType?
    ) : ClassOrTypeAliasType

    data class TypeAliasType(<|endoftext|>


Prompt:
private val annotations =
        (NOT_NULL_ANNOTATIONS + NULLABLE_ANNOTATIONS + JAVAX_NONNULL_ANNOTATION_FQ_NAME)
            .mapTo(HashSet()) { it.internalNameWithoutInnerClasses }
            .toTypedArray()

    override fun methodAnnotationsChanged(
        context: NamingContext,
        method: ProtoMethodEntity,

Response:
annotationsDiff: Difference.Specifier<ClassType, Difference>,
        paramAnnotationsDiff: Difference.Specifier<ParamAnnotation, Difference>
    ): Set<Recompile> {
        val changedAnnotations = annotationsDiff.addedOrRemoved() +
                paramAnnotationsDiff.addedOrRemoved().map { it.type }

        return handleNullAnnotationsChanges(context, method, changedAnnotations)
    }<|endoftext|>


Prompt:
// CHECK-DEFAULTABI: zeroext i16 [[UNSIGNED_SHORT_ID_BRIDGE]](i16 zeroext %0)
// CHECK-DEFAULTABI: [[UNSIGNED_SHORT_ID_PTR:%[0-9]+]] = load i16 (i16)*, i16 (i16)** @{{.*unsigned_short_id}}

Response:
// CHECK-DEFAULTABI: call zeroext i16 [[UNSIGNED_SHORT_ID_PTR]](i16 zeroext %0)

// CHECK-AAPCS: i16 [[UNSIGNED_SHORT_ID_BRIDGE]](i16 %0)<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.analysis.collectors.components

import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.fir.FirElement
import org.jetbrains.kotlin.fir.FirSession

Response:
import org.jetbrains.kotlin.fir.analysis.CheckersComponentInternal
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.analysis.checkers.expression.ExpressionCheckers<|endoftext|>


Prompt:
expect(1.toShort()) { shortArrayOf(3, 2, 1).reduceRightIndexed { index, a, b -> if (index != 1) (a - b).toShort() else a.toShort() } }

        assertFailsWith<UnsupportedOperationException> {
            intArrayOf().reduceRightIndexed { index, a, b -> index + a + b }
        }
    }

Response:
@Test fun reduceRightIndexedOrNull() {
        expect(1) { intArrayOf(1, 2, 3).reduceRightIndexedOrNull { index, a, b -> index + a - b } }
        expect(1.toLong()) { longArrayOf(1, 2, 3).reduceRightIndexedOrNull { index, a, b -> index + a - b } }<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB

import kotlinx.serialization.*

fun local(): String {
    @Serializable
    data class Carrier(val i: Int)

    return Carrier.serializer().descriptor.toString()
}

fun box(): String {
    val expected = "local.Carrier(i: kotlin.Int)"

Response:
val actual = local()
    if (expected != actual) {
        return "Fail: $actual"
    }
    return "OK"
}<|endoftext|>


Prompt:
val result_9 = select(A(x2), A(x1), A(x3))
    val result_10 = select(A(x3), A(x2))
    val result_11 = select(A(x4), A(x2))
    val result_12 = select(A(x4), A(x3), A(x2))

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("dynamic")!>result_1<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("dynamic")!>result_2<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("dynamic")!>result_3<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("dynamic")!>result_4<!><|endoftext|>


Prompt:
j.<!UNRESOLVED_REFERENCE!>I<!> {}
}

fun K.testK() {
    <!UNRESOLVED_REFERENCE!>C<!>()
    C2()
    <!UNRESOLVED_REFERENCE!>I<!> {}
}

fun testK2(k: K) {

Response:
k.<!UNRESOLVED_REFERENCE!>C<!>()
    k.C2()
    k.<!UNRESOLVED_REFERENCE!>I<!> {}
}

// MODULE: m2(m1)
// FILE: testResolutionContinues.kt
fun J.testResolutionContinues() {
    acceptI(I {})
}<|endoftext|>


Prompt:
expect annotation class A5(val x: Int = 42, val y: String)

@A1(0)
@A2
@A3(0, "")
@A4(0, "")
@A5(0, "")
fun test() {}

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

Response:
actual typealias A1 = J1
actual typealias A2 = J2
actual typealias A3 = J3
actual typealias A4 = J4
actual typealias A5 = J5

// FILE: J1.java

public @interface J1 {
    int x();
    String y();
}

// FILE: J2.java

public @interface J2 {
    int x();<|endoftext|>


Prompt:
// \p{cased} (\p{case-ignorable})* Sigma !( (\p{case-ignorable})* \p{cased} )
// The regular-expression operator * is "possessive", consuming as many characters as possible, with no backup.
// This is significant in the case of Final_Sigma, because the sets of case-ignorable and cased characters are not disjoint.

Response:
private fun String.isFinalSigmaAt(index: Int): Boolean {
    if (this[index] == '\u03A3' && index > 0) {
        var i = index - 1
        var codePoint: Int = 0
        while (i >= 0) {
            codePoint = codePointBefore(i)
            if (codePoint.isCaseIgnorable()) {
                i -= codePoint.charCount()<|endoftext|>


Prompt:
override fun equals(other: Any?): Boolean {
        if (other !is ConstructorApproximationKey)
            return false

        return objCFunctionApproximation == other.objCFunctionApproximation
                && valueParametersTypes.contentEquals(other.valueParametersTypes)
    }

    override fun hashCode() = hashCode(valueParametersTypes)

Response:
.appendHashCode(objCFunctionApproximation)
}

private fun <T> objCFunctionApproximation(value: T): ObjCFunctionApproximation
        where T : CirHasAnnotations, T : CirCallableMemberWithParameters {
    return if (value.annotations.any { it.type.classifierId.isObjCInteropCallableAnnotation }) {<|endoftext|>


Prompt:
testCasesByRangesOfFile.putIfAbsent(startPosition, mutableMapOf())
        testCasesByRangesOfFile[startPosition]!![testCaseNumber] = this
    }
}

fun parseTestCases(testFiles: TestFiles): SpecTestCasesSet {
    val testCasesSet = SpecTestCasesSet(mutableMapOf(), mutableMapOf(), mutableMapOf())

Response:
var rangeOffset = 0

    for ((filename, fileContent) in testFiles) {
        val matcher = testCaseInfoPattern.matcher(fileContent)
        var startFind = 0

        testCasesSet.byFiles.computeIfAbsent(filename) {
            testCasesSet.byRanges.putIfAbsent(filename, TreeMap())
            mutableMapOf()
        }<|endoftext|>


Prompt:
// test.kt:6 box
// test.kt:10 box
// test.kt:13 box
// test.kt:13 box
// test.kt:13 box
// test.kt:13 box
// test.kt:14 box

// EXPECTATIONS WASM
// test.kt:5 $box (12, 4)

Response:
// test.kt:6 $box (13, 11, 13, 17, 11, 11, 11, 13, 11, 13, 17, 11, 11, 11)
// test.kt:7 $box (8, 8, 8, 8)
// test.kt:10 $box (8, 4)
// test.kt:12 $box (8, 8, 8, 8, 8, 8, 8, 8)<|endoftext|>


Prompt:
@InternalKotlinGradlePluginApi
data class KotlinCompilerPluginData(
    @get:Classpath
    val classpath: FileCollection,

    @get:Internal
    val options: CompilerPluginOptions,

    /**
     * Used only for Up-to-date checks
     */
    @get:Nested
    val inputsOutputsState: InputsOutputsState
) {

Response:
data class InputsOutputsState(
        @get:Input
        val inputs: Map<String, String>,

        @get:InputFiles
        @get:IgnoreEmptyDirectories
        @get:NormalizeLineEndings
        @get:PathSensitive(PathSensitivity.RELATIVE)
        val inputFiles: Set<File>,

        @get:OutputFiles
        val outputFiles: Set<File><|endoftext|>


Prompt:
return initSpecialMetadata.invokeWithoutNullArgs(ctor, parent, interfaces, suspendArity)
            }
        }

        return getInitMetadata().invokeWithoutNullArgs(
            ctor,
            name,
            defaultConstructor,
            parent,
            interfaces,
            suspendArity,
            associatedObjectKey,
            associatedObjects
        )
    }

Response:
private fun IrType.asConstructorRef(): JsExpression? {
        val ownerSymbol = classOrNull?.takeIf {
            !isAny() && !isFunctionType() && !it.owner.isEffectivelyExternal()
        } ?: return null

        return ownerSymbol.owner.getClassRef(context.staticContext)
    }<|endoftext|>


Prompt:
// CompilationOutputs keeps the `outputDir` clean by removing all outdated JS and other unknown files.
        // To ensure that useful files around `outputFile`, such as irdump, are not removed, use `tmpBuildDir` instead.
        val allJsFiles = writeAll(tmpBuildDir, outputFile.nameWithoutExtension, TsCompilationStrategy.NONE, moduleId, moduleKind).filter {

Response:
it.extension == "js" || it.extension == "mjs"
        }

        val mainModuleFile = allJsFiles.last()
        mainModuleFile.fixJsFile(rootDir, outputFile, moduleId, moduleKind)

        dependencies.map { it.first }.zip(allJsFiles.dropLast(1)).forEach { (depModuleId, builtJsFilePath) -><|endoftext|>


Prompt:
}
}

/**
 * @see closure
 * @receiver is not included in the return set
 */
inline fun <reified T : Any> T.linearClosure(next: (T) -> T?): Set<T> {
    val initial = next(this) ?: return emptySet()
    val results = createResultSet<T>()
    var enqueued: T? = initial

Response:
while (enqueued != null) {
        if (enqueued != this && results.add(enqueued)) {
            enqueued = next(enqueued)
        } else break
    }

    return results
}

/**
 * @see closure
 * @receiver is not included in the return set
 */<|endoftext|>


Prompt:
x = "OK"
    }
    return "FAIL"
}

fun box() {
    val result = compute()
    val localX = x
}

// EXPECTATIONS JVM_IR +USE_INLINE_SCOPES_NUMBERS
// test.kt:28 box:
// test.kt:13 compute:
// test.kt:14 compute:

Response:
// test.kt:15 compute: a:java.lang.String="a":java.lang.String
// test.kt:7 compute: a:java.lang.String="a":java.lang.String, $i$f$g\1\15:int=0:int<|endoftext|>


Prompt:
override var origin: IrDeclarationOrigin,
    override val symbol: IrTypeParameterSymbol,
    override val descriptor: TypeParameterDescriptor,
    override var name: Name,
    override var index: Int,
    override var isReified: Boolean,
    override var variance: Variance,
    override val stubGenerator: DeclarationStubGenerator,

Response:
override val typeTranslator: TypeTranslator,
) : IrTypeParameter(), IrLazyDeclarationBase {
    init {
        symbol.bind(this)
    }

    override var parent: IrDeclarationParent by createLazyParent()

    override var annotations: List<IrConstructorCall> by createLazyAnnotations()<|endoftext|>


Prompt:
fun mangled(z: Z): Number = z.value

    internal fun internal(s: String): Int = s.length

    // Some different members with similar JVM signatures, to check that kotlinFunction doesn't incorrectly resolve into one of these.
    private fun jvmFoo(s: String): String = s
    private fun `mangled-IQRRRT4`(z: Number) {}

Response:
private fun `internal$main`(s: String): String = s
}

@JvmInline
value class Z(val value: Number)

fun test(f: KFunction<*>) {
    val javaMethod = f.javaMethod
        ?: error("javaMethod == null for $f")
    assertEquals(f, javaMethod.kotlinFunction, "Incorrect kotlinFunction for $javaMethod")<|endoftext|>


Prompt:
fun isLateinitIsInitializedPropertyGetter(symbol: IrFunctionSymbol): Boolean =
            symbol is IrSimpleFunctionSymbol && symbol.owner.let { function ->
                function.name.asString() == "<get-isInitialized>" &&
                        function.isTopLevel &&
                        function.getPackageFragment().packageFqName.asString() == "kotlin" &&

Response:
function.valueParameters.isEmpty() &&
                        symbol.owner.extensionReceiverParameter?.type?.classOrNull?.owner.let { receiverClass ->
                            receiverClass?.fqNameWhenAvailable?.toUnsafe() == StandardNames.FqNames.kProperty0
                        }
            }

        fun isTypeOfIntrinsic(symbol: IrFunctionSymbol): Boolean =<|endoftext|>


Prompt:
var resultValue = digitsToInt(number, srcIndex, count).toULong()
    srcIndex += count

    if (remaining > 0) {
        count = minOf(remaining, 9)
        remaining -= count

        // get the denormalized power of 10

Response:
val mult: UInt = (s_Pow10MantissaTable[count - 1] shr (64 - s_Pow10ExponentTable[count - 1])).toUInt()
        resultValue = mul32x32To64((resultValue).toUInt(), mult) + digitsToInt(number, srcIndex, count)
        srcIndex += count
    }<|endoftext|>


Prompt:
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: FAILS_IN_JS_IR
// IGNORE_BACKEND: JS, JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// FILE: test.kt

fun checkEqual(x: Any, y: Any) {

Response:
if (x != y || y != x) throw AssertionError("$x and $y should be equal")
    if (x.hashCode() != y.hashCode()) throw AssertionError("$x and $y should have the same hash code")
}

fun checkNotEqual(x: Any, y: Any) {<|endoftext|>


Prompt:
public inline fun <T, R : Any> Array<out T>.firstNotNullOf(transform: (T) -> R?): R {
    return firstNotNullOfOrNull(transform) ?: throw NoSuchElementException("No element of the array was transformed to a non-null value.")
}

/**
 * Returns the first non-null value produced by [transform] function being applied to elements of this array in iteration order,

Response:
* or `null` if no non-null value was produced.
 *
 * @sample samples.collections.Collections.Transformations.firstNotNullOf
 */
@SinceKotlin("1.5")
@kotlin.internal.InlineOnly
public inline fun <T, R : Any> Array<out T>.firstNotNullOfOrNull(transform: (T) -> R?): R? {<|endoftext|>


Prompt:
internal fun getClassFileToDecompile(testData: TestData, useStringTable: Boolean): VirtualFile {
        val extraOptions = buildList {
            this.add(CommonCompilerArguments::allowKotlinPackage.cliArgument)
            if (useStringTable) {
                this.add(K2JVMCompilerArguments::useTypeTable.cliArgument)
            }

Response:
this.addAll(testData.additionalCompilerOptions)
            addAll(listOf(CommonCompilerArguments::languageVersion.cliArgument, getLanguageVersionToCompile().versionString))
        }
        val library = CompilerTestUtil.compileJvmLibrary(
            src = testData.directory.toFile(),
            extraOptions = extraOptions,
        ).toPath()<|endoftext|>


Prompt:
@JvmGradlePluginTests
    @GradleTest
    fun passesOptInAnnotation(gradleVersion: GradleVersion) {
        project(
            projectName = "simpleProject",
            gradleVersion = gradleVersion,
        ) {
            buildGradle.appendText(
                """
                |

Response:
|tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask.class).configureEach {
                |    compilerOptions.optIn.addAll("kotlin.RequiresOptIn", "my.CustomOptIn")
                |}
                """.trimMargin()
            )

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


Prompt:
putValueArgument(0, irConst(key.key.hashCode()))
        putValueArgument(1, irConst(key.startOffset))
        putValueArgument(2, irConst(key.endOffset))
    }

    private fun irMetaClassAnnotation(
        file: String
    ): IrConstructorCall = IrConstructorCallImpl(
        UNDEFINED_OFFSET,

Response:
UNDEFINED_OFFSET,
        metaClassAnnotation!!.defaultType,
        metaClassAnnotation.constructors.single(),
        0,
        0,
        1
    ).apply {
        putValueArgument(0, irConst(file))
    }

    private fun buildClass(filePath: String): IrClass {
        val fileName = filePath.split('/').last()<|endoftext|>


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

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


Prompt:
// This is what Context collects about IR.
abstract class Ir<out T : CommonBackendContext>(val context: T) {

    abstract val symbols: Symbols

    internal val localScopeWithCounterMap = LocalDeclarationsLowering.LocalScopeWithCounterMap()

    open fun shouldGenerateHandlerParameterForDefaultBodyFun() = false
}

Response:
open class BuiltinSymbolsBase(val irBuiltIns: IrBuiltIns, private val symbolTable: ReferenceSymbolTable) {

    private fun getClass(name: Name, vararg packageNameSegments: String = arrayOf("kotlin")): IrClassSymbol =
        irBuiltIns.findClass(name, *packageNameSegments)<|endoftext|>


Prompt:
expression.transformChildren(this, data)

        val intrinsicType = tryGetIntrinsicType(expression)
        if (intrinsicType != IntrinsicType.ENUM_VALUES && intrinsicType != IntrinsicType.ENUM_VALUE_OF && intrinsicType != IntrinsicType.ENUM_ENTRIES)
            return expression

        data!!.at(expression)

Response:
val irClassSymbol = expression.getTypeArgument(0)!!.classifierOrNull as? IrClassSymbol

        if (irClassSymbol == null || irClassSymbol == context.ir.symbols.enum) {
            // Either a type parameter or a type parameter erased to 'Enum'.
            return data.irCall(context.ir.symbols.throwIllegalStateException)
        }<|endoftext|>


Prompt:
declaration.printATypeParameterWithNoIndent()
        if (declaration.superTypes.size > 1) declaration.printWhereClauseTypesWithNoIndent(true)
    }

    override fun visitValueParameter(declaration: IrValueParameter, data: IrDeclaration?) = wrap(declaration, data) {
        // TODO index?
        declaration.printAValueParameterWithNoIndent(data)
    }

Response:
override fun visitProperty(declaration: IrProperty, data: IrDeclaration?) = wrap(declaration, data) {
        if (options.printFakeOverridesStrategy == FakeOverridesStrategy.NONE && declaration.isFakeOverride) return

        declaration.printlnAnnotations()
        p.printIndent()

        // TODO better rendering for modifiers on property and accessors<|endoftext|>


Prompt:
interface <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>B<!>

enum class <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>B<!>

val <!REDECLARATION!>u<!> = 10
val <!REDECLARATION!>u<!> = 20

Response:
val <!SYNTAX!>(a,b)<!> = 30 to 40
val <!SYNTAX!>(c,d)<!> = 50 to 60

typealias <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>TA<!> = A
typealias <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>TA<!> = B<|endoftext|>


Prompt:
) : KtLocalVariableSymbol(), KtFe10PsiSymbol<KtVariableDeclaration, VariableDescriptor> {
    override val descriptor: VariableDescriptor? by cached {
        val bindingContext = analysisContext.analyze(psi, AnalysisMode.PARTIAL)
        bindingContext[BindingContext.VARIABLE, psi]
    }

    override val name: Name

Response:
get() = withValidityAssertion {
            when {
                psi.nameIdentifier?.text == "_" -> SpecialNames.UNDERSCORE_FOR_UNUSED_VAR
                else -> psi.nameAsSafeName
            }
        }
    override val returnType: KtType<|endoftext|>


Prompt:
// ISSUE: KT-59689
// FIR_IDENTICAL
// DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
// OPT_IN: kotlin.contracts.ExperimentalContracts

import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract

class A {
    fun returnsTrue(x: Any?): Boolean {

Response:
contract { returns(true) implies (x is String) }
        return x is String
    }

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

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


Prompt:
import org.jetbrains.kotlin.fir.types.*

object FirPropertyAccessorsTypesChecker : FirPropertyChecker(MppCheckerKind.Common) {
    override fun check(declaration: FirProperty, context: CheckerContext, reporter: DiagnosticReporter) {
        checkGetter(declaration, context, reporter)
        checkSetter(declaration, context, reporter)
    }

Response:
private fun checkGetter(property: FirProperty, context: CheckerContext, reporter: DiagnosticReporter) {
        val getter = property.getter ?: return
        val propertyType = property.returnTypeRef.coneType

        checkAccessorForDelegatedProperty(property, getter, context, reporter)

        if (getter.isImplicitDelegateAccessor()) {
            return
        }<|endoftext|>


Prompt:
// test.kt:18 $foo (16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16)
// test.kt:13 $foo (4, 4, 4, 4, 4, 4, 4)
// test.kt:20 $foo (1, 1, 1, 1, 1, 1, 1)

Response:
// test.kt:17 $foo (18, 14, 18, 14)
// test.kt:24 $box<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
import java.util.*

interface ESReceiver : ESValue {
    val receiverValue: ReceiverValue

    override fun <T> accept(visitor: ESExpressionVisitor<T>): T = visitor.visitReceiver(this)
}

Response:
abstract class AbstractESValue(override val type: ESType?) : ESValue {
    override val effects: List<ESEffect> = listOf()
}

open class ESReceiverValue(override val receiverValue: ReceiverValue) : AbstractESValue(null), ESReceiver

/**
 * [ESVariable] is class with multiple applications.
 *<|endoftext|>


Prompt:
fun `test - sourceSetClassifier - custom name`() = project.runLifecycleAwareTest {
        val target = kotlin.createExternalKotlinTarget<FakeTarget> { defaults() }
        val compilation = target.createCompilation<FakeCompilation> {
            defaults(kotlin)
            sourceSetTreeClassifierV2 = KotlinSourceSetTreeClassifier.Name("mySourceSetTree")

Response:
}

        assertEquals(KotlinSourceSetTree("mySourceSetTree"), KotlinSourceSetTree.orNull(compilation))
    }

    @Test
    fun `test - sourceSetClassifier - custom property`() = project.runLifecycleAwareTest {
        val kotlin = multiplatformExtension
        val myProperty = project.objects.property<KotlinSourceSetTree>()<|endoftext|>


Response: colNumber=13)<|endoftext|>


Prompt:
buffer.append(prefix)
    var count = 0
    for (element in this) {
        if (++count > 1) buffer.append(separator)
        if (limit < 0 || count <= limit) {
            if (transform != null)
                buffer.append(transform(element))
            else
                buffer.append(element.toString())
        } else break
    }

Response:
if (limit >= 0 && count > limit) buffer.append(truncated)
    buffer.append(postfix)
    return buffer
}

/**
 * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.
 *<|endoftext|>


Prompt:
fun clashingMethodWithObjCNameInBoth(): Any
}

fun i2() = object : SwiftNameManglingI2 {
    override val clashingProperty: Any
        get() = "one"

    override fun clashingMethod(): Any = "two"

    override fun swiftClashingMethodWithObjCNameInI1(): Any = "three"

Response:
override fun clashingMethodWithObjCNameInI2(): Any = "four"

    override fun clashingMethodWithObjCNameInBoth(): Any = "five"
}<|endoftext|>


Prompt:
public inline fun <R> kotlin.CharArray.foldRight(initial: R, operation: (kotlin.Char, acc: R) -> R): R

public inline fun <R> kotlin.DoubleArray.foldRight(initial: R, operation: (kotlin.Double, acc: R) -> R): R

Response:
public inline fun <R> kotlin.FloatArray.foldRight(initial: R, operation: (kotlin.Float, acc: R) -> R): R

public inline fun <R> kotlin.IntArray.foldRight(initial: R, operation: (kotlin.Int, acc: R) -> R): R<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1285
package foo

class Test() {
    var a = 0
}

var Test.b: Int
    get() = a * 3
    set(c: Int) {
        a = c - 1
    }

val Test.d: Int get() = 44

fun box(): String {
    val c = Test()

Response:
if (c.a != 0) return "fail1: ${c.a}";
    if (c.b != 0) return "fail2: ${c.b}";
    c.a = 3;
    if (c.b != 9) return "fail3: ${c.a}";
    c.b = 10;
    if (c.a != 9) return "fail4: ${c.a}";<|endoftext|>


Prompt:
}

            return
        }

        val resolveTarget = classLikeDeclaration.asResolveTarget()
        if (resolveTarget != null) {
            resolveToSupertypePhase(resolveTarget)
        }
    }

    private fun crawlSupertypeFromResolvedDeclaration(classLikeDeclaration: FirClassLikeDeclaration) {
        val parentClass = classLikeDeclaration.outerClass()

Response:
if (parentClass != null) {
            crawlSupertype(parentClass.defaultType())
        }

        val superTypeRefs = when (classLikeDeclaration) {
            is FirTypeAlias -> listOf(classLikeDeclaration.expandedTypeRef)
            is FirClass -> classLikeDeclaration.superTypeRefs
        }

        for (typeRef in superTypeRefs) {<|endoftext|>


Prompt:
* @param destination the array to copy to.
 * @param destinationOffset the position in the [destination] array to copy to, 0 by default.
 * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.
 * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.
 *

Response:
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.
 * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],
 * or when that index is out of the [destination] array indices range.<|endoftext|>


Prompt:
buildResolveAndCheckFir: (FirSession, List<F>) -> ModuleCompilerAnalyzedOutput,
    useWasmPlatform: Boolean,
): List<ModuleCompilerAnalyzedOutput> {
    // FIR
    val extensionRegistrars = FirExtensionRegistrar.getInstances(moduleStructure.project)

Response:
val mainModuleName = moduleStructure.compilerConfiguration.get(CommonConfigurationKeys.MODULE_NAME)!!
    val escapedMainModuleName = Name.special("<$mainModuleName>")
    val platform = if (useWasmPlatform) {
        when (moduleStructure.compilerConfiguration.get(WasmConfigurationKeys.WASM_TARGET, WasmTarget.JS)) {<|endoftext|>


Prompt:
1 <!INFIX_MODIFIER_REQUIRED!>plus<!> platformNN
    1 <!INFIX_MODIFIER_REQUIRED!>plus<!> <!TYPE_MISMATCH!>platformN<!>
    1 <!INFIX_MODIFIER_REQUIRED!>plus<!> platformJ

Response:
platformNN <!INFIX_MODIFIER_REQUIRED!>plus<!> 1
    platformN <!INFIX_MODIFIER_REQUIRED, UNSAFE_INFIX_CALL!>plus<!> 1
    platformJ <!INFIX_MODIFIER_REQUIRED!>plus<!> 1

    platformNN += 1<|endoftext|>


Prompt:
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, OVERLOAD_RESOLUTION_AMBIGUITY, OVERLOAD_RESOLUTION_AMBIGUITY_BECAUSE_OF_STUB_TYPES!>consume<!>(<!STUB_TYPE_IN_ARGUMENT_CAUSES_AMBIGUITY!>getTypeVariable()<!>)
    }

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

fun consume(value: TargetType) {}
fun consume(value: DifferentType) {}

class Buildee<TV> {<|endoftext|>


Prompt:
fun test(a: String, b: String?): String {
    return a + "\u0001" + 2.toChar() + 3.toChar() + 4L + b + 5.0 + 6F + '7' + b + "\u0002" + 1.toChar()
}

fun box(): String {
    val test = test("O", "K")

Response:
return if (test != "O\u0001\u0002\u00034K5.06.07K\u0002\u0001") "fail  ${test}" else "OK"
}<|endoftext|>


Prompt:
assertEquals(
                            "If the sign is positive, the result should be positive.",
                            absMagnitudeBits, resultBits)
                }
                if (sign < 0 || (-0.0f).toBits() == sign.toBits()) {
                    assertEquals(
                            "If the sign is negative, the result should be negative.",
                            negMagnitudeBits, resultBits)
                }

Response:
}
        }

        assertTrue("The result should be NaN.", Float.isNaN(Float.NaN.withSign(Float.NaN)))
    }

    /**
     * Tests kotlin.math.cos(Double)
     */
    @Test fun cosD() {
        // Test for cos(Double): Double<|endoftext|>


Prompt:
if (constructor.isPrimary && constructor.constructedClass.isMultiFieldValueClass &&
                constructor.origin != JvmLoweredDeclarationOrigin.STATIC_MULTI_FIELD_VALUE_CLASS_CONSTRUCTOR
            ) {
                val oldArguments = List(expression.valueArgumentsCount) {
                    expression.getValueArgument(it)

Response:
?: error("Default arguments for MFVC primary constructors are not yet supported:\n${expression.dump()}")
                }
                require(rootNode.subnodes.size == oldArguments.size) {
                    "Old ${constructor.render()} must have ${rootNode.subnodes.size} arguments but got ${oldArguments.size}"
                }<|endoftext|>


Prompt: $i$a$-baz1-LibraryKt$baz$1$1\7\71\4$iv:int=0:int

Response: // library.kt:22 box: mainVar:int=1:int, fooParam$iv:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=1:int, bazParam\1$iv:int=1:int, $i$f$baz\1\7:int=0:int, bazVar\1$iv:int=3:int,<|endoftext|>


Prompt:
@OptIn(Marker::class)
    operator fun provideDelegate(x: Any?, y: Any?): C = C()
}

val x: String by <!OPT_IN_USAGE_ERROR, OPT_IN_USAGE_ERROR!>O<!>

@Marker
class OperatorContainer : Comparable<OperatorContainer> {
    @OptIn(Marker::class)

Response:
override fun compareTo(other: OperatorContainer): Int {
        return 0
    }
}

@OptIn(Marker::class)
class AnotherContainer : Iterable<C> {
    @OptIn(Marker::class)
    override fun iterator(): Iterator<C> {
        return object : Iterator<C> {
            override fun hasNext(): Boolean {
                return false
            }<|endoftext|>


Prompt:
0x0UL,     0x0UL,     0x0UL,     0x0UL,
            0x0UL,     0x400921fb54442d18UL,     0x400921fb54442d18UL,     0x400921fb54442d18UL,

Response:
0x400921fb54442d18UL,     0x400921fb54442d18UL,     0x400921fb54442d18UL,     0x400921fb54442d18UL,
            0x400921fb54442d18UL,     0x0UL,     0x3ff921fb54442d18UL,     0x2bfbUL,<|endoftext|>


Prompt:
val resolvedCall = trace.bindingContext[COLLECTION_LITERAL_CALL, expression] ?: return null
        return createConstantValueForArrayFunctionCall(resolvedCall)
    }

    private fun evaluateCall(
        callExpression: KtExpression,
        receiverExpression: KtExpression,
        expectedType: KotlinType?
    ): CompileTimeConstant<*>? {

Response:
val resolvedCall = callExpression.getResolvedCall(trace.bindingContext) ?: return null
        if (!KotlinBuiltIns.isUnderKotlinPackage(resolvedCall.resultingDescriptor)) return null

        val resultingDescriptorName = resolvedCall.resultingDescriptor.name<|endoftext|>


Prompt:
val v: Int = 22,
        val w: Int = 23,
        val x: Int = 24,
        val y: Int = 25,
        val z: Int = 26,
        val aa: Int = 27,
        val bb: Int = 28,
        val cc: Int = 29,
        val dd: Int = 30,
        val ee: Int = 31,

Response:
val ff: Int = 32,
        val gg: Int = 33,
        val hh: Int = 34,
        val ii: Int = 35,
        val jj: Int = 36,
        val kk: Int = 37,
        val ll: Int = 38,
        val mm: Int = 39,
        val nn: Int = 40,
        val oo: Int = 41,<|endoftext|>


Prompt:
visitor.visitElement(this)
        }
    }

    internal class FieldNameGenerator {
        private val usedNames: MutableSet<String> = mutableSetOf()

        fun generateUniqueFieldName(base: String): String {
            if (usedNames.add(base)) return base
            var i = 1
            while (true) {
                val suggestion = "$base$$i"

Response:
if (usedNames.add(suggestion)) return suggestion
                i++
            }
        }
    }
}<|endoftext|>


Prompt:
value = "-Xfriend-paths",
        valueDescription = "<path>",
        description = "Paths to output directories for friend modules (modules whose internals should be visible)."
    )
    var friendPaths: Array<String>? = null
        set(value) {
            checkFrozen()
            field = value
        }

    @Argument(

Response:
value = "-Xallow-no-source-files",
        description = "Allow the set of source files to be empty."
    )
    var allowNoSourceFiles = false
        set(value) {
            checkFrozen()
            field = value
        }

    @Argument(
        value = "-Xemit-jvm-type-annotations",<|endoftext|>


Prompt:
typeParameters.serializeTypeParameters(context, output = clazz.typeParameters)
    clazz.name = className

    clazz.constructors += nestedConstructors
    clazz.functions += nestedFunctions
    clazz.properties += nestedProperties

    directNestedClasses.forEach { directNestedClass ->
        val shortClassName = directNestedClass.name.substringAfterLast('.')

Response:
if (directNestedClass.kind == ClassKind.ENUM_ENTRY) {
            clazz.enumEntries += shortClassName
            clazz.klibEnumEntries += KlibEnumEntry(name = shortClassName, annotations = directNestedClass.annotations)
        } else {
            clazz.nestedClasses += shortClassName
        }
    }<|endoftext|>


Prompt:
call("a.A.after")
                caught("some exception")
            }
            suite("Inner") {
                test("innerTest") {
                    call("a.A.Inner.innerTest")
                }
            }
            suite("Nested") {
                test("nestedTest") {
                    call("a.A.Nested.nestedTest")
                }
            }

Response:
suite("Companion") {
                test("companionTest") {
                    call("a.A.companionTest")
                }
            }
        }
        suite("O") {
            test("test") {
                call("a.O.test")
            }
        }
    }
    suite("a.a") {
        suite("A") {
            test("passing") {<|endoftext|>


Prompt:
if (!(2.toByte() in emptyCharSequence.indices) != !range1.contains(2.toByte())) throw AssertionError()
    if (!(2.toByte() !in emptyCharSequence.indices) != range1.contains(2.toByte())) throw AssertionError()
    // no local optimizations

Response:
if (element12 in emptyCharSequence.indices != range1.contains(element12)) throw AssertionError()
    if (element12 !in emptyCharSequence.indices != !range1.contains(element12)) throw AssertionError()
    if (!(element12 in emptyCharSequence.indices) != !range1.contains(element12)) throw AssertionError()<|endoftext|>


Prompt:
* Puts all the given [pairs] into this [MutableMap] with the first component in the pair being the key and the second the value.
 */
public fun <K, V> MutableMap<in K, in V>.putAll(pairs: Array<out Pair<K, V>>): Unit {
    for ((key, value) in pairs) {
        put(key, value)
    }
}

/**

Response:
* Puts all the elements of the given collection into this [MutableMap] with the first component in the pair being the key and the second the value.
 */
public fun <K, V> MutableMap<in K, in V>.putAll(pairs: Iterable<Pair<K, V>>): Unit {
    for ((key, value) in pairs) {
        put(key, value)
    }
}<|endoftext|>


Prompt:
private fun createModuleWithScopeProviderFromBinary(
    kotlinDistribution: Distribution,
    input: InputModule.Binary,
): ModuleWithScopeProvider {
    lateinit var binaryModule: KtLibraryModule
    lateinit var fakeSourceModule: KtSourceModule
    buildStandaloneAnalysisAPISession {

Response:
registerProjectService(KtLifetimeTokenProvider::class.java, KtAlwaysAccessibleLifetimeTokenProvider())

        buildKtModuleProvider {
            platform = NativePlatforms.unspecifiedNativePlatform

            val stdlib = addModule(
                buildKtLibraryModule {
                    addBinaryRoot(Path(kotlinDistribution.stdlib))
                    platform = NativePlatforms.unspecifiedNativePlatform<|endoftext|>


Prompt:
val longList = mutableListOf<Long>()
    for (i in 1L..7L step 2L) {
        longList += i
    }
    assertEquals(listOf(1L, 3L, 5L, 7L), longList)

    val charList = mutableListOf<Char>()
    for (i in 'a'..'g' step 2) {

Response:
charList += i
    }
    assertEquals(listOf('a', 'c', 'e', 'g'), charList)

    return "OK"
}<|endoftext|>


Prompt:
property.copy(type = ExportedType.TypeOf(className), name = name)
                    .generateTypeScriptString(indent, prefix, esModules) + "\n${classForRender.generateTypeScriptString(indent, declare, esModules)}"
            } else {
                classForRender.generateTypeScriptString(indent, prefix, esModules)
            }
        }
    }

Response:
private fun ExportedRegularClass.generateTypeScriptString(indent: String, prefix: String, esModules: Boolean): String {
        val keyword = if (isInterface) "interface" else "class"
        val (interfaceCompanions, allNestedClasses) = nestedClasses.partition { isInterface && it.ir.isCompanion }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.tree.generator.context

import org.jetbrains.kotlin.fir.tree.generator.model.*
import org.jetbrains.kotlin.generators.tree.*
import org.jetbrains.kotlin.types.Variance

Response:
abstract class AbstractFieldConfigurator<T : AbstractFirTreeBuilder>(private val builder: T) {
    inner class ConfigureContext(val element: Element) {
        operator fun FieldSet.unaryPlus() {
            element.fields.addAll(this.map { it.copy() })
        }

        operator fun Field.unaryPlus() {<|endoftext|>


Prompt:
setOf(nodeA, nodeB, nodeC, nodeD), closure.toSet(),
            "Expected transitiveClosure to be robust against loops and self references"
        )
    }

    @Test
    fun `closure with empty nodes`() {
        assertSame(
            emptySet(), Node("").closure { it.children },
            "Expected no Set being allocated on empty closure"
        )
    }

Response:
@Test
    fun `closureSequence with empty nodes`() {
        assertSame(
            emptySequence(), Node("").closureSequence { it.children },
            "Expected no Set being allocated on empty closure"
        )
    }

    @Test
    fun `closure with only self reference`() {
        val node = Node("a")
        node.children.add(node)<|endoftext|>


Prompt:
0x3ff0000000000000UL,     0x3ff0000000000000UL,     0x3ff0000000000000UL,     0x3ff0000000000000UL,
            0x4010000000000000UL,     0x401000000000f3e1UL,     0x400ffffffffe183eUL,     0x4000000000000000UL,

Response:
0x4030000000000000UL,     0x3ff6a09e667f3bcdUL,     0x4070000000000000UL,     0x3fd0000000000000UL,
            0x3fd000000000f3e1UL,     0x3fcffffffffe183eUL,     0x3fe0000000000000UL,     0x3fb0000000000000UL,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.js.sourceMap.SourceMap3Builder
import org.jetbrains.kotlin.js.util.TextOutputImpl
import java.io.File
import kotlin.system.exitProcess

fun main(args: Array<String>) {
    val outputFile = File(args[0])
    val baseDir = File(args[1]).canonicalFile

Response:
val wrapperFile = File(args[2])

    val inputPaths = args.drop(3).map { File(it) }
    mergeStdlibParts(outputFile, wrapperFile, baseDir, inputPaths)
}

/**
 * Combines several JS input files, that comprise Kotlin JS Standard Library,
 * into a single JS module.<|endoftext|>


Prompt:
* using the provided [transform] function applied to each pair of elements.
 * The resulting sequence ends as soon as the shortest input sequence ends.
 *
 * The operation is _intermediate_ and _stateless_.
 *
 * @sample samples.collections.Sequences.Transformations.zipWithTransform
 */

Response:
public fun <T, R, V> Sequence<T>.zip(other: Sequence<R>, transform: (a: T, b: R) -> V): Sequence<V> {
    return MergingSequence(this, other, transform)
}

/**
 * Returns a sequence of pairs of each two adjacent elements in this sequence.
 *
 * The returned sequence is empty if this sequence contains less than two elements.
 *<|endoftext|>


Prompt:
@TypedIntrinsic(IntrinsicType.INTEROP_FUNPTR_INVOKE)
public external operator fun <P1, P2, P3, P4, R> CPointer<CFunction<(P1, P2, P3, P4) -> R>>.invoke(p1: P1, p2: P2, p3: P3, p4: P4): R

Response:
@ExperimentalForeignApi
@TypedIntrinsic(IntrinsicType.INTEROP_FUNPTR_INVOKE)<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function2<kotlin.Int, kotlin.Int, kotlin.Number & kotlin.Comparable<*>>")!>select(id(A5<Int, Int>()), id { x, y ->

Response: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x<!>;<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>y<!><|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// WITH_REFLECT

// different annotation order
// IGNORE_BACKEND: ANDROID

package test

import kotlin.test.assertEquals

annotation class Ann1
annotation class Ann2

class Foo {
    @setparam:Ann1
    var delegate = " "
        set(@Ann2 value) {}
}

fun box(): String {

Response:
val setterParameters = Foo::delegate.setter.parameters
    assertEquals(2, setterParameters.size)
    assertEquals("[]", setterParameters.first().annotations.toString())
    assertEquals("[@test.Ann2(), @test.Ann1()]", setterParameters.last().annotations.toString())
    return "OK"
}<|endoftext|>


Prompt:
private val classifiers: CirKnownClassifiers,
    private val intPlatformId: CirEntityId,
    private val longPlatformId: CirEntityId,
    private val mixedPlatformId: CirEntityId,
) : NullableSingleInvocationCommonizer<CirClassOrTypeAliasType> {

    protected abstract fun doCommonize(values: List<CirClassOrTypeAliasType>): CirClassOrTypeAliasType?

Response:
override fun invoke(values: List<CirClassOrTypeAliasType>): CirClassOrTypeAliasType? {
        val typesToCommonizeWithTargets = values.zip(classifiers.classifierIndices.targets)
        if (typesToCommonizeWithTargets.any { (type, target) -> !inputTypeIsKnownAndMatchesPlatformBitWidth(type, target) }) return null<|endoftext|>


Prompt:
fun poll45() {
    val inv = try { ::Foo6 } finally { ::Foo6 }
    inv()
}

fun poll46() {
    val inv = try { foo7() } finally { ::<!CANNOT_INFER_PARAMETER_TYPE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!> }
    inv
}

Response:
fun poll5() {
    val inv = try { ::<!UNRESOLVED_REFERENCE!>bar<!> } catch (e: Exception) { ::<!UNRESOLVED_REFERENCE!>foo<!> } finally { ::<!UNRESOLVED_REFERENCE!>foo<!> }
    <!UNRESOLVED_REFERENCE!>inv<!>()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.checkers.DeclarationChecker
import org.jetbrains.kotlin.resolve.checkers.DeclarationCheckerContext
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe

Response:
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.resolve.jvm.annotations.findJvmFieldAnnotation
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.isError<|endoftext|>


Prompt:
public fun CharSequence.indexOf(string: String, startIndex: Int = 0, ignoreCase: Boolean = false): Int {
    return if (ignoreCase || this !is String)
        indexOf(string, startIndex, length, ignoreCase)
    else
        nativeIndexOf(string, startIndex)
}

/**
 * Returns the index within this char sequence of the last occurrence of the specified character,

Response:
* starting from the specified [startIndex].
 *
 * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.
 * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.
 * @return An index of the last occurrence of [char] or -1 if none is found.
 */<|endoftext|>


Prompt:
return@lambda2
    }

fun testAnonymousFunctionLabel() =
    anonFun@ fun() {
        return@anonFun
    }

fun testLoopLabelInReturn(xs: List<Int>) {
    L@ for (x in xs) {
        if (x > 0) <!NOT_A_FUNCTION_LABEL!>return@L<!>
    }
}

Response:
fun testValLabelInReturn() {
    L@ val fn = { <!NOT_A_FUNCTION_LABEL!>return@L<!> }
    fn()
}

fun testHighOrderFunctionCallLabelInReturn() {
    L@ run {
        <!NOT_A_FUNCTION_LABEL!>return@L<!>
    }
}<|endoftext|>


Prompt:
* Exposes the JavaScript [MediaTrackConstraints](https://developer.mozilla.org/en/docs/Web/API/MediaTrackConstraints) to Kotlin
 */
public external interface MediaTrackConstraints : MediaTrackConstraintSet {
    var advanced: Array<MediaTrackConstraintSet>?
        get() = definedExternally
        set(value) = definedExternally
}

Response:
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@kotlin.internal.InlineOnly<|endoftext|>


Prompt:
abstract class FirErrorPrimaryConstructor : FirConstructor(), FirDiagnosticHolder {
    abstract override val source: KtSourceElement?
    abstract override val moduleData: FirModuleData
    abstract override val origin: FirDeclarationOrigin
    abstract override val attributes: FirDeclarationAttributes
    abstract override val typeParameters: List<FirTypeParameterRef>
    abstract override val status: FirDeclarationStatus

Response:
abstract override val returnTypeRef: FirTypeRef
    abstract override val receiverParameter: FirReceiverParameter?
    abstract override val deprecationsProvider: DeprecationsProvider
    abstract override val containerSource: DeserializedContainerSource?
    abstract override val dispatchReceiverType: ConeSimpleKotlinType?
    abstract override val contextReceivers: List<FirContextReceiver><|endoftext|>


Prompt:
public val versionRequirements: MutableList<KmVersionRequirement> = ArrayList(0)

    internal val extensions: List<KmConstructorExtension> =
        MetadataExtensions.INSTANCES.map(MetadataExtensions::createConstructorExtension)
}

/**
 * Represents a Kotlin function declaration.
 *
 * Various function attributes can be read and manipulated via extension properties,

Response:
* such as [KmFunction.visibility] or [KmFunction.isSuspend].
 *
 * @property name the name of the function
 */
public class KmFunction internal constructor(internal var flags: Int, public var name: String) {

    public constructor(name: String) : this(0, name)

    /**
     * Type parameters of the function.
     */<|endoftext|>


Prompt:
fun checkEqual(message: String, a1: Any, a2: Any) {
    if (a1 != a2) {
        throw Exception("$message: equals: $a1 != $a2")
    }
    if (a1.hashCode() != a2.hashCode()) {
        throw Exception("$message: hashCode: ${a1.hashCode()} != ${a2.hashCode()}")

Response:
}
}

fun checkNotEqual(message: String, a1: Any, a2: Any) {
    if (a1 == a2) {
        throw Exception("$message: equals: $a1 == $a2")
    }
}

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


Prompt:
if (propertyA.setter != null && propertyB.setter != null)
            compareFlags(propertyContext, propertyA.setter!!, propertyB.setter!!, PROPERTY_ACCESSOR_FLAGS, FlagKind.SETTER)

        compareAnnotationLists(propertyContext, propertyA.annotations, propertyB.annotations)

Response:
compareAnnotationLists(propertyContext, propertyA.getterAnnotations, propertyB.getterAnnotations, AnnotationKind.GETTER)
        compareAnnotationLists(propertyContext, propertyA.setterAnnotations, propertyB.setterAnnotations, AnnotationKind.SETTER)

        compareTypeParameterLists(propertyContext, propertyA.typeParameters, propertyB.typeParameters)<|endoftext|>


Prompt:
body = context.createIrBuilder(symbol).run {
            irExprBody(irInt(flags))
        }
    }

    protected fun IrSimpleFunction.generateWriteToParcelBody(
        irClass: IrClass,
        parcelerObject: IrClass?,
        parcelableProperties: List<ParcelableProperty?>,
        receiverParameter: IrValueParameter,

Response:
parcelParameter: IrValueParameter,
        flagsParameter: IrValueParameter
    ) {
        body = androidSymbols.createBuilder(symbol).run {
            irBlockBody {
                when {
                    parcelerObject != null ->
                        +parcelerWrite(parcelerObject, parcelParameter, flagsParameter, irGet(receiverParameter))

                    parcelableProperties.isNotEmpty() -><|endoftext|>


Prompt:
when (this) {
                is IrPropertyWithLateBinding -> {
                    this.visibility = maxVisibilityMember.visibility
                    this.modality = modality
                    maxVisibilityMember as IrProperty
                    this.getter = this.getter?.updateAccessorModalityAndVisibility(
                        modality, (maxVisibilityMember.getter ?: maxVisibilityMember).visibility
                    )

Response:
this.setter = this.setter?.updateAccessorModalityAndVisibility(
                        modality, (maxVisibilityMember.setter ?: maxVisibilityMember).visibility
                    )
                }
                is IrFunctionWithLateBinding -> {
                    this.visibility = maxVisibilityMember.visibility
                    this.modality = modality
                }<|endoftext|>


Prompt:
// Out<*> is the same as Out<SubstitutedUpperBounds> (i.e. Out<Supertype(CapturedType(*))>)
        ProjectionKind.STAR -> session.typeApproximator.approximateToSuperType(
            capturedTypeArgument, TypeApproximatorConfiguration.FinalApproximationAfterResolutionAndInference
        )
        else -> null
    }
}

Response:
private fun ConeClassLikeType.computePartialExpansion(
    useSiteSession: FirSession,
    supertypeSupplier: SupertypeSupplier
): ConeClassLikeType = fullyExpandedType(useSiteSession) { supertypeSupplier.expansionForTypeAlias(it, useSiteSession) }

private fun FirClassLikeSymbol<*>.collectSuperTypes(<|endoftext|>


Prompt:
?: return ErrorExpressionGenerator(statementGenerator).generateErrorExpression(
                ktBreak, RuntimeException("Loop not found for break expression: ${ktBreak.text}")
            )
        return IrBreakImpl(
            ktBreak.startOffsetSkippingComments, ktBreak.endOffset, context.irBuiltIns.nothingType, parentLoop
        ).apply {

Response:
label = parentLoop.label.takeIf { ktBreak.getLabelName() != null }
        }
    }

    fun generateContinue(ktContinue: KtContinueExpression): IrExpression {
        val parentLoop = findParentLoop(ktContinue)
            ?: return ErrorExpressionGenerator(statementGenerator).generateErrorExpression(<|endoftext|>


Prompt:
if (nativeMath.abs(x) >= taylor_2_bound) {
                // approximation by taylor series in x at 0 up to order 4
                result -= (x * x * x) / 6
            }
            result
        }
    }

/**
 * Computes the inverse hyperbolic cosine of the value [x].
 *

Response:
* The returned value is positive `y` such that `cosh(y) == x`.
 *
 * Special cases:
 *   - `acosh(NaN)` is `NaN`
 *   - `acosh(x)` is `NaN` when `x < 1`
 *   - `acosh(+Inf)` is `+Inf`
 */
@SinceKotlin("1.2")<|endoftext|>


Prompt:
setter?.valueParameters?.first()?.findAnnotation(annotationEntry)?.let { return it }
        }

        return when {
            !goDeep -> null
            this is FirProperty -> correspondingValueParameterFromPrimaryConstructor?.fir?.resolveAndFindAnnotation(annotationEntry)
            this is FirValueParameter -> correspondingProperty?.resolveAndFindAnnotation(annotationEntry)

Response:
else -> null
        }
    }

    private fun FirAnnotationContainer.findAnnotation(
        annotationEntry: KtAnnotationEntry,
    ): FirAnnotation? = annotations.find { it.psi == annotationEntry }
}

private fun KtDeclaration.isPartOf(callableDeclaration: KtCallableDeclaration): Boolean = when (this) {<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.TypeVarianceConflictInExpandedType

internal class SmartcastImpossibleImpl(
    override val desiredType: KtType,
    override val subject: KtExpression,
    override val description: String,
    override val isCastToNotNull: Boolean,

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

internal class SmartcastImpossibleOnImplicitInvokeReceiverImpl(
    override val desiredType: KtType,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.backend.konan.llvm.CodeGenerator
import org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportBlockCodeGenerator
import org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGenerator

Response:
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageUtil
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.konan.exec.Command<|endoftext|>


Prompt:
val DOCUMENT_POSITION_CONTAINS: Short
        val DOCUMENT_POSITION_CONTAINED_BY: Short
        val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short
    }
}

/**
 * Exposes the JavaScript [HTMLHeadElement](https://developer.mozilla.org/en/docs/Web/API/HTMLHeadElement) to Kotlin
 */

Response:
public external abstract class HTMLHeadElement : HTMLElement {
    companion object {
        val ELEMENT_NODE: Short
        val ATTRIBUTE_NODE: Short
        val TEXT_NODE: Short
        val CDATA_SECTION_NODE: Short
        val ENTITY_REFERENCE_NODE: Short
        val ENTITY_NODE: Short<|endoftext|>


Prompt:
/** Divides this value by the other value, truncating the result to an integer that is closer to zero. */
    @kotlin.internal.IntrinsicConstEvaluation
    public operator fun div(other: Long): Long =
        this.divide(other)

    /** Divides this value by the other value. */
    @kotlin.internal.IntrinsicConstEvaluation

Response:
public inline operator fun div(other: Float): Float =
        this.toFloat().div(other)

    /** Divides this value by the other value. */
    @kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun div(other: Double): Double =
        this.toDouble().div(other)

    /**<|endoftext|>


Prompt:
.mapNotNull { runCatching { it.kotlin }.getOrNull() }
            .filter { runCatching { it.superclasses }.isSuccess } // Filter out Packages and file facades
            .filter { !it.qualifiedName.orEmpty().startsWith("$ideaTcsPackage.test") } // Filter out test sources
            .toSet()
    }

Response:
private object AllClassScanner : Scanner {
        override fun scan(classFile: ClassFile): MutableList<MutableMap.MutableEntry<String, String>> {
            return mutableListOf(entry(classFile.name, classFile.name))
        }
    }

    fun Class<*>.getDeclaredFieldOrNull(name: String): Field? {
        return try {<|endoftext|>


Prompt:
open var encoding: String
    open var method: String
    open var name: String
    open var noValidate: Boolean
    open var target: String
    open val elements: HTMLFormControlsCollection
    open val length: Int
    fun submit()
    fun reset()
    fun checkValidity(): Boolean
    fun reportValidity(): Boolean

    companion object {
        val ELEMENT_NODE: Short

Response:
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<|endoftext|>


Prompt:
if (c.add("") !== c) return "fail 2"
    if (c.addAll(java.util.ArrayList()) !== c) return "fail 3"

    val method = c.javaClass.methods.single { it.name == "remove" && it.returnType == Boolean::class.javaPrimitiveType }

    try {
        method.invoke(c, "")

Response:
return "fail 4"
    } catch (e: java.lang.reflect.InvocationTargetException) {
        if (e.cause!!.message != "Operation is not supported for read-only collection") return "fail 5: ${e.cause!!.message}"
    }

    return "OK"
}<|endoftext|>


Prompt:
import objcnames.protocols.ForwardDeclaredProtocolProtocol
import a.*
import kotlinx.cinterop.*

fun testStruct(s: Any?) = consumeStruct(s as CPointer<ForwardDeclaredStruct>)
fun testClass(s: Any?) = consumeClass(s as ForwardDeclaredClass)

Response:
fun testProtocol(s: Any?) = consumeProtocol(s as ForwardDeclaredProtocolProtocol)

fun <T : ForwardDeclaredClass> testClass2Impl(s: Any?) = consumeClass(s as T)
fun <T : ForwardDeclaredProtocolProtocol> testProtocol2Impl(s: Any?) = consumeProtocol(s as T)<|endoftext|>


Prompt:
val men = arrayListOf(Person1("Phill"), Person1(), Person1("Bob"))
    for (k in men) {
        k.name
        loop@ for (i in men) {
            i.name
            <!UNREACHABLE_CODE!>val valeua : Int =<!>     break@loop
            <!UNREACHABLE_CODE!>i.name<!>

Response:
}
        k.name
        val s = k.name ?: break
        k.name
    }
    val a = 1
}

class Person1(var name: String? = null) {}

// TESTCASE NUMBER: 2

fun case2() {
    var name: Any? = null
    val men = arrayListOf(Person2("Phill"), Person2(), Person2("Bob"))<|endoftext|>


Prompt:
final override fun visitDelegateFieldReference(delegateFieldReference: FirDelegateFieldReference, data: D): FirReference {
        return transformDelegateFieldReference(delegateFieldReference, data)
    }

    open fun transformBackingFieldReference(backingFieldReference: FirBackingFieldReference, data: D): FirReference {
        return transformElement(backingFieldReference, data)
    }

Response:
final override fun visitBackingFieldReference(backingFieldReference: FirBackingFieldReference, data: D): FirReference {
        return transformBackingFieldReference(backingFieldReference, data)
    }

    open fun transformResolvedCallableReference(resolvedCallableReference: FirResolvedCallableReference, data: D): FirReference {
        return transformElement(resolvedCallableReference, data)
    }<|endoftext|>


Prompt:
override fun getListOfAcceptableFunctions(): List<String> {
        return listOf("kotlin.arrayOfNulls")
    }

    override fun evaluate(irFunction: IrFunction, environment: IrInterpreterEnvironment) {
        val size = environment.callStack.loadState(irFunction.valueParameters.first().symbol).asInt()

Response:
val array = arrayOfNulls<Any?>(size)
        val typeArgument = irFunction.typeParameters.map { environment.callStack.loadState(it.symbol) }.single() as KTypeState
        val returnType = (irFunction.returnType as IrSimpleType).buildSimpleType {
            arguments = listOf(makeTypeProjection(typeArgument.irType, Variance.INVARIANT))<|endoftext|>


Prompt:
override fun a(b: C, c: B): D
    override fun b(a: D, c: B): C
    override fun c(a: D, b: C): B
    inner class Inner<C, D : C, E : J2<C, D>>() {
        fun dependentFunction(value: A): E

Response:
fun <A : CharSequence, E : Number> independentFunction(value: A): E
    }
}<|endoftext|>


Prompt:
}
    }
}

// TESTCASE NUMBER: 3
fun <T> case_3(x: Any?) where T: CharSequence, T: Number {
    class Case1<K> where K : T {
        inline fun <reified T : K> case_1() {
            if (x is T) {

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


Prompt:
private val valueDirectivesMap = mutableMapOf<ValueDirective<*>, CompilerConfigurationKey<*>>()

    fun register(
        directive: SimpleDirective,
        key: CompilerConfigurationKey<Boolean>,
        isInverted: Boolean = false
    ) {
        booleanDirectivesMap[directive] = key
        if (isInverted) {
            invertedBooleanDirectives += directive

Response:
}
    }

    fun <T : Any> register(
        directive: ValueDirective<T>,
        key: CompilerConfigurationKey<T>
    ) {
        valueDirectivesMap[directive] = key
    }

    fun configure(configuration: CompilerConfiguration, registeredDirectives: RegisteredDirectives) {
        for ((directive, key) in booleanDirectivesMap) {<|endoftext|>


Prompt:
val descriptor = trace.get(BindingContext.ANNOTATION, entry) ?: continue
            val classDescriptor = descriptor.annotationClass ?: continue
            // This check matters for the applicable annotations only.
            val applicableTargets = AnnotationChecker.applicableTargetSetFromTargetAnnotationOrNull(classDescriptor)

Response:
if (applicableTargets == null || !applicableTargets.contains(KotlinTarget.FILE)) continue
            fileAnnotationsToCheck.add(Pair(entry, classDescriptor))
        }

        val isMultifileClass = fileAnnotationsToCheck.any { it.second.fqNameSafe == JVM_MULTIFILE_CLASS }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.KtCallableSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtClassLikeSymbol
import org.jetbrains.kotlin.kdoc.psi.impl.KDocName
import org.jetbrains.kotlin.name.FqName

Response:
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtThisExpression

internal class KtFe10ReferenceShortener(
    override val analysisSession: KtFe10AnalysisSession,
) : KtReferenceShortener(), Fe10KtAnalysisSessionComponent {
    override val token: KtLifetimeToken<|endoftext|>


Prompt:
STRING_NULL_DEFAULT,
    EMPTY_STRING_LIST_DEFAULT,
    EMPTY_STRING_ARRAY_DEFAULT,
    LANGUAGE_VERSIONS,
    API_VERSIONS,
    JVM_TARGET_VERSIONS,
    JS_ECMA_VERSIONS,
    JS_MODULE_KINDS,
    JS_SOURCE_MAP_CONTENT_MODES,

Response:
JS_MAIN,
    JS_SOURCE_MAP_NAMES_POLICY,
}

enum class GradleInputTypes(val gradleType: String) {
    INPUT("org.gradle.api.tasks.Input"),
    INTERNAL("org.gradle.api.tasks.Internal")
}<|endoftext|>


Prompt: var l1: Int = <!PROPERTY_INITIALIZER_IN_INTERFACE!>0<!>;  <!WRONG_MODIFIER_TARGET!>abstract<!> get  <!WRONG_MODIFIER_TARGET!>abstract<!> set

Response:
var n: Int                       <!WRONG_MODIFIER_TARGET!>abstract<!> get <!WRONG_MODIFIER_TARGET!>abstract<!> set(v: Int) {}
}<|endoftext|>


Prompt:
@SinceKotlin("1.1")
    @kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun rem(other: Long): Long =
        this.toLong() % other

    /**
     * Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
     *

Response:
* 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
    public inline operator fun rem(other: Float): Float =
        this.toFloat() % other

    /**<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.test.framework.utils.executeOnPooledThreadInReadAction
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.assertions

Response:
abstract class AbstractRendererTest : AbstractAnalysisApiBasedTest() {
    override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {
        val renderer = KtDeclarationRendererForSource.WITH_SHORT_NAMES.with {<|endoftext|>


Prompt:
// !CHECK_TYPE

//KT-2176 non-nullability is not inferred after !! or "as"
package kt2176

import checkSubtype

fun f1(a: String?) {
    a!!
    checkSubtype<String>(<!DEBUG_INFO_SMARTCAST!>a<!>)
}

fun f2(a: String) {

Response:
a<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
    checkSubtype<String>(a)
}

fun f3(a: Any?) {
    a as String
    checkSubtype<String>(<!DEBUG_INFO_SMARTCAST!>a<!>)
}

fun f4(a: Any) {
    a as String<|endoftext|>


Prompt:
val x: (Int) -> @Ann(<!UNRESOLVED_REFERENCE!>unresolved_reference<!>) Unit = {} // OK, no error in IDE and in the compiler
}

/*
 * TESTCASE NUMBER: 2
 * UNEXPECTED BEHAVIOUR
 */
fun case_2() {

Response:
val x: (@Ann(<!UNRESOLVED_REFERENCE!>unresolved_reference<!>) Int) -> Unit = { a: Int -> println(a) } // OK, no error in IDE and in the compiler
}

// TESTCASE NUMBER: 3
fun case_3() {<|endoftext|>


Prompt:
// DONT_TARGET_EXACT_BACKEND: JS
// EXPECTED_REACHABLE_NODES: 1270
// SKIP_MINIFICATION
// ES_MODULES
// WITH_STDLIB

// MODULE: vararg
// FILE: lib.kt
@JsExport
fun uintVararg(vararg uints: UInt): String {
    for (u in uints)  {

Response:
if (u == 0u) return "Failed"
    }

    return "OK"
}

@JsExport
fun uint(a: Int): UInt {
    return a.toUInt()
}

// FILE: main.mjs
// ENTRY_ES_MODULE
import { uint, uintVararg } from "./vararg-vararg_v5.mjs"<|endoftext|>


Prompt:
model(it, "sealedInheritors")
        }

        test<AbstractDanglingFileSealedInheritorsTest> {
            model(it, "sealedInheritors")
        }
    }

    component("multiplatformInfoProvider") {
        test<AbstractExpectForActualTest> {
            model(it, "expectForActual")
        }
    }

Response:
component("psiTypeProvider") {
        test<AbstractAnalysisApiPsiTypeProviderTest> {
            model(it, "psiType/forDeclaration")
        }

        test<AbstractAnalysisApiExpressionPsiTypeProviderTest> {
            model(it, "psiType/forExpression")
        }<|endoftext|>


Prompt:
fun IrSimpleType.toBuilder(): IrSimpleTypeBuilder =
    IrSimpleTypeBuilder().also { b ->
        b.kotlinType = originalKotlinType
        if (this is IrCapturedType) {
            b.captureStatus = captureStatus
            b.capturedLowerType = lowerType
            b.capturedTypeConstructor = constructor
        } else {
            b.classifier = classifier
        }

Response:
b.nullability = nullability
        b.arguments = arguments
        b.annotations = annotations
        b.abbreviation = abbreviation
    }

fun IrSimpleTypeBuilder.buildSimpleType(): IrSimpleType =
    if (classifier == null) {
        check(captureStatus != null && capturedTypeConstructor != null) {
            "Neither classifier nor captured type constructor is provided"
        }<|endoftext|>


Prompt: <!EXPECTED_CONDITION!>is <!UNRESOLVED_REFERENCE!>SomeClass<!><!><!COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT!>,<!> <!EXPECTED_CONDITION!>is

Response: <!UNRESOLVED_REFERENCE!>OtherClass<!><!><!SYNTAX!><!><|endoftext|>


Prompt:
// IMPORTANT!
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
// examine the resulting bytecode shape carefully.
// Range and progression-based loops generated with Kotlin compiler should be
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
// Otherwise it may result in performance regression due to missing HotSpot optimizations.

Response:
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
// with compiler built from your changes if you are not sure.

fun intArray() = intArrayOf(0, 0, 0, 0)
fun longArray() = longArrayOf(0, 0, 0, 0)

fun f(): Int {
    var n = 0
    for (i in intArray()) {<|endoftext|>


Prompt:
private fun popBuilder(): ControlFlowInstructionsGeneratorWorker {
        val worker = builders.pop()
        builder = if (!builders.isEmpty()) {
            builders.peek()
        } else {
            null
        }
        return worker
    }

    override fun enterSubroutine(subroutine: KtElement, eventOccurrencesRange: EventOccurrencesRange?) {
        val builder = builder

Response:
val shouldInlnie = eventOccurrencesRange != null
        if (builder != null && subroutine is KtFunctionLiteral) {
            pushBuilder(subroutine, builder.returnSubroutine, shouldInlnie)
        } else {
            pushBuilder(subroutine, subroutine, shouldInlnie)
        }
        delegateBuilder.enterBlockScope(subroutine)<|endoftext|>


Prompt:
return <!UNRESOLVED_REFERENCE!>listOf<!>(bar.doSomething())
        }
    }
}

class Bar() : IInterfaceInput<Baz>, IInterfaceOutput<Baz> {
    override fun doSomething(input: Baz) {
        throw UnsupportedOperationException("not implemented")
    }

    override fun doSomething(): Baz {

Response:
throw UnsupportedOperationException("not implemented")
    }

}

data class Baz(val myField: Int)<|endoftext|>


Prompt:
)

            buildWithCocoapodsWrapper(":linkPodDebugFrameworkIOS") {
                assertTasksExecuted(":podBuildAFNetworkingIphonesimulator")
                assertTasksExecuted(":podBuildSDWebImageIphonesimulator")
                assertTasksExecuted(":podBuildSSZipArchiveIphonesimulator")

Response:
assertTasksExecuted(":cinteropSDWebImageIOS")

                extractNativeTasksCommandLineArgumentsFromOutput(":linkPodDebugFrameworkIOS") {
                    assertCommandLineArgumentsContainSequentially("-linker-option", "-framework", "-linker-option", "AFNetworking")<|endoftext|>


Prompt:
attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(NativeDependenciesUsage.NATIVE_DEPENDENCY))
        }
    }

    /**
     * Root directory where to place all dependencies.
     */
    abstract val dependenciesDirectory: DirectoryProperty

    /**
     * Dependency repository.
     */
    abstract val repositoryURL: Property<String>

Response:
abstract class Target @Inject constructor(
            private val owner: NativeDependenciesDownloaderExtension,
            private val _target: TargetWithSanitizer,
    ) {
        val target by _target::target
        val sanitizer by _target::sanitizer

        private val project by owner::project

        private val platformManager = project.extensions.getByType<PlatformManager>()<|endoftext|>


Prompt:
assertEquals(null, TestObject.readOnlyNativeFooNWrapper.nativeFooN?.s)

    assertEquals(null, TestObject.readOnlyNativeFooNWrapperN?.nativeFooN?.s)
    TestObject.nativeFooNWrapperN = NativeFooNWrapper(NativeFoo("Boston"))

Response:
assertEquals("Boston", TestObject.readOnlyNativeFooNWrapperN?.nativeFooN?.s)
    TestObject.nativeFooNWrapperN = NativeFooNWrapper(null)
    assertEquals(null, TestObject.readOnlyNativeFooNWrapperN?.nativeFooN?.s)

    nullifyTestProperties(TestObject)
}<|endoftext|>


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

internal class ReifiedTypeParameterInOverrideImpl(
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,

Response:
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.ReifiedTypeParameterInOverride

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


Prompt:
parameterFromSuperclass
                    )
                )
            }
        }
    }

    private fun checkNameAndDefaultForFakeOverrideParameter(
        containingFunction: CallableMemberDescriptor,
        descriptor: ValueParameterDescriptor,
        multipleDefaultsInSuper: Boolean
    ) {
        val containingClass = containingFunction.containingDeclaration

Response:
val classElement = DescriptorToSourceUtils.descriptorToDeclaration(containingClass) as KtClassOrObject?
            ?: error("Declaration not found for class: $containingClass")

        if (multipleDefaultsInSuper) {<|endoftext|>


Prompt:
fun popCycledSymbolIfExists(): FirCallableSymbol<*>? = cycledSymbol?.also { cycledSymbol = null }
}

/**
 * This resolver is responsible for [IMPLICIT_TYPES_BODY_RESOLVE][FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE] phase.
 *
 * This resolver:

Response:
* - Transforms [FirImplicitTypeRef] into [FirResolvedTypeRef][org.jetbrains.kotlin.fir.types.FirResolvedTypeRef].
 *
 * Before the transformation, the resolver [recreates][BodyStateKeepers] all bodies
 * to prevent corrupted states due to [PCE][com.intellij.openapi.progress.ProcessCanceledException].
 *<|endoftext|>


Prompt:
parameter<String>("reference")
        }

        val DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE by error<PsiElement>()

        val MISSING_DEPENDENCY_CLASS by error<PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED) {
            parameter<ConeKotlinType>("type")
        }

Response:
val MISSING_DEPENDENCY_CLASS_IN_EXPRESSION_TYPE by warning<PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED) {
            parameter<ConeKotlinType>("type")
        }<|endoftext|>


Prompt:
fun FirMemberDeclaration.setLazyPublishedVisibility(annotations: List<FirAnnotation>, parentProperty: FirProperty?, session: FirSession) {
    setLazyPublishedVisibility(
        hasPublishedApi = annotations.any { it.unexpandedClassId == StandardClassIds.Annotations.PublishedApi },
        parentProperty,
        session
    )
}

Response:
fun FirMemberDeclaration.setLazyPublishedVisibility(hasPublishedApi: Boolean, parentProperty: FirProperty?, session: FirSession) {
    if (!hasPublishedApi) return

    lazyPublishedApiEffectiveVisibility = lazy {
        val containingClassLookupTag = (when {
            parentProperty != null -> parentProperty.symbol.callableId.classId<|endoftext|>


Prompt:
model("codegen/boxInline")
            }

            testClass<AbstractFirBlackBoxCodegenTestWithInlineScopes>("FirBlackBoxModernJdkCodegenTestGeneratedWithInlineScopes") {
                model("codegen/boxModernJdk")
            }
        }

        // ---------------------------------------------- FIR tests ----------------------------------------------

Response:
testGroup(testsRoot = "compiler/fir/analysis-tests/tests-gen", testDataRoot = "compiler/testData") {
            testClass<AbstractFirPsiDiagnosticTest>(suiteTestClassName = "FirPsiOldFrontendDiagnosticsTestGenerated") {
                model(
                    "diagnostics/tests", pattern = "^(.*)\\.kts?$",<|endoftext|>


Prompt:
modification.execute(moduleTestDir, moduleSourceDir) {}
            }

            val outputKlibFile = resolveModuleArtifact(module, buildDir)

            val friends = mutableListOf<File>()
            if (moduleStep.rebuildKlib) {
                val dependencies = mutableListOf(File(STDLIB_KLIB), File(KOTLIN_TEST_KLIB))

Response:
for (dep in moduleStep.dependencies) {
                    val klibFile = resolveModuleArtifact(dep.moduleName, buildDir)
                    dependencies += klibFile
                    if (dep.isFriend) {
                        friends += klibFile
                    }
                }
                val configuration = createConfiguration(module, projStep.language, projectInfo.moduleKind)<|endoftext|>


Prompt:
/** Subtracts the other value from this value. */
    @kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun minus(other: Byte): Int =
        this.toInt() - other.toInt()

    /** Subtracts the other value from this value. */
    @kotlin.internal.IntrinsicConstEvaluation

Response:
public inline operator fun minus(other: Short): Int =
        this.toInt() - other.toInt()

    /** Subtracts the other value from this value. */
    @kotlin.internal.IntrinsicConstEvaluation
    public inline operator fun minus(other: Int): Int =
        this.toInt() - other

    /** Subtracts the other value from this value. */<|endoftext|>


Prompt:
if (envBuildType == null || envTargets.isEmpty() || envEmbeddedFrameworksDir == null) {
        locateOrRegisterTask<DefaultTask>(frameworkTaskName) { task ->
            task.group = BasePlugin.BUILD_GROUP
            task.description = "Embed and sign ${framework.namePrefix} framework as requested by Xcode's environment variables"
            task.doFirst {

Response:
fireEnvException(frameworkTaskName)
            }
        }
        return
    }

    val checkSandboxAndWriteProtectionTask = locateOrRegisterTask<DefaultTask>(AppleXcodeTasks.checkSandboxAndWriteProtection) { task ->
        task.group = BasePlugin.BUILD_GROUP<|endoftext|>


Prompt:
val classSuite = expectations.getOrCreateClassSuite(className)

                    when (kind) {
                        "class" -> classSuite.addClassExpectation(className, jvmSignature, genericSignature)
                        "field" -> classSuite.addFieldExpectation(className, memberName, jvmSignature, genericSignature)

Response:
"method" -> classSuite.addMethodExpectation(className, memberName, jvmSignature, genericSignature)
                        else -> throw AssertionError("$ktFile:${lineNo + 1}: unsupported expectation kind: $kind")
                    }

                    // Expectation, skip the following 'jvm signature' and 'generic signature' lines
                    lineNo += 3
                } else {<|endoftext|>


Prompt:
if (resolvedArgument !is ResolvedCallArgument.SimpleArgument) {
                        error("Incorrect resolved argument for parameter $parameter :$resolvedArgument")
                    } else {
                        if (resolvedArgument.callArgument.isSpread) {
                            addDiagnostic(NonVarargSpread(resolvedArgument.callArgument))
                        }
                    }
                }
            }

Response:
for (parameter in parameters) {
                if (!result.containsKey(parameter.original)) {
                    if (parameter.hasDefaultValue()) {
                        result[parameter.original] = ResolvedCallArgument.DefaultArgument
                    } else if (parameter.isVararg) {
                        result[parameter.original] = ResolvedCallArgument.VarargArgument(emptyList())
                    } else {<|endoftext|>


Prompt:
// ISSUE: KT-60450
fun main() {
    val l = listOf<String>()
    l.zip(l).forEach { left, <!CANNOT_INFER_PARAMETER_TYPE!>right<!><!SYNTAX!><!>

    }

Response:
l.zip(l).forEach <!ARGUMENT_TYPE_MISMATCH!>{ left, <!CANNOT_INFER_PARAMETER_TYPE!>right<!> ->

    }<!>
}<|endoftext|>


Response:
if (z == null) {
            <!DEBUG_INFO_CONSTANT, DEBUG_INFO_EXPRESSION_TYPE("case_25.`<anonymous>`.`<no name provided>`? & kotlin.Nothing?")!>z<!>
        }
    }
}

// TESTCASE NUMBER: 26<|endoftext|>


Prompt:
val superclassName = (supertype.classifier as? KmClassifier.Class)?.name ?: return@supertype
            if (!superclassName.isInSamePackage()) return@supertype
            val sealedClass = sealedClassesMap[superclassName] ?: return@supertype
            sealedClass.sealedSubclasses += clazz.name
        }
    }
}

Response:
internal fun CirClassConstructor.serializeConstructor(
    context: CirTreeSerializationContext
): KmConstructor = KmConstructor().also { constructor ->
    constructor.modifiersFrom(this)
    annotations.mapTo(constructor.annotations) { it.serializeAnnotation() }
    // TODO: nowhere to write constructor type parameters<|endoftext|>


Prompt:
// non-default accessor modality is always final, so we check property.modality instead
            ProtoEnumFlags.modality(property.modality!!),
            !isDefault,
            accessor.isExternal,
            accessor.isInline
        )
    }

    private fun createChildSerializer(declaration: FirDeclaration): FirElementSerializer =
        FirElementSerializer(

Response:
session, scopeSession, declaration, Interner(typeParameters), extension,
            typeTable, versionRequirementTable, serializeTypeTableToFunction = false,
            typeApproximator, languageVersionSettings, produceHeaderKlib
        )

    val stringTable: FirElementAwareStringTable
        get() = extension.stringTable

    private fun useTypeTable(): Boolean = extension.shouldUseTypeTable()<|endoftext|>


Prompt:
fun getMissingCases(expression: KtWhenExpression, context: BindingContext, nullable: Boolean) =
        if (nullable) getNullCaseIfMissing(expression, context) else listOf()

    private fun getNullCaseIfMissing(expression: KtWhenExpression, context: BindingContext): List<WhenMissingCase> {
        for (entry in expression.entries) {

Response:
for (condition in entry.conditions) {
                if (condition is KtWhenConditionWithExpression) {
                    condition.expression?.let {
                        val type = context.getType(it)
                        if (type != null && KotlinBuiltIns.isNullableNothing(type)) {
                            return listOf()
                        }
                    }
                }
            }
        }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryAttributes
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCapability
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCoordinates
import org.junit.Test

Response:
class IdeaKotlinBinaryCoordinatesSerializationTest : AbstractSerializationTest<IdeaKotlinBinaryCoordinates>() {
    override fun serialize(value: IdeaKotlinBinaryCoordinates): ByteArray = IdeaKotlinBinaryCoordinatesProto(value).toByteArray()

    override fun deserialize(data: ByteArray): IdeaKotlinBinaryCoordinates =<|endoftext|>


Prompt:
<!CONFLICTING_OVERLOADS!>tailrec fun testDifferencesInTailrecModifierPresenceReverse()<!> {}
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun testDifferencesInTailrecModifierPresenceReverse()<!> {}

Response:
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) private fun testIdenticalPrivateVisibility()<!> {}
<!CONFLICTING_OVERLOADS!>private fun testIdenticalPrivateVisibility()<!> {}<|endoftext|>


Prompt:
// JVM_ABI_K1_K2_DIFF: KT-63861

// FILE: 1.kt

package test

public inline fun doCall(block: ()-> Int, exception: (e: Exception)-> Unit, finallyBlock: ()-> Int, res: Int = -111) : Int {
    try {
        return block()
    } catch (e: Exception) {
        exception(e)

Response:
} finally {
        finallyBlock()
    }
    return res
}

public inline fun <R> doCall2(block: ()-> R, exception: (e: Exception)-> Unit, finallyBlock: ()-> R, res: R) : R {
    try {
        return block()
    } catch (e: Exception) {
        exception(e)
    } finally {
        finallyBlock()<|endoftext|>


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

@file:Suppress("DuplicatedCode", "unused")

package org.jetbrains.kotlin.fir.expressions.builder

import kotlin.contracts.*

Response:
import org.jetbrains.kotlin.KtSourceElement
import org.jetbrains.kotlin.fir.FirImplementationDetail
import org.jetbrains.kotlin.fir.builder.FirAnnotationContainerBuilder
import org.jetbrains.kotlin.fir.builder.FirBuilderDsl<|endoftext|>


Prompt:
// WITH_STDLIB
import kotlin.test.assertEquals

enum class TestEnumClass(val x: Int) {
    ZERO
//    {
//        init {
//        }
//    }
    ;
    constructor(): this(0)
}

fun box(): String {
    assertEquals(TestEnumClass.ZERO.x, 0)

    return "OK"

Response: }<|endoftext|>


Prompt: 0x0000, 0x0020, 0x0022, 0x0027, 0x002b, 0x002e, 0x0030, 0x003a, 0x003c, 0x003f, 0x0041, 0x005b, 0x005e, 0x0061, 0x007b, 0x007e, 0x007f, 0x00a0, 0x00a2,

Response: 0x00a6,<|endoftext|>


Prompt:
const val minus8 = twoVal.<!EVALUATED("0.0")!>minus(doubleVal)<!>

const val times1 = oneVal.<!EVALUATED("2")!>times(twoVal)<!>
const val times2 = twoVal.<!EVALUATED("4")!>times(twoVal)<!>

Response:
const val times3 = threeVal.<!EVALUATED("6")!>times(twoVal)<!>
const val times4 = twoVal.<!EVALUATED("4")!>times(byteVal)<!>
const val times5 = twoVal.<!EVALUATED("4")!>times(shortVal)<!><|endoftext|>


Prompt:
package cases.whenMappings

enum class SampleEnum {
    A,
    B,
    C
}

fun SampleEnum.deacronimize() = when (this) {
    SampleEnum.A -> "Apple"
    SampleEnum.B -> "Biscuit"
    SampleEnum.C -> "Cinnamon"
}

Response:
inline fun SampleEnum.switch(thenA: () -> Unit, thenB: () -> Unit, thenC: () -> Unit) = when (this) {
    SampleEnum.C -> thenC()
    SampleEnum.B -> thenB()
    SampleEnum.A -> thenA()
}<|endoftext|>


Prompt:
const val rem1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>byteVal.rem(byteVal)<!>
const val rem2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>byteVal.rem(shortVal)<!>

Response:
const val rem3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>byteVal.rem(intVal)<!>
const val rem4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>byteVal.rem(longVal)<!><|endoftext|>


Prompt:
public external abstract class SVGTransform : JsAny {
    open val type: Short
    open val matrix: DOMMatrix
    open val angle: Float
    fun setMatrix(matrix: DOMMatrixReadOnly)
    fun setTranslate(tx: Float, ty: Float)
    fun setScale(sx: Float, sy: Float)
    fun setRotate(angle: Float, cx: Float, cy: Float)

Response:
fun setSkewX(angle: Float)
    fun setSkewY(angle: Float)

    companion object {
        val SVG_TRANSFORM_UNKNOWN: Short
        val SVG_TRANSFORM_MATRIX: Short
        val SVG_TRANSFORM_TRANSLATE: Short
        val SVG_TRANSFORM_SCALE: Short<|endoftext|>


Prompt:
takeUByte(EXPLICIT_INT)

    takeUShort(IMPLICIT_INT)
    takeUShort(BIGGER_THAN_UBYTE)

    takeUInt(IMPLICIT_INT)

    takeULong(IMPLICIT_INT)

    takeUBytes(IMPLICIT_INT, EXPLICIT_INT, 42u)

Response:
takeLong(<!TYPE_MISMATCH!>IMPLICIT_INT<!>)

    takeIntWithoutAnnotation(IMPLICIT_INT)

    takeUIntWithoutAnnotaion(UINT_CONST)

    takeUByte(<!TYPE_MISMATCH!>LONG_CONST<!>)<|endoftext|>


Prompt:
override val pub1: String
        get() = ""

}

fun case1(){
    val a = Case1()
    a.<!INVISIBLE_REFERENCE!>priv<!>()
    a.<!INVISIBLE_REFERENCE!>prot<!>()
    a.int()
    a.pub()

Response:
a.<!INVISIBLE_REFERENCE!>priv1<!>
    a.<!INVISIBLE_REFERENCE!>prot1<!>
    a.int1
    a.pub1
}

//MODULE: implBase(base)
//FILE: Impl.kt
package implBase
import base.*

// TESTCASE NUMBER: 2
fun case2() {<|endoftext|>


Prompt:
<!INVISIBLE_SETTER!>javaClass.<!INVISIBLE_SETTER!>somethingPublic<!><!> = 1
}

// FILE: JavaClass.java
public class JavaClass {
    public int getSomethingPublic() { return 1; }
    protected int getSomethingProtected() { return 1; }
    private int getSomethingPrivate() { return 1; }

Response:
int getSomethingPackage() { return 1; }

    protected void setSomethingPublic(int value) {}
}<|endoftext|>


Prompt:
operator fun invoke(usedDeprecatedFlags: List<String>) = build(
            "The following properties are obsolete and no longer supported:\n" +
                    "${usedDeprecatedFlags.joinToString()}\n" +
                    "Read the details here: https://kotlinlang.org/docs/multiplatform-compatibility-guide.html#deprecate-hmpp-properties",
        )
    }

Response:
object DeprecatedKotlinNativeTargetsDiagnostic : ToolingDiagnosticFactory(ERROR) {
        operator fun invoke(usedTargetIds: List<String>) = build(
            "The following removed Kotlin/Native targets were used in the project: ${usedTargetIds.joinToString()}"
        )
    }<|endoftext|>


Prompt:
add(fragment.exportBlock)
            add(fragment.initializerBlock)
            fragment.tests?.let { add(it) }
            fragment.mainFunction?.let { add(it) }
            addAll(fragment.inlinedLocalDeclarations.values)
        })

        val definedNames = collectDefinedNamesInAllScopes(allCode)

Response:
serializedNames.forEach {
            assert(!it.isTemporary || it in definedNames || it in knownNames) { "JsName ${it.ident} is unbound" }
        }
    }
}<|endoftext|>


Prompt:
fun case_8(value_1: SealedClassMixed?): String = <!NO_ELSE_IN_WHEN!>when<!>(value_1) {
    SealedMixedChildObject1 -> ""
}

/*
 * TESTCASE NUMBER: 9
 * DISCUSSION: maybe make exhaustive without else?
 */

Response:
fun case_9(value_1: Any?): String = <!NO_ELSE_IN_WHEN!>when<!> (value_1) {
    is Any -> ""
    null -> ""
}

/*
 * TESTCASE NUMBER: 10
 * DISCUSSION
 * ISSUES: KT-26044
 */<|endoftext|>


Prompt:
public val <T : Annotation> T.annotationClass: KClass<out T>
    get() = (this as java.lang.annotation.Annotation).annotationType().kotlin as KClass<out T>

/**
 * Returns a Java [Class] instance of the enum the given constant belongs to.
 *
 * @see java.lang.Enum.getDeclaringClass
 */

Response:
@SinceKotlin("1.7")
@InlineOnly
public inline val <E : Enum<E>> Enum<E>.declaringJavaClass: Class<E>
    get() = (this as java.lang.Enum<E>).declaringClass<|endoftext|>


Prompt:
// Note: this is default for clang on at least on iOS and macOS.
        enforceFramePointer(llvmFunction, context)
    }
}

/**
 * Set target cpu and its features to make LLVM generate correct machine code.
 */
internal fun addTargetCpuAndFeaturesAttributes(context: Context, llvmFunction: LLVMValueRef) {
    context.config.platform.targetCpu?.let {

Response:
LLVMAddTargetDependentFunctionAttr(llvmFunction, "target-cpu", it)
    }
    context.config.platform.targetCpuFeatures?.let {
        LLVMAddTargetDependentFunctionAttr(llvmFunction, "target-features", it)
    }
}

private fun shouldEnforceFramePointer(context: Context): Boolean {
    // TODO: do we still need it?<|endoftext|>


Prompt:
// FIR_IDENTICAL
//If this test hangs, it means something is broken.
object A {
    val iii = 42
}

//inappropriate but participating in resolve functions
fun foo(s: String, a: Any) = s + a
fun foo(a: Any, s: String) = s + a
fun foo(i: Int, j: Int) = i + j

Response:
fun foo(a: Any, i: Int) = "$a$i"
fun foo(f: (Int)->Int, i: Int) = f(i)
fun foo(f: (String)->Int, s: String) = f(s)
fun foo(f: (Any)->Int, a: Any) = f(a)<|endoftext|>


Prompt:
package kotlin.math.fdlibm

import kotlin.wasm.internal.wasm_f64_sqrt as sqrt

internal fun __ieee754_hypot(x: Double, y: Double): Double {
    var a: Double
    var b: Double
    var t1: Double
    var t2: Double
    var y1: Double
    var y2: Double

Response:
var w: Double
    var j: Int
    var k: Int
    var ha: Int
    var hb: Int

    ha = __HI(x) and 0x7fffffff    /* high word of  x */
    hb = __HI(y) and 0x7fffffff    /* high word of  y */
    if (hb > ha) {<|endoftext|>


Prompt:
annotations: List<Annotation> = emptyList(),
        parameters: List<Parameter> = emptyList(),
        typeParameters: List<OpenType> = emptyList(),
        result: Type = UnitType,
        body: List<Node> = emptyList()
    ) : this(
        name,
        FunctionType(
            name,
            annotations = annotations,
            parameters = parameters,

Response:
typeParameters = typeParameters,
            result = result
        ),
        body
    )

    val open = type.typeParameters.isNotEmpty()

    override fun accept(visitor: Visitor) = visitor.visit(this)

    override fun visitChildren(visitor: Visitor) {
        walk(type.parameters, visitor)
        walk(body, visitor)
    }<|endoftext|>


Prompt:
"useOptIn" -> optInAnnotations += item.getAttribute("annotation").value
            }
        }

        return ModuleData(
            moduleName,
            timestamp,
            outputDir,
            moduleNameQualifier,
            classpath,
            sources,
            javaSourceRoots,
            friendDirs,
            optInAnnotations,
            modularJdkRoot,

Response:
jdkHome,
            isCommon,
        )
    }

    private fun loadModuleDumpFile(file: File): List<ModuleData> {
        val rootElement = JDOMUtil.load(file)
        val modules = rootElement.getChildren("module")
        val arguments = rootElement.getChild("compilerArguments")?.let { loadCompilerArguments(it) }<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor(arg: SameUserKlass)<!>
    }

    class TestMultipleIdenticalValueParameters {

Response:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor(arg1: UserKlassA, arg2: UserKlassB)<!>
        <!CONFLICTING_OVERLOADS!>constructor(arg1: UserKlassA, arg2: UserKlassB)<!>
    }<|endoftext|>


Prompt:
// that is illegal access since enum entries are not yet initialized:
    //   enum class E(...) {
    //     E1, E2, ...
    //     val m1 = E1
    //   }
    //     ~>
    //   class E {
    //     E m1 ...
    //     E(...) { // <init>
    //       m1 = E1
    //     }

Response:
//     final static E1, E2, ...
    //     static { // <clinit>
    //       E1 = new E(...)
    //       ...
    //     }
    //   }
    //
    // A companion object is desugared to a static final singleton, and initialized in <clinit> too. However, enum lowering goes first,<|endoftext|>


Prompt:
fun NBtoB(bb: IB?) = bb as? IB
fun BtoNB(bb: IB) = bb as? IB?

fun nullToNullB(aa: Any?) = aa as? IB?
fun notNullToNullB(aa: Any) = aa as? IB?
fun nullToNotNullB(aa: Any?) = aa as? IB

Response:
fun notNullToNotNullB(aa: Any) = aa as? IB

fun nullToNullC(aa: Any?) = aa as? IC?
fun notNullToNullC(aa: Any) = aa as? IC?
fun nullToNotNullC(aa: Any?) = aa as? IC
fun notNullToNotNullC(aa: Any) = aa as? IC<|endoftext|>


Prompt:
object O {
        @BeforeTest fun before() { println("before (A.object)") }
        @AfterTest fun after() { println("after (A.object)") }
        @Test fun test1() { println("test1 (A.object)") }
        @Ignore @Test fun ignoredTest() { throw AssertionError("Ignored test") }

Response:
@BeforeClass fun beforeClass() { println("beforeClass (A.object)") }
        @AfterClass fun afterClass() { println("afterClass (A.object)") }
    }
}

object O {
    @BeforeTest fun before() { println("before (object)") }
    @AfterTest fun after() { println("after (object)") }<|endoftext|>


Prompt:
private fun String.throwInvalidNumberOfDigits(startIndex: Int, endIndex: Int, maxDigits: Int, requireMaxLength: Boolean) {
    val specifier = if (requireMaxLength) "exactly" else "at most"
    val substring = substring(startIndex, endIndex)
    throw NumberFormatException(

Response:
"Expected $specifier $maxDigits hexadecimal digits at index $startIndex, but was $substring of length ${endIndex - startIndex}"
    )
}

private fun String.throwNotContainedAt(index: Int, endIndex: Int, part: String, partName: String) {
    val substring = substring(index, (index + part.length).coerceAtMost(endIndex))<|endoftext|>


Prompt:
/**
     * Empty [symbols] list equals to unresolved reference.
     */
    fun KtAnalysisSession.renderResolvedTo(
        symbols: List<KtSymbol>,
        renderPsiClassName: Boolean = false,
        renderer: KtDeclarationRenderer = KtDeclarationRendererForDebug.WITH_QUALIFIED_NAMES,

Response:
additionalInfo: KtAnalysisSession.(KtSymbol) -> String? = { null }
    ): String {
        if (symbols.isEmpty()) return UNRESOLVED_REFERENCE_RESULT

        return symbols.map { renderResolveResult(it, renderPsiClassName, renderer, additionalInfo) }
            .sorted()
            .withIndex()<|endoftext|>


Prompt:
testGroup("plugins/fir-plugin-prototype/tests-gen", "plugins/fir-plugin-prototype/testData") {
            testClass<AbstractFirPsiPluginDiagnosticTest> {
                model("diagnostics")
            }

            testClass<AbstractFirLightTreePluginBlackBoxCodegenTest> {
                model("box")
            }

Response:
testClass<AbstractFirLoadK2CompiledWithPluginJvmKotlinTest> {
                model("firLoadK2Compiled")
            }

            testClass<AbstractFirLoadK2CompiledWithPluginJsKotlinTest> {
                model("firLoadK2Compiled")
            }
        }

        testGroup(<|endoftext|>


Prompt:
const val anotherPropName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName::anotherProperty.name<!>
const val fooName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName::foo.name<!>

Response:
const val barName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>SomeClassWithName::bar.name<!>

const val stringClassName = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>::String.name<!><|endoftext|>


Prompt:
protected fun createFunctionSymbol(declaration: Function, signature: IdSignature?): IrSimpleFunctionSymbol {
        return signature?.let { createPublicFunctionSymbol(declaration, signature) } ?: createPrivateFunctionSymbol(declaration)
    }

    protected open fun createPublicFunctionSymbol(declaration: Function, signature: IdSignature): IrSimpleFunctionSymbol {

Response:
return IrSimpleFunctionPublicSymbolImpl(signature)
    }

    protected open fun createPrivateFunctionSymbol(declaration: Function): IrSimpleFunctionSymbol {
        return IrSimpleFunctionSymbolImpl()
    }

    // ------------------------------------ type parameter ------------------------------------

    fun declareGlobalTypeParameter(
        declaration: TypeParameter,
        typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter,<|endoftext|>