Prompt:
val id: Long?,
        val mask: Long,
        val description: String?,
    ) : IdSignature() {

        @Deprecated(
            "When constructing 'CommonSignature', you need to set 'description' to the mangled name from which 'id' was " +
                    "computed, or to null if it's not applicable",
            level = DeprecationLevel.WARNING,
        )

Response:
constructor(
            packageFqName: String,
            declarationFqName: String,
            id: Long?,
            mask: Long,
        ) : this(packageFqName, declarationFqName, id, mask, null)

        override val isPubliclyVisible: Boolean get() = true

        override fun packageFqName(): FqName = FqName(packageFqName)<|endoftext|>


Prompt:
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS

tailrec fun withWhen2(counter : Int) : Int =
        when {
            counter == 0 -> counter
            counter == 50 -> 1 + <!NON_TAIL_RECURSIVE_CALL!>withWhen2<!>(counter - 1)

Response:
<!NON_TAIL_RECURSIVE_CALL!>withWhen2<!>(0) == 0 -> withWhen2(counter - 1)
            else -> 1
        }

fun box() : String = if (withWhen2(100000) == 1) "OK" else "FAIL"<|endoftext|>


Prompt:
// p.Annotations

package p

class Annotations {

    @R("a") @R("b") @R("c")
    fun repeatables1() {

    }

    @R("a")
    fun repeatables2() {

    }

    @R("a") @S("b") @R("c") @S("D") @R("f")

Response:
fun repeatables3() {

    }

}

@Repeatable
@Retention(AnnotationRetention.SOURCE)
annotation class S(val g: String)

@Repeatable
@Retention(AnnotationRetention.SOURCE)
annotation class R(val s: String)<|endoftext|>


Prompt:
assertFalse(eqBooleanDoubleQ(false, null))
    assertFalse(eqBooleanDoubleQ(false, undefined))
    assertFalse(eqBooleanDoubleQ(true, 0.toDouble()))
    assertFalse(eqBooleanDoubleQ(true, 1.toDouble()))
    assertFalse(eqBooleanDoubleQ(true, null))
    assertFalse(eqBooleanDoubleQ(true, undefined))

Response:
assertFalse(eqBooleanQDouble(false, 0.toDouble()))
    assertFalse(eqBooleanQDouble(false, 1.toDouble()))
    assertFalse(eqBooleanQDouble(true, 0.toDouble()))
    assertFalse(eqBooleanQDouble(true, 1.toDouble()))
    assertFalse(eqBooleanQDouble(null, 0.toDouble()))<|endoftext|>


Prompt:
* - either `step > 0` and `start <= end`,
 * - or `step < 0` and `start >= end`.
 *
 * @param start first element of the progression
 * @param end ending bound for the progression
 * @param step increment, or difference of successive elements in the progression
 * @return the final element of the progression
 * @suppress
 */
@PublishedApi

Response:
internal fun getProgressionLastElement(start: Long, end: Long, step: Long): Long = when {
    step > 0 -> if (start >= end) end else end - differenceModulo(end, start, step)
    step < 0 -> if (start <= end) end else end + differenceModulo(start, end, -step)
    else -> throw kotlin.IllegalArgumentException("Step is zero.")
}<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?"), DEBUG_INFO_SMARTCAST!>x<!>.funT()
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?"), DEBUG_INFO_SMARTCAST!>x<!>.funAny()

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

// TESTCASE NUMBER: 5
fun case_5() {<|endoftext|>


Prompt:
c.resume(value)
        COROUTINE_SUSPENDED
    }
}

fun builder(c: suspend Controller.() -> Unit): String {
    val controller = Controller()
    c.startCoroutine(controller, EmptyContinuation)
    return controller.result
}

