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

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

val xs = listOf("a", "b", "c", "d")

fun box(): String {
    val s = StringBuilder()

    for ((_, x) in xs.withIndex()) {<|endoftext|>


Prompt:
<!USELESS_IS_CHECK!>!is <!DUPLICATE_LABEL_IN_WHEN, DYNAMIC_NOT_ALLOWED!>dynamic?<!><!> -> {}
    }

    dl as List<dynamic>
    <!USELESS_IS_CHECK!>dl is List<dynamic><!>

    when (dl) {

Response:
<!USELESS_IS_CHECK!>is List<dynamic><!> -> {}
    }
}<|endoftext|>


Prompt:
// so the parameters are captured and assigning to them requires temporarily rewriting their types (see
        // `SharedVariablesLowering`), and that we can't do. So we have to create new `var`s for this purpose.
        // TODO: an optimization pass will rewrite the types of vars back since the lambdas are guaranteed to be inlined

Response:
//  in place (otherwise they can't jump to the start of the function at all), so this is all a waste of CPU time.
        val parameterToVariable = irFunction.explicitParameters.associateWith {
            if (someCallsAreFromOtherFunctions || !it.isAssignable)<|endoftext|>


Prompt:
package kotlin.reflect

/**
 * Represents a property, such as a named `val` or `var` declaration.
 * Instances of this class are obtainable by the `::` operator.
 *
 * See the [Kotlin language documentation](https://kotlinlang.org/docs/reference/reflection.html)
 * for more information.
 *
 * @param V the type of the property value.

Response:
*/
public actual interface KProperty<out V> : KCallable<V>

public actual interface KProperty0<out V> : kotlin.reflect.KProperty<V>, () -> V {

    public actual fun get(): V

    public override abstract operator fun invoke(): V
}<|endoftext|>


Prompt:
val inv = ::bar2 <!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>in<!> setOf(::foo2)
        <!UNRESOLVED_REFERENCE!>inv<!>()
    }
}

fun poll82(): Flow<String> {
    return flow {
        val inv = ::bar3 in setOf(::foo3)

Response:
<!UNRESOLVED_REFERENCE!>inv<!>()
    }
}

fun poll83(): Flow<String> {
    return flow {
        val inv = ::bar4 <!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>in<!> setOf(::foo4)
        inv
    }
}

fun poll84(): Flow<String> {<|endoftext|>


Prompt:
if (descriptor.hasReadonlyComposableAnnotation()) {
                        // enforce that the original call was readonly
                        if (!resolvedCall.isReadOnlyComposableInvocation()) {
                            illegalCallMustBeReadonly(
                                context,
                                reportOn
                            )
                        }
                    }
                    return
                }
                is KtCallableReferenceExpression -> {

Response:
illegalComposableFunctionReference(context, node)
                    return
                }
                is KtFile -> {
                    // if we've made it this far, the call was made in a non-composable context.
                    illegalCall(context, reportOn)
                    return
                }
                is KtClass -> {
                    // composable calls are never allowed in the initializers of a class<|endoftext|>


Prompt:
package org.jetbrains.kotlin.util

import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.diagnostics.PsiDiagnosticUtils
import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments

Response:
class KotlinFrontEndException(message: String, cause: Throwable) : KotlinExceptionWithAttachments(message, cause) {
    constructor(
        message: String,
        cause: Throwable,
        element: PsiElement
    ) : this(getExceptionMessage("Front-end", message, cause, PsiDiagnosticUtils.atLocation(element)), cause) {<|endoftext|>


Prompt:
* type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 1
 * type-inference, smart-casts, smart-cast-types -> paragraph 9 -> sentence 8
 */
class A

fun test(a: Any) {
    var q: String? = null

    when (a) {
        is A -> q = "1"
    }
    // When is not exhaustive

Response:
return <!RETURN_TYPE_MISMATCH!>q<!>
}<|endoftext|>


Prompt:
CAPTURED_VARIABLE("captured var", "local variable that is mutated in a capturing closure"),

    // Member variable regardless of its visibility
    // Smart casts are not safe
    MUTABLE_PROPERTY("member", "mutable property that could be mutated concurrently"),

    // A delegated property.
    // Smart casts are not safe

Response:
DELEGATED_PROPERTY("delegate", "delegated property"),
}<|endoftext|>


Prompt:
fun visitPropertyAccessor(propertyAccessor: PropertyAccessor): PropertyAccessor

    fun visitSimpleStubContainer(simpleStubContainer: SimpleStubContainer): SimpleStubContainer

    fun visitFunctionParameter(element: FunctionParameterStub): FunctionParameterStub

    fun visitAnnotation(element: AnnotationStub): AnnotationStub

Response:
fun visitReceiverParameter(element: ReceiverParameterStub): ReceiverParameterStub

}<|endoftext|>


Prompt:
* **Q:** Why not just use the [IrSimpleFunction] class itself?
 *
 * **A:** Because a symbol, unlike a declaration, can be bound or unbound (see [isBound]).
 *
 * We need this distinction to work with IR before the linkage phase. In pre-linkage IR the symbols referencing declarations from
 * other modules are not yet bound.
 *

Response:
* During the linkage phase, we collect all the unbound symbols in the IR tree and try to resolve them to the declarations they should
 * refer to. For unbound symbols for public declarations from other modules, [signature] is used to resolve those declarations.
 *
 * @see IdSignature
 * @see SymbolTable
 */
interface IrSymbol : DeclarationSymbolMarker {

    /**<|endoftext|>


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

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & Inv<*>?")!>a<!>.propNullableAny
        <!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & Inv<*>?")!>a<!>.funT()
        <!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & Inv<*>?")!>a<!>.funAny()<|endoftext|>


Prompt:
* The (contents-based) header id.
 * Its [value] remains valid across different runs of the indexer and the process,
 * and thus can be used to 'serialize' the id.
 */
data class HeaderId(val value: String)

data class Location(val headerId: HeaderId)

interface LocatableDeclaration {
    val location: Location
}

interface TypeDeclaration : LocatableDeclaration

Response:
sealed class StructMember(val name: String) {
    abstract val offset: Long?
}

/**
 * C struct field.
 */
class Field(name: String, val type: Type, override val offset: Long, val typeSize: Long, val typeAlign: Long)
    : StructMember(name)

val Field.isAligned: Boolean<|endoftext|>


Prompt:
return klass
    }
}

private fun reflectFunctionClassFqn(shortName: Name): FqName = KOTLIN_REFLECT_FQ_NAME.child(shortName)
private fun reflectionFunctionClassName(isSuspend: Boolean, arity: Int): Name =
    Name.identifier("K${if (isSuspend) "Suspend" else ""}Function$arity")

Response:
fun KotlinBuiltIns.functionClassDescriptor(arity: Int): FunctionClassDescriptor =
    getFunction(arity) as FunctionClassDescriptor

fun KotlinBuiltIns.suspendFunctionClassDescriptor(arity: Int): FunctionClassDescriptor =
    getSuspendFunction(arity) as FunctionClassDescriptor<|endoftext|>


Prompt:
<init>(LFooImpl;I)V
              public final invoke(Landroidx/compose/runtime/Composer;I)V
              public synthetic bridge invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
              final synthetic LFooImpl; %tmp0_rcvr
              final synthetic I %%changed

Response:
OUTERCLASS FooImpl bar (Landroidx/compose/runtime/Composer;I)V
              final static INNERCLASS FooImpl%bar%1 null null
            }
        """
    )

    @Test
    fun testSealedClassEtc() = checkApi(
        """
            sealed class CompositionLocal2<T> {
                inline val current: T
                    @Composable<|endoftext|>


Prompt:
val type = getterDescriptor.returnType ?: return@let
                    report("getters", type, getterDescriptor.annotations)
                }
                descriptor.setter?.valueParameters?.single()?.let { report("parameters", it.type, it.annotations) }

Response:
descriptor.extensionReceiverParameter?.let { report("receivers", it.type, it.annotations) }
                descriptor.contextReceiverParameters.forEach { report("receivers", it.type, it.annotations) }
            }
            is PropertyAccessorDescriptor -> Unit
            is LocalVariableDescriptor -> {<|endoftext|>


Prompt: val CANNOT_WEAKEN_ACCESS_PRIVILEGE: KtDiagnosticFactory3<Visibility, FirCallableSymbol<*>, Name> by error3<KtModifierListOwner, Visibility, FirCallableSymbol<*>, Name>(SourceElementPositioningStrategies.VISIBILITY_MODIFIER)

Response: val CANNOT_WEAKEN_ACCESS_PRIVILEGE_WARNING: KtDiagnosticFactory3<Visibility, FirCallableSymbol<*>, Name> by warning3<KtModifierListOwner, Visibility, FirCallableSymbol<*>, Name>(SourceElementPositioningStrategies.VISIBILITY_MODIFIER)<|endoftext|>


Prompt:
":app:kaptDebugKotlin",
                ":app:kaptGenerateStubsDebugKotlin"
            )
        }
    }

    @DisplayName("works in android project")
    @GradleAndroidTest
    fun testKotlinAndroidProject(
        gradleVersion: GradleVersion,
        agpVersion: String,
        jdkVersion: JdkVersions.ProvidedJdk,

Response:
) {
        project(
            "AndroidProject",
            gradleVersion,
            buildOptions = defaultBuildOptions.copy(androidVersion = agpVersion),
            buildJdk = jdkVersion.location
        ) {
            testConfigurationCacheOf(
                ":Lib:compileFlavor1DebugKotlin",
                ":Android:compileFlavor1DebugKotlin"
            )
        }
    }<|endoftext|>


Prompt:
return conversionScope.withFunction(irConstructor) {
            memberGenerator.convertFunctionContent(irConstructor, constructor, containingClass = conversionScope.containerFirClass())
        }
    }

    override fun visitAnonymousInitializer(
        anonymousInitializer: FirAnonymousInitializer,
        data: Any?
    ): IrElement = whileAnalysing(session, anonymousInitializer) {

Response:
val irAnonymousInitializer = declarationStorage.getIrAnonymousInitializer(anonymousInitializer)
        declarationStorage.enterScope(irAnonymousInitializer.symbol)
        irAnonymousInitializer.body = convertToIrBlockBody(anonymousInitializer.body!!)
        declarationStorage.leaveScope(irAnonymousInitializer.symbol)
        return irAnonymousInitializer
    }<|endoftext|>


Prompt:
// LANGUAGE: +MultiPlatformProjects
// WITH_STDLIB

// MODULE: common
// FILE: common.kt

expect class Foo(a: String, b: Int = 0, c: Double? = null)

// MODULE: platform()()(common)
// FILE: platform.kt

import kotlin.test.assertEquals

Response:
actual class Foo actual constructor(a: String, b: Int, c: Double?) {
    val result: String = a + "," + b + "," + c
}