fun box(): String {
    val value = builder {
        try {

Response:
outer@for (x in listOf("A", "B")) {
                try {
                    result += suspendWithResult(x)
                    for (y in listOf("C", "D")) {
                        try {
                            result += suspendWithResult(y)
                            if (y == "D") {
                                break@outer
                            }
                        }
                        finally {
                            result += "!"
                        }<|endoftext|>


Prompt:
return when (unwrapped) {
            is FlexibleType -> unwrapped
            is SimpleType -> KotlinTypeFactory.flexibleType(unwrapped, unwrapped.makeNullableAsSpecified(true))
        }.inheritEnhancement(unwrapped)
    }

    override fun replaceAttributes(newAttributes: TypeAttributes): UnwrappedType =

Response:
KotlinTypeFactory.flexibleType(lowerBound.replaceAttributes(newAttributes), upperBound.replaceAttributes(newAttributes))

    override fun render(renderer: DescriptorRenderer, options: DescriptorRendererOptions): String {
        if (options.debugMode) {
            return "(${renderer.renderType(lowerBound)}..${renderer.renderType(upperBound)})"
        }<|endoftext|>


Prompt:
// TESTCASE NUMBER: 4
class Case4(x: Int = <!NULL_FOR_NONNULL_TYPE!>null<!>)

// TESTCASE NUMBER: 5
class Case5 constructor(x: Any = <!NULL_FOR_NONNULL_TYPE!>null<!>)

// TESTCASE NUMBER: 6
class Case6 {

Response:
fun foo(x: Nothing = <!NULL_FOR_NONNULL_TYPE!>null<!>) {}
}

// TESTCASE NUMBER: 7
class Case7 {
    val x: Int get() = <!NULL_FOR_NONNULL_TYPE!>null<!>
}

// TESTCASE NUMBER: 8
class Case8 {
    var x: Any = 0<|endoftext|>


Prompt:
public inline fun kotlin.BooleanArray.maxOf(selector: (kotlin.Boolean) -> kotlin.Double): kotlin.Double

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

Response:
public inline fun kotlin.BooleanArray.maxOf(selector: (kotlin.Boolean) -> kotlin.Float): kotlin.Float

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


Prompt:
"SUPERTYPE_INITIALIZED_IN_INTERFACE",
    "INTERFACE_WITH_SUPERCLASS",
    "FINAL_SUPERTYPE",
    "CLASS_CANNOT_BE_EXTENDED_DIRECTLY",
    "SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE",
    "SINGLETON_IN_SUPERTYPE",

Response:
"NULLABLE_SUPERTYPE",
    "MANY_CLASSES_IN_SUPERTYPE_LIST",
    "SUPERTYPE_APPEARS_TWICE",
    "CLASS_IN_SUPERTYPE_FOR_ENUM",
    "SEALED_SUPERTYPE",
    "SEALED_SUPERTYPE_IN_LOCAL_CLASS",<|endoftext|>


Prompt:
// SKIP_KT_DUMP
// TARGET_BACKEND: JVM

// FILE: Java1.java
public class Java1 extends KotlinClass { }

// FILE: Java2.java
public class Java2 extends KotlinClass<Integer> { }

// FILE: Java3.java
public class Java3<T> extends KotlinClass {
    public void foo(T t) { }

Response:
public Number bar() {
        return null;
    }
}

// FILE: Java4.java
public class Java4 extends KotlinClass2 { }

// FILE: Java5.java
public class Java5 extends KotlinClass2<Integer> { }

// FILE: Java6.java
public class Java6 extends KotlinClass2 {
    @Override
    public void foo(Number t) {}
    @Override<|endoftext|>


Prompt:
override fun isSubClassOf(subClass: KtClassOrObjectSymbol, superClass: KtClassOrObjectSymbol): Boolean {
        return isSubClassOf(subClass, superClass, allowIndirectSubtyping = true)
    }

    override fun isDirectSubClassOf(subClass: KtClassOrObjectSymbol, superClass: KtClassOrObjectSymbol): Boolean {

Response:
return isSubClassOf(subClass, superClass, allowIndirectSubtyping = false)
    }

    private fun isSubClassOf(subClass: KtClassOrObjectSymbol, superClass: KtClassOrObjectSymbol, allowIndirectSubtyping: Boolean): Boolean {
        require(subClass is KtFirSymbol<*>)<|endoftext|>


Prompt:
fun src(src : String) { /*...*/ }
  }

  class Library : ClassPathEntry {
    fun classpath(entries : ClassPathEntry/*...*/) { /*...*/ }
  }

  fun library(initializer :   Library.() -> Library) {
    val lib = Library()
    lib.initializer()
    return lib
  }

  fun classpath(/*...*/)

Response:
fun module(/*...*/)
}<|endoftext|>


Prompt:
// `(P * Q)(primitive)` -> `P(primitive), Q(primitive)`
        else -> Pair(argument, argument)
    }

    private fun generateAlias(argument: JsExpression): Pair<JsExpression, JsExpression> {
        val tmp = JsScope.declareTemporary()
        val statementContext = lastStatementLevelContext

Response:
statementContext.addPrevious(newVar(tmp, null))
        return Pair(assignment(tmp.makeRef(), argument), tmp.makeRef())
    }

    private val JsExpression.needsAlias: Boolean
        get() = when (this) {
            is JsLiteral.JsValueLiteral -> false
            else -> !isLocalVar
        }<|endoftext|>


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

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

Response:
public external abstract class HTMLSourceElement : HTMLElement, JsAny {
    open var src: String
    open var type: String
    open var srcset: String
    open var sizes: String
    open var media: String

    companion object {
        val ELEMENT_NODE: Short
        val ATTRIBUTE_NODE: Short
        val TEXT_NODE: Short<|endoftext|>


Prompt:
protected val outputXCFrameworkFile: File
        get() = outputDir.resolve(buildType.getName()).resolve("${xcFrameworkName.get()}.xcframework")

    /**
     * Adds the specified frameworks in this XCFramework.
     */
    fun from(vararg frameworks: Framework) {
        frameworks.forEach { framework ->

Response:
require(framework.konanTarget.family.isAppleFamily) {
                "XCFramework supports Apple frameworks only"
            }
            dependsOn(framework.linkTask)
        }
        fromFrameworkDescriptors(frameworks.map { FrameworkDescriptor(it) })
    }<|endoftext|>


Prompt:
val OVERLOADS_PRIVATE: KtDiagnosticFactory0 by warning0<KtAnnotationEntry>()
    val DEPRECATED_JAVA_ANNOTATION: KtDiagnosticFactory1<FqName> by warning1<KtAnnotationEntry, FqName>()

Response:
val JVM_PACKAGE_NAME_CANNOT_BE_EMPTY: KtDiagnosticFactory0 by error0<KtAnnotationEntry>()
    val JVM_PACKAGE_NAME_MUST_BE_VALID_NAME: KtDiagnosticFactory0 by error0<KtAnnotationEntry>()<|endoftext|>


Prompt:
val emptyMap: Map<String, Any>? = emptyMap<String, Any>()
            assertTrue(emptyMap.isNullOrEmpty())

            val map: Map<Char, Int>? = mapOf('a' to 1, 'b' to 2, 'c' to 3)
            assertFalse(map.isNullOrEmpty())
        }

        @Sample
        fun mapOrEmpty() {

Response:
val nullMap: Map<String, Any>? = null
            assertPrints(nullMap.orEmpty(), "{}")

            val map: Map<Char, Int>? = mapOf('a' to 1, 'b' to 2, 'c' to 3)
            assertPrints(map.orEmpty(), "{a=1, b=2, c=3}")
        }

        @Sample<|endoftext|>


Prompt:
classpath = classpath?.let(FileUtilRt::toSystemIndependentName)
            jdkHome = jdkHome?.let(FileUtilRt::toSystemIndependentName)
            kotlinHome = kotlinHome?.let(FileUtilRt::toSystemIndependentName)

Response:
friendPaths?.forEachIndexed { index, s -> friendPaths!![index] = FileUtilRt.toSystemIndependentName(s) }
        }

        is K2JSCompilerArguments -> {
            outputDir = (outputDir ?: outputFile)?.let(FileUtilRt::toSystemIndependentName)<|endoftext|>


Prompt:
fun <A, E> testFailures(array: A, fill: A.(E, Int, Int) -> Unit, element: E, arraySize: Int) {
            assertFailsWith<IndexOutOfBoundsException> {
                array.fill(element, -1, arraySize)
            }
            assertFailsWith<IndexOutOfBoundsException> {

Response:
array.fill(element, 0, arraySize + 1)
            }
            assertFailsWith<IllegalArgumentException> {
                array.fill(element, 1, 0)
            }
        }

        testFailures(BooleanArray(5) { it % 2 == 0 }, BooleanArray::fill, true, 5)<|endoftext|>


Prompt:
* DESCRIPTION: Implicit receiver: set of implicitly-imported extension callables
 */

// FILE: Extensions.kt
package libPackage

private fun String.padEnd(length: Int, padChar: Char = ' '): String = TODO()

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

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

Response:
s.<!DEBUG_INFO_CALL("fqName: kotlin.text.padEnd; typeCall: extension function")!>padEnd(length = 5)<!>
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.types.IrSimpleType

fun getInlineClassUnderlyingType(irClass: IrClass): IrSimpleType {
    val representation = irClass.inlineClassRepresentation ?: error("Not an inline class: ${irClass.render()}")
    return representation.underlyingType
}

fun getInlineClassBackingField(irClass: IrClass): IrField {

Response:
for (declaration in irClass.declarations) {
        if (declaration is IrField && !declaration.isStatic)
            return declaration

        if (declaration is IrProperty) {
            val backingField = declaration.backingField
            if (backingField != null && !backingField.isStatic) {
                return backingField
            }
        }
    }<|endoftext|>


Prompt:
return categoryCode == CharCategory.DECIMAL_DIGIT_NUMBER.code
    }

    private fun isLetter(categoryCode: String): Boolean {
        return categoryCode in listOf(
            CharCategory.UPPERCASE_LETTER,
            CharCategory.LOWERCASE_LETTER,
            CharCategory.TITLECASE_LETTER,
            CharCategory.MODIFIER_LETTER,

Response:
CharCategory.OTHER_LETTER
        ).map { it.code }
    }

    private val otherLowerChars = listOf<IntRange>(
        ${otherLowercaseRanges.joinToString { it.hexIntRangeLiteral() }}
    ).flatten().toHashSet()

    private fun isLowerCase(char: Char, categoryCode: String): Boolean {<|endoftext|>


Prompt:
dependencyKind = DependencyKind.Source
        }

        useConfigurators(
            ::CommonEnvironmentConfigurator,
            ::JvmEnvironmentConfigurator,
            ::ScriptingPluginEnvironmentConfigurator
        )

        facadeStep(::FirFrontendFacade)
        firHandlersStep {
            useHandlers(
                ::FirDiagnosticsHandler
            )

Response:
commonFirHandlersForCodegenTest()
        }

        facadeStep(::Fir2IrResultsConverter)
        irHandlersStep {
            useHandlers(
                ::IrTextDumpHandler,
                ::IrPrettyKotlinDumpHandler,
            )
        }
        facadeStep(::JvmIrBackendFacade)
        jvmArtifactsHandlersStep {<|endoftext|>


Prompt:
}

/**
 * Returns a list of all elements sorted according to the specified [comparator].
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 */
public fun <T> Iterable<T>.sortedWith(comparator: Comparator<in T>): List<T> {
    if (this is Collection) {

Response:
if (size <= 1) return this.toList()
       @Suppress("UNCHECKED_CAST")
       return (toTypedArray<Any?>() as Array<T>).apply { sortWith(comparator) }.asList()
    }
    return toMutableList().apply { sortWith(comparator) }
}

/**<|endoftext|>


Prompt:
"shared:assembleReleaseAppleFrameworkForXcodeIosArm64",
                    "shared:assembleDebugAppleFrameworkForXcodeIosArm64",
                    "shared:assembleCustomDebugAppleFrameworkForXcodeIosX64",
                    "shared:assembleCustomReleaseAppleFrameworkForXcodeIosX64",
                    "shared:assembleCustomDebugAppleFrameworkForXcodeIosArm64",

Response:
"shared:assembleCustomReleaseAppleFrameworkForXcodeIosArm64",
                ),
                environmentVariables = environmentVariables,
            )
            buildAndFail(
                ":shared:embedAndSignCustomAppleFrameworkForXcode",
                environmentVariables = environmentVariables
            ) {
                assertTasksFailed(":shared:embedAndSignCustomAppleFrameworkForXcode")<|endoftext|>


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

import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol

Response:
open class FirSymbolRenderer {

    internal lateinit var components: FirRendererComponents
    protected val printer get() = components.printer

    open fun printReference(symbol: FirBasedSymbol<*>) {
        printer.print(renderReference(symbol))
    }

    protected open fun renderReference(symbol: FirBasedSymbol<*>): String {<|endoftext|>


Prompt:
class A {
    fun foo(i: A) {}

    fun baz(i: A) {}
}

class B {
    fun foo(s: B) {}
    fun foo(c: Char) {}

    fun baz(s: B) {}
}

fun <T> bar(f: (T) -> Unit): T = TODO()

fun test() {

Response:
<!CANNOT_INFER_PARAMETER_TYPE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>myWith<!>(A()) <!CANNOT_INFER_PARAMETER_TYPE!>{
        val t1 = bar(::foo)

        val t2 = bar(::baz)<|endoftext|>


Prompt:
causeOfIncorporationConstraint.kind,
            )
        val isFromVariableFixation = otherConstraint.position.from is FixVariableConstraintPosition<*>
                || causeOfIncorporationConstraint.position.from is FixVariableConstraintPosition<*>

        if (!causeOfIncorporationConstraint.kind.isEqual() &&

Response:
!isUsefulForNullabilityConstraint &&
            !isFromVariableFixation &&
            !containsConstrainingTypeWithoutProjection(newConstraintType, causeOfIncorporationConstraint)
        ) return

        if (trivialConstraintTypeInferenceOracle.isGeneratedConstraintTrivial(<|endoftext|>


Prompt:
// ISSUE: KT-56949

// IGNORE_LIGHT_ANALYSIS
// IGNORE_BACKEND: ANY
// REASON: red code (see corresponding diagnostic test)

fun box(): String {
    build {
        setTypeVariable(TargetType())
        consumeDifferentTypeSubtype(getTypeVariable())
    }
    return "OK"
}

class TargetType
class DifferentType

Response:
fun <T: DifferentType> consumeDifferentTypeSubtype(value: T) {}

class Buildee<TV> {
    fun setTypeVariable(value: TV) { storage = value }
    fun getTypeVariable(): TV = storage
    private var storage: TV = TargetType() as TV
}

fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {<|endoftext|>


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

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

fun testK2(k: K) {

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

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


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

        if (x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>x<!>.equals(null)

Response:
if (x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>x<!>.propT

        if (x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>x<!>.propAny<|endoftext|>


Prompt:
private fun handleAsIncOrDecOperator(context: BindingContext, unaryExpression: KtUnaryExpression): KtCallInfo? {
        if (unaryExpression.operationToken !in KtTokens.INCREMENT_AND_DECREMENT) return null
        val operatorCall = unaryExpression.getResolvedCall(context) ?: return null

Response:
val resolvedCalls = mutableListOf(operatorCall)
        val operatorPartiallyAppliedSymbol = operatorCall.toPartiallyAppliedFunctionSymbol<KtFunctionSymbol>(context) ?: return null
        val baseExpression = unaryExpression.baseExpression
        val kind = unaryExpression.getInOrDecOperationKind()
        val precedence = when (unaryExpression) {<|endoftext|>


Prompt:
fun invoke()
}

fun interface F5 {
    val <!FUNCTION_DELEGATE_MEMBER_NAME_CLASH!>functionDelegate<!>: Any? get() = null
    fun invoke()
}

fun interface F6 {
    val String.functionDelegate: Function<*>? get() = null

Response:
fun getFunctionDelegate(x: Any?): Function<*>? = null
    fun invoke()
}<|endoftext|>


Prompt:
if (fullyExpandedType.isArrayOfNothing()) {
            reporter.reportOn(source, FirErrors.UNSUPPORTED, "Array<Nothing> is illegal", context)
        } else {
            for (typeArg in fullyExpandedType.typeArguments) {
                val typeArgType = typeArg.type ?: continue
                checkTypeAndTypeArguments(typeArgType, source, context, reporter)

Response:
}
        }
    }
}<|endoftext|>


Prompt:
<!CONFLICTING_OVERLOADS!>fun testVarianceDifferentReturnTypesCReverse(): Invariant<UserKlass><!> = Invariant()
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun testVarianceDifferentReturnTypesCReverse(): Invariant<*><!> = Invariant<UserKlass>()

Response:
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun testVarianceDifferentReturnTypesD(): Invariant<out UserKlass><!> = Invariant()
<!CONFLICTING_OVERLOADS!>fun testVarianceDifferentReturnTypesD(): Invariant<*><!> = Invariant<UserKlass>()<|endoftext|>


Prompt:
// https://webassembly.github.io/gc/core/binary/types.html
    const val FUNC_TYPE: Byte = -0x20 // 0x60
    const val STRUCT_TYPE: Byte = -0x21 // 0x5F
    const val ARRAY_TYPE: Byte = -0x22 // 0x5E
    const val SUB_TYPE: Byte = -0x30 // 0x50

Response:
const val SUB_FINAL_TYPE: Byte = -0x31 // 0x4F
    const val REC_GROUP: Byte = -0x32 // 0x4E

    @JvmInline
    value class Section private constructor(val id: UShort) {
        companion object {
            // https://webassembly.github.io/spec/core/binary/modules.html#sections<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue
import org.jetbrains.kotlin.test.services.JUnit5Assertions.fail
import java.io.File

internal class PredefinedTestCaseGroupProvider(annotation: PredefinedTestCases) : TestCaseGroupProvider {

Response:
private val testCaseIdToPredefinedTestCase: Map<TestCaseId.Named, PredefinedTestCase> = buildMap {
        annotation.testCases.forEach { predefinedTestCase ->
            val testCaseId = TestCaseId.Named(predefinedTestCase.name)
            if (put(testCaseId, predefinedTestCase) != null)<|endoftext|>


Prompt:
val nearestClass = this as? IrClass ?: parentClassOrNull ?: return false
        val outermostClass = generateSequence(nearestClass) { it.parentClassOrNull }.last()
        return outermostClass.visibility == DescriptorVisibilities.PRIVATE
    }
}

/** An optimization to avoid re-computing file for every visited declaration */

Response:
internal abstract class FileAwareIrElementTransformerVoid(startingFile: PLFile?) : IrElementTransformerVoid() {
    private var _currentFile: PLFile? = startingFile
    val currentFile: PLFile get() = _currentFile ?: error("No information about current file")

    protected fun <T> runInFile(file: PLFile, block: () -> T): T {<|endoftext|>


Prompt:
private val SINGLE_VALUE_RANGE = SINGLE_VALUE_PATTERN.toRegex()
    }
}

internal fun fixSemver(version: String): String {
    var i = 0
    var number = 0
    var major = "0"
    var minor = "0"
    var patch = "0"
    val rest = StringBuilder()
    val digits = StringBuilder()

Response:
fun setComponent() {
        val digitsFiltered = digits.toString().trimStart { it == '0' }.takeIf { it.isNotEmpty() } ?: "0"
        when (number) {
            0 -> major = digitsFiltered
            1 -> minor = digitsFiltered
            2 -> patch = digitsFiltered
            else -> error(number)
        }
    }<|endoftext|>


Prompt:
incrementalResultsConsumer?.run {
                processPackagePart(ioFile, compiledFile.metadata, empty, empty)
                with(compiledFile.irData!!) {
                    processIrFile(
                        ioFile,
                        fileData,
                        types,
                        signatures,
                        strings,
                        declarations,
                        bodies,
                        fqName.toByteArray(),
                        fileMetadata,

Response:
debugInfo,
                    )
                }
            }
        },
        processKlibHeader = {
            incrementalResultsConsumer?.processHeader(it)
        },
    )

    val fullSerializedIr = serializerOutput.serializedIr ?: error("Metadata-only KLIBs are not supported in Kotlin/JS")

    val versions = KotlinLibraryVersioning(<|endoftext|>


Prompt:
parameters.printJoin(", ")
                println(" ->")
            } else {
                println()
            }
            indented {
                body?.print()
            }
            println()
            println("}")
        }
    }

    override fun visitTypeOperator(expression: IrTypeOperatorCall) {
        when (expression.operator) {

Response:
IrTypeOperator.IMPLICIT_COERCION_TO_UNIT -> {
                expression.argument.print()
            }
            IrTypeOperator.NOT_INSTANCEOF -> {
                expression.argument.print()
            }
            IrTypeOperator.CAST, IrTypeOperator.SAFE_CAST, IrTypeOperator.IMPLICIT_CAST -> {
                expression.argument.print()
            }<|endoftext|>


Prompt:
val startCollectionCount = startCounts?.collectionCount ?: 0
            measurements += GarbageCollectionMeasurement(
                it.name,
                it.collectionTime - startCollectionTime,
                it.collectionCount - startCollectionCount
            )
        }
    }

    private fun recordJitCompilationTime() {
        if (!isEnabled) return

Response:
val bean = ManagementFactory.getCompilationMXBean() ?: return
        measurements += JitCompilationMeasurement(bean.totalCompilationTime)
    }

    private fun recordInitializationTime() {
        val time = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - initStartNanos)
        measurements += CompilerInitializationMeasurement(time)<|endoftext|>


Prompt:
is ClassDescriptor -> "class"
                else -> "non-function declaration"
            }
            declaration.modifierList?.getModifier(KtTokens.EXTERNAL_KEYWORD)?.let {
                trace.report(Errors.WRONG_MODIFIER_TARGET.on(it, KtTokens.EXTERNAL_KEYWORD, target))
            }
            return
        }

Response:
if (DescriptorUtils.isInterface(descriptor.containingDeclaration)) {
            trace.report(ErrorsJvm.EXTERNAL_DECLARATION_IN_INTERFACE.on(declaration))
        }
        else if (descriptor.modality == Modality.ABSTRACT) {
            if (declaration is KtPropertyAccessor) {<|endoftext|>


Prompt:
import kotlin.reflect.KClass

private val NamedDomainObjectContainer<KotlinSourceSet>.jvmMain
    get() = maybeCreate("jvmMain")

private val Project.jvmWarmup: Int
    get() = (property("jvmWarmup") as String).toInt()

private val Project.jvmBenchResults: String
    get() = property("jvmBenchResults") as String

Response:
open class KotlinNativeBenchmarkExtension @Inject constructor(project: Project) : BenchmarkExtension(project) {
    var jvmSrcDirs: Collection<Any> = emptyList()
    var mingwSrcDirs: Collection<Any> = emptyList()
    var posixSrcDirs: Collection<Any> = emptyList()<|endoftext|>


Prompt:
}

            if (rhs.isMarkedNullable) {
                trace.report(ACTUAL_TYPE_ALIAS_TO_NULLABLE_TYPE.on(declaration))
                return
            }
        }
    }

    private fun getUsedTypeAliasParameters(type: KotlinType, typeAlias: TypeAliasDescriptor): Set<TypeParameterDescriptor> =

Response:
type.constituentTypes().mapNotNullTo(HashSet()) {
            val descriptor = it.constructor.declarationDescriptor as? TypeParameterDescriptor
            descriptor?.takeIf { it.containingDeclaration == typeAlias }
        }

    private class TypeAliasDeclarationCheckingReportStrategy(
        private val trace: BindingTrace,<|endoftext|>


Prompt:
visitLoop(x)

    open fun visitDocComment(comment: JsDocComment): Unit =
            visitElement(comment)

    open fun visitSingleLineComment(comment: JsSingleLineComment): Unit =
            visitElement(comment)

    open fun visitMultiLineComment(comment: JsMultiLineComment): Unit =
            visitElement(comment)

Response:
open fun visitExport(export: JsExport): Unit =
            visitElement(export)

    open fun visitImport(import: JsImport): Unit =
        visitElement(import)

    protected open fun visitElement(node: JsNode) {
    }
}<|endoftext|>


Prompt:
// !LANGUAGE: -AllowBreakAndContinueInsideWhen

fun breakContinueInWhen(i: Int) {
    for (y in 0..10) {
        when(i) {
            0 -> <!BREAK_OR_CONTINUE_IN_WHEN!>continue<!>
            1 -> <!BREAK_OR_CONTINUE_IN_WHEN!>break<!>
            2 -> {

Response:
for(z in 0..10) {
                    break
                }
                for(w in 0..10) {
                    continue
                }
            }
        }
    }
}

fun breakContinueInWhenWithWhile(i: Int, j: Int) {
    while (i > 0) {
        when (i) {<|endoftext|>


Prompt:
capturedVar.putFieldInsns.forEach { set(it, VarInsnNode(storeOpcode, capturedVar.localVarIndex)) }
            }
        }

    }
}

internal const val REF_ELEMENT_FIELD = "element"
internal const val INIT_METHOD_NAME = "<init>"

Response:
internal val REF_TYPE_TO_ELEMENT_TYPE = HashMap<String, Type>().apply {
    put(AsmTypes.OBJECT_REF_TYPE.internalName, AsmTypes.OBJECT_TYPE)
    PrimitiveType.entries.forEach {
        put(AsmTypes.sharedTypeForPrimitive(it).internalName, AsmTypes.valueTypeForPrimitive(it))
    }<|endoftext|>


Prompt:
var xx: String? = null

    init {
        class A {
            val x = str
        }

        xx = A().x
    }
}

fun testFun3(str: String): String = TestClass(str).xx!!

fun String.testFun4(): String {
    class A {
        val x = this@testFun4
    }
    return A().x
}

Response:
fun box(): String {
    return when {
        testFun1("test1") != "test1" -> "Fail #1 (local class with capture)"
        testFun2("test2") != "test2" -> "Fail #2 (local class with capture ctor in another context)"
        testFun3("test3") != "test3" -> "Fail #3 (local class with capture ctor in init{ ... })"<|endoftext|>


Prompt:
// WITH_STDLIB

import kotlin.test.*

@Suppress("NOTHING_TO_INLINE")
inline fun foo(i4: Int, i5: Int): Int {
    if (i4 > 0) return i4
    return i5
}

fun bar(i1: Int, i2: Int): Int {
    return foo(i1, i2)
}

Response:
fun box(): String {
    assertEquals(3, bar(3, 8))
    return "OK"
}<|endoftext|>


Prompt:
val f_reduceRightIndexedOrNullSuper = fn("reduceRightIndexedOrNull(operation: (index: Int, T, acc: S) -> S)") {
        include(Lists, ArraysOfObjects)
    } builder {
        since("1.4")
        inline()

        doc { reduceDoc("reduceRightIndexedOrNull") }

Response:
sample("samples.collections.Collections.Aggregates.reduceRightOrNull")
        typeParam("S")
        typeParam("T : S")
        returns("S?")
        body {
            """
            var index = lastIndex
            if (index < 0) return null

            var accumulator: S = get(index--)
            while (index >= 0) {<|endoftext|>


Prompt:
super.visitCallableReferenceAccess(callableReferenceAccess)
            }

            override fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier) {
                processResolvedQualifier(resolvedQualifier)
                super.visitResolvedQualifier(resolvedQualifier)
            }

Response:
override fun visitErrorResolvedQualifier(errorResolvedQualifier: FirErrorResolvedQualifier) {
                processResolvedQualifier(errorResolvedQualifier)
                super.visitErrorResolvedQualifier(errorResolvedQualifier)
            }

            private fun processErrorNameReference(resolvable: FirResolvable) {<|endoftext|>


Prompt:
items.mapNotNull { (it.content.firstOrNull() as? Text)?.textTrim }
        } else {
            listOfNotNull((it.content.firstOrNull() as? Text)?.textTrim)
        }
    }
    return null
}

private fun readV2Config(element: Element): KotlinFacetSettings {
    return readV2AndLaterConfig(element)
}

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

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


Prompt:
// rootProject will be handled with the SingleActionPerProject above
    if (project.rootProject !== project) {
        doHandleHierarchicalStructureFlagsMigration(project)
    }
}

private fun doHandleHierarchicalStructureFlagsMigration(project: Project) {
    with(PropertiesProvider(project)) {
        if (hierarchicalStructureSupport) {

Response:
if (project === project.rootProject)
                project.extensions.extraProperties.getOrPut(PropertyNames.KOTLIN_MPP_ENABLE_GRANULAR_SOURCE_SETS_METADATA) { "true" }
            PropertiesProvider(project).mpp13XFlagsSetByPlugin = true
        }
    }
}<|endoftext|>


Prompt:
// ISSUE: KT-45970

val a_1: Byte = 1
var a_2: Byte = 1
val b_1: Short = 1
var b_2: Short = 1
val c_1: Int = 1
var c_2: Int = 1
val d_1: Long = 1
var d_2: Long = 1

Response:
val e_1: Byte = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>1 + 2<!>
var e_2: Byte = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>1 + 2<!><|endoftext|>


Prompt:
import javax.inject.Inject

@DisableCachingByDefault(because = "Swift Export is experimental, so no caching for now")
internal abstract class SwiftExportTask : DefaultTask() {

    @get:InputFiles
    @get:PathSensitive(PathSensitivity.RELATIVE)
    abstract val swiftExportClasspath: ConfigurableFileCollection

    @get:Inject

Response:
abstract val workerExecutor: WorkerExecutor

    @get:Nested
    abstract val parameters: SwiftExportParameters

    @TaskAction
    fun run() {
        val workQueue = workerExecutor.classLoaderIsolation { workerSpec ->
            workerSpec.classpath.from(swiftExportClasspath)
        }

        workQueue.submit(SwiftExportAction::class.java) { workParameters -><|endoftext|>


Prompt:
override fun getContributedDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean) =
            addedDescriptors.subList(0, descriptorLimit)

        override fun getContributedClassifier(name: Name, location: LookupLocation) =
            variableOrClassDescriptorByName(name, descriptorLimit) as? ClassifierDescriptor

Response:
// NB. This is important to have this explicit override, otherwise calls will be delegated to `this`-delegate,
        // which will use default implementation from `ResolutionScope`, which will call `getContributedClassifier` on
        // the `LexicalWritableScope` instead of calling it on this snapshot
        override fun getContributedClassifierIncludeDeprecated(
            name: Name,
            location: LookupLocation<|endoftext|>


Prompt:
scope.offsetInBits += sizeInBits
            val alignInBits = expression.type.alignment
            scope.offsetInBits = alignTo(scope.offsetInBits, alignInBits)
            @Suppress("UNCHECKED_CAST")
            scope.members.add(DICreateMemberType(
                    refBuilder = builder,

Response:
refScope = scope.scope as DIScopeOpaqueRef,
                    name = expression.computeSymbolName(),
                    file = irFile.diFileScope(),
                    lineNum = expression.startLine(),
                    sizeInBits = sizeInBits,
                    alignInBits = alignInBits,
                    offsetInBits = scope.offsetInBits,
                    flags = 0,<|endoftext|>


Prompt:
bar2 <!ARGUMENT_TYPE_MISMATCH!>{}<!>
    bar2 {1}
    bar2 {<!UNRESOLVED_REFERENCE!>it<!>}
    bar2 <!ARGUMENT_TYPE_MISMATCH!>{<!CANNOT_INFER_PARAMETER_TYPE!>it<!> -> it}<!>
}

Response:
fun bar(f :  (Int, Int) -> Int) {}
fun bar1(f :  (Int) -> Int) {}
fun bar2(f :  () -> Int) {}

infix fun String.to(dest : String) {

}

infix fun String.on(predicate :  (s : URI) -> Boolean) : URI {
    return URI(this)
}<|endoftext|>


Prompt:
return getMetricReporter(chunk)?.measure(metric, action) ?: action.invoke()
    }

    override fun reportDirtyFiles(kotlinDirtySourceFilesHolder: KotlinDirtySourceFilesHolder) {
        getMetricReporter(kotlinDirtySourceFilesHolder.chunk)?.let {

Response:
it.addChangedFiles(kotlinDirtySourceFilesHolder.allRemovedFilesFiles.map { it.path })
            it.addChangedFiles(kotlinDirtySourceFilesHolder.allDirtyFiles.map { it.path })
        }
    }

    override fun reportCompilerArguments(chunk: ModuleChunk, kotlinChunk: KotlinChunk) {<|endoftext|>


Prompt:
val cacheMode = testRunSettings.get<CacheMode>()
            when {
                cacheMode.useStaticCacheForUserLibraries -> {
                    this["staticCache"] = "TestMode.Scope.EVERYWHERE"
                    this["lazyIr"] = "TestMode.Scope.NOWHERE" // by default LazyIR is disabled
                }
                cacheMode.useStaticCacheForDistributionLibraries -> {

Response:
this["staticCache"] = "TestMode.Scope.DISTRIBUTION"
                    this["lazyIr"] = "TestMode.Scope.NOWHERE" // by default LazyIR is disabled
                }
            }
        }

        override fun customizeModuleSources(moduleName: String, moduleSourceDir: File) {
            if (moduleName == MAIN_MODULE_NAME)<|endoftext|>


Prompt:
@Suppress("NOTHING_TO_INLINE")
internal inline fun <K : Any, V> compactMapOf(key: K, value: V): Map<K, V> =
    singletonMap(key, value)

@Suppress("NOTHING_TO_INLINE")

Response:
internal inline fun <K : Any, V> compactMapOf(key1: K, value1: V, key2: K, value2: V): Map<K, V> =
    SmartFMap.emptyMap<K, V>().plus(key1, value1).plus(key2, value2)

internal inline fun <reified T> Iterable<T?>.firstNonNull() = firstIsInstance<T>()<|endoftext|>


Prompt:
GCInfo(key, accumulator.gcTime + element.gcTime, accumulator.collections + element.collections)
                },
                (components.toList() + other.components.toList()).groupingBy { (name, _) -> name }.fold(0L) { a, b -> a + b.second },
                files + other.files,
                lines + other.lines
            )

Response:
}

        fun totalTime() = components.values.sum()
    }

    protected lateinit var totalPassResult: CumulativeTime

    override fun beforePass(pass: Int) {
        totalPassResult = CumulativeTime()
        totalModules.clear()
        okModules.clear()
        errorModules.clear()
        crashedModules.clear()<|endoftext|>


Prompt:
nameBindings[tag] = readString()
            }
        }

        return JsIrModuleHeaderNames(definitions, nameBindings, optionalCrossModuleImports)
    }

    protected fun CodedOutputStream.commitJsIrModuleHeaderNames(jsIrHeader: JsIrModuleHeader) {
        val names = mutableMapOf<String, Pair<Int, String?>>()

Response:
for ((tag, name) in jsIrHeader.nameBindings) {
            names[tag] = NameType.NAME_BINDINGS.typeMask to name
        }
        for (tag in jsIrHeader.optionalCrossModuleImports) {
            val maskAndName = names[tag]<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.visitors.FirTransformer
import org.jetbrains.kotlin.fir.visitors.FirVisitor

Response:
import org.jetbrains.kotlin.name.StandardClassIds
import org.jetbrains.kotlin.types.TypeApproximatorConfiguration

class FirWhenExhaustivenessTransformer(private val bodyResolveComponents: BodyResolveComponents) : FirTransformer<Any?>() {
    companion object {
        private val exhaustivenessCheckers = listOf(<|endoftext|>


Prompt:
public inline fun ByteArray.filter(predicate: (Byte) -> Boolean): List<Byte> {
    return filterTo(ArrayList<Byte>(), predicate)
}

/**
 * Returns a list containing only elements matching the given [predicate].
 *
 * @sample samples.collections.Collections.Filtering.filter
 */

Response:
public inline fun ShortArray.filter(predicate: (Short) -> Boolean): List<Short> {
    return filterTo(ArrayList<Short>(), predicate)
}

/**
 * Returns a list containing only elements matching the given [predicate].
 *
 * @sample samples.collections.Collections.Filtering.filter
 */<|endoftext|>


Prompt:
// TARGET_BACKEND: NATIVE
// MODULE: cinterop
// FILE: kt57640.def
language = Objective-C
headers = kt57640.h

// FILE: kt57640.h
#import <Foundation/NSObject.h>

@interface Base : NSObject
@property (readwrite) Base* delegate;
@end

@protocol Foo

Response:
@property (readwrite) id<Foo> delegate;
@end

@protocol Bar
@property (readwrite) id<Bar> delegate;
@end

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


Prompt:
public abstract operator fun get(index: kotlin.Int): kotlin.Char

    public abstract fun subSequence(startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence
}

public interface Comparable<in T> {
    public abstract operator fun compareTo(other: T): kotlin.Int
}

Response:
public final class Double private constructor() : kotlin.Number, kotlin.Comparable<kotlin.Double> {
    public companion object {
        public const final val MAX_VALUE: kotlin.Double = COMPILED_CODE /* compiled code */

        public const final val MIN_VALUE: kotlin.Double = COMPILED_CODE /* compiled code */<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1312
package foo

open class X(private val x: String) {
    fun foo(): String {
        class B : X("fail1") {
            inner class C {
                fun bar() = x
            }

            fun baz() = C().bar()
        }
        return B().baz()
    }
}

Response:
open class Y(private val x: String) {
    fun foo(): String {
        class B {
            inner class C : Y("fail2") {
                fun bar() = x
            }

            fun baz() = C().bar()
        }
        return B().baz()
    }
}

fun box(): String {
    val x = X("OK").foo()<|endoftext|>


Prompt:
// is declared to extend Super<T>, and propagating data here is highly non-trivial, so we only look at the head type constructor
        // (outermost type), unless the type in the subclass is interchangeable with the all the types in superclasses:
        // e.g. we have (Mutable)List<String!>! in the subclass and { List<String!>, (Mutable)List<String>! } from superclasses

Response:
// Note that `this` is flexible here, so it's equal to it's bounds
        val onlyHeadTypeConstructor = forceOnlyHeadTypeConstructor ||
                (isCovariant && overrides.any { !this@computeIndexedQualifiers.isEqual(it) })

        val treeSize = if (onlyHeadTypeConstructor) 1 else indexedThisType.size<|endoftext|>


Prompt:
fun serializeIrFile(file: IrFile): SerializedIrFile = declarationTable.inFile(file) {
        val topLevelDeclarations = mutableListOf<SerializedDeclaration>()

        val proto = ProtoFile.newBuilder()
            .addAllFqName(serializeFqName(file.packageFqName.asString()))

Response:
.addAllAnnotation(serializeAnnotations(file.annotations))

        file.declarations.forEach {
            if (skipIfPrivate(it)) {
                // Skip the declaration if producing header klib and the declaration is not public.
                return@forEach
            }
            if (it.descriptor.isExpectMember && !it.descriptor.isSerializableExpectClass) {<|endoftext|>


Prompt:
override fun resolveFriendPaths(compilation: InternalKotlinCompilation<*>): Iterable<FileCollection> {
        return mutableListOf<FileCollection>().apply {
            compilation.allAssociatedCompilations.forEach {
                add(it.output.classesDirs)
                // Adding classes that could be produced to non-default destination for JVM target
                // Check KotlinSourceSetProcessor for details

Response:
@Suppress("UNCHECKED_CAST")
                add(
                    compilation.project.files(
                        (it.compileTaskProvider as TaskProvider<KotlinCompileTool>).flatMap { task -> task.destinationDirectory }
                    )
                )
            }
            add(friendArtifactResolver.resolveFriendArtifacts(compilation))
        }
    }

    /* Resolution of friend artifacts */<|endoftext|>


Prompt:
* Returns a copy of this string converted to upper case using the rules of the specified [locale].
 *
 * This function supports one-to-many and many-to-one character mapping,
 * thus the length of the returned string can be different from the length of the original string.
 *
 * @sample samples.text.Strings.uppercaseLocale
 */
@SinceKotlin("1.5")

Response:
@WasExperimental(ExperimentalStdlibApi::class)
@kotlin.internal.InlineOnly
public inline fun String.uppercase(locale: Locale): String = (this as java.lang.String).toUpperCase(locale)

/**
 * Encodes the contents of this string using the specified character set and returns the resulting byte array.<|endoftext|>


Prompt:
case.<!DEBUG_INFO_CALL("fqName: Case2.foo; typeCall: function")!>foo(::y, ::y)<!>
        case.foo(::y, ::y)

        this.foo(::x, ::y)

Response:
this.<!DEBUG_INFO_CALL("fqName: Case2.foo; typeCall: function")!>foo(::x, ::y)<!>
        this.foo(::x, ::y)
    }

}

// TESTCASE NUMBER: 3
class Case3() {
    fun foo(vararg x: ()->Short): String = TODO() // (1.1)<|endoftext|>


Prompt:
glColor3f(1.0f, 0.0f, 0.0f)
    glTranslatef(0.0f, 0.0f, 0.0f)
    glRotatef(rotation, 0.0f, 1.0f, 0.0f)
    glRotatef(90.0f, 0.0f, 1.0f, 0.0f)

Response:
// Draw the teapot
    glutSolidTeapot(1.0)
    glPopMatrix()

    rotation += rotationSpeed
    glutSwapBuffers()
}

fun initialize() {
    // select projection matrix
    glMatrixMode(GL_PROJECTION)

    // set the viewport
    glViewport(0, 0, windowWidth, windowHeight)<|endoftext|>


Prompt:
fun tvosX64(name: String, configure: Action<KotlinNativeTargetWithSimulatorTests>) = tvosX64(name) { configure.execute(this) }
    fun tvosX64(configure: Action<KotlinNativeTargetWithSimulatorTests>) = tvosX64 { configure.execute(this) }

    fun tvosSimulatorArm64(

Response:
name: String = "tvosSimulatorArm64",
        configure: KotlinNativeTargetWithSimulatorTests.() -> Unit = { }
    ): KotlinNativeTargetWithSimulatorTests =
        configureOrCreate(
            name,
            @Suppress("DEPRECATION")
            presets.getByName("tvosSimulatorArm64") as KotlinNativeTargetWithSimulatorTestsPreset,<|endoftext|>


Prompt:
package org.jetbrains.kotlin

import com.intellij.lang.LighterASTNode
import com.intellij.lang.TreeBackedLighterAST
import com.intellij.openapi.util.Ref
import com.intellij.psi.PsiComment
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile

Response:
import com.intellij.psi.PsiWhiteSpace
import com.intellij.psi.tree.IElementType
import com.intellij.util.diff.FlyweightCapableTreeStructure
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.util.OperatorNameConventions<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.model.Frontend2BackendConverter
import org.jetbrains.kotlin.test.model.FrontendFacade
import org.jetbrains.kotlin.test.model.FrontendKinds

open class AbstractIrLocalVariableTest : AbstractLocalVariableTestBase<ClassicFrontendOutputArtifact>(FrontendKinds.ClassicFrontend) {

Response:
override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
        get() = ::ClassicFrontendFacade

    override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<ClassicFrontendOutputArtifact, IrBackendInput>>
        get() = ::ClassicFrontend2IrConverter<|endoftext|>


Prompt:
}

            val message = {
                "Build service Gradle Node Modules should be already registered"
            }

            requireNotNull(rootProjectDir, message)
            requireNotNull(cacheDir, message)

            return project.gradle.sharedServices.registerIfAbsent(serviceName, serviceClass) {
                it.parameters.rootProjectDir.set(rootProjectDir)

Response:
it.parameters.cacheDir.set(cacheDir)
            }
        }

        fun registerIfAbsent(
            project: Project,
            rootProjectDir: File?,
            cacheDir: Provider<Directory>?
        ) = registerIfAbsentImpl(project, rootProjectDir, cacheDir).also { serviceProvider -><|endoftext|>


Prompt:
addSubtypesOf(builtIns.throwable.defaultType)

                is MergeInstruction ->
                    addTypePredicates(it.outputValue)

                is AccessValueInstruction -> {
                    val accessTarget = it.target
                    val receiverValue = it.receiverValues[value]
                    if (receiverValue != null) {

Response:
typePredicates.add(getReceiverTypePredicate((accessTarget as AccessTarget.Call).resolvedCall, receiverValue))
                    } else {
                        val expectedType = when (accessTarget) {
                            is AccessTarget.Call ->
                                (accessTarget.resolvedCall.resultingDescriptor as? VariableDescriptor)?.type
                            is AccessTarget.Declaration ->
                                accessTarget.descriptor.type<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion
import org.jetbrains.kotlin.analysis.api.symbols.KtFunctionSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtReceiverParameterSymbol

Response:
import org.jetbrains.kotlin.analysis.api.symbols.KtTypeParameterSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtValueParameterSymbol
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolKind<|endoftext|>


Prompt:
outer@ while (true) {
        inner@ while (x == null) {
            break@outer
        }
    }
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & kotlin.String?")!>x<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & kotlin.String?"), DEBUG_INFO_SMARTCAST!>x<!>.length
}

/*
 * TESTCASE NUMBER: 2
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-22454
 */
fun case_2() {
    var x: String? = null<|endoftext|>


Prompt:
fun getSyntheticGetter(expression: IrGetField, scopes: List<ScopeWithIr>): IrSimpleFunctionSymbol {
        val dispatchReceiverType = expression.receiver?.type
        val dispatchReceiverClassSymbol = dispatchReceiverType?.classifierOrNull as? IrClassSymbol
        val symbol = expression.symbol

Response:
val parent = symbol.owner.accessorParent(dispatchReceiverClassSymbol?.owner ?: symbol.owner.parent, scopes) as IrClass
        return getterMap.getOrPut(FieldKey(symbol, parent, expression.superQualifierSymbol)) {
            makeGetterAccessorSymbol(symbol, parent, expression.superQualifierSymbol)
        }
    }<|endoftext|>


Prompt:
* Counts the number of consecutive least significant bits that are zero in the binary representation of this [Long] number.
 */
@SinceKotlin("1.4")
public actual fun Long.countTrailingZeroBits(): Int =
        if (this == 0L) 64 else countTrailingZeroBits(this)

/**

Response:
* Returns a number having a single bit set in the position of the most significant set bit of this [Long] number,
 * or zero, if this number is zero.
 */
@SinceKotlin("1.4")
public actual fun Long.takeHighestOneBit(): Long =
        if (this == 0L) 0L else 1L.shl(64 - 1 - countLeadingZeroBits(this))

/**<|endoftext|>


Prompt:
inline fun <reified T> foo4(t: T){}
}

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

class C : Java1() { //Kotlin ← Java ← Kotlin with explicit override
    override suspend fun foo3() { }
    override fun foo2() {}
}

suspend fun test(b: B, c: C) {

Response:
b.foo()
    b.foo2()
    b.foo3()
    b.foo4(1)

    c.foo()
    c.foo2()
    c.foo3()
    c.foo4("")
}<|endoftext|>


Prompt:
case133 checkType { check<Char>()}
}
// TESTCASE NUMBER: 134
fun case134(){
   val case134 = '\u42ff'
   <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char")!>case134<!>
   case134 checkType { check<Char>()}
}
// TESTCASE NUMBER: 135
fun case135(){

Response:
val case135 = '\u4300'
   <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char")!>case135<!>
   case135 checkType { check<Char>()}
}
// TESTCASE NUMBER: 136
fun case136(){
   val case136 = '\u43ff'<|endoftext|>


Prompt:
object EnumWithContextualSerializer: ToDoSerializer<EnumWithContextual>("contextual|EnumWithContextual")
object NestedEnumWithContextualSerializer: ToDoSerializer<Container.NestedEnumWithContextual>("contextual|Container.NestedEnumWithContextual")

Response:
object EnumWithUseContextualSerializer: ToDoSerializer<EnumWithUseContextual>("contextual|EnumWithUseContextual")
object NestedEnumWithUseContextualSerializer: ToDoSerializer<Container.NestedEnumWithUseContextual>("contextual|Container.NestedEnumWithUseContextual")<|endoftext|>


Prompt:
fun getScriptInternalName(typeConstructor: TypeConstructorMarker): String

    // NB: The counterpart, [KotlinTypeMapper#writeGenericType], doesn't have restriction on [type]
    fun Writer.writeGenericType(type: KotlinTypeMarker, asmType: Type, mode: TypeMappingMode)
}

object AbstractTypeMapper {

Response:
fun <Writer : JvmDescriptorTypeWriter<Type>> mapClass(
        context: TypeMappingContext<Writer>,
        typeConstructor: TypeConstructorMarker,
        materialized: Boolean
    ): Type {
        return with(context.typeContext) {
            when {
                typeConstructor.isClassTypeConstructor() -> {<|endoftext|>


Prompt:
operator fun Case.E.plusAssign(value: Int) {}
operator fun Case.Inv.invoke(i: Int) {}

// FILE: Lib22.kt
// TESTCASE NUMBER: 4
package testPackCase4
import testPackCase4.Case
import testPackCase4.Case.Inv
import testPackCase4.Case.E

Response:
operator fun Case.E.plusAssign(value: Int) {}
operator fun Case.Inv.invoke(i: Int) {}

// FILE: TestCase4.kt
// TESTCASE NUMBER: 4
package testPackCase4
import libPackage1.*
class Case() {

    operator fun plusAssign(value: Int) {}

    class E(val plusAssign: Inv? = null) {<|endoftext|>


Prompt:
in <!CONFUSING_BRANCH_CONDITION_WARNING, USELESS_IS_CHECK!>x !is String<!> -> {}
        in <!CONFUSING_BRANCH_CONDITION_WARNING!>x < x<!> -> {}
        in <!CONFUSING_BRANCH_CONDITION_WARNING!>x > x<!> -> {}

Response:
in <!CONFUSING_BRANCH_CONDITION_WARNING!>x <= x<!> -> {}
        in <!CONFUSING_BRANCH_CONDITION_WARNING!>x >= x<!> -> {}
        in <!CONFUSING_BRANCH_CONDITION_WARNING!>x == x<!> -> {}<|endoftext|>


Prompt:
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
            testClass<AbstractNativeBlackBoxTest>(
                suiteTestClassName = "LldbTestGenerated",
                annotations = listOf(
                    debugger(),
                    provider<UseStandardTestCaseGroupProvider>(),
                    forceDebugMode(),
                    forceHostTarget()
                )
            ) {

Response:
model("lldb")
            }
        }
        testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
            testClass<AbstractNativeBlackBoxTest>(
                suiteTestClassName = "FirLldbTestGenerated",
                annotations = listOf(
                    debugger(),
                    provider<UseStandardTestCaseGroupProvider>(),
                    forceDebugMode(),<|endoftext|>


Prompt:
get() = hasSerializableAnnotationWithoutArgs
            || (!annotations.hasSerializableAnnotation && hasMetaSerializableAnnotation)

private val ClassDescriptor.hasSerializableAnnotationWithoutArgs: Boolean
    get() {
        if (!hasSerializableAnnotation) return false
        // If provided descriptor is lazy, carefully look at psi in order not to trigger full resolve which may be recursive.

Response:
// Otherwise, this descriptor is deserialized from another module, and it is OK to check value right away.
        val psi = findSerializableAnnotationDeclaration() ?: return (serializableWith == null)
        return psi.valueArguments.isEmpty()
    }

private val ClassDescriptor.hasSerializableAnnotationWithArgs: Boolean
    get() {
        if (!hasSerializableAnnotation) return false<|endoftext|>


Prompt:
diagnosticHolder.report(ErrorsParcelize.NO_PARCELABLE_SUPERTYPE.on(reportElement))
        }

        for (supertypeEntry in declaration.superTypeListEntries) {
            supertypeEntry as? KtDelegatedSuperTypeEntry ?: continue
            val delegateExpression = supertypeEntry.delegateExpression ?: continue

Response:
val type = bindingContext[BindingContext.TYPE, supertypeEntry.typeReference] ?: continue
            if (type.isParcelable()) {
                val reportElement = supertypeEntry.byKeywordNode?.psi ?: delegateExpression
                diagnosticHolder.report(ErrorsParcelize.PARCELABLE_DELEGATE_IS_NOT_ALLOWED.on(reportElement))
            }<|endoftext|>


Prompt:
noLibraries: Boolean = false,
    target: TargetBackend = TargetBackend.JVM,
    useJdk11: Boolean = false
) {
    useConfigurators(::SerializationEnvironmentConfigurator.bind(noLibraries))

    if (useJdk11) {
        configureModernJavaTest(TestJdkKind.FULL_JDK_11, JvmTarget.JVM_11)

Response:
}

    if (!noLibraries) {
        when (target) {
            TargetBackend.JVM, TargetBackend.JVM_IR -> useCustomRuntimeClasspathProviders(::SerializationRuntimeClasspathJvmProvider)
            TargetBackend.JS_IR, TargetBackend.JS_IR_ES6 -> useCustomRuntimeClasspathProviders(::SerializationRuntimeClasspathJsProvider)<|endoftext|>


Prompt:
@file:Suppress("NOTHING_TO_INLINE")

package com.example

class SomeClass {

    @JvmName("changedFunctionJvmName")
    fun changedFunction(): Int = 0

    val changedPropertyAccessor: Int
        @JvmName("changedPropertyAccessorJvmName")
        get() = 0
}

@JvmName("changedInlineFunctionJvmName")

Response:
inline fun changedInlineFunction(): Int = 0

inline val changedInlinePropertyAccessor: Int
    @JvmName("changedInlinePropertyAccessorJvmName")
    get() = 0<|endoftext|>


Prompt:
valueTypeConstructor.getApproximatedType()
            }
            is TypedCompileTimeConstant -> {
                val typeFromCall = callForArgument.resultingDescriptor.returnType?.lowerIfFlexible()
                if (typeFromCall != null) {
                    typeFromCall
                } else {
                    val constantValue = compileTimeValue.constantValue

Response:
if (constantValue is ErrorValue) return
                    // Values of all numeric constants are held in Long value
                    val value = constantValue.value as? Long ?: return
                    IntegerLiteralTypeConstructor(value, moduleDescriptor, compileTimeValue.parameters).getApproximatedType()
                }
            }
            else -> return
        }<|endoftext|>


Prompt:
class Test {
  companion object {
    public var prop: Int = 0
      set(i : Int) {
        field = i
      }
  }
}

// TESTED_OBJECT_KIND: property
// TESTED_OBJECTS: Test, prop
// FLAGS: ACC_STATIC, ACC_PRIVATE

// TESTED_OBJECT_KIND: property

Response:
// TESTED_OBJECTS: Test$Companion, prop
// ABSENT: TRUE<|endoftext|>


Prompt:
const val a2 = <!EVALUATED: `10`!>tryFinally(10)<!>
const val a3 = <!EVALUATED: `10`!>outerReturnTryFinally(10)<!>
const val a4 = <!EVALUATED: `10`!>outerReturnUnitTryFinally(10)<!>

Response:
const val b1 = <!EVALUATED: `Inside try block; Inside finally; Outside try; `!>tryFinally2()<!>
const val c1 = <!WAS_NOT_EVALUATED: `
Exception java.lang.IllegalArgumentException: In finally
	at TryFinallyKt.tryCatchFinally(tryFinally.kt:57)<|endoftext|>


Prompt:
is KtContractReturnsNotNullEffectDeclaration, is KtContractReturnsSuccessfullyEffectDeclaration -> Unit
                    is KtContractReturnsSpecificValueEffectDeclaration ->
                        appendProperty(value::value, ::renderKtContractConstantValue, endWithNewLine)
                }
            }
        }
    }

Response:
private fun Context.renderKtContractConstantValue(value: KtContractConstantValue, endWithNewLine: Boolean = true): Unit =
    printer.appendHeader(value::class) {
        appendSimpleProperty(value::constantType, endWithNewLine)
    }

private fun Context.renderKtContractParameterValue(value: KtContractParameterValue, endWithNewLine: Boolean = true): Unit =<|endoftext|>


Prompt:
interface FirCallableDeclaration<F : FirCallableDeclaration<F>> : FirTypedDeclaration, FirSymbolOwner<F> {
    abstract override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R
}

Response:
abstract class FirVariable<F : FirVariable<F>> : FirPureAbstractElement(), FirCallableDeclaration<F>, FirAnnotatedDeclaration, FirStatement {
    abstract override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R
}

abstract class FirWhenExpression {
    abstract val subjectVariable: FirVariable<*>?
}<|endoftext|>


Prompt:
name = Name.identifier(CONTINUATION_RESULT_FIELD_NAME)
                type = context.ir.symbols.resultOfAnyType
                visibility = JavaDescriptorVisibilities.PACKAGE_VISIBILITY
            }
            val capturedThisField = dispatchReceiverParameter?.let {
                addField {
                    name = Name.identifier("this$0")
                    type = it.type

Response:
origin = IrDeclarationOrigin.FIELD_FOR_OUTER_THIS
                    visibility = JavaDescriptorVisibilities.PACKAGE_VISIBILITY
                    isFinal = true
                }
            }
            val labelField = addField(COROUTINE_LABEL_FIELD_NAME, context.irBuiltIns.intType, JavaDescriptorVisibilities.PACKAGE_VISIBILITY)<|endoftext|>


Prompt:
assertTrue(eqShortQBooleanQ(null, null))
    assertTrue(eqShortQBooleanQ(null, undefined))
    assertFalse(eqShortQBooleanQ(undefined, false))
    assertFalse(eqShortQBooleanQ(undefined, true))
    assertTrue(eqShortQBooleanQ(undefined, null))
    assertTrue(eqShortQBooleanQ(undefined, undefined))

Response:
assertTrue(eqShortShort(0.toShort(), 0.toShort()))
    assertFalse(eqShortShort(0.toShort(), 1.toShort()))
    assertFalse(eqShortShort(1.toShort(), 0.toShort()))
    assertTrue(eqShortShort(1.toShort(), 1.toShort()))<|endoftext|>


Prompt:
Type.OBJECT -> if (STRING_BUILDER_OBJECT_APPEND_ARG_TYPES.contains(type)) type else AsmTypes.OBJECT_TYPE
                Type.ARRAY -> AsmTypes.OBJECT_TYPE
                Type.BYTE, Type.SHORT -> Type.INT_TYPE
                else -> type
            }
        }

Response:
fun create(state: GenerationState, mv: InstructionAdapter) =
            StringConcatGenerator(state.config.runtimeStringConcat, mv)
    }
}<|endoftext|>


Prompt:
// IGNORE_BACKEND_K2: JVM_IR, JS_IR, JS_IR_ES6, NATIVE, WASM
// FIR status: KT-46419, ILT conversions to Byte and Short are not supported by design

fun box(): String {
    val a1: Byte? = 1.unaryMinus()
    val a2: Short? = 1.unaryMinus()

Response:
val a3: Int? = 1.unaryMinus()
    val a4: Long? = 1.unaryMinus()
    val a5: Double? = 1.0.unaryMinus()
    val a6: Float? = 1f.unaryMinus()

    if (a1!! != (-1).toByte()) return "fail 1"<|endoftext|>


Prompt:
@JsExport
fun provideULong(): ULong = ULong.MAX_VALUE

@JsExport
fun provideNullableULong(nullable: Boolean): ULong? = if (nullable) null else ULong.MAX_VALUE

@JsExport
fun consumeULong(x: ULong) = x.toString()

@JsExport

Response:
fun consumeNullableULong(x: ULong?) = x?.toString()

fun box(): String = "OK"

// FILE: entry.mjs

import {
    makeC,
    getX,
    getString,
    isEven,
    anyAsEI,
    eiAsAny,
    provideUByte,
    provideUShort,
    provideUInt,<|endoftext|>


Prompt:
if (element is KtParameter && element.getStrictParentOfType<KtDeclaration>() is KtPrimaryConstructor) {
            val containingClassDescriptor = context.trace[BindingContext.CLASS, containingClass]
            val thisAnnotationDescriptor = context.trace[BindingContext.ANNOTATION, annotationEntry]

Response:
if (containingClass != null && containingClassDescriptor != null && thisAnnotationDescriptor != null) {
                // We can ignore value arguments here cause @TypeParceler is a zero-parameter annotation
                if (containingClassDescriptor.annotations.any { it.type == thisAnnotationDescriptor.type }) {<|endoftext|>


Prompt:
* Returns the sum of all values produced by [selector] function applied to each element in the array.
 */
@SinceKotlin("1.4")
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
@kotlin.jvm.JvmName("sumOfBigDecimal")
@kotlin.internal.InlineOnly

Response:
public inline fun DoubleArray.sumOf(selector: (Double) -> java.math.BigDecimal): java.math.BigDecimal {
    var sum: java.math.BigDecimal = 0.toBigDecimal()
    for (element in this) {
        sum += selector(element)
    }
    return sum
}

/**<|endoftext|>


Prompt:
interface DeprecatedModifierContainingDeclaration : KtFirDiagnostic<PsiElement> {
        override val diagnosticClass get() = DeprecatedModifierContainingDeclaration::class
        val modifier: KtModifierKeywordToken
        val target: String
    }

    interface InapplicableOperatorModifier : KtFirDiagnostic<PsiElement> {

Response:
override val diagnosticClass get() = InapplicableOperatorModifier::class
        val message: String
    }

    interface NoExplicitVisibilityInApiMode : KtFirDiagnostic<KtDeclaration> {
        override val diagnosticClass get() = NoExplicitVisibilityInApiMode::class
    }<|endoftext|>


Prompt:
val receiversCount = listOf(expression.dispatchReceiver, expression.extensionReceiver).count { it != null }
                    return when (receiversCount) {
                        0 -> { // Cache KProperties with no arguments.
                            val field = kProperties.getOrPut(expression.symbol.owner) {
                                createKProperty(expression, kTypeGenerator, this) to kProperties.size
                            }

Response:
irCall(arrayItemGetter).apply {
                                dispatchReceiver = irGetField(null, kPropertiesField)
                                putValueArgument(0, irInt(field.second))
                            }
                        }

                        1 -> createKProperty(expression, kTypeGenerator, this) // Has receiver.<|endoftext|>


Prompt:
subProjectTempRoot?.let {
                try {
                    fs.delete {
                        delete(it)
                    }
                } catch (e: Exception) {
                    logger.warn("Can't delete test temp root folder $it", e.printStackTrace())
                }
            }
        }

        if (parallel && jUnitMode != JUnitMode.JUnit5) {

Response:
val forks = (totalMaxMemoryForTestsMb / memoryPerTestProcessMb).coerceAtMost(16)
            maxParallelForks =
                project.providers.gradleProperty("kotlin.test.maxParallelForks").orNull?.toInt()
                    ?: forks.coerceIn(1, Runtime.getRuntime().availableProcessors())
        }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.IrWhen
import org.jetbrains.kotlin.ir.expressions.IrWhileLoop
import org.jetbrains.kotlin.ir.expressions.impl.IrIfThenElseImpl
import org.jetbrains.kotlin.ir.symbols.IrReturnTargetSymbol

Response:
import org.jetbrains.kotlin.ir.symbols.IrTypeAliasSymbol
import org.jetbrains.kotlin.ir.symbols.UnsafeDuringIrConstructionAPI
import org.jetbrains.kotlin.ir.types.IrDynamicType
import org.jetbrains.kotlin.ir.types.IrErrorType<|endoftext|>


Prompt:
operator fun A.component1(): Int = fizz(a)

inline operator fun A.component2(): Int = buzz(b)

inline operator fun A.component3(): Int = buzz(c)

operator fun A.component4(): Int = fizz(d)

inline operator fun A.component5(): Int = buzz(e)

fun box(): String {

Response:
val (a, b, c, d, e) = A(1, 2, 3, 4, 5)

    assertEquals(1, a)
    assertEquals(2, b)
    assertEquals(3, c)
    assertEquals(4, d)
    assertEquals(5, e)<|endoftext|>


Prompt:
?.contains { (it.unwrap() as? ConeTypeParameterType)?.lookupTag == typeParameter.symbol.toLookupTag() } != false

    if (valueParameters.any { it.returnTypeRef.isBadType() } || receiverParameter?.typeRef?.isBadType() == true) return false

    return true
}

Response:
private fun ConeKotlinType.unwrap(): ConeSimpleKotlinType = lowerBoundIfFlexible().let {
    if (it is ConeDefinitelyNotNullType) it.original.unwrap() else it
}<|endoftext|>


Prompt:
for (i in 4.toLong() downTo 0.toInt() step 2L) sb.append(i); sb.appendLine()
    for (i in 4.toLong() downTo 0.toLong() step 2L) sb.append(i); sb.appendLine()
    for (i in 'a' .. 'd' step 2) sb.append(i); sb.appendLine()

Response:
for (i in 'a' until 'd' step 2) sb.append(i); sb.appendLine()
    for (i in 'd' downTo 'a' step 2) sb.append(i); sb.appendLine()

    assertEquals("""
        01234
        01234
        01234
        01234
        01234
        01234
        01234
        01234<|endoftext|>


Prompt:
open class Class {
    <!JS_NAME_CLASH!>open fun test()<!> {}
}

class MyClass : Class() {
    <!JS_NAME_CLASH!>@JsName("test") val notTest<!> = 1
}

// FILE: OpenInheritedMethodClashedWithChildPropertyGetterJsName.kt

Response:
package OpenInheritedMethodClashedWithChildPropertyGetterJsName
open class Class {
    <!JS_NAME_CLASH!>open fun test()<!> {}
}

class MyClass : Class() {
    val notTest: Int
        <!JS_NAME_CLASH!>@JsName("test") get()<!> = 1
}<|endoftext|>


Prompt:
// others will be early-returned
        val valueToMap = future.await()
        synchronized(value) {
            if (value.isCompleted) return@synchronized
            value.complete(transform(valueToMap))
            transform = { throw IllegalStateException("Unexpected 'transform' in future") }
        }
        return value.getCompleted()
    }

Response:
override fun getOrThrow(): R = synchronized(value) {
        if (value.isCompleted) return value.getCompleted()
        value.complete(transform(future.getOrThrow()))
        transform = { throw IllegalStateException("Unexpected 'transform' in future") }
        value.getCompleted()
    }

    private fun writeReplace(): Any {
        return Surrogate(getOrThrow())
    }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.backend.common.phaser.PhaseDescription
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
import org.jetbrains.kotlin.backend.jvm.ir.isJvmInterface

Response:
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.ir.builders.declarations.addFunction
import org.jetbrains.kotlin.ir.builders.declarations.addTypeParameter<|endoftext|>


Prompt:
bytes[byteIndex++] = REPLACEMENT_BYTE_SEQUENCE[2]
                } else {
                    bytes[byteIndex++] = ((codePoint shr 18) or 0xF0).toByte()
                    bytes[byteIndex++] = (((codePoint shr 12) and 0x3F) or 0x80).toByte()

Response:
bytes[byteIndex++] = (((codePoint shr 6) and 0x3F) or 0x80).toByte()
                    bytes[byteIndex++] = ((codePoint and 0x3F) or 0x80).toByte()
                    charIndex++
                }
            }
        }
    }

    return if (bytes.size == byteIndex) bytes else bytes.copyOf(byteIndex)
}<|endoftext|>


Prompt:
sourceFile(SourceFile.URanges)
            }
        }
    }

    val f_reversed = fn("reversed()") {
        include(ProgressionsOfPrimitives, rangePrimitives)
    } builder {
        doc { "Returns a progression that goes over the same range in the opposite direction with the same step." }
        returns("TProgression")
        body {

Response:
"return TProgression.fromClosedRange(last, first, -step)"
        }
    }

    val f_step = fn("step(step: STEP)") {
        include(ProgressionsOfPrimitives, rangePrimitives)
    } builder {
        infix(true)
        doc { "Returns a progression that goes over the same range with the given step." }<|endoftext|>


Prompt:
@kotlin.internal.IntrinsicConstEvaluation public final operator fun minus(other: kotlin.Double): kotlin.Double { /* compiled code */ }

    @kotlin.internal.IntrinsicConstEvaluation public final operator fun minus(other: kotlin.Float): kotlin.Double { /* compiled code */ }

Response:
@kotlin.internal.IntrinsicConstEvaluation public final operator fun minus(other: kotlin.Int): kotlin.Double { /* compiled code */ }

    @kotlin.internal.IntrinsicConstEvaluation public final operator fun minus(other: kotlin.Long): kotlin.Double { /* compiled code */ }<|endoftext|>


Prompt:
override fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference, data: Nothing?) {
        visitLocalDelegatedPropertyReference(expression)
    }

    fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference) {
        visitCallableReference(expression)
    }