fun box(): String {
    assertEquals("OK,0,null", Foo("OK").result)
    assertEquals("OK,42,null", Foo("OK", 42).result)<|endoftext|>


Prompt:
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
 */
@SinceKotlin("1.4")
public expect fun StringBuilder.insertRange(index: Int, value: CharArray, startIndex: Int, endIndex: Int): StringBuilder

/**

Response:
* Inserts characters in a subsequence of the specified character sequence [value] into this string builder at the specified [index] and returns this instance.
 *
 * The inserted characters go in the same order as in the [value] character sequence, starting at [index].
 *
 * @param index the position in this string builder to insert at.
 * @param value the character sequence from which a subsequence is inserted.<|endoftext|>


Prompt:
val uintList = mutableListOf<UInt>()
    for (i in (1u..<9u).reversed() step 2) {
        uintList += i
    }
    assertEquals(listOf(8u, 6u, 4u, 2u), uintList)

    val ulongList = mutableListOf<ULong>()

Response:
for (i in (1uL..<9uL).reversed() step 2L) {
        ulongList += i
    }
    assertEquals(listOf(8uL, 6uL, 4uL, 2uL), ulongList)

    return "OK"
}<|endoftext|>


Prompt:
buildWithCocoapodsWrapper(":linkPodDebugFrameworkIOS") {
                assertHasDiagnostic(CocoapodsPluginDiagnostics.LinkOnlyUsedWithStaticFramework)
            }
        }
    }

    @DisplayName("Add pod-dependencies together with noPodspec")
    @GradleTest
    fun testPodDependenciesWithNoPodspec(gradleVersion: GradleVersion) {

Response:
nativeProjectWithCocoapodsAndIosAppPodFile(gradleVersion = gradleVersion) {
            buildGradleKts.addCocoapodsBlock(
                """
                    noPodspec()

                    pod("Base64", version = "1.1.2")
                """.trimIndent()
            )
            buildWithCocoapodsWrapper(":linkPodDebugFrameworkIOS") {<|endoftext|>


Prompt:
val qualifier = trace.bindingContext[BindingContext.QUALIFIER, qualifierExpression]
                    if (qualifier != null && generateQualifier(expression, qualifier)) return
                }
                if (!generateCall(expression) && expression.parent !is KtCallExpression) {
                    createNonSyntheticValue(expression, MagicKind.UNRESOLVED_CALL, generateAndGetReceiverIfAny(expression))

Response:
}
            }
        }

        override fun visitLabeledExpression(expression: KtLabeledExpression) {
            mark(expression)
            val baseExpression = expression.baseExpression
            if (baseExpression != null) {
                generateInstructions(baseExpression)
                copyValue(baseExpression, expression)
            }

            val labelNameExpression = expression.getTargetLabel()<|endoftext|>


Prompt:
println(C().<!INVISIBLE_MEMBER!>propAI<!>.x())
    println(C().<!INVISIBLE_MEMBER!>propG<!>.x())
    println(C().<!INVISIBLE_MEMBER!>propOI<!>.df())
    println(C().<!INVISIBLE_MEMBER!>propL<!>.l())

Response:
println(C().<!INVISIBLE_MEMBER!>propL2<!>.l2())
}<|endoftext|>


Prompt:
val symbol = innerDeclaration.initializer?.toResolvedCallableSymbol(context.session)
                        if (context.languageVersionSettings.supportsFeature(LanguageFeature.InlineClassImplementationByDelegation) &&
                            symbol != null && symbol in primaryConstructorParametersSymbolsSet
                        ) {
                            continue
                        }

Response:
val delegatedTypeRefSource = (innerDeclaration.returnTypeRef as FirResolvedTypeRef).delegatedTypeRef?.source
                        reporter.reportOn(
                            delegatedTypeRefSource,
                            FirErrors.VALUE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION,
                            context
                        )
                    }
                }

                is FirProperty -> {<|endoftext|>


Prompt:
class C {
    suspend fun get(x: Int) = 1
    suspend fun set(x: Int, v: String) {}

    suspend fun contains(y: String): Boolean = true
}

class D
suspend fun D.get(x: Int) =1
suspend fun D.set(x: Int, v: String) {}

Response: suspend fun D.contains(y: String): Boolean = true<|endoftext|>


Prompt:
suspendWithValue("456")
        } catch (e: RuntimeException) {
            suspendWithValue("fail")
            throw RuntimeException("fail 8")
        } catch (e: Exception) {
            if (e.message != "M3") throw Exception("fail 9: ${e.message}")
            suspendWithValue("OK")
        } finally {
            suspendWithValue("ignored 7")

Response:
wasCalled = true
        }
    }

    return globalResult
}<|endoftext|>


Prompt:
// EXPECTATIONS JVM_IR
// test.kt:30 box
// test.kt:5 stringSwitch
// test.kt:6 stringSwitch
// test.kt:5 stringSwitch
// test.kt:12 stringSwitch
// test.kt:13 stringSwitch
// test.kt:12 stringSwitch
// test.kt:20 stringSwitch
// test.kt:19 stringSwitch
// test.kt:22 stringSwitch

Response:
// test.kt:19 stringSwitch
// test.kt:27 stringSwitch
// test.kt:31 box
// test.kt:5 stringSwitch
// test.kt:7 stringSwitch
// test.kt:5 stringSwitch
// test.kt:12 stringSwitch
// test.kt:14 stringSwitch
// test.kt:12 stringSwitch
// test.kt:20 stringSwitch
// test.kt:19 stringSwitch<|endoftext|>


Prompt:
interface TypeMappingConfiguration<out T : Any> {
    fun commonSupertype(types: Collection<@JvmSuppressWildcards KotlinType>): KotlinType
    fun getPredefinedTypeForClass(classDescriptor: ClassDescriptor): T?
    fun getPredefinedInternalNameForClass(classDescriptor: ClassDescriptor): String?

Response:
fun getPredefinedFullInternalNameForClass(classDescriptor: ClassDescriptor): String? = null
    fun processErrorType(kotlinType: KotlinType, descriptor: ClassDescriptor)

    // returns null when type doesn't need to be preprocessed
    fun preprocessType(kotlinType: KotlinType): KotlinType? = null
}

fun <T : Any> mapType(<|endoftext|>


Prompt:
assertArrayContentEquals(uintArrayOf(2u, 3u, 9u), uintArrayOf(2u, 3u, 9u, 2u, 3u, 9u).sliceArray(listOf(3, 1, 2)))
        assertArrayContentEquals(ubyteArrayOf(127u, 100u), ubyteArrayOf(50u, 100u, 127u).sliceArray(listOf(2, 1)))

Response:
assertArrayContentEquals(ushortArrayOf(200u, 100u), ushortArrayOf(50u, 100u, 200u).sliceArray(listOf(2, 1)))
        assertArrayContentEquals(ulongArrayOf(100u, 200u, 30u), ulongArrayOf(50u, 100u, 200u, 30u).sliceArray(1..3))<|endoftext|>


Prompt:
import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilationResult.Success
import org.jetbrains.kotlin.konan.test.blackbox.support.util.DumpedTestListing
import org.jetbrains.kotlin.konan.test.blackbox.support.util.startsWith

Response:
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertFalse
import org.jetbrains.kotlin.test.services.JUnit5Assertions.fail
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
import java.io.File
import java.io.IOException

class TestExecutable(<|endoftext|>


Prompt:
// For multiplatform tests it's expected that LL and FIR diverge,
        // because IR actualizer doesn't run in IDE mode tests.
        forTestsNotMatching("compiler/testData/diagnostics/tests/multiplatform/*") {
            useAfterAnalysisCheckers(::LLFirDivergenceCommentChecker)
        }

        useAfterAnalysisCheckers(::LLFirTestSuppressor)
    }

Response:
abstract fun configureTest(builder: TestConfigurationBuilder)

    inner class LowLevelFirFrontendFacade(
        testServices: TestServices,
        private val facadeFactory: LLFirAnalyzerFacadeFactory,
    ) : FirFrontendFacade(testServices) {
        override val additionalServices: List<ServiceRegistrationData>
            get() = emptyList()<|endoftext|>


Prompt:
override fun createDescriptorExtension(): DescriptorSymbolTableExtension {
        return ExtensionDecorator()
    }

    private inner class ExtensionDecorator : DescriptorSymbolTableExtension(this) {
        override fun referenceValueParameter(declaration: ParameterDescriptor): IrValueParameterSymbol {
            val fi = fragmentInfo ?: return super.referenceValueParameter(declaration)

Response:
if (declaration !is ReceiverParameterDescriptor) return super.referenceValueParameter(declaration)

            val finderPredicate = when (val receiverValue = declaration.value) {
                is ExtensionReceiver, is ContextReceiver -> { (targetDescriptor, _): EvaluatorFragmentParameterInfo ->
                    receiverValue == (targetDescriptor as? ReceiverParameterDescriptor)?.value
                }<|endoftext|>


Prompt:
return evaluateCall(calleeExpression, receiverExpression, expectedType)
        }

        if (selectorExpression is KtSimpleNameExpression) {
            val result = evaluateCall(selectorExpression, expression.receiverExpression, expectedType)
            if (result != null) return result
        }

        // MyEnum.A, Integer.MAX_VALUE

Response:
if (selectorExpression != null) {
            return evaluate(selectorExpression, expectedType)
        }

        return null
    }

    override fun visitCallExpression(expression: KtCallExpression, expectedType: KotlinType?): CompileTimeConstant<*>? {
        val call = expression.getResolvedCall(trace.bindingContext) ?: return null<|endoftext|>


Prompt:
if (!equalsBy(expectedValueParameters, actualValueParameters) { it.isVararg }) {
            return ExpectActualCheckingCompatibility.ValueParameterVararg
        }

        // Adding noinline/crossinline to parameters is disallowed, except if the expected declaration was not inline at all
        if (expectDeclaration is SimpleFunctionSymbolMarker && expectDeclaration.isInline) {

Response:
if (expectedValueParameters.indices.any { i -> !expectedValueParameters[i].isNoinline && actualValueParameters[i].isNoinline }) {
                return ExpectActualCheckingCompatibility.ValueParameterNoinline
            }
            if (expectedValueParameters.indices.any { i -> !expectedValueParameters[i].isCrossinline && actualValueParameters[i].isCrossinline }) {<|endoftext|>


Prompt:
public fun <T> Array<out T>.minWithOrNull(comparator: Comparator<in T>): T? {
    if (isEmpty()) return null
    var min = this[0]
    for (i in 1..lastIndex) {
        val e = this[i]
        if (comparator.compare(min, e) > 0) min = e
    }
    return min
}

Response:
/**
 * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.
 */
@SinceKotlin("1.4")
public fun ByteArray.minWithOrNull(comparator: Comparator<in Byte>): Byte? {
    if (isEmpty()) return null
    var min = this[0]
    for (i in 1..lastIndex) {<|endoftext|>


Prompt:
var firstInClass = true

        var notClosed = lexemes.currentChar != Lexer.CHAR_RIGHT_SQUARE_BRACKET
        while (!lexemes.isEmpty() && (notClosed || firstInClass)) {
            when (lexemes.currentChar) {

                Lexer.CHAR_RIGHT_SQUARE_BRACKET -> {

Response:
if (buffer >= 0) {
                        result.add(buffer)
                    }
                    buffer = ']'.toInt()
                    lexemes.next()
                }

                Lexer.CHAR_LEFT_SQUARE_BRACKET -> {
                    if (buffer >= 0) {
                        result.add(buffer)
                        buffer = -1
                    }
                    lexemes.next()<|endoftext|>


Prompt:
val clInit = classCodegen.createOrGetClInitCodegen()
        with(clInit.v) {
            getstatic(threadSafeModeType.internalName, LAZY_PUBLICATION_MODE_NAME.identifier, threadSafeModeType.descriptor)
            getstatic(lambdaType.internalName, JvmAbi.INSTANCE_FIELD, lambdaType.descriptor)

Response:
checkcast(function0Type)
            invokestatic(
                "kotlin/LazyKt",
                "lazy",
                "(${threadSafeModeType.descriptor}${function0Type.descriptor})${kotlinLazyType.descriptor}",
                false
            )<|endoftext|>


Prompt:
Returns a set containing all elements of the original set and the given [elements] array,
                which aren't already in this set.

                The returned set preserves the element iteration order of the original set.
                """
            }
            body {
                """
                val result = LinkedHashSet<T>(mapCapacity(this.size + elements.size))
                result.addAll(this)

Response:
result.addAll(elements)
                return result
                """
            }
        }
        specialFor(Sequences) {
            doc {
                """
                Returns a sequence containing all elements of original sequence and then all elements of the given [elements] array.

                Note that the source sequence and the array being added are iterated only when an `iterator` is requested from<|endoftext|>


Prompt:
override fun isTypeParameterUpperBoundClass(property: IrPropertySymbol, index: Int, expected: IrClassSymbol): Boolean {
        return property.owner.getter?.typeParameters?.getOrNull(index)?.superTypes?.any { it.classOrNull == expected } ?: false
    }

Response:
override fun isValueParameterClass(function: IrFunctionSymbol, index: Int, expected: IrClassSymbol?): Boolean {
        return function.owner.valueParameters.getOrNull(index)?.type?.classOrNull == expected
    }

    override fun isReturnClass(function: IrFunctionSymbol, expected: IrClassSymbol): Boolean {
        return function.owner.returnType.classOrNull == expected<|endoftext|>


Prompt:
).buildWithScope { irProperty ->
            irProperty.backingField =
                if (propertyDescriptor.actuallyHasBackingField(context.bindingContext))
                    generatePropertyBackingField(ktProperty, propertyDescriptor) { irField ->
                        ktProperty.initializer?.let evaluateInitializer@{ ktInitializer ->
                            val compileTimeConst = propertyDescriptor.compileTimeInitializer

Response:
if (compileTimeConst != null) {
                                val constantInfo = context.bindingContext.get(BindingContext.COMPILE_TIME_VALUE, ktInitializer)
                                if (propertyDescriptor.isConst ||
                                    (constantInfo?.usesNonConstValAsConstant == false &&
                                            (!constantInfo.usesVariableAsConstant ||<|endoftext|>


Prompt:
}

    return result.toTypedArray()
}

fun stringsToBytes(strings: Array<String>): ByteArray {
    val resultLength = strings.sumOf { it.length }
    val result = ByteArray(resultLength)

    var i = 0
    for (s in strings) {
        for (si in 0..s.length - 1) {

Response:
result[i++] = s[si].code.toByte()
        }
    }

    assert(i == result.size) { "Should have reached the end" }

    return result
}<|endoftext|>


Prompt:
* HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses
 */

/*
 * TESTCASE NUMBER: 1
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28489
 */
fun case_1(x: Boolean?) {
    l1@ while (true) {
        l2@ while (true || x as Boolean) {

Response:
break@l1
        }
    }

    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean & kotlin.Boolean?")!>x<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean & kotlin.Boolean?"), DEBUG_INFO_SMARTCAST!>x<!>.not()
}

/*<|endoftext|>


Prompt:
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtCallableReferenceExpression
import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.resolve.source.getPsi

Response:
import org.jetbrains.kotlin.resolve.source.toSourceElement
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.types.KotlinType

class SyntheticClassDescriptorForLambda(
        containingDeclaration: DeclarationDescriptor,
        name: Name,
        supertypes: Collection<KotlinType>,<|endoftext|>


Prompt:
if (!checkEqualsClassMultiFieldValueClassUnderlyingName(old, new)) return false

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

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

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

Response:
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) return false
        if (old.hasVersionRequirementTable()) {
            if (!checkEquals(old.versionRequirementTable, new.versionRequirementTable)) return false
        }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.analysis.wasm.checkers.expression

import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
import org.jetbrains.kotlin.diagnostics.reportOn
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind

Response:
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirFunctionCallChecker
import org.jetbrains.kotlin.fir.analysis.diagnostics.wasm.FirWasmErrors<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.calls.inference.model.*
import org.jetbrains.kotlin.types.model.TypeVariableMarker

class ConeDeclaredUpperBoundConstraintPosition : DeclaredUpperBoundConstraintPosition<Nothing?>(null) {
    override fun toString(): String = "DeclaredUpperBound"
}

Response:
class ConeSemiFixVariableConstraintPosition(variable: TypeVariableMarker) : SemiFixVariableConstraintPosition(variable) {
    override fun toString(): String = "Fix variable ${(variable as ConeTypeVariable).typeConstructor.name}"
}

class ConeFixVariableConstraintPosition(variable: TypeVariableMarker) : FixVariableConstraintPosition<Nothing?>(variable, null) {<|endoftext|>


Prompt:
if (j >= length || !codePoint.isCased()) {
                        return true
                    }
                }
            }
            return false
        }
    """.trimIndent()

    private fun lowercaseImpl(): String = """
        internal fun String.lowercaseImpl(): String {
            var unchangedIndex = 0
            while (unchangedIndex < this.length) {

Response:
val codePoint = codePointAt(unchangedIndex)
                if (codePoint.lowercaseCodePoint() != codePoint) { // '\u0130' and '\u03A3' have lowercase corresponding mapping in UnicodeData.txt, no need to check them separately
                    break
                }
                unchangedIndex += codePoint.charCount()
            }
            if (unchangedIndex == this.length) {<|endoftext|>


Prompt:
override fun lower(irFile: IrFile) {
        runOnFilePostfix(irFile, withLocalDeclarations = true)
    }

    override fun lower(irBody: IrBody, container: IrDeclaration) {
        val realContainer = container as? IrDeclarationParent ?: container.parent
        irBody.transformChildrenVoid(ReferenceTransformer(realContainer))
    }

Response:
private val nothingType = context.irBuiltIns.nothingType
    private val stringType = context.irBuiltIns.stringType

    private inner class ReferenceTransformer(private val container: IrDeclarationParent) : IrElementTransformerVoid() {

        override fun visitBody(body: IrBody): IrBody {
            return body
        }<|endoftext|>


Prompt:
override fun restoreSymbol(analysisSession: KtAnalysisSession): T? {
        require(analysisSession is KtFirAnalysisSession)
        val classLikeSymbol = analysisSession.firSymbolBuilder.classifierBuilder.buildClassLikeSymbolByClassId(classId) ?: return null
        if (!expectedClass.isInstance(classLikeSymbol)) return null

Response:
@Suppress("UNCHECKED_CAST")
        return classLikeSymbol as T
    }

    override fun pointsToTheSameSymbolAs(other: KtSymbolPointer<KtSymbol>): Boolean = other === this ||
            other is KtFirClassLikeSymbolPointer &&
            other.classId == classId &&
            other.expectedClass == expectedClass
}<|endoftext|>


Prompt:
@GCUnsafeCall("Kotlin_String_lastIndexOfChar")
internal actual external fun String.nativeLastIndexOf(ch: Char, fromIndex: Int): Int

/**
 * Returns the index within this string of the last occurrence of the specified character, starting from the specified offset.
 */
@GCUnsafeCall("Kotlin_String_lastIndexOfString")

Response:
internal actual external fun String.nativeLastIndexOf(str: String, fromIndex: Int): Int

/**
 * Returns `true` if this string is equal to [other], optionally ignoring character case.
 *
 * Two strings are considered to be equal if they have the same length and the same character at the same index.<|endoftext|>


Prompt:
p.printWithNoIndent("@")
            p.printWithNoIndent(it)
        }
    }

    override fun visitTry(aTry: IrTry, data: IrDeclaration?) = wrap(aTry, data) {
        p.printWithNoIndent("try ")
        aTry.tryResult.accept(this, data)
        p.printlnWithNoIndent()

Response:
aTry.catches.forEach { it.accept(this, data) }

        aTry.finallyExpression?.let {
            p.print("finally ")
            it.accept(this, data)
        }
    }

    override fun visitCatch(aCatch: IrCatch, data: IrDeclaration?) = wrap(aCatch, data) {<|endoftext|>


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

fun localExtensionOnNullableParameter(): T {

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

    var t: T? = T(1)
    t?.local(2)

    return t!!
}

fun box(): String {
    val result = localExtensionOnNullableParameter().value

Response:
if (result != 3) return "fail 2: $result"

    return "OK"
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.declarations.utils.superConeTypes
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
import org.jetbrains.kotlin.fir.types.toRegularClassSymbol

Response:
import org.jetbrains.kotlin.name.JsStandardClassIds.Annotations.JsExternalInheritorsOnly
import org.jetbrains.kotlin.utils.addToStdlib.popLast

sealed class FirJsExternalInheritorOnlyChecker(mppKind: MppCheckerKind) : FirClassChecker(mppKind) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.IrLoop
import org.jetbrains.kotlin.ir.symbols.IrReturnableBlockSymbol
import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol

Response:
import org.jetbrains.kotlin.wasm.ir.*
import java.util.LinkedList

enum class LoopLabelType { BREAK, CONTINUE }
enum class SyntheticLocalType { IS_INTERFACE_PARAMETER, TABLE_SWITCH_SELECTOR }

class WasmFunctionCodegenContext(
    val irFunction: IrFunction,
    private val wasmFunction: WasmFunction.Defined,<|endoftext|>


Prompt:
package org.jetbrains.kotlin.backend.jvm.lower

import org.jetbrains.kotlin.backend.common.FileLoweringPass
import org.jetbrains.kotlin.backend.common.phaser.PhaseDescription
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext

Response:
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter<|endoftext|>


Prompt:
<!INAPPLICABLE_JVM_FIELD!>@JvmField<!>
    override val i: Int = 0
    <!INAPPLICABLE_JVM_FIELD!>@JvmField<!>
    override final val j: Int = 0
}

class JK(
    override val i: Int,

Response:
<!INAPPLICABLE_JVM_FIELD!>@JvmField<!> override val j: Int,
) : K

annotation class L {
    companion object {
        <!INAPPLICABLE_JVM_FIELD!>@JvmField<!>
        var c = 3
    }
}

object O {
    @JvmField
    val c = 3
}<|endoftext|>


Prompt:
val x13 = <!DEBUG_INFO_EXPRESSION_TYPE("Foo<Bar<L & Any>>")!>foo1(<!DEBUG_INFO_EXPRESSION_TYPE("L & Any")!>y!!<!>)<!>

    val x20 = <!DEBUG_INFO_EXPRESSION_TYPE("Foo<Bar<L>>")!>foo2(x)<!>

Response:
val x21 = <!DEBUG_INFO_EXPRESSION_TYPE("Foo<Bar<L>>")!>foo2(y)<!>

    val x30 = <!DEBUG_INFO_EXPRESSION_TYPE("Foo<Bar<L>>")!>foo3(x)<!><|endoftext|>


Prompt:
project("instantExecutionToJs", gradleVersion) {
            assertSimpleConfigurationCacheScenarioWorks(
                "assemble",
                buildOptions = defaultBuildOptions,
                executedTaskNames = listOf(":compileKotlinJs")
            )
        }
    }

    @DisplayName("configuration cache is working for kotlin/js browser project")
    @GradleTest

Response:
fun testBrowserDistribution(gradleVersion: GradleVersion) {
        project("kotlin-js-browser-project", gradleVersion) {
            assertSimpleConfigurationCacheScenarioWorks(
                ":app:build",
                buildOptions = defaultBuildOptions,
                executedTaskNames = listOf(
                    ":app:packageJson",
                    ":app:publicPackageJson",<|endoftext|>


Prompt:
c: TypeResolutionContext,
        constructor: TypeConstructor,
        argumentElements: List<KtTypeProjection>
    ): List<TypeProjection> {
        return argumentElements.mapIndexed { i, argumentElement ->
            val projectionKind = argumentElement.projectionKind
            ModifierCheckerCore.check(argumentElement, c.trace, null, languageVersionSettings)

Response:
if (projectionKind == KtProjectionKind.STAR) {
                val parameters = constructor.parameters
                if (parameters.size > i) {
                    val parameterDescriptor = parameters[i]
                    TypeUtils.makeStarProjection(parameterDescriptor)
                } else {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.incremental.storage.ProtoMapValue
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.ProtoBuf.Type
import org.jetbrains.kotlin.metadata.deserialization.Flags
import org.jetbrains.kotlin.metadata.deserialization.NameResolver

Response:
import org.jetbrains.kotlin.metadata.deserialization.TypeTable
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.protobuf.MessageLite<|endoftext|>


Prompt:
// KJS_WITH_FULL_RUNTIME
class C(val i: Int) {
}

class M {
  operator fun C.component1() = i + 1
  operator fun C.component2() = i + 2

  fun doTest(l : ArrayList<C>): String {
      var s = ""
      for ((a, b) in l) {

Response:
s += "$a:$b;"
      }
      return s
  }
}

fun box(): String {
  val l = ArrayList<C>()
  l.add(C(0))
  l.add(C(1))
  l.add(C(2))
  val s = M().doTest(l)<|endoftext|>


Prompt:
}

/**
 * @suppress TODO: KT-58858 add documentation
 * Defines a subplugin option that should be excluded from Gradle input/output checks
 */
open class InternalSubpluginOption(key: String, value: String) : SubpluginOption(key, value)

/**
 * @suppress TODO: KT-58858 add documentation
 * Keeps one or more compiler options for one of more compiler plugins.
 */

Response:
open class CompilerPluginConfig {
    @get:Internal
    protected val optionsByPluginId = mutableMapOf<String, MutableList<SubpluginOption>>()

    fun allOptions(): Map<String, List<SubpluginOption>> = optionsByPluginId

    fun addPluginArgument(pluginId: String, option: SubpluginOption) {<|endoftext|>


Prompt:
fun generateMethodNode(method: IrFunction): SMAPAndMethodNode {
        if (!method.isInline && !method.isSuspendCapturingCrossinline()) {
            // Inline methods can be used multiple times by `IrSourceCompilerForInline`, suspend methods
            // are used twice (`f` and `f$$forInline`) if they capture crossinline lambdas, and everything

Response:
// else is only generated by `generateMethod` below so does not need caching.
            // TODO: inline lambdas are not marked `isInline`, and are generally used once, but may be needed
            //       multiple times if declared in a `finally` block - should they be cached?
            return FunctionCodegen(method, this).generate()
        }<|endoftext|>


Prompt:
block: TestInterface<R>.() -> Unit
): R = TODO()

class Inv<K>

interface TestInterface<R> {
    fun emit(r: R)
    fun get(): R
    fun getInv(): Inv<R>
}

fun <U> id(x: U) = x

fun test() {
    val ret = build {
        emit("1")
        get()

Response:
getInv()
        ""
    }
}<|endoftext|>


Prompt:
val test6 = """\n"""
    if (test6 != "\\n") return "Fail 6: $test6"

    val test7 = """\${'$'}foo"""
    if (test7 != "\\\$foo") return "Fail 7: $test7"

    val test8 = """$ foo"""
    if (test8 != "$ foo") return "Fail 8: $test8"

Response:
return "OK"
}

fun new() : String {
  return """
    sdfasdf
    ${<!UNRESOLVED_REFERENCE!>a<!>}
    ds"asdfas
    $<!UNRESOLVED_REFERENCE!>b<!>
    asgfaf
  """

}<|endoftext|>


Prompt:
} else {
                emptyList()
            }

            LazyObjCInterfaceImpl(
                name,
                attributes,
                generics = translateGenerics(ktClassOrObject),
                psi = ktClassOrObject,
                lazy = this
            )
        }
    }

Response:
private fun translateGenerics(ktClassOrObject: KtClassOrObject): List<ObjCGenericTypeDeclaration> = if (configuration.objcGenerics) {
        ktClassOrObject.typeParametersWithOuter
            .map {
                ObjCGenericTypeRawDeclaration(
                    nameTranslator.getTypeParameterName(it),
                    ObjCVariance.fromKotlinVariance(it.variance)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.REIFIED_TYPE_PARAMETER_IN_OVERRIDE
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.REIFIED_TYPE_PARAMETER_NO_INLINE

Response:
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.REPEATED_ANNOTATION
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.REPEATED_ANNOTATION_WARNING
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.REPEATED_BOUND<|endoftext|>


Prompt:
expect(null) { ubyteArrayOf().minWithOrNull(reverseOrder()) }
        expect(1u) { ushortArrayOf(1u).minWithOrNull(reverseOrder()) }
        expect(3u) { uintArrayOf(2u, 3u).minWithOrNull(reverseOrder()) }

Response:
expect(3uL) { ulongArrayOf(3u, 2u).minWithOrNull(reverseOrder()) }
    }

    @Test
    fun maxWithOrNull() {
        expect(null) { arrayOf<UByte>().maxWithOrNull(naturalOrder()) }
        expect(1u) { arrayOf<UShort>(1u).maxWithOrNull(naturalOrder()) }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.descriptors.toIrBasedDescriptor
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody

Response:
import org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
import org.jetbrains.kotlin.ir.symbols.*
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.name.Name<|endoftext|>


Prompt:
call
                    )
                }
                val bindRef = JsNameRef(Namer.BIND_FUNCTION, jsBindTarget)
                JsInvocation(bindRef, jsReceiver)
            }

            add(intrinsics.jsContexfulRef) { call, context: JsGenerationContext ->
                val receiver = call.getValueArgument(0)!!

Response:
val jsReceiver = receiver.accept(IrElementToJsExpressionTransformer(), context)
                val target = call.getValueArgument(1) as IrRawFunctionReference
                val jsTarget = context.getNameForMemberFunction(target.symbol.owner as IrSimpleFunction)

                JsNameRef(jsTarget, jsReceiver)
            }<|endoftext|>


Prompt:
MEMBER_PROPERTY_WITHOUT_FIELD_OR_DELEGATE("member property without backing field or delegate", false),
    TOP_LEVEL_PROPERTY("top level property", false), // with and without field/delegate
    TOP_LEVEL_PROPERTY_WITH_BACKING_FIELD("top level property with backing field", false),

Response:
TOP_LEVEL_PROPERTY_WITH_DELEGATE("top level property with delegate", false),
    TOP_LEVEL_PROPERTY_WITHOUT_FIELD_OR_DELEGATE("top level property without backing field or delegate", false),

    BACKING_FIELD("backing field"),

    INITIALIZER("initializer", false),<|endoftext|>


Prompt:
public fun kotlin.UByteArray.dropLast(n: kotlin.Int): kotlin.collections.List<kotlin.UByte>

@kotlin.SinceKotlin(version = "1.3")
@kotlin.ExperimentalUnsignedTypes

Response:
public fun kotlin.UIntArray.dropLast(n: kotlin.Int): kotlin.collections.List<kotlin.UInt>

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


Prompt:
val expected = " Hello World! "
    val v = UserValueClass(1)

    assertEquals(expected, " $v ", "testUserValueClass - template")
    assertEquals(expected, toStringTemplateAny(v), "testUserValueClass - toStringTemplateAny(v)")
    assertEquals(expected, toStringTemplateGeneric(v), "testUserValueClass - toStringTemplateGeneric(v)")

Response:
assertEquals(expected, toStringTemplateInlineGeneric(v), "testUserValueClass - toStringTemplateInlineGeneric(v)")
    assertEquals(expected, toStringTemplateInlineReifiedGeneric(v), "testUserValueClass - toStringTemplateInlineReifiedGeneric(v)")<|endoftext|>


Prompt:
private inline val CirHasModality.kmModality: KmModality
    get() = when (modality) {
        Modality.FINAL -> KmModality.FINAL
        Modality.ABSTRACT -> KmModality.ABSTRACT
        Modality.OPEN -> KmModality.OPEN
        Modality.SEALED -> KmModality.SEALED
    }

Response:
private inline val CallableMemberDescriptor.Kind.kmMemberKind: MemberKind
    get() = when (this) {
        CallableMemberDescriptor.Kind.DECLARATION -> MemberKind.DECLARATION
        CallableMemberDescriptor.Kind.FAKE_OVERRIDE -> MemberKind.FAKE_OVERRIDE<|endoftext|>


Prompt:
return registryDir.walk()
        .map { Pair(it, portExtractor(it.name)) }
        .filter { (file, port) -> port != null && filter(file, port) }
        .mapNotNull { (file, port) ->

Response:
assert(port!! in COMPILE_DAEMON_PORTS_RANGE_START..<COMPILE_DAEMON_PORTS_RANGE_END)
            val relativeAge = fileToCompareTimestamp.lastModified() - file.lastModified()
            report(DaemonReportCategory.DEBUG, "found daemon on port $port ($relativeAge ms old), trying to connect")<|endoftext|>


Prompt:
declaration is FirPropertyAccessor && containingPropertyModality != null -> containingPropertyModality
                    declaration.isOverride -> Modality.OPEN
                    else -> Modality.FINAL
                }
            }

            else -> Modality.FINAL
        }

    }
}

private val FirClass.modality: Modality?
    get() = when (this) {

Response:
is FirRegularClass -> status.modality
        is FirAnonymousObject -> Modality.FINAL
        else -> error("Unknown kind of class: ${this::class}")
    }

private fun FirDeclaration.hasOwnBodyOrAccessorBody(): Boolean {
    return when (this) {
        is FirSimpleFunction -> this.body != null<|endoftext|>


Prompt:
public fun kotlin.DoubleArray.dropLast(n: kotlin.Int): kotlin.collections.List<kotlin.Double>

public fun kotlin.FloatArray.dropLast(n: kotlin.Int): kotlin.collections.List<kotlin.Float>

Response:
public fun kotlin.IntArray.dropLast(n: kotlin.Int): kotlin.collections.List<kotlin.Int>

public fun kotlin.LongArray.dropLast(n: kotlin.Int): kotlin.collections.List<kotlin.Long><|endoftext|>


Prompt: $i$f$x6\6\54:int=0:int, y6\6$iv:int=6:int

Response: // library.kt:29 box: m:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=100:int, x4Var\4$iv:int=4:int, $i$f$x4\4\8:int=0:int, y4\4$iv:int=4:int<|endoftext|>


Prompt:
override val stringBuilder = irBuiltIns.findClass(Name.identifier("StringBuilder"),"kotlin", "text")!!

    override val defaultConstructorMarker = internalClass("DefaultConstructorMarker")

    private fun arrayToExtensionSymbolMap(name: String, filter: (IrFunctionSymbol) -> Boolean = { true }) =
            arrays.associateWith { classSymbol ->

Response:
irBuiltIns.findFunctions(Name.identifier(name), "kotlin", "collections")
                        .singleOrNull { function ->
                            lookup.isExtensionReceiverClass(function, classSymbol) && !lookup.isExpect(function) && filter(function)
                        } ?: error("No function $name for $classSymbol")
            }<|endoftext|>


Prompt:
Thus, by default, there is no need for the main code to receive the same dependency versions as tests.
            However, the other way around works in the opposite. See, for example, test [commonMainWithHigherVersion] */
            api("commonMain", "lib", "1.0")
            api("commonTest", "lib", "2.0")
        }
    }

    @Test

Response:
@Ignore("TODO: KT-66375")
    fun leafSourceSetsDependsOnDifferentVersionsAndCommonCodeDoesNot() {
        assertSourceSetDependenciesResolution("leafSourceSetsDependsOnDifferentVersionsAndCommonCodeDoesNot.txt") { project ->
            project.defaultTargets()

            /** Even though commonMain has no dependency on lib, thus there is no connection between<|endoftext|>


Prompt:
public inline fun kotlin.DoubleArray.reduceRightIndexedOrNull(operation: (index: kotlin.Int, kotlin.Double, acc: kotlin.Double) -> kotlin.Double): kotlin.Double?

@kotlin.SinceKotlin(version = "1.4")

Response:
public inline fun kotlin.FloatArray.reduceRightIndexedOrNull(operation: (index: kotlin.Int, kotlin.Float, acc: kotlin.Float) -> kotlin.Float): kotlin.Float?

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


Prompt:
// !LANGUAGE: +ContextReceivers
// !DIAGNOSTICS: -UNUSED_PARAMETER

class A
class B<X>(val x: X)

context(T)
fun <T> T.f(t: B<T>) {}

fun Int.main(a: A, b: B<String>) {

Response:
a.f(<!ARGUMENT_TYPE_MISMATCH!>b<!>)
}<|endoftext|>


Prompt:
if (element is KtTypeProjection && element.projectionKind == KtProjectionKind.STAR) {
                    return markElement(element)
                }

                val modifierList = element.modifierList.sure { "No modifier list, but modifier has been found by the analyzer" }
                modifierList.getModifier(KtTokens.IN_KEYWORD)?.let { return markElement(it) }

Response:
modifierList.getModifier(KtTokens.OUT_KEYWORD)?.let { return markElement(it) }

                throw IllegalStateException("None of the modifiers is found: in, out")
            }
        }
    }

    @JvmField<|endoftext|>


Prompt:
// ISSUE: KT-63377
// FIR_DUMP

class OuterClassWithObject<OuterParam> {
    object OuterParam {
        fun foo() {}
    }

    val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!>

Response:
val l = <!CALLABLE_REFERENCE_LHS_NOT_A_CLASS!>OuterParam::<!UNRESOLVED_REFERENCE!>foo<!><!>

    fun foo() {
        val k = ::<!UNRESOLVED_REFERENCE!>OuterParam<!><|endoftext|>


Prompt:
// !LANGUAGE: +ContextReceivers

interface A
interface B

<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()

<!CONFLICTING_OVERLOADS!>context(A, B)
fun f(): Unit<!> = TODO()

fun test(a: A, b: B) {

Response:
with(a) {
        with(b) {
            <!OVERLOAD_RESOLUTION_AMBIGUITY!>f<!>()
        }
    }
}<|endoftext|>


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

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

internal fun KotlinStubs.generateObjCCall(

Response:
builder: IrBuilderWithScope,
        method: IrSimpleFunction,
        isStret: Boolean,
        selector: String,
        directSymbolName: String?,
        call: IrFunctionAccessExpression,
        superQualifier: IrClassSymbol?,
        receiver: ObjCCallReceiver,
        arguments: List<IrExpression?>
) = builder.irBlock {<|endoftext|>


Prompt:
val irClass = irClassSymbol.owner

        require(irClass.kind == ClassKind.ENUM_CLASS)

        fun IrClass.findStaticMethod(name: Name) = simpleFunctions().single {
            it.name == name && it.dispatchReceiverParameter == null
        }

        return when (intrinsicType) {
            IntrinsicType.ENUM_VALUES -> {

Response:
val function = irClass.findStaticMethod(Name.identifier("values"))
                data.irCall(function)
            }
            IntrinsicType.ENUM_VALUE_OF -> {
                val function = irClass.findStaticMethod(Name.identifier("valueOf"))
                data.irCall(function).apply {
                    putValueArgument(0, expression.getValueArgument(0)!!)<|endoftext|>


Prompt:
binaryOperation(DOUBLE, INT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun),
        binaryOperation(DOUBLE, LONG, "minus", { a, b -> a.minus(b) }, emptyBinaryFun),
        binaryOperation(DOUBLE, SHORT, "minus", { a, b -> a.minus(b) }, emptyBinaryFun),

Response:
binaryOperation(DOUBLE, BYTE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun),
        binaryOperation(DOUBLE, DOUBLE, "compareTo", { a, b -> a.compareTo(b) }, emptyBinaryFun),<|endoftext|>


Prompt:
private fun loadClassBuilderInterceptors(): List<org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension> {
        // Using Class.forName here because we're in the old JVM backend, and we need to load extensions declared in the JVM IR backend.

Response:
val adapted = Class.forName("org.jetbrains.kotlin.backend.jvm.extensions.ClassBuilderExtensionAdapter")
            .getDeclaredMethod("getExtensions", Project::class.java)
            .invoke(null, project) as List<org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension><|endoftext|>


Prompt:
if (comparator.compare(minValue, v) > 0) {
            minValue = v
        }
    }
    return minValue
}

/**
 * Returns the smallest value according to the provided [comparator]
 * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.
 */
@SinceKotlin("1.4")

Response:
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
@kotlin.internal.InlineOnly
public inline fun <R> IntArray.minOfWithOrNull(comparator: Comparator<in R>, selector: (Int) -> R): R? {
    if (isEmpty()) return null<|endoftext|>


Prompt:
if (isEqualAnyRight(null, A(""))) return "Fail 13"
    if (!isEqualAnyRight(A(""), A(""))) return "Fail 14"
    if (!isEqualSameNullable(null, null)) return "Fail 15"
    if (!isEqualSameNullable(A(""), A(""))) return "Fail 16"

Response:
if (isEqualSameNullable(null, A(""))) return "Fail 17"
    if (isEqualSameNullable(A(""), null)) return "Fail 18"
    if (isEqualSameNullable(A(""), A("a"))) return "Fail 19"
    if (!isEqualAnyNullableLeft(null, null)) return "Fail 20"<|endoftext|>


Prompt:
val isTailStatement = if (index == expression.statements.lastIndex) {
                    // The last statement defines the result of the container expression, so it has the same kind.
                    data.isTailExpression
                } else {
                    // In a Unit-returning function, any statement directly followed by a `return` is a tail statement.
                    isUnitReturn && expression.statements[index + 1].let {

Response:
it is IrReturn && it.returnTargetSymbol == irFunction.symbol && it.value.isUnitRead()
                    }
                }
                irStatement.accept(this, VisitorState(isTailStatement, data.inOtherFunction))
            }
        }

        private fun IrExpression.isUnitRead(): Boolean =<|endoftext|>


Prompt:
if (header.packageName.isNotEmpty()) {
        visit(METADATA_PACKAGE_NAME_FIELD_NAME, header.packageName)
    }
    if (header.extraInt != 0) {
        visit(METADATA_EXTRA_INT_FIELD_NAME, header.extraInt)
    }
    visitEnd()
}

private fun KmClass.removePrivateDeclarations(

Response:
removeCopyAlongWithConstructor: Boolean,
    preserveDeclarationOrder: Boolean,
    classesToBeDeleted: Set<String>,
    pruneClass: Boolean,
    treatInternalAsPrivate: Boolean,
) {
    constructors.removeIf { pruneClass || it.visibility.shouldRemove(treatInternalAsPrivate) }
    (this as KmDeclarationContainer).removePrivateDeclarations(<|endoftext|>


Prompt:
options.processorsStatsReportFile?.let { dumpProcessorStats(wrappedProcessors, it, logger::info) }

        options.fileReadHistoryReportFile?.let {
            dumpFileReadHistory(fileManager, it, logger::info)
        }

        if (logger.isVerbose) {
            filer.displayState()
        }

Response:
if (log.nerrors > 0) {
            throw KaptBaseError(KaptBaseError.Kind.ERROR_RAISED)
        }
    } finally {
        processingEnvironment.close()
        this@doAnnotationProcessing.close()
    }
}

private fun showProcessorStats(wrappedProcessors: List<ProcessorWrapper>, logger: (String) -> Unit) {<|endoftext|>


Prompt:
stubGenerator.unboundSymbolGeneration = true

        object : IrDeserializer {
            override fun getDeclaration(symbol: IrSymbol) = functionIrClassFactory.getDeclaration(symbol)
                    ?: stubGenerator.getDeclaration(symbol)

Response:
override fun resolveBySignatureInModule(signature: IdSignature, kind: IrDeserializer.TopLevelSymbolKind, moduleName: Name): IrSymbol {
                error("Should not be called")
            }

            override fun postProcess(inOrAfterLinkageStep: Boolean) = Unit
        }
    } else {<|endoftext|>


Prompt:
* Sorts the array in-place.
 *
 * @sample samples.collections.Arrays.Sorting.sortArray
 */
public actual fun FloatArray.sort(): Unit {
    nativeSort()
}

/**
 * Sorts the array in-place.
 *
 * @sample samples.collections.Arrays.Sorting.sortArray
 */
public actual fun CharArray.sort(): Unit {

Response:
nativeSort(::primitiveCompareTo)
}

/**
 * Sorts the array in-place according to the natural order of its elements.
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 *
 * @sample samples.collections.Arrays.Sorting.sortArrayOfComparable
 */<|endoftext|>


Prompt:
val nullableDoubleIeee754Equals = getInternalFunction("nullableDoubleIeee754Equals")

    val unsafeGetScratchRawMemory = getInternalFunction("unsafeGetScratchRawMemory")
    val returnArgumentIfItIsKotlinAny = getInternalFunction("returnArgumentIfItIsKotlinAny")

    val startCoroutineUninterceptedOrReturnIntrinsics =

Response:
(0..2).map { getInternalFunction("startCoroutineUninterceptedOrReturnIntrinsic$it") }

    // KProperty implementations
    val kLocalDelegatedPropertyImpl: IrClassSymbol = this.getInternalClass("KLocalDelegatedPropertyImpl")<|endoftext|>


Prompt:
assertNull(inferCommonizerTarget(commonMain), "Expected commonMain to have no commonizer target")
        assertNull(inferCommonizerTarget(commonTest), "Expected commonTest to have no commonizer target")
    }

    @Test
    fun `nativeMain with non hmpp workaround`() {
        val linux1 = kotlin.linuxX64("linux1")

Response:
val linux2 = kotlin.linuxArm64("linux2")

        val nativeMain = kotlin.sourceSets.create("nativeMain")

        listOf(linux1, linux2).forEach { target ->
            @Suppress("DEPRECATION")
            target.compilations.getByName("main").source(nativeMain)
        }

        assertEquals(<|endoftext|>


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

Response:
0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,
            0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,<|endoftext|>


Prompt:
tree: FlyweightCapableTreeStructure<LighterASTNode>
        ): List<TextRange> {
            return markElement(tree.typeParametersList(node) ?: node, startOffset, endOffset, tree, node)
        }
    }

    val NAME_IDENTIFIER: LightTreePositioningStrategy = object : LightTreePositioningStrategy() {
        override fun mark(

Response:
node: LighterASTNode,
            startOffset: Int,
            endOffset: Int,
            tree: FlyweightCapableTreeStructure<LighterASTNode>
        ): List<TextRange> {
            val nameIdentifier = tree.nameIdentifier(node)
            if (nameIdentifier != null) {
                return markElement(nameIdentifier, startOffset, endOffset, tree, node)
            }<|endoftext|>


Prompt:
* This includes replacing all `if` expressions with corresponding `when` expressions,
     * converting `for` loops into blocks with an `iterator` variable declaration and a `while` loop, and similar.
     */
    RAW_FIR(noProcessor = true),

    /**
     * The compiler resolves all imports in the file.
     *

Response:
* Effectively, this means that the compiler splits all imports on the longest existing package part and the related class qualifier.
     * More specifically, if an import is `import aaa.bbb.ccc.D`, the compiler tries to resolve the package `aaa.bbb.ccc` first.<|endoftext|>


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

public abstract class Component {
    public void setPreferredSize(Object preferredSize) {}
    public Object getPreferredSize() { return new Object(); }
}

// FILE: ProjectMain.kt

class ComboBox<T>: Component() {
    override fun getPreferredSize(): Any? = "OK"
}

fun box(): String {

Response:
val comboBox = ComboBox<Int>()
    comboBox.preferredSize = Any()
    return comboBox.preferredSize as String
}<|endoftext|>


Prompt:
// Auto-generated by GenerateSteppedRangesCodegenTestData. Do not edit!
// WITH_STDLIB
import kotlin.test.*

fun box(): String {
    val intList = mutableListOf<Int>()
    for (i in 7 downTo 1 step 7) {
        intList += i
    }
    assertEquals(listOf(7), intList)

Response:
val longList = mutableListOf<Long>()
    for (i in 7L downTo 1L step 7L) {
        longList += i
    }
    assertEquals(listOf(7L), longList)

    val charList = mutableListOf<Char>()
    for (i in 'g' downTo 'a' step 7) {
        charList += i
    }<|endoftext|>


Prompt:
override fun <D> transformTypeParameters(transformer: FirTransformer<D>, data: D): FirField {
        typeParameters.transformInplace(transformer, data)
        return this
    }

    override fun replaceDelegate(newDelegate: FirExpression?) {}
    override val delegate: FirExpression?
        get() = null

Response:
override var containerSource: DeserializedContainerSource? = null

    override fun <D> transformInitializer(transformer: FirTransformer<D>, data: D): FirField {
        return this
    }

    override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?) {}
    override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider) {}<|endoftext|>


Prompt:
* The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,
     * and then that string was inserted into this string builder at the specified [index].
     *
     * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
     */
    @SinceKotlin("1.9")

Response:
public fun insert(index: Int, value: Int): StringBuilder

    /**
     * Inserts the string representation of the specified long [value] into this string builder at the specified [index] and returns this instance.
     *
     * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,<|endoftext|>


Prompt:
// !LANGUAGE: +WarningOnMainUnusedParameter
// !DIAGNOSTICS: +UNUSED_PARAMETER

// FILE: a.kt
fun main(args: Array<String>) {}

// FILE: b.kt
fun main(args: Array<String>) {}

// FILE: c.kt

Response: fun foo() { <!OVERLOAD_RESOLUTION_AMBIGUITY!>main<!>(arrayOf("a", "b")) }<|endoftext|>


Prompt:
return PsiClassImplUtil.getAllWithSubstitutorsByMap(this, PsiClassImplUtil.MemberType.METHOD)
    }

    override fun getRBrace(): PsiElement? = null

    override fun getLBrace(): PsiElement? = null

Response:
override fun getInitializers(): Array<PsiClassInitializer> = PsiClassInitializer.EMPTY_ARRAY

    override fun getElementIcon(flags: Int): Icon? = throw UnsupportedOperationException("This should be done by KotlinIconProvider")<|endoftext|>


Prompt:
private val enumWhenTracker: EnumWhenTracker?
) : ControlFlowInformationProvider {
    private val pseudocodeVariablesData by lazy {
        PseudocodeVariablesData(pseudocode, trace.bindingContext)
    }

    constructor(
        declaration: KtElement,
        trace: BindingTrace,
        languageVersionSettings: LanguageVersionSettings,

Response:
diagnosticSuppressor: PlatformDiagnosticSuppressor,
        enumWhenTracker: EnumWhenTracker? = null
    ) : this(
        declaration,
        trace,
        ControlFlowProcessor(trace, languageVersionSettings).generatePseudocode(declaration),
        languageVersionSettings,
        diagnosticSuppressor,
        enumWhenTracker
    )<|endoftext|>


Prompt:
protected val irBuiltIns: IrBuiltIns,
    private val replaceTypesInsideInlinedFunctionBlock: Boolean = false
) : IrElementTransformerVoid() {

    protected open fun IrExpression.useAs(type: IrType): IrExpression = this

    protected open fun IrExpression.useAsStatement(): IrExpression = this

Response:
protected open fun IrExpression.useInTypeOperator(operator: IrTypeOperator, typeOperand: IrType): IrExpression =
        this

    protected open fun IrExpression.useAsValue(value: IrValueDeclaration): IrExpression = this.useAs(value.type)

    protected open fun IrExpression.useAsArgument(parameter: IrValueParameter): IrExpression =<|endoftext|>


Prompt:
bridgeInvokeFunction.initialize(
        null,
        lambdaCodegen.descriptor.thisAsReceiverParameter,
        emptyList(),
        emptyList(),
        emptyList(),
        lambdaCodegen.descriptor.builtIns.anyType,
        Modality.FINAL,
        DescriptorVisibilities.PUBLIC
    )

Response:
lambdaCodegen.generateMethod(bridgeInvokeFunction) { _, _ ->
        load(0, lambdaType)
        invokevirtual(lambdaType.internalName, "invoke", "()L${resultSimpleType.toClassDescriptor.classId!!.internalName};", false)
        areturn(kSerializerType)
    }<|endoftext|>


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

Response: if (x != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?"), DEBUG_INFO_SMARTCAST!>x<!>.equals(null)<|endoftext|>


Prompt:
val insnsToRemove = ArrayList<AbstractInsnNode>()

        val insns = methodNode.instructions.toArray()
        for (i in insns.indices) {
            val insn = insns[i]
            if (shouldRemove(insn, i, liveness)) {
                insnsToRemove.add(insn)
            }
        }

Response:
methodNode.remove(insnsToRemove)

        // Remove empty try-catch blocks to make sure we don't break data flow analysis invariants by dead code elimination.
        methodNode.removeEmptyCatchBlocks()

        methodNode.removeUnusedLocalVariables()
    }

    private fun shouldRemove(insn: AbstractInsnNode, index: Int, liveness: BooleanArray): Boolean {<|endoftext|>


Prompt:
h = Holder()
    test0 = test0(h, false, throwExternalFinEx1 = true, res = "OK")
    if (test0 != "EXCEPTION_IN_EXTERNAL_FINALLY" || h.value != "OK_NON_LOCAL, OK_FINALLY1, OK_FINALLY2") return "test0_2: ${test0}, holder: ${h.value}"

Response:
h = Holder()
    test0 = test0(h, false, throwExternalFinEx2 = true, res = "OK")
    if (test0 != "EXCEPTION222_IN_EXTERNAL_FINALLY" || h.value != "OK_NON_LOCAL, OK_FINALLY1, OK_FINALLY2") return "test0_4: ${test0}, holder: ${h.value}"<|endoftext|>


Prompt:
override fun toString() = "$value.toLong()"
}

class NullValue : ConstantValue<Void?>(null) {
    override fun getType(module: ModuleDescriptor) = module.builtIns.nullableNothingType

Response:
override fun <R, D> accept(visitor: AnnotationArgumentVisitor<R, D>, data: D) = visitor.visitNullValue(this, data)
}

class ShortValue(value: Short) : IntegerValueConstant<Short>(value) {
    override fun getType(module: ModuleDescriptor) = module.builtIns.shortType<|endoftext|>


Prompt:
return javaSupplier != null && type.isSubtypeOfClass(javaSupplier) &&
                type is IrSimpleType && (type.arguments.size == 1 && isStringSupertype(type.arguments.first()))
    }

    private fun isStringSupertype(argument: IrTypeArgument): Boolean =
        argument is IrTypeProjection && isStringSupertype(argument.type)

Response:
private fun isStringSupertype(type: IrType): Boolean =
        context.irBuiltIns.stringType.isSubtypeOf(type, irTypeSystemContext)

    private fun IrType?.isAssignableTo(type: IrType?): Boolean {
        if (this != null && type != null) {
            if (isSubtypeOf(type, irTypeSystemContext)) return true<|endoftext|>


Prompt:
package testPackNew

class A() {
    fun foo(i: Int) {}
    infix fun A.foo(i: Int) {}

    fun bar(a: A) {
        //todo: add info if function is infix one
       <!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: infix extension function")!>a foo 1<!>

Response:
}

    fun buz(a: A){
        fun foo(i: Int) {}
        //todo: add info if function is infix one
        <!DEBUG_INFO_CALL("fqName: testPackNew.A.foo; typeCall: infix extension function")!>a foo 1<!>
    }

    fun boo(a: A){<|endoftext|>


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

Response: $i$f$baz1\21\109:int=0:int, baz1Var\21:int=3:int, baz2Param\22:int=1:int, $i$f$baz2\22\111:int=0:int, baz2Var\22:int=3:int<|endoftext|>


Prompt:
// FIR_IDENTICAL
import kotlin.jvm.Synchronized

interface My {
    <!SYNCHRONIZED_IN_INTERFACE!>@Synchronized<!> fun foo()

    <!SYNCHRONIZED_IN_INTERFACE!>@Synchronized<!> fun bar() = 1

Response:
<!SYNCHRONIZED_IN_INTERFACE!>@Synchronized<!> fun baz(): String {
        return "abc"
    }

    var v: String
        <!SYNCHRONIZED_IN_INTERFACE!>@Synchronized<!> get() = ""<|endoftext|>


Prompt:
val reportDir = workDir.resolve("buildReport")

        @Suppress("UNREACHABLE_CODE")
        fun getReportFile(): File {
            return Files.list(reportDir.toPath()).let {
                val files = it.toArray()
                val singleFile = (files.singleOrNull() as Path?).also {

Response:
it ?: fail("The directory must contain a single file, but got: $files")
                }

                return singleFile?.toFile()!!
            }
        }

        fun assertFileContains(
            file: File,
            vararg expectedText: String,
        ) {
            val text = file.readText()<|endoftext|>


Prompt:
x = 1
        }

        fun foo() {
            val a : Int
            doSmth(<!UNINITIALIZED_VARIABLE!>a<!>)
        }
    }
}

fun foo() {
    val a = object {
        val x : Int

Response:
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val y : Int<!>
        val z : Int
        init {
            x = 1
            z = 3
        }
        fun foo() {
            <!VAL_REASSIGNMENT!>y<!> = 10
            <!VAL_REASSIGNMENT!>z<!> = 13
        }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.descriptorUtil.classId

internal object ActualTypealiasToSpecialAnnotationChecker : DeclarationChecker {
    override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {
        if (!context.languageVersionSettings.supportsFeature(LanguageFeature.MultiplatformRestrictions)) return

Response:
if (declaration !is KtTypeAlias || descriptor !is TypeAliasDescriptor || !descriptor.isActual) {
            return
        }
        val classDescriptor = descriptor.classDescriptor ?: return
        if (classDescriptor.kind != ClassKind.ANNOTATION_CLASS) {
            return
        }
        val classId = classDescriptor.classId ?: return<|endoftext|>


Prompt: COMPLETED SUCCESS // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest4

Response: STARTED TEST displayName: myTest5, classDisplayName: MyTestNested, className: my.company.product.MyTest.MyTestNested, name: myTest5 // iosTest/my.company.product.MyTest/my.company.product.MyTest.MyTestNested/my.company.product.MyTest.MyTestNested.myTest5<|endoftext|>


Prompt:
getContributedFunctionsAndIntercept(
                    name,
                    location,
                    contextReceiver,
                    extensionReceiver,
                    scopeTower
                ) + it.getInnerConstructors(
                    name,
                    location
                ) + syntheticScopes.collectSyntheticMemberFunctions(listOfNotNull(it), name, location)
            }
        }

Response:
return contextReceiversGroup.map(collectMembers).flatten()
    }

    override fun recordLookup(name: Name) {
        for (type in contextReceiversGroup.map { it.allOriginalTypes }.flatten()) {
            type.memberScope.recordLookup(name, location)
        }
    }
}<|endoftext|>


Prompt:
val parameters = mutableMapOf("target" to "Linux", "type" to "dev", "build" to "", "branch" to "master")
    parametersPart.forEach {
        val parsedParameter = it.split("=", limit = 2)
        if (parsedParameter.size == 2) {
            val (key, value) = parsedParameter
            parameters[key] = value
        }

Response:
}

    buildsNumberToShow = parameters["count"]?.toInt() ?: buildsNumberToShow
    beforeDate = parameters["before"]?.let { decodeURIComponent(it) }
    afterDate = parameters["after"]?.let { decodeURIComponent(it) }

    // Get branches.
    val branchesUrl = "$serverUrl/branches"<|endoftext|>


Prompt:
@CompileTimeCalculation
class Person(val name: String, val surname: String) {
    var age: Int
    val wholeName: String

    init {
        wholeName = name + " " + surname
    }

    init {
        age = -1
    }

    constructor(name: String) : this(name, "<NULL>") {}

Response:
constructor() : this("<NOT_GIVEN>") {}

    constructor(name: String, age: Int): this(name) {
        this.age = age
    }
}

const val a1 = <!EVALUATED: `-1`!>Person("Ivan", "Ivanov").age<!><|endoftext|>


Prompt:
interface KotlinCompilationTask<out CO : KotlinCommonCompilerOptions> : Task {

    /**
     * Represents the compiler options used by a Kotlin compilation process.
     *
     * This can be used to get the values of currently configured options or modify them.
     */
    @get:Nested
    val compilerOptions: CO

    /**
     * Configures the [compilerOptions] with the provided configuration.

Response:
*/
    fun compilerOptions(configure: CO.() -> Unit) {
        configure(compilerOptions)
    }

    /**
     * Configures the [compilerOptions] with the provided configuration.
     */
    fun compilerOptions(configure: Action<in CO>) {
        configure.execute(compilerOptions)
    }
}<|endoftext|>


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

Response:
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) open fun testDifferentReturnTypes(): UserKlassA<!> = UserKlassA()
    <!CONFLICTING_OVERLOADS!>open fun testDifferentReturnTypes(): UserKlassB<!> = UserKlassB()<|endoftext|>


Prompt:
if (source.getChild(KtNodeTypes.TYPE_REFERENCE, depth = 1) != null) return false
        // Do not check if the containing file is not a physical file.
        val containingFile = context.containingDeclarations.first()
        if (containingFile.source?.elementType in codeFragmentTypes) return false

        return when (source.elementType) {

Response:
// Only require return type if the function is defined via `=`. If it has a block body or is abstract, we don't require return
            // type because not declaring means it returns `Unit`.
            KtNodeTypes.FUN -> source.getChild(KtTokens.EQ, depth = 1) != null
            KtNodeTypes.PROPERTY -> true
            else -> false
        }
    }<|endoftext|>


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

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


Prompt:
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test
import java.io.File

@Tag("infrastructure")
@TestMetadata(TEST_SUITE_PATH)
@TestDataPath("\$PROJECT_ROOT")
class InfrastructureDumpedTestListingTest : AbstractNativeSimpleTest() {
    @Test

Response:
@TestMetadata(TEST_CASE_NAME)
    fun testListingCompiledFromSources() {
        doTest(TEST_CASE_PATH, fromSources = true)
    }

    @Test
    @TestMetadata(TEST_CASE_NAME)
    fun testListingCompiledFromIncludedLibrary() {
        doTest(TEST_CASE_PATH, fromSources = false)<|endoftext|>


Prompt:
// Copyright (C) 2020-2023 Brian Norman
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software

Response:
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.jetbrains.kotlin.powerassert.diagram

import org.jetbrains.kotlin.ir.builders.*<|endoftext|>


Prompt:
name,
                NoLookupLocation.FROM_BACKEND
            ).single()

        Predefined.anyMethodSelectors.forEach { (name, selector) ->
            methodSelectors.forceAssign(any.method(name), selector)
        }

        Predefined.anyMethodSwiftNames.forEach { (name, swiftName) ->

Response:
methodSwiftNames.forceAssign(any.method(name), swiftName)
        }
    }

    private object Predefined {
        val anyMethodSelectors = mapOf(
            "hashCode" to "hash",
            "toString" to "description",
            "equals" to "isEqual:"
        ).mapKeys { Name.identifier(it.key) }<|endoftext|>


Prompt:
assertEquals(arr[0], -51)
        assertEquals(arr[1], -19)
        arr[0] = 51
        arr[1] = 19
        assertEquals(arr[0], 51)
        assertEquals(arr[1], 19)

        assertEquals(true, b)
        b = false
        assertEquals(false, b)

Response:
// Check that subtyping via Nothing-returning functions does not break compiler.
        assertFailsWith<NotImplementedError> {
            ui = TODO()
            t.i = TODO()
            next = TODO()
            e = TODO()
            nonStrict = TODO()
            b = TODO()
        }
    }
    memScoped {<|endoftext|>


Prompt:
val baseC: BaseBuildee<TargetType>
                get() = this@build
        }
    }

    // initialization of a mutable property's backing field
    build {
        class LocalWrapper {
            var baseD: BaseBuildee<TargetType> = this@build
                set(value) {
                    field = BaseBuildee()
                }
        }
    }

Response:
// body of a setter of a mutable property
    build {
        class LocalWrapper {
            var baseE: BaseBuildee<TargetType> = BaseBuildee()
                set(value) {
                    field = this@build
                }
        }
    }

    // assignment via a mutable property's setter
    build {
        baseF = this
    }<|endoftext|>


Prompt:
public fun LongArray.randomOrNull(random: Random): Long? {
    if (isEmpty())
        return null
    return get(random.nextInt(size))
}

/**
 * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.
 */
@SinceKotlin("1.4")

Response:
public fun FloatArray.randomOrNull(random: Random): Float? {
    if (isEmpty())
        return null
    return get(random.nextInt(size))
}

/**
 * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.
 */
@SinceKotlin("1.4")<|endoftext|>


Prompt:
// MODULE: context

// FILE: context.kt
fun test() {
    var x = 0

    fun call() {
        x = 1
    }

    <caret_context>call()
}

// MODULE: main
// MODULE_KIND: CodeFragment
// CONTEXT_MODULE: context

// FILE: fragment.kt
// CODE_FRAGMENT_KIND: EXPRESSION

Response: call()<|endoftext|>


Prompt:
val allReverseAdapters = createReverseAdapters(types)

        return types.map {
            val reverseAdapters = allReverseAdapters.getValue(it).adapters
            when (it) {
                objCClassForAny -> {
                    createTypeAdapter(it, superClass = null, reverseAdapters)
                }

                is ObjCClassForKotlinClass -> {

Response:
val superClass = it.superClassNotAny ?: objCClassForAny

                    dataGenerator.emitEmptyClass(it.binaryName, superClass.binaryName)
                    // Note: it is generated only to be visible for linker.
                    // Methods will be added at runtime.

                    createTypeAdapter(it, superClass, reverseAdapters)
                }<|endoftext|>


Prompt:
add(FirErrors.INCORRECT_CHARACTER_LITERAL) { firDiagnostic ->
        IncorrectCharacterLiteralImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }
    add(FirErrors.EMPTY_CHARACTER_LITERAL) { firDiagnostic ->
        EmptyCharacterLiteralImpl(

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


Prompt:
// LANGUAGE: +BreakContinueInInlineLambdas
// TARGET_BACKEND: JVM_IR
// TARGET_BACKEND: JS_IR
// TARGET_BACKEND: JS_IR_ES6
// TARGET_BACKEND: NATIVE
// TARGET_BACKEND: WASM

inline fun foo(block: () -> Unit) { block() }

fun box(): String {

Response:
while (true) {
        foo { break }
        return "FAIL"
    }

    return "OK"
}<|endoftext|>


Prompt:
@JvmField
val JVM_THROWS_ANNOTATION_FQ_NAME = FqName("kotlin.jvm.Throws")

val KOTLIN_THROWS_ANNOTATION_FQ_NAME = FqName("kotlin.Throws")

Response: val KOTLIN_NATIVE_THROWS_ANNOTATION_FQ_NAME = FqName("kotlin.native.Throws")<|endoftext|>


Prompt:
package org.jetbrains.kotlin.analysis.test.framework

import com.intellij.openapi.Disposable
import com.intellij.openapi.util.Disposer
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.TestInfo

Response:
abstract class TestWithDisposable {
    private var _disposable: Disposable? = Disposer.newDisposable("Disposable for Analysis Api tests")
    protected val disposable: Disposable get() = _disposable!!

    @BeforeEach
    fun initDisposable(testInfo: TestInfo) {<|endoftext|>


Prompt: <!DEBUG_INFO_CALL("fqName: testPackCase3.plusAssign; typeCall: operator extension function")!>a?.b <!NULLABLE_EXTENSION_OPERATOR_WITH_SAFE_CALL_RECEIVER!>+=<!> c<!>

Response:
a?.b.<!DEBUG_INFO_CALL("fqName: testPackCase3.plusAssign; typeCall: operator extension function")!>plusAssign(c)<!>

    val x = {<|endoftext|>


Prompt:
get() = "Interface with Getter"

    var interfaceVarOpen: String
}

@JsExport
open class Owner {
    open val classOpenReadonly: String = "Class Readonly Open"
    open var classOpenVar: String = "Class Var Open"
    open lateinit var classOpenLateinitVar: String;

    lateinit var classLateinitVar: String;

Response:
val classFinalReadonly: String = "Class Readonly Final"
    var classFinalVar: String = "Class Default"

    val classGetterOnly: String
        get() = "Class with Final Getter"

    open val classOpenGetterOnly: String
        get() = "Class with Open Getter"

    var classSetterOnly: String = "Class setter only"<|endoftext|>


Prompt:
enum class EnumerationBCE constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {
        ENTRY1 {
            override fun abstractFunc() {
                TODO("Not yet implemented")
            }
        },
        ENTRY2() {
            override fun abstractFunc() {
                TODO("Not yet implemented")
            }
        };

Response:
abstract fun abstractFunc()
    }

    enum class EnumerationBDA constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {
        <!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>ENTRY;<!>

        constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())<|endoftext|>


Prompt:
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
        annotations.forEach { it.accept(visitor, data) }
        calleeReference.accept(visitor, data)
    }

    override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirInaccessibleReceiverExpressionImpl {

Response:
transformAnnotations(transformer, data)
        transformCalleeReference(transformer, data)
        return this
    }

    override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirInaccessibleReceiverExpressionImpl {
        annotations.transformInplace(transformer, data)
        return this
    }<|endoftext|>


Prompt:
private fun JCDiagnostic.Factory.errorJava9Aware(
    source: DiagnosticSource?,
    pos: JCDiagnostic.DiagnosticPosition?,
    key: String,
    vararg args: String
): JCDiagnostic {
    return if (isJava9OrLater()) {
        val errorMethod = this::class.java.getDeclaredMethod(
            "error",

Response:
JCDiagnostic.DiagnosticFlag::class.java,
            DiagnosticSource::class.java,
            JCDiagnostic.DiagnosticPosition::class.java,
            String::class.java,
            Array<Any>::class.java
        )<|endoftext|>


Prompt:
analysisResult: AnalysisResult, sourceFiles: List<KtFile>, kotlinCompilerConfiguration: CompilerConfiguration,
    messageCollector: MessageCollector
): GenerationState {
    val diagnosticsReporter = DiagnosticReporterFactory.createReporter()
    return GenerationState.Builder(
        sourceFiles.first().project,
        ClassBuilderFactories.BINARIES,
        analysisResult.moduleDescriptor,

Response:
analysisResult.bindingContext,
        kotlinCompilerConfiguration
    ).diagnosticReporter(
        diagnosticsReporter
    ).build().also {
        KotlinCodegenFacade.compileCorrectFiles(
            sourceFiles,
            it,
            if (kotlinCompilerConfiguration.getBoolean(JVMConfigurationKeys.IR))
                JvmIrCodegenFactory(<|endoftext|>


Prompt:
is KtAnnotatedExpression -> parent.annotationEntries
        is KtLabeledExpression -> parent.getAnnotationEntries()
        else -> emptyList()
    }
}

fun KtAnnotationsContainer.collectAnnotationEntriesFromStubOrPsi(): List<KtAnnotationEntry> {
    return when (this) {

Response:
is StubBasedPsiElementBase<*> -> stub?.collectAnnotationEntriesFromStubElement() ?: collectAnnotationEntriesFromPsi()
        else -> collectAnnotationEntriesFromPsi()
    }
}

private fun StubElement<*>.collectAnnotationEntriesFromStubElement(): List<KtAnnotationEntry> {
    return childrenStubs.flatMap { child -><|endoftext|>


Prompt:
KtSymbolKind.CLASS_MEMBER, KtSymbolKind.ACCESSOR,
        -> SirCallableKind.INSTANCE_METHOD
        KtSymbolKind.LOCAL,
        KtSymbolKind.SAM_CONSTRUCTOR,
        -> TODO("encountered callable kind($symbolKind) that is not translatable currently. Fix this crash during KT-65980.")
    }

Response: internal fun KtSymbol.documentation(): String? = this.psiSafe<KtDeclaration>()?.docComment?.text<|endoftext|>


Prompt:
However in our class hierarchy JsArrayLiteral is subclass of JsLiteral,
which makes very easy to implement incorrect aliasing logic.
 */

package foo

// CHECK_NOT_CALLED: moveTo

inline fun Array<Int>.push(element: Int): Unit = asDynamic().push(element)

Response:
inline fun Array<Int>.splice(index: Int, howMany: Int): Unit = asDynamic().splice(index, howMany)

data class PairArray<T, R>(val fst: Array<T>, val snd: Array<R>)

inline fun moveTo(source: Array<Int>, sink: Array<Int>): PairArray<Int, Int> {
    val size = source.size<|endoftext|>


Prompt:
context,
                    reporter,
                    when (context.session.languageVersionSettings.supportsFeature(LanguageFeature.ProhibitUseSiteGetTargetAnnotations)) {
                        true -> FirErrors.INAPPLICABLE_TARGET_ON_PROPERTY
                        false -> FirErrors.INAPPLICABLE_TARGET_ON_PROPERTY_WARNING
                    }
                )
            }
            FIELD -> {

Response:
if (annotated is FirBackingField) {
                    val propertySymbol = annotated.propertySymbol
                    if (propertySymbol.delegateFieldSymbol != null && !propertySymbol.hasBackingField) {
                        reporter.reportOn(annotation.source, FirErrors.INAPPLICABLE_TARGET_PROPERTY_HAS_NO_BACKING_FIELD, context)
                    }
                }<|endoftext|>


Prompt: ((T) -> kotlin.CharSequence)? = ...): A

Response: public fun <T> kotlin.Array<out T>.joinToString(separator: kotlin.CharSequence = ..., prefix: kotlin.CharSequence = ..., postfix: kotlin.CharSequence = ..., limit: kotlin.Int = ..., truncated: kotlin.CharSequence = ..., transform: ((T) -> kotlin.CharSequence)? = ...):<|endoftext|>


Prompt:
test<Foo>(::test1) {
        check(a.contentEquals(intArrayOf(1, 2, 11, 0)), "Fail 1: ${a.joinToString()}")
        check(b.contentEquals(arrayOf("hello", "helloc", "hello, Kotlin", "cc")), "Fail 2: ${b.joinToString()}")
    }

    return "OK"

Response: }<|endoftext|>


Prompt:
return Platform.values().firstOrNull { it.version == version }
                ?: error("Can't find platform $version")
        }
    }
}

enum class Ide(val platform: Platform) : CompatibilityPredicate {
    IJ213(Platform.P213);

    val kind = Kind.values().first { it.shortName == name.take(2) }

Response:
val version = name.dropWhile { !it.isDigit() }.toInt()

    val displayVersion: String = when (kind) {
        Kind.IntelliJ -> "IJ${platform.displayVersion}"
        Kind.AndroidStudio -> "Studio${name.substringAfter("AS").toCharArray().joinToString(separator = ".")}"
    }<|endoftext|>


Prompt:
if (upperBound !is ConeClassLikeType) return false

        if (fir.name.asString() in ERASED_COLLECTION_PARAMETER_NAMES) {
            require(upperBound.lookupTag.classId == StandardClassIds.Collection) {
                "Unexpected type: ${upperBound.lookupTag.classId}"
            }

Response:
return upperBound.typeArguments.singleOrNull() is ConeStarProjection
        }

        return upperBound.classId == StandardClassIds.Any
    }

    private fun FirProperty.computeJvmDescriptorForGetter(customName: String? = null, includeReturnType: Boolean = false): String {<|endoftext|>


Prompt:
* @return true if this symbol shouldn't be processed as the owner of an annotation call
 */
internal fun FirBasedSymbol<*>.cannotResolveAnnotationsOnDemand(): Boolean {
    return this is FirCallableSymbol<*> && isLocalForLazyResolutionPurposes
}

/**
 * Invoke [action] on each callable declaration that can have postponed symbols
 *

Response:
* @see postponedSymbolsForAnnotationResolution
 */
internal fun FirDeclaration.forEachDeclarationWhichCanHavePostponedSymbols(action: (FirCallableDeclaration) -> Unit) {
    when (this) {
        is FirCallableDeclaration -> action(this)
        else -> {}
    }
}

/**<|endoftext|>


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

Response:
*/
@SinceKotlin("2.0")
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
public actual fun String.toCharArray(
        destination: CharArray,
        destinationOffset: Int = 0,
        startIndex: Int = 0,
        endIndex: Int = length
): CharArray {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.backend.konan.driver.phases.Fir2IrOutput
import org.jetbrains.kotlin.backend.konan.driver.phases.FirOutput
import org.jetbrains.kotlin.backend.konan.ir.KonanSymbols

Response:
import org.jetbrains.kotlin.backend.konan.ir.SymbolOverIrLookupUtils
import org.jetbrains.kotlin.backend.konan.serialization.KonanIdSignaturer
import org.jetbrains.kotlin.backend.konan.serialization.KonanManglerDesc<|endoftext|>


Prompt:
// !LANGUAGE: +ProperFinally
// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt

package test

var result = ""

class A {
    var field = 0
    inline fun a(f: () -> Any): Any {
        try {
            val value = f()
            return value
        } finally {
            field--
        }
    }

Response:
fun c(vararg functions: () -> Any): Any = a {
        for (function in functions) {
            try { return function() } catch (fail: Throwable) { }
        }
        throw RuntimeException()
    }
}

// FILE: 2.kt
import test.*

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


Prompt:
supertypes.forEach { supertype ->
            kotlin.test.assertNull(supertype.outerType, "Expected no outerType")
            kotlin.test.assertTrue(supertype.arguments.isEmpty(), "Expected no arguments. Found ${supertype.arguments}")

Response:
kotlin.test.assertFalse(supertype.isMarkedNullable, "Expected supertype to be marked *not* nullable")
        }
    }

    fun `test single nullable supertype from module`() {
        val module = createCirTreeFromSourceCode(
            """
                interface A
                class X: A
            """.trimIndent()
        )<|endoftext|>


Prompt:
class TestTypeParameterWithMultipleIdenticalUpperBoundsBA<T: UserInterfaceA> where T: UserInterfaceB {
    @Deprecated(message = "", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor()<!>
}

Response:
<!CONFLICTING_OVERLOADS!>fun <T: UserInterfaceA> TestTypeParameterWithMultipleIdenticalUpperBoundsBA()<!> where T: UserInterfaceB {}

class TestTypeParameterWithMultipleIdenticalUpperBoundsBAReverse<T: UserInterfaceA> where T: UserInterfaceB {
    <!CONFLICTING_OVERLOADS!>constructor()<!>
}<|endoftext|>


Prompt:
val irCall = if (isArrayReceiver) {
                            transformAtomicUpdateCallOnArrayElement(
                                expression = expression,
                                functionName = functionName,
                                valueType = valueType,
                                getPropertyReceiver = propertyGetterCall,
                                parentFunction = data
                            )
                        } else {
                            transformAtomicUpdateCallOnProperty(
                                expression = expression,
                                functionName = functionName,

Response:
valueType = valueType,
                                castType = if (it is IrTypeOperatorCall) valueType else null,
                                getPropertyReceiver = propertyGetterCall,
                                parentFunction = data
                            )
                        }
                        return super.visitExpression(irCall, data)
                    }
                    if (expression.symbol.owner.isInline && expression.extensionReceiver != null) {
                        /**<|endoftext|>


Prompt:
public inline fun <R> kotlin.CharArray.scanIndexed(initial: R, operation: (index: kotlin.Int, acc: R, kotlin.Char) -> R): kotlin.collections.List<R>

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

Response:
public inline fun <R> kotlin.DoubleArray.scanIndexed(initial: R, operation: (index: kotlin.Int, acc: R, kotlin.Double) -> R): kotlin.collections.List<R>

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


Prompt:
import org.jetbrains.kotlin.gradle.plugin.mpp.resources.KotlinTargetResourcesPublicationImpl
import org.jetbrains.kotlin.incremental.deleteDirectoryContents
import javax.inject.Inject

@DisableCachingByDefault
internal abstract class ResolveResourcesFromDependenciesTask : DefaultTask() {

    @get:Inject

Response:
abstract val fileSystem: FileSystemOperations

    @get:Inject
    abstract val archiveOperations: ArchiveOperations

    @get:Input
    abstract val filterResourcesByExtension: Property<Boolean>

    @get:PathSensitive(PathSensitivity.NONE)
    @get:InputFiles
    abstract val archivesFromDependencies: ConfigurableFileCollection<|endoftext|>


Prompt:
fun findEmbeddableOptions(options: List<String>): List<List<String>> {
        val result = mutableListOf<List<String>>()
        val iterator = options.iterator()
        loop@while (iterator.hasNext()) {
            val option = iterator.next()
            result += when {
                option.startsWith("-l") -> listOf(option)

Response:
option == "-framework" && iterator.hasNext() -> listOf(option, iterator.next())
                else -> break@loop // Ignore the rest.
            }
        }
        return result
    }

    val optionsToEmbed = findEmbeddableOptions(config.platform.configurables.linkerKonanFlags) +<|endoftext|>


Prompt:
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.cfg.ControlFlowBuilder.PredefinedOperation.NOT_NULL_ASSERTION
import org.jetbrains.kotlin.cfg.ControlFlowBuilder.PredefinedOperation.OR
import org.jetbrains.kotlin.cfg.pseudocode.ControlFlowInstructionsGenerator

Response:
import org.jetbrains.kotlin.cfg.pseudocode.PseudoValue
import org.jetbrains.kotlin.cfg.pseudocode.Pseudocode
import org.jetbrains.kotlin.cfg.pseudocode.PseudocodeImpl
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.AccessTarget<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>.equals(10)
}

// TESTCASE NUMBER: 3
fun case_3() {
    var x: Boolean? = true
    x!!
    val y = {
        var x: Int? = 10
    }

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>.equals(10)
}<|endoftext|>


Prompt:
scientists.associateByTo(byLastName) { it.lastName }

            assertTrue(byLastName.isNotEmpty())
            // Jacob Bernoulli does not occur in the map because only the last pair with the same key gets added
            assertPrints(byLastName, "{Hopper=Grace Hopper, Bernoulli=Johann Bernoulli}")
        }

        @Sample

Response:
fun associateByToWithValueTransform() {
            data class Person(val firstName: String, val lastName: String)

            val scientists = listOf(Person("Grace", "Hopper"), Person("Jacob", "Bernoulli"), Person("Johann", "Bernoulli"))

            val byLastName = mutableMapOf<String, String>()
            assertTrue(byLastName.isEmpty())<|endoftext|>


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

    class TestMultipleIdenticalValueParametersReverse {

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

    class TestMultipleDifferentlyNamedValueParametersA {<|endoftext|>