Response:
override fun visitClassReference(expression: IrClassReference, data: Nothing?) {
        visitClassReference(expression)
    }

    fun visitClassReference(expression: IrClassReference) {
        visitDeclarationReference(expression)
    }

    override fun visitConst(expression: IrConst<*>, data: Nothing?) {
        visitConst(expression)
    }<|endoftext|>


Prompt:
abstract val argumentsWithConversion: Map<KotlinCallArgument, SamConversionDescription>
    abstract val argumentsWithSuspendConversion: Map<KotlinCallArgument, UnwrappedType>
    abstract val argumentsWithUnitConversion: Map<KotlinCallArgument, UnwrappedType>

Response:
abstract val argumentsWithConstantConversion: Map<KotlinCallArgument, IntegerValueTypeConstant>
    abstract fun setCandidateDescriptor(newCandidateDescriptor: CallableDescriptor)
}

class SamConversionDescription(
    val convertedTypeByOriginParameter: UnwrappedType,
    val convertedTypeByCandidateParameter: UnwrappedType, // expected type for corresponding argument<|endoftext|>


Prompt:
if (old.hasDelegateMethod()) {
            if (!checkEquals(old.delegateMethod, new.delegateMethod)) return false
        }

        return true
    }

    open fun checkEquals(old: ProtoBuf.Annotation.Argument.Value, new: ProtoBuf.Annotation.Argument.Value): Boolean {

Response:
if (old.hasType() != new.hasType()) return false
        if (old.hasType()) {
            if (old.type != new.type) return false
        }

        if (old.hasIntValue() != new.hasIntValue()) return false
        if (old.hasIntValue()) {
            if (old.intValue != new.intValue) return false
        }<|endoftext|>


Prompt:
System.out?.println("  else escape(i + 1, result + escapeChar(this.get(i)))");
  System.out?.println();
  System.out?.println("fun main(args : Array<String>) {");
  System.out?.println("  val s = \"" + s.escape() + "\";");
  System.out?.println(s);
  return "OK"

Response: }<|endoftext|>


Prompt:
fun typeDesc(type: PsiType): String = when (type) {
        PsiType.VOID -> primitive(VOID_TYPE)

        PsiType.BOOLEAN -> primitive(BOOLEAN_TYPE)

        PsiType.CHAR -> primitive(CHAR_TYPE)
        PsiType.INT -> primitive(INT_TYPE)

Response:
PsiType.BYTE -> primitive(BYTE_TYPE)
        PsiType.SHORT -> primitive(SHORT_TYPE)
        PsiType.LONG -> primitive(LONG_TYPE)

        PsiType.FLOAT -> primitive(FLOAT_TYPE)
        PsiType.DOUBLE -> primitive(DOUBLE_TYPE)<|endoftext|>


Prompt: // library.kt:30 baz: param:int=6:int, b:int=2:int, inlineCallParam1\1:int=1:int, inlineCallParam2\1:int=2:int, $i$f$inlineCall\1\10:int=0:int, e\1:int=5:int, baz1Param\2:int=1:int,

Response: $i$f$baz1\2\50:int=0:int, baz1Var\2:int=3:int, baz1BlockParam\4:int=1:int, $i$a$-baz1-LibraryKt$inlineCall$1\4\53\1:int=0:int, baz1LambdaVar\4:int=1:int,<|endoftext|>


Prompt:
@kotlin.internal.IntrinsicConstEvaluation
    public operator fun compareTo(other: Long): Int

    /**
     * Compares this value with the specified value for order.
     * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
     * or a positive number if it's greater than other.
     */

Response:
@kotlin.internal.IntrinsicConstEvaluation
    public operator fun compareTo(other: Float): Int

    /**
     * Compares this value with the specified value for order.
     * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
     * or a positive number if it's greater than other.
     */<|endoftext|>


Prompt:
// (discarding the exception or aborting a previous jump in the process) so merge all data just in case.
            else -> persistentMapOf(label to data.values.reduce { a, b -> mergeInfo(a, b, to) })
        }
    }

    override fun visitNode(
        node: CFGNode<*>,
        data: PathAwareControlFlowInfo<K, V>

Response:
): PathAwareControlFlowInfo<K, V> = data
}

inline fun <K, V> PersistentMap<K, V>.merge(other: PersistentMap<K, V>, block: (V, V) -> V): PersistentMap<K, V> =
    mutate {
        other.mapValuesTo(it) { (label, rightValue) -><|endoftext|>


Prompt:
!(nx == x) -> "Fail 6"
        !(nx != y) -> "Fail 7"
        nn == 0L -> "Fail 8"
        !(nn != 0L) -> "Fail 9"
        nn == x -> "Fail 10"
        !(nn != x) -> "Fail 11"
        ax != 0L -> "Fail 12"
        ax == 1L -> "Fail 13"

Response:
!(ax == 0L) -> "Fail 14"
        !(ax != 1L) -> "Fail 15"
        ax != x -> "Fail 16"
        ax == y -> "Fail 17"
        !(ax == x) -> "Fail 18"
        !(ax != y) -> "Fail 19"
        ax != bx -> "Fail 20"
        ax == by -> "Fail 21"<|endoftext|>


Prompt:
conflictingSymbol: FirBasedSymbol<*>,
    conflictingPresentation: String? = null,
    conflictingFile: FirFile? = null,
) {
    conflictingSymbol.lazyResolveToPhase(FirResolvePhase.STATUS)
    if (conflictingSymbol == declaration) return
    if (
        declaration.moduleData != conflictingSymbol.moduleData &&

Response:
!shouldCheckForMultiplatformRedeclaration(declaration, conflictingSymbol)
    ) return
    val actualConflictingPresentation = conflictingPresentation ?: FirRedeclarationPresenter.represent(conflictingSymbol)
    if (actualConflictingPresentation != declarationPresentation) return
    val actualConflictingFile =
        conflictingFile ?: when (conflictingSymbol) {<|endoftext|>


Prompt:
private val firSymbolProvider: FirSymbolProvider,
) : KtSymbolProvider(), KtFirAnalysisSessionComponent {

    override fun getParameterSymbol(psi: KtParameter): KtVariableLikeSymbol {
        return when {
            psi.isFunctionTypeParameter -> errorWithFirSpecificEntries(

Response:
"Creating KtValueParameterSymbol for function type parameter is not possible. Please see the KDoc of getParameterSymbol",
                psi = psi,
            )

            psi.isLoopParameter || psi.isCatchParameter -> {
                firSymbolBuilder.variableLikeBuilder.buildLocalVariableSymbol(<|endoftext|>


Prompt:
@GCUnsafeCall("Kotlin_Long_countOneBits")
public actual external fun Long.countOneBits(): Int

/**
 * Counts the number of consecutive most significant bits that are zero in the binary representation of [Long] [value].
 * Returns undefined result for zero [value].
 */
@GCUnsafeCall("Kotlin_Long_countLeadingZeroBits")

Response:
private external fun countLeadingZeroBits(value: Long): Int

/**
 * Counts the number of consecutive most significant bits that are zero in the binary representation of this [Long] number.
 */
@SinceKotlin("1.4")
public actual fun Long.countLeadingZeroBits(): Int =
        if (this == 0L) 64 else countLeadingZeroBits(this)

/**<|endoftext|>


Prompt:
super.testAbiChangeInLib_changeMethodSignature(gradleVersion)
    }

    @Disabled("KT-57147")
    @GradleTest
    override fun testNonAbiChangeInLib_changeMethodBody(gradleVersion: GradleVersion) {
        super.testNonAbiChangeInLib_changeMethodBody(gradleVersion)
    }
}

Response:
@DisplayName("Default incremental compilation with disabled precise compilation outputs backup")
abstract class IncrementalJavaChangeWithoutPreciseCompilationBackupIT : IncrementalJavaChangeDefaultIT() {
    override val defaultBuildOptions = super.defaultBuildOptions.copy(usePreciseOutputsBackup = false, keepIncrementalCompilationCachesInMemory = false)
}

@DisplayName("Default incremental compilation with precise compilation outputs backup on K1")<|endoftext|>


Prompt:
constructor(container: KDeclarationContainerImpl, descriptor: PropertyDescriptor) : super(container, descriptor)

    private val _getter = lazy(PUBLICATION) { Getter(this) }

    override val getter: Getter<T, V> get() = _getter.value

    override fun get(receiver: T): V = getter.call(receiver)

Response:
private val delegateSource = lazy(PUBLICATION) { computeDelegateSource() }

    override fun getDelegate(receiver: T): Any? = getDelegateImpl(delegateSource.value, receiver, null)

    override fun invoke(receiver: T): V = get(receiver)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker
import org.jetbrains.kotlin.fir.analysis.diagnostics.wasm.FirWasmErrors.ASSOCIATED_OBJECT_INVALID_BINDING

Response:
import org.jetbrains.kotlin.fir.declarations.FirClass
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
import org.jetbrains.kotlin.fir.declarations.hasAnnotation
import org.jetbrains.kotlin.fir.types.coneType<|endoftext|>


Prompt:
internal class KotlinStaticData(override val generationState: NativeGenerationState, override val llvm: CodegenLlvmHelpers, module: LLVMModuleRef) : ContextUtils, StaticData(module, llvm) {
    private val stringLiterals = mutableMapOf<String, ConstPointer>()

    // Must match OBJECT_TAG_PERMANENT_CONTAINER in C++.

Response:
private fun permanentTag(typeInfo: ConstPointer): ConstPointer {
        return typeInfo.addBits(llvm, kTypeInfoPtr, 1)
    }

    private fun objHeader(typeInfo: ConstPointer): Struct {
        return Struct(runtime.objHeaderType, permanentTag(typeInfo))
    }

    private fun arrayHeader(typeInfo: ConstPointer, length: Int): Struct {<|endoftext|>


Prompt:
open class BaseClass(private val _prop: String) : BaseInterface {
    final override val prop: String get() = _prop
}

@JsExport
fun getImpl(): BaseInterface = Impl()

@JsExport
fun getBase(): BaseInterface = BaseClass("base")

// FILE: main.mjs
// ENTRY_ES_MODULE

Response:
import { getBase, getImpl } from "./exportInterfaceWithoutClases-export_interface_v5.mjs"

export function box() {
    if (getBase().prop != "base") return "fail 1";
    if (getImpl().prop != "foobar") return "fail 2";

    return "OK"
}<|endoftext|>


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

// TESTCASE NUMBER: 12
fun case_12(x: Boolean?) {
    while (true) {

Response:
break || x!!
    }

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

// TESTCASE NUMBER: 13<|endoftext|>


Prompt:
override fun any(): Any = Any()
    override fun anyN(): Any? = Any()
    override fun block(): () -> Int = { 42 }
    override fun blockN(): (() -> Int)? = null
    override fun pointer(): CPointer<*> = 1L.toCPointer<COpaque>()!!
    override fun pointerN(): CPointer<*>? = null

Response:
override fun int(): Int = 42
    override fun longN(): Long? = null
    override fun double(): Double = 3.14
}

@Throws(Throwable::class)
fun testSwiftThrowing(methods: SwiftOverridableMethodsWithThrows) = with(methods) {
    assertSwiftThrowing { unit() }
    assertSwiftThrowing { nothing() }<|endoftext|>


Prompt:
set(value) = definedExternally
    var clientY: Int? /* = 0 */
        get() = definedExternally
        set(value) = definedExternally
    var button: Short? /* = 0 */
        get() = definedExternally
        set(value) = definedExternally
    var buttons: Short? /* = 0 */
        get() = definedExternally
        set(value) = definedExternally

Response:
var relatedTarget: EventTarget? /* = null */
        get() = definedExternally
        set(value) = definedExternally
    var region: String? /* = null */
        get() = definedExternally
        set(value) = definedExternally
}

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


Prompt:
method.selectors.size == 1 && method.parameters.size == 0
            )

            if (method.selectors.size == 1 && method.parameters.size == 0) {
                append(method.selectors[0])
            } else {
                for (i in 0 until method.selectors.size) {
                    if (i > 0) append(' ')

Response:
val parameter = method.parameters[i]
                    val selector = method.selectors[i]
                    append(selector)
                    append("(")
                    append(parameter.type.render())
                    append(")")
                    append(parameter.name)
                }
            }
        }

        fun appendAttributes() {
            appendPostfixDeclarationAttributes(method.attributes)
        }<|endoftext|>


Prompt:
val method = typeMapper.mapToCallableMethod(delegateTo, true)
                        val myParameters = signature.valueParameters
                        val calleeParameters = method.getValueParameters()

                        if (myParameters.size != calleeParameters.size) {
                            throw AssertionError(
                                    "Method from super interface has a different signature.\n" +

Response:
"This method:\n%s\n%s\n%s\nSuper method:\n%s\n%s\n%s".format(
                                            descriptor, signature, myParameters, delegateTo, method, calleeParameters
                                    )
                            )
                        }

                        var k = 0
                        val it = calleeParameters.iterator()
                        for (parameter in myParameters) {<|endoftext|>


Prompt:
val unusedDiagnostic = asTextDiagnostic(unresolvedReference, "i")
        val toManyArguments = asTextDiagnostic(diagnostics[7])
        val range = asDiagnosticRange(unresolvedReference, unusedDiagnostic, toManyArguments)
        val wrongParameter = wrongParameters(
            unusedDiagnostic,

Response:
"OI;UNRESOLVED_REFERENCE(xx)",
            unresolvedReference.startOffset,
            unresolvedReference.endOffset
        )

        doTest(object : Test(wrongParameter) {
            override fun makeTestData(diagnostics: MutableList<ActualDiagnostic>, diagnosedRanges: MutableList<DiagnosedRange>) {<|endoftext|>


Prompt:
val buildOptions = this.buildOptions.copy(
                nativeOptions = this.buildOptions.nativeOptions.copy(
                    cocoapodsPlatform = "iphonesimulator",
                    cocoapodsArchs = "x86_64",
                    cocoapodsConfiguration = "Debug"
                )
            )
            buildAndFail("syncFramework", buildOptions = buildOptions) {

Response:
assertOutputContains("error: Could not find com.example.unknown:dependency:0.0.1.")
            }
        }
    }

    @DisplayName("Xcode style errors when sync framework compilation failed")
    @GradleTest
    fun testSyncFrameworkUseXcodeStyleErrorsWhenCompilationFailed(gradleVersion: GradleVersion) {<|endoftext|>


Prompt:
visitLabel(readEndLabel)
            load(inputVar, kInputType)
            load(descVar, descType)
            invokeinterface(
                kInputType.internalName, CallingConventions.end,
                "(" + descType.descriptor + ")V"
            )
            if (!serializableDescriptor.isInternalSerializable) {
                //validate all required (constructor) fields

Response:
for ((i, property) in properties.serializableConstructorProperties.withIndex()) {
                    if (property.optional || property.transient) {
                        if (!property.isConstructorParameterWithDefault)
                            throw CompilationException(
                                "Property ${property.name} was declared as optional/transient but has no default value",
                                null,
                                null
                            )
                    } else {<|endoftext|>


Prompt:
dependOnBuiltIns
            )
            val project = files.firstOrNull()?.project ?: throw AssertionError("No files to analyze")

            val multiplatformLanguageSettings = object : LanguageVersionSettings by languageVersionSettings {
                override fun getFeatureSupport(feature: LanguageFeature): LanguageFeature.State =
                    if (feature == LanguageFeature.MultiPlatformProjects) LanguageFeature.State.ENABLED

Response:
else languageVersionSettings.getFeatureSupport(feature)
            }

            val resolverForModuleFactory = CommonResolverForModuleFactory(
                CommonAnalysisParameters(metadataPartProviderFactory),
                targetEnvironment,
                targetPlatform,
                shouldCheckExpectActual = false,
                dependenciesContainer
            )

            val projectContext = explicitProjectContext ?: ProjectContext(project, "metadata serializer")<|endoftext|>


Prompt:
FirDiagnosticsCompilerResultsReporter.reportToMessageCollector(
            diagnosticsReporter,
            messageCollector,
            configuration.getBoolean(CLIConfigurationKeys.RENDER_DIAGNOSTIC_INTERNAL_NAME)
        )

        ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
        return state
    }
}

Response:
fun CompilerConfiguration.configureSourceRoots(chunk: List<Module>, buildFile: File? = null) {
    val hmppCliModuleStructure = get(CommonConfigurationKeys.HMPP_MODULE_STRUCTURE)
    for (module in chunk) {
        val commonSources = getBuildFilePaths(buildFile, module.getCommonSourceFiles()).toSet()<|endoftext|>


Prompt:
accumulator = operation(index, accumulator, this[index])
        result.add(accumulator)
    }
    return result
}

/**
 * Returns a list containing successive accumulation values generated by applying [operation] from left to right
 * to each element, its index in the original array and current accumulator value that starts with the first element of this array.
 *

Response:
* Note that `acc` value passed to [operation] function should not be mutated;
 * otherwise it would affect the previous value in resulting list.
 *
 * @param [operation] function that takes the index of an element, current accumulator value
 * and the element itself, and calculates the next accumulator value.
 *
 * @sample samples.collections.Collections.Aggregates.runningReduce
 */<|endoftext|>


Prompt:
fun KtExpression.getPropertyResolvedCallWithAssert(context: BindingContext): ResolvedCall<out PropertyDescriptor> {
    val resolvedCall = getResolvedCallWithAssert(context)
    assert(resolvedCall.resultingDescriptor is PropertyDescriptor) {
        "ResolvedCall for this expression must be ResolvedCall<? extends PropertyDescriptor>: ${this.getTextWithLocation()}"

Response:
}
    @Suppress("UNCHECKED_CAST")
    return resolvedCall as ResolvedCall<out PropertyDescriptor>
}

fun KtExpression.getVariableResolvedCallWithAssert(context: BindingContext): ResolvedCall<out VariableDescriptor> {
    val resolvedCall = getResolvedCallWithAssert(context)<|endoftext|>


Prompt:
nativeProject("expect-actual-fun-or-class-ic", gradleVersion) {
            build("assemble")

            listOf("jvmMain", "jsMain", "nativeMain").forEach { sourceSet ->
                // just touch the file. expected logic is this:
                // actual declaration needs to be recompiled -> we add expect declaration to the list of compiled files

Response:
kotlinSourcesDir(sourceSet).resolve("ActualFunFoo.kt").addPrivateVal()
            }

            build("assemble", buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)) {
                assertTasksExecuted(":compileKotlinJvm", ":compileKotlinJs", ":compileKotlinNative")
                assertIncrementalCompilation(<|endoftext|>


Prompt:
*     [CirTypeParameterType]           [CirClassOrTypeAliasType]
 *                                            /           \
 *                               [CirClassType]           [CirTypeAliasType]
 */
sealed class CirType {
    final override fun toString() = buildString { appendDescriptionTo(this) }
    internal abstract fun appendDescriptionTo(builder: StringBuilder)
}

Response:
data class CirFlexibleType(val lowerBound: CirSimpleType, val upperBound: CirSimpleType) : CirType() {
    override fun appendDescriptionTo(builder: StringBuilder) {
        builder.append("lower = ")
        lowerBound.appendDescriptionTo(builder)
        builder.append(", upper = ")
        upperBound.appendDescriptionTo(builder)
    }
}

/**<|endoftext|>


Prompt:
argumentExpression.accept(this, null).ifNotValidConst { return it }
                }
                ConstantArgumentKind.VALID_CONST
            }
            else -> ConstantArgumentKind.NOT_CONST
        }
    }

    override fun visitQualifiedAccessExpression(
        qualifiedAccessExpression: FirQualifiedAccessExpression, data: Nothing?
    ): ConstantArgumentKind {

Response:
val expressionType = qualifiedAccessExpression.getExpandedType()
        if (expressionType.isReflectFunctionType(session) || expressionType.isKProperty(session) || expressionType.isKMutableProperty(session)) {
            return qualifiedAccessExpression.dispatchReceiver?.accept(this, data) ?: ConstantArgumentKind.VALID_CONST
        }<|endoftext|>


Prompt:
@file:JvmName(<!EVALUATED("OtherKt")!>"OtherKt"<!>)
package one.two

const val FOO = <!EVALUATED("1")!>1<!>

const val BAZ = <!EVALUATED("3")!>Bar.BAR + 1<!>

Response:
// This class is presented here to check that on super type resolve phase we have resolved `JvmName` annotation
class Child : Bar()

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


Prompt:
import org.jetbrains.kotlin.konan.test.blackbox.support.util.*
import org.jetbrains.kotlin.test.directives.model.Directive
import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives
import org.jetbrains.kotlin.test.services.JUnit5Assertions

Response:
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertEquals
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertFalse
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertNotEquals<|endoftext|>


Prompt:
package org.jetbrains.kotlin.contracts.description.expressions

import org.jetbrains.kotlin.contracts.description.BooleanExpression
import org.jetbrains.kotlin.contracts.description.ContractDescriptionElement
import org.jetbrains.kotlin.contracts.description.ContractDescriptionVisitor

Response:
import org.jetbrains.kotlin.descriptors.ParameterDescriptor

interface ContractDescriptionValue : ContractDescriptionElement {
    override fun <R, D> accept(contractDescriptionVisitor: ContractDescriptionVisitor<R, D>, data: D): R =
        contractDescriptionVisitor.visitValue(this, data)
}

open class ConstantReference(val name: String) : ContractDescriptionValue {<|endoftext|>


Prompt:
constructor(arg1A: UserKlassA, arg2A: UserKlassB)
}
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun TestMultipleDifferentlyNamedValueParametersBReverse(arg1B: UserKlassA, arg2B: UserKlassB) {}

class TestMultipleTypeAliasedValueParameterTypesA {

Response:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor(arg1: UserKlassA, arg2: SameUserKlassB)
}
fun TestMultipleTypeAliasedValueParameterTypesA(arg1: UserKlassA, arg2: SameUserKlassB) {}

class TestMultipleTypeAliasedValueParameterTypesAReverse {<|endoftext|>


Prompt:
IdeaKotlinBinaryCoordinates(
            group = "myGroup",
            module = "myModule",
            version = "myVersion",
            sourceSetName = null
        )
    )

    @Test
    fun `sample 3`() = testSerialization(
        IdeaKotlinBinaryCoordinates(
            group = "myGroup",
            module = "myModule",

Response:
version = "myVersion",
            sourceSetName = null,
            capabilities = setOf(
                IdeaKotlinBinaryCapability("my", "capability", "1.0.0"),
                IdeaKotlinBinaryCapability("my", "other-capability", "1.0.0")
            )
        )
    )

    @Test<|endoftext|>


Prompt:
private fun buildInfoForRoot(root: FirFunctionSymbol<*>): Map<FirBasedSymbol<*>, Fork> {
        assignedLocalVariablesByDeclaration?.let { return it }

        val data = MiniCfgBuilder.MiniCfgData()
        MiniCfgBuilder().visitElement(root.fir, data)

        assignedLocalVariablesByDeclaration = data.forks

Response:
variableAssignments = data.assignments

        return data.forks
    }

    private fun enterScope(
        symbol: FirBasedSymbol<*>,
        evaluatedInPlace: Boolean,
    ): Pair<Fork?, VariableAssignments> {
        val currentInfo = getInfoForDeclaration(symbol)
        val prohibitInThisScope = scopes.top().second.copy()<|endoftext|>


Prompt:
public fun <K, V> linkedMapOf(vararg pairs: kotlin.Pair<K, V>): kotlin.collections.LinkedHashMap<K, V>

@kotlin.SinceKotlin(version = "1.1")
@kotlin.internal.InlineOnly
public inline fun <T> linkedSetOf(): kotlin.collections.LinkedHashSet<T>

Response:
public fun <T> linkedSetOf(vararg elements: T): kotlin.collections.LinkedHashSet<T>

public fun <V> linkedStringMapOf(vararg pairs: kotlin.Pair<kotlin.String, V>): kotlin.collections.LinkedHashMap<kotlin.String, V><|endoftext|>


Prompt:
selector = annotation.getAnnotationStringValue("selector"),
        encoding = annotation.getAnnotationStringValue("encoding"),
        isStret = annotation.getAnnotationValueOrNull<Boolean>("isStret") ?: false,
        directSymbol = null,
)

/**
 * @param onlyExternal indicates whether to accept overriding methods from Kotlin classes
 */

Response:
private fun FunctionDescriptor.getObjCMethodInfo(onlyExternal: Boolean): ObjCMethodInfo? {
    if (this.kind.isReal) {
        this.decodeObjCMethodAnnotation()?.let { return it }

        if (onlyExternal) {
            return null
        }
    }<|endoftext|>


Prompt: 0x0006, 0x0011, 0x001a, 0x0005, 0x0004, 0x0006, 0x0018, 0x0009, 0x0018, 0x0011, 0x14b1, 0x0011, 0x0005, 0x0011, 0x0005, 0x0225, 0x0005, 0x18a5,

Response: 0x0006, 0x4625,<|endoftext|>


Prompt:
}

    val list4 = ArrayList<Long>()
    for (i in (5L downTo 3L).reversed()) {
        list4.add(i)
        if (list4.size > 23) break
    }
    if (list4 != listOf<Long>(3, 4, 5)) {

Response:
return "Wrong elements for (5L downTo 3L).reversed(): $list4"
    }

    val list5 = ArrayList<Char>()
    for (i in ('c' downTo 'a').reversed()) {
        list5.add(i)
        if (list5.size > 23) break
    }<|endoftext|>


Prompt:
val alreadyDone: MutableSet<AnyNamedPhase> = mutableSetOf(),
    var depth: Int = 0,
    var phaseCount: Int = 0,
    val stickyPostconditions: MutableSet<Checker<Data>> = mutableSetOf()
) {
    fun copyOf() = PhaserState(alreadyDone.toMutableSet(), depth, phaseCount, stickyPostconditions)
}

Response:
// Copy state, forgetting the sticky postconditions (which will not be applicable to the new type)
fun <Input, Output> PhaserState<Input>.changePhaserStateType() = PhaserState<Output>(alreadyDone, depth, phaseCount, mutableSetOf())

inline fun <R, D> PhaserState<D>.downlevel(nlevels: Int, block: () -> R): R {
    depth += nlevels<|endoftext|>


Prompt:
* UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28159
 */
fun case_2(x: Nothing?) {

Response: if (<!SENSELESS_COMPARISON!><!DEBUG_INFO_CONSTANT!>x<!> !== null<!> && <!SENSELESS_COMPARISON!><!DEBUG_INFO_CONSTANT!>x<!> !== null<!>) {<|endoftext|>


Prompt:
public const val degree: Char = '\u00B0'
    /** The character ± */
    public const val plusMinus: Char = '\u00B1'
    /** The character ¶ */
    public const val paragraph: Char = '\u00B6'
    /** The character · */

Response:
public const val middleDot: Char = '\u00B7'
    /** The character ½ */
    public const val half: Char = '\u00BD'
    /** The character – */
    public const val ndash: Char = '\u2013'
    /** The character — */
    public const val mdash: Char = '\u2014'<|endoftext|>