Prompt:
// LANGUAGE: -ReportErrorsForComparisonOperators

fun nullableNothingIdentity(a: Int, b: Nothing?) {
    a === <!DEBUG_INFO_CONSTANT!>b<!>
}

fun samePrimitiveIdentity(a: Int, b: Int) {
    <!DEPRECATED_IDENTITY_EQUALS!>a === b<!>
}

Response:
fun identityWithImplicitBoxing(a: Int, b: Any?) {
    <!IMPLICIT_BOXING_IN_IDENTITY_EQUALS!>a === b<!>
}

enum class E1 { A, B }
enum class E2 { C, D }

fun nullableEnums(a: E1?, b: E2?) {
    a == b
}<|endoftext|>


Prompt:
private val ClassDescriptor.isAnonymousObjectOrContained: Boolean
        get() {
            var current: DeclarationDescriptor? = this
            while (current != null) {
                if (DescriptorUtils.isAnonymousObject(current)) {
                    return true
                }
                current = current.containingDeclaration
            }
            return false
        }

Response:
private fun checkEnum(descriptor: ClassDescriptor, declaration: KtDeclaration, trace: BindingTrace) {
        if (descriptor.kind != ClassKind.ENUM_CLASS) return

        val entryBySerialName = mutableMapOf<String, ClassDescriptor?>()
        descriptor.enumEntries().forEach { entryDescriptor -><|endoftext|>


Prompt:
@GCUnsafeCall("Kotlin_io_Console_println0")
public actual external fun println()

/**
 * Reads a line of input from the standard input stream and returns it,
 * or throws a [RuntimeException] if EOF has already been reached when [readln] is called.
 *
 * LF or CRLF is treated as the line terminator. Line terminator is not included in the returned string.
 *

Response:
* The input is interpreted as UTF-8. Invalid bytes are replaced by the replacement character '\uFFFD'.
 */
@SinceKotlin("1.6")
public actual fun readln(): String = readlnOrNull() ?: throw ReadAfterEOFException("EOF has already been reached")

/**
 * Reads a line of input from the standard input stream and returns it,<|endoftext|>


Prompt:
1 to 3 -> AT_LEAST_ONCE
            2 to 2 -> MORE_THAN_ONCE
            2 to 3 -> MORE_THAN_ONCE
            3 to 3 -> MORE_THAN_ONCE
            else -> throw IllegalArgumentException()
        }

        fun or(x: EventOccurrencesRange, y: EventOccurrencesRange): EventOccurrencesRange =

Response:
fromRange(min(x.left, y.left), max(x.right, y.right))

        fun plus(x: EventOccurrencesRange, y: EventOccurrencesRange): EventOccurrencesRange =
            fromRange(x.left + y.left, x.right + y.right)
    }<|endoftext|>


Prompt:
return JsIrProgramFragments(result, exportFragment)
    }

    private fun Set<IrDeclaration>.computeTag(declaration: IrDeclaration): String? {
        // Use LEGACY here because the declaration may come from an old klib, in which its `IdSignature.CommonSignature`

Response:
// doesn't have `description`, but only `id`. Hence, we always render the signature with `id` instead of `description`,
        // because otherwise there may be a mismatch when we're computing the tag first for the IrDeclaration deserialized from klib,
        // and then for the same declaration but constructed from a descriptor.
        //<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_MULTI_MODULE: JVM_MULTI_MODULE_IR_AGAINST_OLD
// FILE: 1.kt
package test

class C {
    var x: () -> Unit
        inline get() = {}
        inline set(noinline value) {
            bar(value)
        }

Response:
fun bar(i: I) = i.foo()
}

fun interface I {
    fun foo()
}

// FILE: 2.kt
import test.*

fun box(): String {
    var result = "fail"
    val c = C()
    c.x = { result = "OK" }
    return result
}<|endoftext|>


Prompt: <!OVERLOAD_RESOLUTION_AMBIGUITY!>-<!><!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000<!> <!CANNOT_INFER_PARAMETER_TYPE, UNRESOLVED_REFERENCE_WRONG_RECEIVER!>checkType<!> {

Response: <!INAPPLICABLE_CANDIDATE!>check<!><<!CANNOT_INFER_PARAMETER_TYPE!>Short<!>>()<|endoftext|>


Prompt:
return builder.irNull(builtIns.nothingNType)
        }

        // Handled by autoboxing transformer
        if (toType.isInlined() && !fromType.isInlined()) {
            return builder.irCall(
                symbols.unboxIntrinsic,
                toType,
                typeArguments = listOf(fromType, toType)
            ).also {

Response:
it.putValueArgument(0, value)
            }
        }

        if (!toType.isInlined() && fromType.isInlined()) {
            return builder.irCall(
                symbols.boxIntrinsic,
                toType,
                typeArguments = listOf(fromType, toType)
            ).also {
                it.putValueArgument(0, value)<|endoftext|>


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

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

Response:
sample("samples.ranges.Ranges.step$primitive")
        signature("step(step: ${primitive!!.stepType})", notForSorting = true)
        returns("TProgression")
        body {
            """
            checkStepIsPositive(step > 0, step)<|endoftext|>


Prompt:
* because there are no elements in it that _do not_ match the predicate.
 * See a more detailed explanation of this logic concept in ["Vacuous truth"](https://en.wikipedia.org/wiki/Vacuous_truth) article.
 *
 * @sample samples.collections.Collections.Aggregates.all
 */
public inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean {

Response:
for (element in this) if (!predicate(element)) return false
    return true
}

/**
 * Returns `true` if array has at least one element.
 *
 * @sample samples.collections.Collections.Aggregates.any
 */
public fun <T> Array<out T>.any(): Boolean {
    return !isEmpty()
}

/**<|endoftext|>


Prompt:
irCall(backendContext.ir.symbols.enumValueOfFunction).apply {
                                    putValueArgument(0, javaClassReference(irClass.defaultType))
                                    putValueArgument(1, irGet(declaration.valueParameters[0]))
                                }

                            IrSyntheticBodyKind.ENUM_ENTRIES -> {
                                // We're ensuring on FE level that this declaration exists only

Response:
// when the corresponding flag is set up (-> entriesField is never null)
                                irGetField(null, entriesField!!)
                            }
                        }
                    )
                }
                return declaration
            }
        }

        private inner class EnumClassCallTransformer : IrElementTransformerVoidWithContext() {
            override fun visitClassNew(declaration: IrClass): IrStatement =<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.calls.inference.extractAllContainingTypeVariables
import org.jetbrains.kotlin.resolve.calls.tower.ApplicabilityDetail
import org.jetbrains.kotlin.resolve.calls.tower.isSuccess
import org.jetbrains.kotlin.types.model.*

Response:
import org.jetbrains.kotlin.utils.SmartList
import org.jetbrains.kotlin.utils.addToStdlib.trimToSize

private typealias Context = TypeSystemInferenceExtensionContext

class MutableVariableWithConstraints private constructor(
    private val context: Context,
    override val typeVariable: TypeVariableMarker,<|endoftext|>


Prompt:
super.configure(builder)
        with(builder) {
            defaultDirectives {
                +CodegenTestDirectives.IGNORE_FIR2IR_EXCEPTIONS_IF_FIR_CONTAINS_ERRORS
            }
        }
    }

    override fun TestConfigurationBuilder.configuration() {
        configureFirParser(parser)
        baseFirDiagnosticTestConfiguration()

Response:
facadeStep(::Fir2IrResultsConverter)
        irHandlersStep {
            useHandlers(
                ::IrDiagnosticsHandler
            )
        }

        useAdditionalService(::LibraryProvider)

        @OptIn(TestInfrastructureInternals::class)
        useModuleStructureTransformers(DuplicateFileNameChecker, PlatformModuleProvider)
    }
}<|endoftext|>


Prompt:
is KtOperationExpression -> true
        is KtArrayAccessExpression -> true
        is KtCallableReferenceExpression -> true
        else -> false
    }

    protected companion object {

Response:
private val nonCallBinaryOperator: Set<KtSingleValueToken> = setOf(KtTokens.ELVIS, KtTokens.EQEQEQ, KtTokens.EXCLEQEQEQ)
    }
}<|endoftext|>


Prompt:
// FIR_IDENTICAL
class Foo<T>

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

class Out<out P>

interface A<K>
class B : A<Int>
class C : A<String>

fun <K : <!FINAL_UPPER_BOUND!>Out<C><!>> main() {

Response:
val foo = Foo<K>()
    Bar<Out<B>>().takeFoo(foo) // error in 1.3.72, no error in 1.4.31
}<|endoftext|>


Prompt:
public abstract fun <S : KtVariableLikeSymbol> asSignature(symbol: S): KtVariableLikeSignature<S>
}

public interface KtSignatureSubstitutorMixIn : KtAnalysisSessionMixIn {
    /**
     * Applies a [substitutor] to the given symbol and return a signature with substituted types.
     *

Response:
* @see KtSubstitutor.substitute
     */
    public fun <S : KtCallableSymbol> S.substitute(substitutor: KtSubstitutor): KtCallableSignature<S> =
        withValidityAssertion { analysisSession.signatureSubstitutor.substitute(this, substitutor) }

    /**<|endoftext|>


Prompt:
override fun KotlinTypeMarker.isUnit(): Boolean {
        require(this is UnwrappedType, this::errorMessage)
        return KotlinBuiltIns.isUnit(this)
    }

    override fun KotlinTypeMarker.isBuiltinFunctionTypeOrSubtype(): Boolean {
        require(this is UnwrappedType, this::errorMessage)
        return isBuiltinFunctionalTypeOrSubtype

Response:
}

    override fun createFlexibleType(lowerBound: SimpleTypeMarker, upperBound: SimpleTypeMarker): KotlinTypeMarker {
        require(lowerBound is SimpleType, this::errorMessage)
        require(upperBound is SimpleType, this::errorMessage)
        return KotlinTypeFactory.flexibleType(lowerBound, upperBound)
    }<|endoftext|>


Prompt: // test.kt:5 foo: $completion:kotlin.coroutines.Continuation=A$foo1$1

Response: // test.kt:7 foo1: $completion:kotlin.coroutines.Continuation=Generated_Box_MainKt$main$1, $continuation:kotlin.coroutines.Continuation=A$foo1$1, $result:java.lang.Object=null, l:long=42:long<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource

@FirBuilderDsl
open class FirFieldBuilder : FirVariableBuilder, FirAnnotationContainerBuilder {

Response:
override var source: KtSourceElement? = null
    override var resolvePhase: FirResolvePhase = FirResolvePhase.RAW_FIR
    override lateinit var moduleData: FirModuleData
    override lateinit var origin: FirDeclarationOrigin
    override var attributes: FirDeclarationAttributes = FirDeclarationAttributes()<|endoftext|>


Prompt:
public inline fun kotlin.ULongArray.elementAtOrElse(index: kotlin.Int, defaultValue: (kotlin.Int) -> kotlin.ULong): kotlin.ULong

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

Response:
public inline fun kotlin.UShortArray.elementAtOrElse(index: kotlin.Int, defaultValue: (kotlin.Int) -> kotlin.UShort): kotlin.UShort

public fun <T> kotlin.collections.Iterable<T>.elementAtOrElse(index: kotlin.Int, defaultValue: (kotlin.Int) -> T): T<|endoftext|>


Prompt:
diagnosticSeverityStats.putIfAbsent(caseNumber, mutableMapOf())
                diagnosticSeverityStats[caseNumber]!!.run { put(severity, getOrDefault(severity, 0) + 1) }
            }
        }
    }

    private fun collectDiagnostics(files: List<BaseDiagnosticsTest.TestFile>) {
        files.forEach { file ->

Response:
file.actualDiagnostics.forEach {
                val diagnosticName = it.diagnostic.factory.name
                diagnosticStats.run { put(diagnosticName, getOrDefault(diagnosticName, 0) + 1) }
                diagnostics.add(it.diagnostic)
            }
        }
        collectDiagnosticStatistic()
    }<|endoftext|>


Prompt:
"priority is inconsistent: ${a.renderForDebugging()} v.s. ${b.renderForDebugging()}"
                }
                val nameDiff = a.lookupTag.name.compareTo(b.lookupTag.name)
                if (nameDiff != 0) {
                    return nameDiff
                }
                val nullabilityDiff = compare(a.nullability, b.nullability)

Response:
if (nullabilityDiff != 0) {
                    return nullabilityDiff
                }
                return compare(a.typeArguments, b.typeArguments)
            }
            is ConeFlexibleType -> {
                require(b is ConeFlexibleType) {
                    "priority is inconsistent: ${a.renderForDebugging()} v.s. ${b.renderForDebugging()}"
                }<|endoftext|>


Prompt:
// FIR_IDENTICAL
// LANGUAGE:-ProhibitMissedMustBeInitializedWhenThereIsNoPrimaryConstructor
// DIAGNOSTICS: -DEBUG_INFO_LEAKING_THIS
class Foo() {
    constructor(x: Int) : this()

    <!MUST_BE_INITIALIZED!>var x: String<!>
        set(value) {}

    init {

Response:
x = ""
    }
}<|endoftext|>


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

Response: class x<!CONFLICTING_OVERLOADS!>()<!> {}<|endoftext|>


Prompt:
assertEquals(aif, nullToNullB(aif), "AIF? as? IB?")
    assertEquals(aij, nullToNullB(aij), "AIJ? as? IB?")
    assertEquals(baia, nullToNullB(baia), "BAIA? as? IB?")

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


Prompt:
* A sequence that returns values from the underlying [sequence] while the [predicate] function returns
 * `true`, and stops returning values once the function returns `false` for the next element.
 */
internal class TakeWhileSequence<T>
constructor(
    private val sequence: Sequence<T>,
    private val predicate: (T) -> Boolean
) : Sequence<T> {

Response:
override fun iterator(): Iterator<T> = object : Iterator<T> {
        val iterator = sequence.iterator()
        var nextState: Int = -1 // -1 for unknown, 0 for done, 1 for continue
        var nextItem: T? = null

        private fun calcNext() {
            if (iterator.hasNext()) {
                val item = iterator.next()<|endoftext|>


Prompt:
val case71 = '\u2300'
   <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char")!>case71<!>
   case71 checkType { check<Char>()}
}
// TESTCASE NUMBER: 72
fun case72(){
   val case72 = '\u23ff'

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char")!>case72<!>
   case72 checkType { check<Char>()}
}
// TESTCASE NUMBER: 73
fun case73(){
   val case73 = '\u2400'
   <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char")!>case73<!><|endoftext|>


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

Response: -EXTENSION_FUNCTION_SHADOWED_BY_MEMBER_PROPERTY_WITH_INVOKE<|endoftext|>


Prompt:
val methodsAbi: List<JavaElementSnapshot>
)

/** Snapshot of a Java class or a Java class member (field or method). */
class JavaElementSnapshot(

    /** The name of the Java element. It is part of the Java element's ABI. */
    val name: String,

    /** The hash of the Java element's ABI. */
    val abiHash: Long
)

Response:
/**
 * [ClassSnapshot] of an inaccessible class.
 *
 * A class is inaccessible if it can't be referenced from other source files (and therefore any changes in an inaccessible class will not
 * require recompilation of other source files).
 */
data object InaccessibleClassSnapshot : ClassSnapshot()<|endoftext|>


Prompt:
var attributes: FirDeclarationAttributes = FirDeclarationAttributes()
    lateinit var name: Name
    lateinit var symbol: FirTypeParameterSymbol
    lateinit var containingDeclarationSymbol: FirBasedSymbol<*>
    lateinit var variance: Variance
    var isReified: Boolean by kotlin.properties.Delegates.notNull<Boolean>()

Response:
val bounds: MutableList<FirTypeRef> = mutableListOf()
    override val annotations: MutableList<FirAnnotation> = mutableListOf()

    override fun build(): FirTypeParameter {
        return FirTypeParameterImpl(
            source,
            resolvePhase,
            moduleData,
            origin,
            attributes,
            name,
            symbol,<|endoftext|>


Prompt:
target: BuildTarget<JavaSourceRootDescriptor>,
        dataPaths: BuildDataPaths?
    ): List<JavaSourceRootDescriptor> {
        val moduleBuildTarget = target as? ModuleBuildTarget ?: return listOf()
        val module = moduleBuildTarget.module

        val result = mutableListOf<JavaSourceRootDescriptor>()

Response:
// Add source roots with type KotlinSourceRootType.
        //
        // Note: `KotlinSourceRootType` cannot be supported directly, since `SourceRootDescriptors` are computed by
        // `ModuleBuildTarget.computeAllTargets`. `ModuleBuildTarget` is required for incremental compilation.<|endoftext|>


Prompt:
class RepeatableAnnotationChecker(
    private val languageVersionSettings: LanguageVersionSettings,
    private val jvmTarget: JvmTarget,
    private val platformAnnotationFeaturesSupport: JvmPlatformAnnotationFeaturesSupport,
    private val module: ModuleDescriptor,
) : AdditionalAnnotationChecker {
    override fun checkEntries(
        entries: List<KtAnnotationEntry>,

Response:
actualTargets: List<KotlinTarget>,
        trace: BindingTrace,
        annotated: KtAnnotated?,
        languageVersionSettings: LanguageVersionSettings
    ) {
        if (entries.isEmpty()) return

        val annotations = entries.mapNotNull { entry ->
            val descriptor = trace.get(BindingContext.ANNOTATION, entry)<|endoftext|>


Prompt:
return if (this in Short.MIN_VALUE.toFloat()..Short.MAX_VALUE.toFloat()) this.toInt().toShort() else null
}

/**
 * Returns a range from this value up to but excluding the specified [to] value.
 *
 * If the [to] value is less than or equal to `this` value, then the returned range is empty.
 */

Response:
public infix fun Int.until(to: Byte): IntRange {
    return this .. (to.toInt() - 1).toInt()
}

/**
 * Returns a range from this value up to but excluding the specified [to] value.
 *
 * If the [to] value is less than or equal to `this` value, then the returned range is empty.
 */<|endoftext|>


Prompt:
private fun FirRegularClassSymbol.toResolvedQualifierExpressionReceiver(source: KtSourceElement?): ExpressionReceiverValue {
        val resolvedQualifier = buildResolvedQualifier {
            packageFqName = classId.packageFqName
            relativeClassFqName = classId.relativeClassName
            this.symbol = this@toResolvedQualifierExpressionReceiver

Response:
this.source = source?.fakeElement(KtFakeSourceElementKind.ImplicitReceiver)
        }.apply {
            setTypeOfQualifier(bodyResolveComponents)
        }
        return ExpressionReceiverValue(resolvedQualifier)
    }

    // For static entries we may return here FirResolvedQualifier, wrapped in ExpressionReceiverValue<|endoftext|>


Prompt:
fun deserialize(annotation: ProtoConstructorCall): AbiQualifiedName {
                val idSignature = deserializeIdSignature(annotation.symbol)
                val annotationClassName = when {
                    idSignature is CommonSignature -> idSignature
                    idSignature is CompositeSignature && idSignature.container is FileSignature -> idSignature.inner as CommonSignature

Response:
else -> error("Unexpected annotation signature encountered: ${idSignature::class.java}, ${idSignature.render()}")
                }.extractQualifiedName { rawRelativeName ->
                    check(rawRelativeName.endsWith(INIT_SUFFIX)) {
                        "Annotation constructor name does not have '$INIT_SUFFIX' suffix: $rawRelativeName"
                    }<|endoftext|>


Prompt:
// FILE: test.kt
@file:JvmName("MultifileClass")
@file:JvmMultifileClass
<!ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES!>@file:JavaAnn<!>
<!ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES!>@file:JavaClassAnn<!>

Response:
@file:JavaSourceAnn

// FILE: JavaAnn.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface JavaAnn {
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.USE_JAVAC_BASED_ON_JVM_TARGET
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.services.*
import org.jetbrains.kotlin.test.services.jvm.compiledClassesManager

Response:
import org.jetbrains.kotlin.test.util.KtTestUtil
import java.io.File

class JavaCompilerFacade(private val testServices: TestServices) {
    fun compileJavaFiles(module: TestModule, configuration: CompilerConfiguration, classFileFactory: ClassFileFactory) {
        if (module.javaFiles.isEmpty()) return
        val javaClasspath =<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.parseAnalysisFlags
import org.jetbrains.kotlin.test.services.EnvironmentConfigurator
import org.jetbrains.kotlin.test.services.TestServices

Response:
class CommonEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) {
    override val directiveContainers: List<DirectivesContainer>
        get() = listOf(ConfigurationDirectives)

    override fun provideAdditionalAnalysisFlags(
        directives: RegisteredDirectives,
        languageVersion: LanguageVersion
    ): Map<AnalysisFlag<*>, Any?> {<|endoftext|>


Prompt:
o["modifierSymbol"] = modifierSymbol
    o["modifierSymbolLock"] = modifierSymbolLock
    o["view"] = view
    o["detail"] = detail
    o["bubbles"] = bubbles
    o["cancelable"] = cancelable
    o["composed"] = composed
    return o
}

/**

Response:
* Exposes the JavaScript [InputEvent](https://developer.mozilla.org/en/docs/Web/API/InputEvent) to Kotlin
 */
public external open class InputEvent(type: String, eventInitDict: InputEventInit = definedExternally) : UIEvent {
    open val data: String
    open val isComposing: Boolean

    companion object {
        val NONE: Short<|endoftext|>


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

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

/*
 * TESTCASE NUMBER: 3
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-22454
 */
fun case_3(y: Nothing?) {<|endoftext|>


Prompt:
interfaceKDoc = COMMON_COMPILER_OPTIONS_KDOC,
        )
    }

    println("\n### Attributes common for JVM and JS\n")
    generateMarkdown(commonCompilerOptions)

    return GeneratedOptions(commonCompilerInterfaceFqName, deprecatedCommonCompilerInterfaceFqName, commonCompilerOptions)
}

Response:
private fun generateKotlinCommonOptionsImpl(
    srcDir: File,
    commonOptionsInterfaceFqName: FqName,
    commonToolImpl: FqName,
    commonToolCompilerHelperName: FqName,
    options: List<KProperty1<*, *>>,
    withPrinterToFile: (targetFile: File, Printer.() -> Unit) -> Unit
): GeneratedImplOptions {<|endoftext|>


Prompt:
is FirPropertySymbol -> filterOutOverriddenProperties(directOverriddenMembersWithBaseScope as List<MemberWithBaseScope<FirPropertySymbol>>)
                    else -> directOverriddenMembersWithBaseScope
                }.map { it.member }

                val delegatedTo = delegatedWrapperData.wrapped.unwrapFakeOverrides().symbol

Response:
if (symbol.multipleDelegatesWithTheSameSignature == true) {
                    if (directOverriddenMembersWithBaseScope.isNotEmpty() &&
                        // We should report here if either 2+ members or single member with non-enhancement origin
                        directOverriddenMembersWithBaseScope.singleOrNull()?.member?.origin != FirDeclarationOrigin.Enhancement
                    ) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.analysis.checkers.getAllowedAnnotationTargets
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors
import org.jetbrains.kotlin.fir.declarations.toAnnotationClassId
import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef

Response:
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.types.isSomeFunctionType
import org.jetbrains.kotlin.name.StandardClassIds

object FirTypeAnnotationChecker : FirTypeRefChecker(MppCheckerKind.Common) {<|endoftext|>


Prompt:
// CHECK_LABELS_COUNT: function=test name=loop_0 count=1 IGNORED_BACKENDS=JS

fun test() {
    var i = 0
    var j = 0

    loop@ for (m in 1..10) {
        if (m == 4) break@loop
        j = m
    }

    loop@ for (k in 1..10) {

Response:
if (k == 4) break@loop
        i = k
    }

    assertEquals(3, j)
    assertEquals(3, i)
}

fun box(): String {
    test()

    return "OK"
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.project.structure.KtDanglingFileModule
import org.jetbrains.kotlin.analysis.project.structure.KtModule
import org.jetbrains.kotlin.analysis.project.structure.KtSourceModule
import org.jetbrains.kotlin.analysis.providers.createPackagePartProvider

Response:
import org.jetbrains.kotlin.fir.BuiltinTypes
import org.jetbrains.kotlin.fir.SessionConfiguration
import org.jetbrains.kotlin.fir.deserialization.SingleModuleDataProvider
import org.jetbrains.kotlin.fir.java.deserialization.OptionalAnnotationClassesProvider<|endoftext|>


Prompt:
expectedConeType.isByte -> this.toByte()
            expectedConeType.isShort -> this.toShort()
            expectedConeType.isLong -> this.toLong()
            else -> this
        }
    } else this
    return value.createConstantIfAny(session) ?: buildErrorExpression {

Response:
diagnostic = ConeSimpleDiagnostic("Unknown value in JavaLiteralAnnotationArgument: $this", DiagnosticKind.Java)
    }
}

internal fun Any?.createConstantIfAny(session: FirSession, unsigned: Boolean = false): FirExpression? {
    return when (this) {
        is Byte -> buildLiteralExpression(<|endoftext|>


Prompt:
}

    fun exitResolvedQualifierNode(resolvedQualifier: FirResolvedQualifier) {
        graphBuilder.exitResolvedQualifierNode(resolvedQualifier).mergeIncomingFlow()
    }

    fun enterCallArguments(call: FirStatement, arguments: List<FirExpression>) {
        val lambdas = arguments.mapNotNull { it.unwrapAnonymousFunctionExpression() }

Response:
graphBuilder.enterCall(lambdas.mapTo(mutableSetOf()) { it.symbol })
        context.variableAssignmentAnalyzer.enterFunctionCall(lambdas)
        graphBuilder.enterCallArguments(call, lambdas)?.mergeIncomingFlow()
    }

    fun exitCallArguments() {
        val (splitNode, exitNode) = graphBuilder.exitCallArguments()<|endoftext|>


Prompt:
@CheckersComponentInternal internal val allReturnExpressionCheckers: Set<FirReturnExpressionChecker> by lazy { returnExpressionCheckers + basicExpressionCheckers }
    @CheckersComponentInternal internal val allBlockCheckers: Set<FirBlockChecker> by lazy { blockCheckers + basicExpressionCheckers }

Response:
@CheckersComponentInternal internal val allAnnotationCheckers: Set<FirAnnotationChecker> by lazy { annotationCheckers + basicExpressionCheckers }
    @CheckersComponentInternal internal val allAnnotationCallCheckers: Set<FirAnnotationCallChecker> by lazy { annotationCallCheckers + annotationCheckers + basicExpressionCheckers + callCheckers }<|endoftext|>


Prompt:
@kotlin.jvm.JvmName(name = "sumOfULong")
@kotlin.ExperimentalUnsignedTypes
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})
@kotlin.internal.InlineOnly

Response:
public inline fun kotlin.ULongArray.sumOf(selector: (kotlin.ULong) -> kotlin.ULong): kotlin.ULong

@kotlin.SinceKotlin(version = "1.4")
@kotlin.OverloadResolutionByLambdaReturnType
@kotlin.jvm.JvmName(name = "sumOfDouble")<|endoftext|>


Prompt:
when (node.tokenType) {
                KtNodeTypes.SECONDARY_CONSTRUCTOR -> {
                    val valueParameterList = tree.valueParameterList(node)
                        ?: return markElement(node, startOffset, endOffset, tree)
                    return markRange(
                        tree.constructorKeyword(node)!!,
                        tree.lastChild(valueParameterList) ?: valueParameterList,

Response:
startOffset, endOffset, tree, node
                    )
                }
                KtNodeTypes.CONSTRUCTOR_DELEGATION_CALL -> {
                    val delegationReference = tree.findChildByType(node, KtNodeTypes.CONSTRUCTOR_DELEGATION_REFERENCE)
                    if (delegationReference != null && tree.firstChild(delegationReference) == null) {<|endoftext|>


Prompt:
fun test_error_1(base: Base) {
    val x = <!NO_ELSE_IN_WHEN!>when<!> (base) {
        is A -> 1
    }
}

fun test_error_2(base: Base) {
    val x = <!NO_ELSE_IN_WHEN!>when<!> (base) {
        is A -> 1

Response:
is B.C -> 2
    }
}

fun test_error_3(sameFile: SameFile) {
    val x = <!NO_ELSE_IN_WHEN!>when<!> (sameFile) {
        is SameFile.A -> 1
    }
}

fun test_error_4(sameFile: SameFile) {<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM
// LAMBDAS: CLASS
// WITH_REFLECT

package test

class C {
    val l: Any = {}
}

fun box(): String {
    val javaClass = C().l.javaClass
    val enclosingConstructor = javaClass.getEnclosingConstructor()

Response:
if (enclosingConstructor?.getDeclaringClass()?.getName() != "test.C") return "ctor: $enclosingConstructor"

    val enclosingClass = javaClass.getEnclosingClass()
    if (enclosingClass?.getName() != "test.C") return "enclosing class: $enclosingClass"<|endoftext|>


Prompt:
package org.jetbrains.kotlinx.jspo

import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
import org.jetbrains.kotlinx.jspo.runners.AbstractFirJsPlainObjectsIrJsBoxTest

Response:
import org.jetbrains.kotlinx.jspo.runners.AbstractFirJsPlainObjectsPluginDiagnosticTest

fun main(args: Array<String>) {
    generateTestGroupSuiteWithJUnit5(args) {
        testGroup(
            "plugins/js-plain-objects/compiler-plugin/tests-gen",<|endoftext|>


Prompt:
val fqName = if (packageName.isNotBlank()) FqName(packageName) else FqName.ROOT
        javac.hasKotlinPackage(fqName)?.let { return it }

        return javac.findPackage(fqName)?.fqName
    }

Response:
private fun JavaClass.findVisibleInnerOrNestedClass(name: Name) = findInnerClass(name)?.let { innerOrNestedClass ->
        when (innerOrNestedClass.visibility) {
            DescriptorVisibilities.PRIVATE -> null
            JavaDescriptorVisibilities.PACKAGE_VISIBILITY -> {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.commonizer.TargetDependent
import org.jetbrains.kotlin.commonizer.mergedtree.*
import org.jetbrains.kotlin.commonizer.toTargetDependent
import org.jetbrains.kotlin.commonizer.tree.CirTreeModule
import org.jetbrains.kotlin.commonizer.tree.CirTreeRoot

Response:
import org.jetbrains.kotlin.commonizer.utils.KtInlineSourceCommonizerTestCase
import org.jetbrains.kotlin.commonizer.utils.MockModulesProvider
import org.jetbrains.kotlin.storage.LockBasedStorageManager

abstract class AbstractMergeCirTreeTest : KtInlineSourceCommonizerTestCase() {<|endoftext|>


Prompt:
// FIR_IDENTICAL
fun foo(a: (String) -> Unit) {
    "".<!UNRESOLVED_REFERENCE!>a<!>()
}

interface A : (String) -> Unit {}
typealias AliasedEFT = ExtensionFunctionType

fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE!>@AliasedEFT<!> A) {

Response:
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
    // Only kotlin.Function{n} type annotated with @Extension should
    "".<!UNRESOLVED_REFERENCE!>a<!>()
}<|endoftext|>


Prompt:
<!FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS, FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS{METADATA}!>fun<!> interface F4 : I4 {}

// MODULE: jvm()()(common)
// FILE: main.kt
actual interface I1 {
    val a: Int
    fun foo()

Response:
}

actual interface I2 {
    fun foo()
    val a: Int
}

actual interface I3 {
    fun foo(a: Int = 0)
}

actual interface I4 {
    fun <T> foo()
}<|endoftext|>


Prompt:
val allForkPointsData = constraintsFromAllForkPoints.toList()
        constraintsFromAllForkPoints.clear()

        var result: ConstraintSystemError? = null
        runTransaction {
            for ((position, forkPointData) in allForkPointsData) {
                if (!applyConstraintsFromFirstSuccessfulBranchOfTheFork(forkPointData, position)) {

Response:
result = NoSuccessfulFork(position)
                    break
                }
            }

            false
        }

        constraintsFromAllForkPoints.addAll(allForkPointsData)

        return result
    }

    /**
     * @return true if there is a successful constraints set for the fork
     */
    private fun applyConstraintsFromFirstSuccessfulBranchOfTheFork(<|endoftext|>


Prompt:
false -> DeprecationInfo(inheritedDeprecations, hasInheritedDeprecations = true)
                    }
                    false -> DeprecationInfo.EMPTY
                }
            }
            else -> DeprecationInfo.EMPTY
        }
    }

    private data class DeprecationInfo(
        val deprecations: List<DescriptorBasedDeprecationInfo>,

Response:
val hasInheritedDeprecations: Boolean,
        val hiddenInheritedDeprecations: List<DescriptorBasedDeprecationInfo> = emptyList()
    ) {
        companion object {
            val EMPTY = DeprecationInfo(emptyList(), hasInheritedDeprecations = false, emptyList())
        }
    }<|endoftext|>


Prompt:
/* Ensure that the problematic androidTest/kotlin source dir is 'in use' */
        val androidTestKotlinSourceDir = project.file("src/androidTest/kotlin")
        androidTestKotlinSourceDir.mkdirs()
        project.evaluate()

        /* Invoke checkers on all source sets */
        project.checkCreatedSourceSets()

Response:
project.checkDiagnostics("kt53709AndroidTest_kotlinInUse")
    }

    @Test
    fun `test - android style source dir usage checker`() {
        val project = buildMinimalAndroidMultiplatformProject()
        val androidStyleMain = project.file("src/main/kotlin")
        val androidStyleUnitTest = project.file("src/test/kotlin")<|endoftext|>


Prompt:
internal fun printFactory(generationPath: File, model: Model): GeneratedFile = printGeneratedType(
    generationPath,
    TREE_GENERATOR_README,
    irFactoryType.packageName,
    irFactoryType.simpleName,
) {
    println("interface ", irFactoryType.simpleName, " {")
    withIndent {
        println("val stageController: ", stageControllerType.render())

Response:
val factoryMethods = model.elements
            .filter { it.implementations.isNotEmpty() && it.generateIrFactoryMethod }
            .sortedWith(compareBy({ it.packageName }, { it.name }))
            .map(::FactoryMethod)

        factoryMethods.forEach { printFactoryMethod(it) }
    }
    println("}")
}<|endoftext|>


Prompt:
val structPointerFromPosix = getStructPointerFromPosix()

    object MyStruct {
        val struct = getMyStructPointer()?.pointed ?: error("Missing my struct")
        val posixProperty: stat = struct.posixProperty
        val longProperty: Long = struct.longProperty
        val doubleProperty: Double = struct.doubleProperty

Response:
val int32tProperty: Int = struct.int32tProperty
        val int64TProperty: Long = struct.int64tProperty
        val linuxOnlyProperty: Boolean = struct.linuxOnlyProperty
    }
}<|endoftext|>


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

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


Prompt:
actualTargets: List<KotlinTarget>,
        trace: BindingTrace,
        annotated: KtAnnotated?,
        languageVersionSettings: LanguageVersionSettings
    ) {
        if (entries.isEmpty()) return

        val annotations = entries.mapNotNull { entry ->
            val descriptor = trace.get(BindingContext.ANNOTATION, entry)

Response:
val useSiteTarget = entry.useSiteTarget?.getAnnotationUseSiteTarget()
            if (descriptor != null) {
                ResolvedAnnotation(entry, descriptor, useSiteTarget)
            } else null
        }

        checkRepeatedEntries(annotations, trace)<|endoftext|>


Prompt: val x = <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION_BASED_ON_JAVA_ANNOTATIONS!>A3<Int?>()<!> // TODO: support reporting errors on typealias constructor calls

Response: val x2 = <!UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION_BASED_ON_JAVA_ANNOTATIONS!>A<Int?>()<!> // TODO: support reporting errors on typealias constructor calls<|endoftext|>


Prompt:
fun containingFileIfAny(): IrFile? = parentStack.getOrNull(0) as? IrFile

    inline fun withContainingFirClass(containingFirClass: FirClass, f: () -> Unit) {
        containingFirClassStack += containingFirClass
        try {
            f()
        } finally {
            containingFirClassStack.removeAt(containingFirClassStack.size - 1)

Response:
}
    }

    fun parentFromStack(): IrDeclarationParent = parentStack.last()

    fun scope(): Scope = scopeStack.last()

    fun parentAccessorOfPropertyFromStack(propertySymbol: IrPropertySymbol): IrSimpleFunction {
        // It is safe to access an owner of property symbol here, because this function may be called
        // only from property accessor of corresponding property<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any? & kotlin.Pair<*, *>")!>x<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Pair<*, *>"), DEBUG_INFO_SMARTCAST!>x<!>.first
}

Response:
// TESTCASE NUMBER: 12
fun case_12(x: Any?) {
    when {
        x !is Pair<*, *>? -> return
        else -> {
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Pair<*, *>?")!>x<!><|endoftext|>


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

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

Response:
transformAnnotations(transformer, data)
        expression = expression.transform(transformer, data)
        return this
    }

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


Prompt:
val result = ArrayList<R>(size)
    for (index in 0 until size) {
        result.add(transform(this[index], this[index + 1]))
    }
    return result
}

/**
 * Creates an [Iterable] instance that wraps the original char sequence returning its characters when being iterated.
 */
public fun CharSequence.asIterable(): Iterable<Char> {

Response:
if (this is String && isEmpty()) return emptyList()
    return Iterable { this.iterator() }
}

/**
 * Creates a [Sequence] instance that wraps the original char sequence returning its characters when being iterated.
 */
public fun CharSequence.asSequence(): Sequence<Char> {
    if (this is String && isEmpty()) return emptySequence()
    return Sequence { this.iterator() }<|endoftext|>


Prompt:
override var onloadedmetadata: ((Event) -> Unit)?
    override var onloadend: ((Event) -> Unit)?
    override var onloadstart: ((ProgressEvent) -> Unit)?
    override var onmousedown: ((MouseEvent) -> Unit)?
    override var onmouseenter: ((MouseEvent) -> Unit)?
    override var onmouseleave: ((MouseEvent) -> Unit)?

Response:
override var onmousemove: ((MouseEvent) -> Unit)?
    override var onmouseout: ((MouseEvent) -> Unit)?
    override var onmouseover: ((MouseEvent) -> Unit)?
    override var onmouseup: ((MouseEvent) -> Unit)?
    override var onwheel: ((WheelEvent) -> Unit)?
    override var onpause: ((Event) -> Unit)?<|endoftext|>


Prompt:
override fun getStyle() = Tokens.Comment.CommentStyle.JAVADOC
    override fun getText() = body
    override fun isDeprecated() = false
}

private class KaptDocCommentTable(map: Map<JCTree, Tokens.Comment> = emptyMap()) : DocCommentTable {
    private val table = map.toMutableMap()

Response:
val map: Map<JCTree, Tokens.Comment>
        get() = table

    override fun hasComment(tree: JCTree) = tree in table
    override fun getComment(tree: JCTree) = table[tree]
    override fun getCommentText(tree: JCTree) = getComment(tree)?.text<|endoftext|>


Prompt: uu = 24, vv = 23, ww = 22, xx = 21, yy = 20, zz = 19, aaa = 18, bbb = 17, ccc = 16, ddd = 15, eee = 14, fff = 13,

Response: ggg = 12, hhh = 11, iii = 10, jjj = 9, kkk = 8, lll = 7, mmm = 6, nnn = 5, ooo = 4, ppp = 3, qqq = 2, rrr = 1).toString()<|endoftext|>


Prompt:
private fun findClassifierQualifierToShorten(
        wholeQualifierClassId: ClassId,
        wholeQualifierElement: KtElement,
    ): ElementToShorten? {
        val positionScopes = shorteningContext.findScopesAtPosition(
            wholeQualifierElement,
            getNamesToImport(),
            towerContextProvider,
            withImplicitReceivers = false,

Response:
) ?: return null

        val allClassIds = wholeQualifierClassId.outerClassesWithSelf
        val allQualifiedElements = wholeQualifierElement.qualifiedElementsWithSelf

        for ((classId, element) in allClassIds.zip(allQualifiedElements)) {
            if (!element.inSelection) continue<|endoftext|>


Prompt:
CallableId.PACKAGE_FQ_NAME_FOR_LOCAL
        } else {
            context.packageFqName
        }

        return if (context.className == FqName.ROOT) {
            CallableId(packageName, Name.special("<anonymous-init>"))
        } else {

Response:
CallableId(packageName, context.className, context.className.shortName())
        }
    }

    /**** Function utils ****/
    fun <T> MutableList<T>.removeLast(): T {
        return removeAt(size - 1)
    }

    fun <T> MutableList<T>.pop(): T? {
        val result = lastOrNull()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.fileClasses.JvmFileClassInfo
import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil
import org.jetbrains.kotlin.fileClasses.JvmMultifileClassPartInfo

Response:
import org.jetbrains.kotlin.fileClasses.JvmSimpleFileClassInfo
import org.jetbrains.kotlin.ir.PsiIrFileEntry
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.IrConst<|endoftext|>


Prompt:
when (this) {
                is IrFunctionAccessExpression -> {
                    if (function.isExternal) {
                        // External functions may have the default arguments declared in native implementations,
                        // which are not available from Kotlin.
                        return null
                    } else if (this is IrEnumConstructorCall && (function.parent as? IrClass)?.symbol == builtIns.enumClass) {

Response:
// This is a special case. IrEnumConstructorCall don't contain arguments.
                        return null
                    }
                }
                is IrFunctionReference -> {
                    // Function references don't contain arguments.
                    return null
                }
            }

            // Default values are not kept in value parameters of fake override/delegated/override functions.
            // So we need to look up for default value across all overridden functions.<|endoftext|>


Prompt:
AnnotatedCallableKind.PROPERTY, AnnotatedCallableKind.PROPERTY_GETTER, AnnotatedCallableKind.PROPERTY_SETTER -> {
                    protocol.propertyExtensionReceiverAnnotation?.let { proto.getExtension(it) }
                }
                else -> error("Unsupported callable kind with property proto for receiver annotations: $kind")
            }

Response:
else -> error("Unknown message: $proto")
        }.orEmpty()
        return annotations.map { annotationProto ->
            loadAnnotation(annotationProto, container.nameResolver)
        }
    }

    override fun loadTypeAnnotations(proto: ProtoBuf.Type, nameResolver: NameResolver): List<A> {<|endoftext|>


Prompt:
// WITH_STDLIB

import kotlin.test.*

interface I {
    inline class IC(val x: Int)
}

interface I2 {
    inline class IC(val x: Int)
}

fun box(): String {
    assertEquals(42, I.IC(42).x)
    assertEquals(117, I2.IC(117).x)

    return "OK"

Response: }<|endoftext|>


Prompt:
val CXIndexOpt_IndexFunctionLocalSymbols: CXIndexOptFlags get() = 2

val CXIndexOpt_IndexImplicitTemplateInstantiations: CXIndexOptFlags get() = 4

val CXIndexOpt_SuppressWarnings: CXIndexOptFlags get() = 8

val CXIndexOpt_SkipParsedBodiesInSession: CXIndexOptFlags get() = 16

Response:
typealias CXIndexOptFlagsVar = IntVarOf<CXIndexOptFlags>

typealias CXIndexOptFlags = Int
private external fun kniBridge0(p0: NativePtr): NativePtr
private external fun kniBridge1(p0: NativePtr): Unit
private external fun kniBridge2(p0: NativePtr): Unit
private external fun kniBridge3(): Long<|endoftext|>


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

fun two() = 2

fun box(): String {
    val uintList = mutableListOf<UInt>()
    val uintProgression = 1u..8u
    for (i in uintProgression step two()) {
        uintList += i
    }

Response:
assertEquals(listOf(1u, 3u, 5u, 7u), uintList)

    val ulongList = mutableListOf<ULong>()
    val ulongProgression = 1uL..8uL
    for (i in ulongProgression step two().toLong()) {
        ulongList += i
    }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.analysis.api.types

public enum class KtTypeMappingMode {
    /**
     * kotlin.Int is mapped to I
     */
    DEFAULT,

    /**
     * kotlin.Int is mapped to I
     * Type aliases are mapped to their expanded form
     */
    DEFAULT_UAST,

    /**

Response:
* kotlin.Int is mapped to Ljava/lang/Integer;
     */
    GENERIC_ARGUMENT,

    /**
     * kotlin.Int is mapped to Ljava/lang/Integer;
     * No projections allowed in immediate arguments
     */
    SUPER_TYPE,

    /**
     * Similar to [SUPER_TYPE], except for that Kotlin collections remain as-is.<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM

// WITH_REFLECT
// FULL_JDK

import java.lang.reflect.GenericArrayType
import java.lang.reflect.ParameterizedType
import kotlin.reflect.KClass
import kotlin.reflect.jvm.javaType
import kotlin.test.assertEquals
import kotlin.test.assertTrue

annotation class Z
enum class E

Response:
annotation class Anno(
        val b: Byte,
        val s: String,
        val ss: Array<String>,
        val z: Z,
        val zs: Array<Z>,
        val e: E,
        val es: Array<E>,
        val k: KClass<*>,
        val ka: Array<KClass<*>>
)<|endoftext|>


Prompt:
// Setup a task that will abort the build if errors will be reported. This task should be the first in the taskgraph
    project.locateOrRegisterCheckKotlinGradlePluginErrorsTask()

    // Schedule diagnostics rendering
    launch {
        configurationResult.await()
        renderReportedDiagnostics(
            collectorProvider.get().getDiagnosticsForProject(project),
            logger,

Response:
diagnosticRenderingOptions
        )
    }

    // Schedule switching of Collector to transparent mode, so that any diagnostics reported
    // after projects are evaluated will be transparently rendered right away instead of being
    // silently swallowed
    gradle.projectsEvaluated {
        collectorProvider.get().switchToTransparentMode()
    }
}<|endoftext|>


Prompt:
}

    init {
        X().A_X()
        X().<!UNRESOLVED_REFERENCE!>T_X<!>()

        Y().A_C_Y()
        Y().<!UNRESOLVED_REFERENCE!>T_Y<!>()
    }
}

class B: A() {
    init {
        X().A_X()

Response:
X().<!UNRESOLVED_REFERENCE!>T_X<!>()

        <!DEPRECATED_ACCESS_BY_SHORT_NAME!>Y()<!>.A_C_Y()
        <!DEPRECATED_ACCESS_BY_SHORT_NAME!>Y()<!>.<!UNRESOLVED_REFERENCE!>T_Y<!>()<|endoftext|>


Prompt:
ScriptDiagnostic.unspecifiedError, message, mapLegacyDiagnosticSeverity(severity), null, mapLegacyScriptPosition(position)
    )
}

fun Iterable<ScriptDiagnostic>.mapToLegacyReports(): List<ScriptReport> = map { (_, message, severity, _, location, exception) ->
    val reportMessage = if (exception == null) message else "$message ($exception)"

Response:
ScriptReport(reportMessage, mapToLegacyScriptReportSeverity(severity), mapToLegacyScriptReportPosition(location))
}<|endoftext|>


Prompt:
if (isEmpty()) throw NoSuchElementException()
    var minValue = selector(this[0])
    for (i in 1..lastIndex) {
        val v = selector(this[i])
        if (comparator.compare(minValue, v) > 0) {
            minValue = v
        }
    }
    return minValue
}

/**

Response:
* Returns the smallest value according to the provided [comparator]
 * among all values produced by [selector] function applied to each element in the array.
 *
 * @throws NoSuchElementException if the array is empty.
 */
@SinceKotlin("1.4")
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType<|endoftext|>


Prompt:
REMOVE_DEBUG_INFO_OPTION,
            REMOVE_DATA_CLASS_COPY_IF_CONSTRUCTOR_IS_PRIVATE_OPTION,
            PRESERVE_DECLARATION_ORDER_OPTION,
            REMOVE_PRIVATE_CLASSES_OPTION,
            TREAT_INTERNAL_AS_PRIVATE_OPTION,
        )

Response:
override fun processOption(option: AbstractCliOption, value: String, configuration: CompilerConfiguration) {
        when (option) {
            OUTPUT_PATH_OPTION -> configuration.put(JvmAbiConfigurationKeys.OUTPUT_PATH, value)
            REMOVE_DEBUG_INFO_OPTION -> configuration.put(JvmAbiConfigurationKeys.REMOVE_DEBUG_INFO, value == "true")<|endoftext|>


Prompt:
// WITH_STDLIB

// FILE: test.kt
fun box(): String {
    val p = Triple("X","O","K")

    val ( _ , o, k ) = p

    return o + k
}

// EXPECTATIONS JVM_IR
// test.kt:5 box:
// test.kt:7 box: p:kotlin.Triple=kotlin.Triple

Response:
// test.kt:9 box: p:kotlin.Triple=kotlin.Triple, o:java.lang.String="O":java.lang.String, k:java.lang.String="K":java.lang.String

// EXPECTATIONS JS_IR
// test.kt:5 box:
// test.kt:7 box: p=kotlin.Triple<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.plugin.createConstructor
import org.jetbrains.kotlin.fir.plugin.createMemberFunction
import org.jetbrains.kotlin.fir.plugin.createNestedClass
import org.jetbrains.kotlin.fir.plugin.fqn

Response:
import org.jetbrains.kotlin.fir.types.constructStarProjectedType
import org.jetbrains.kotlin.fir.symbols.impl.*
import org.jetbrains.kotlin.name.CallableId
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames

/*<|endoftext|>


Prompt:
// Load declarations referenced during `context` initialization
        loadedIr.loadUnboundSymbols()

        val dirtyFiles = dirtyFileExports.entries.associateTo(newHashMapWithExpectedSize(dirtyFileExports.size)) {
            it.key to HashSet(it.value.keys)
        }

        stopwatch.startNext("Processing IR - updating intrinsics and builtins dependencies")

Response:
updater.updateStdlibIntrinsicDependencies(loadedIr, mainModuleFragment, dirtyFiles)

        stopwatch.startNext("Incremental cache - building artifacts")
        val incrementalCachesArtifacts = updater.buildAndCommitCacheArtifacts(loadedIr)

        stopwatch.stop()<|endoftext|>


Prompt:
var value_2: Int

    try {
        funWithAtLeastOnceCallsInPlace { value_2 = 10 }
    } catch (e: Exception) {
        funWithExactlyOnceCallsInPlace { value_2 = 1 }
    }

    value_2++
}

// TESTCASE NUMBER: 6
fun case_6() {
    var value_2: Int

Response:
try {
        funWithAtLeastOnceCallsInPlace { value_2 = 10 }
    } catch (e: Exception) {
        throw Exception()
    } finally {
        funWithAtLeastOnceCallsInPlace { value_2 = 10 }
    }

    value_2++
}

// TESTCASE NUMBER: 7
fun case_7() {
    var value_1: Int<|endoftext|>


Prompt:
open class l : <!UNRESOLVED_REFERENCE!>FromBeta<!>()
    open class m : <!UNRESOLVED_REFERENCE!>FromGamma<!>()

    // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses

Response:
open class o : <!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>()
    open class p : <!UNRESOLVED_REFERENCE!>FromCompanionBeta<!>()
    open class q : <!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>()

    // DEPRECATED: Classifiers from supertypes of our own companion<|endoftext|>


Prompt:
else -> error("Unknown Apple family: ${target.family}")
            }
            contents.append("""
                |    <key>DTXcode</key>
                |    <string>1500</string>
                |    <key>DTXcodeBuild</key>
                |    <string>15A240d</string>
                |    <key>DTSDKBuild</key>

Response:
|    <string>$sdkBuild</string>
                |    <key>DTPlatformBuild</key>
                |    <string>$sdkBuild</string>

            """.trimMargin())
        }

        contents.append("""
            </dict>
            </plist>
        """.trimIndent())

        return contents.toString()
    }<|endoftext|>


Prompt:
// If referencedSymbol is null, it means the reference goes to a package.
            val parent = expression.parent as? KtDotQualifiedExpression ?: return emptyList()
            val fqNameSegments =
                when (expression) {
                    parent.selectorExpression -> parent.fqNameSegments() ?: return emptyList()

Response:
parent.receiverExpression -> listOf(expression.getReferencedName())
                    else -> return emptyList()
                }
            return listOfNotNull(symbolBuilder.createPackageSymbolIfOneExists(FqName.fromSegments(fqNameSegments)))
        }
        val referencedClass = referencedSymbol.fir<|endoftext|>


Prompt:
is ClassDescriptor -> computeClassInternalName(declaration) ?: computeSupertypeInternalName(declaration)
            else -> error("Unexpected declaration type: $declaration")
        }
    }

    private fun computeClassInternalName(descriptor: ClassDescriptor): String? {
        val selfName = descriptor.name.takeIf { !it.isSpecial } ?: return null

Response:
return when (val parent = descriptor.containingDeclaration) {
            is PackageFragmentDescriptor -> {
                val packageInternalName = parent.fqName.asString().replace('.', '/')
                "$packageInternalName/$selfName"
            }
            is ClassDescriptor -> {
                val parentInternalName = computeClassInternalName(parent)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.platform.isJs
import org.jetbrains.kotlin.platform.isWasm
import org.jetbrains.kotlin.platform.jvm.isJvm

private class CaptureCollector {

Response:
val captures = mutableSetOf<IrValueDeclaration>()
    val capturedDeclarations = mutableSetOf<IrSymbolOwner>()
    val hasCaptures: Boolean get() = captures.isNotEmpty() || capturedDeclarations.isNotEmpty()

    fun recordCapture(local: IrValueDeclaration) {
        captures.add(local)
    }<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER

import kotlin.reflect.KProperty1

class Sample(val str: String)

class Inv<T>

class Form {
    operator fun <F> get(field: KProperty1<*, F>): Inv<F> = TODO()
}

Response:
fun <K> foo(i: Inv<K>) {}

fun test(f: Form) {
    foo(f[Sample::str])
}<|endoftext|>


Prompt:
BLUE(0x0000FF)
}

enum class Color1(var rgb: Int) {
    RED(0xFF0000),
    GREEN(0x00FF00),
    BLUE(0x0000FF);

    init { this.rgb += 1 }
}

@MyThreadLocal
var a = 3
enum class Color2() {
    RED(),
    GREEN(),
    BLUE();

Response:
var rgb: Int = 2
        set(value: Int) {
            a = value
        }
}

enum class Color3() {
    RED(),
    GREEN(),
    BLUE();

    var field1: Int by Delegate()
}

enum class Color4 {
    RED {
        var a = 2
        override fun foo() { a = 42 }
    },
    GREEN,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.checkers.OptInNames.SUBCLASS_OPT_IN_REQUIRED_FQ_NAME
import org.jetbrains.kotlin.resolve.checkers.OptInNames.OPT_IN_ANNOTATION_CLASS

Response:
import org.jetbrains.kotlin.resolve.checkers.OptInNames.WAS_EXPERIMENTAL_FQ_NAME
import org.jetbrains.kotlin.resolve.constants.ArrayValue
import org.jetbrains.kotlin.resolve.constants.EnumValue
import org.jetbrains.kotlin.resolve.constants.KClassValue<|endoftext|>


Prompt:
*/
    val startOffset: Int

    /**
     * The end offset of the syntax node from which this IR node was generated,
     * in number of characters from the start of the source file. If there is no source information for this IR node,
     * the [UNDEFINED_OFFSET] constant is used. In order to get the line number and the column number from this offset,

Response:
* [IrFileEntry.getLineNumber] and [IrFileEntry.getColumnNumber] can be used.
     *
     * @see IrFileEntry.getSourceRangeInfo
     */
    val endOffset: Int

    /**
     * Runs the provided [visitor] on the IR subtree with the root at this node.
     *
     * @param visitor The visitor to accept.<|endoftext|>


Prompt:
"LOCAL_VARIABLE" to EnumSet.of(KotlinTarget.LOCAL_VARIABLE),
        "PARAMETER" to EnumSet.of(KotlinTarget.VALUE_PARAMETER),
        "CONSTRUCTOR" to EnumSet.of(KotlinTarget.CONSTRUCTOR),

Response:
"METHOD" to EnumSet.of(KotlinTarget.FUNCTION, KotlinTarget.PROPERTY_GETTER, KotlinTarget.PROPERTY_SETTER),
        "TYPE_USE" to EnumSet.of(KotlinTarget.TYPE)
    )<|endoftext|>


Prompt:
if (element14 in charSequence.indices != range0.contains(element14)) throw AssertionError()
    if (element14 !in charSequence.indices != !range0.contains(element14)) throw AssertionError()
    if (!(element14 in charSequence.indices) != !range0.contains(element14)) throw AssertionError()

Response:
if (!(element14 !in charSequence.indices) != range0.contains(element14)) throw AssertionError()
}

fun testR0xE15() {
    // with possible local optimizations
    if (2L in charSequence.indices != range0.contains(2L)) throw AssertionError()<|endoftext|>


Prompt:
binOp(intrinsics.jsBitShiftRU, JsBinaryOperator.SHRU)
            binOp(intrinsics.jsBitShiftL, JsBinaryOperator.SHL)

            binOp(intrinsics.jsInstanceOf, JsBinaryOperator.INSTANCEOF)

Response:
binOp(intrinsics.jsIn, JsBinaryOperator.INOP)

            prefixOp(intrinsics.jsTypeOf, JsUnaryOperator.TYPEOF)

            add(intrinsics.jsIsEs6) { _, _ -> JsBooleanLiteral(backendContext.es6mode) }<|endoftext|>


Prompt:
assertOutputContains(USING_JVM_INCREMENTAL_COMPILATION_MESSAGE)
            }

            build(
                "assemble",
                buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.LIFECYCLE)
            ) {
                assertOutputDoesNotContain(USING_JVM_INCREMENTAL_COMPILATION_MESSAGE)

Response:
}
        }
    }

    @DisplayName("Conversion between Kotlin and Java")
    @GradleTest
    fun testConvertJavaToKotlin(gradleVersion: GradleVersion) {
        project("convertBetweenJavaAndKotlin", gradleVersion) {
            val barKt = javaSourcesDir().resolve("foo/Bar.kt")<|endoftext|>


Prompt:
@Retention(value = AnnotationRetention.BINARY)
internal annotation class InternalForKotlinNative

/**
 * Marks a class that has a freeze hook.
 */
@Target(AnnotationTarget.CLASS)
@FreezingIsDeprecated
internal annotation class HasFreezeHook

/**
 * Indicates that calls of this function will be replaced with calls to the

Response:
* [callee] implemented in the C++ part of the runtime.
 *
 * This annotation is unsafe and should be used with care: [callee] is
 * responsible for correct interaction with the garbage collector, like
 * placing safe points and switching thread state when using blocking APIs.
 */
@Target(AnnotationTarget.FUNCTION)
@Retention(value = AnnotationRetention.BINARY)<|endoftext|>


Prompt:
"${env["HOSTNAME"]}${env["COMPUTERNAME"]}"
}

fun anonymizeComponentVersion(version: String): String {
    val parts = version.toLowerCase().replace('-', '.')
        .split(".")
        .plus(listOf("0", "0", "0")) // pad with zeros
        .take(4)

Response:
val mainVersion = parts.take(3).map { s -> s.toIntOrNull()?.toString() ?: "0" }

    val suffix = when {
        parts[3].matches("(rc|m|beta)\\d{0,1}".toRegex()) -> "-${parts[3]}"<|endoftext|>


Prompt:
firFile.accept(object : FirVisitorVoid() {
                override fun visitElement(element: FirElement) {
                    val psi = element.psi as? KtElement
                    if (psi != null) {
                        psiSetViaFir += psi
                    }
                    element.acceptChildren(this)
                }
            })

Response:
ktFile.accept(object : KtTreeVisitor<Nothing?>() {
                override fun visitKtElement(element: KtElement, data: Nothing?): Void? {
                    psiSetDirect += element
                    return super.visitKtElement(element, data)
                }
            })
            psiSetDirect -= psiSetViaFir<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("((() -> kotlin.Unit) -> kotlin.Unit)? & (() -> kotlin.Unit) -> kotlin.Unit")!>a<!>.funNullableAny()

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("(() -> kotlin.Unit)? & () -> kotlin.Unit"), DEBUG_INFO_SMARTCAST!>b<!>.equals(null)
        <!DEBUG_INFO_EXPRESSION_TYPE("(() -> kotlin.Unit)? & () -> kotlin.Unit"), DEBUG_INFO_SMARTCAST!>b<!>.propT<|endoftext|>


Prompt:
* Generated from: [org.jetbrains.kotlin.fir.tree.generator.FirTreeBuilder.callableDeclaration]
 */
sealed class FirCallableDeclaration : FirMemberDeclaration() {
    abstract override val source: KtSourceElement?
    abstract override val annotations: List<FirAnnotation>
    abstract override val moduleData: FirModuleData

Response:
abstract override val origin: FirDeclarationOrigin
    abstract override val attributes: FirDeclarationAttributes
    abstract override val typeParameters: List<FirTypeParameterRef>
    abstract override val status: FirDeclarationStatus
    abstract val returnTypeRef: FirTypeRef
    abstract val receiverParameter: FirReceiverParameter?
    abstract val deprecationsProvider: DeprecationsProvider<|endoftext|>


Prompt:
value class F3(val x: F1, val y: F2)

@JvmInline
value class F4(val x: Int)

@JvmInline
value class F5(val x: UInt)

@JvmInline
value class F6(val x: String)

@JvmInline
value class A(
    val f1: F1,

Response:
val f2: F2,
    val f3: F3,
    val f4: F4,
    val f5: F5,
    val f6: F6,
    val f7: Int,
    val f8: UInt,
    val f9: String,
)

@JvmInline
value class B(val a1: A, val a2: A) {<|endoftext|>


Prompt:
if (element4 in emptyCharSequence.indices != range1.contains(element4)) throw AssertionError()
    if (element4 !in emptyCharSequence.indices != !range1.contains(element4)) throw AssertionError()
    if (!(element4 in emptyCharSequence.indices) != !range1.contains(element4)) throw AssertionError()

Response:
if (!(element4 !in emptyCharSequence.indices) != range1.contains(element4)) throw AssertionError()
}

fun testR1xE5() {
    // with possible local optimizations
    if (0.toShort() in emptyCharSequence.indices != range1.contains(0.toShort())) throw AssertionError()<|endoftext|>


Prompt: 0x0011, 0x0009, 0x0005, 0x0006, 0x7084, 0x0018, 0x4624, 0x6b46, 0x0005, 0x0006, 0x0004, 0x0006, 0x10c6, 0x0086, 0x0006, 0x0011, 0x0018, 0x0011,

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


Prompt:
irCall(symbols.interopObjCObjectRawValueGetter).apply {
                extensionReceiver = receiver
            }
}

/**
 * Lowers some interop intrinsic calls.
 */
private class InteropLoweringPart2(val generationState: NativeGenerationState) : FileLoweringPass {
    override fun lower(irFile: IrFile) {

Response:
val transformer = InteropTransformer(generationState, irFile)
        irFile.transformChildrenVoid(transformer)

        while (transformer.newTopLevelDeclarations.isNotEmpty()) {
            val newTopLevelDeclarations = transformer.newTopLevelDeclarations.toList()
            transformer.newTopLevelDeclarations.clear()<|endoftext|>


Prompt:
if (c != null || <!SENSELESS_COMPARISON!>this.c != null<!>) this.c.funNullableT()
        if (c != null || <!SENSELESS_COMPARISON!>this.c != null<!>) this.c.funNullableAny()

Response:
if (c != null || <!SENSELESS_COMPARISON!>this.c != null<!>) this.c

        if (d != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>d<!>.equals(null)<|endoftext|>


Prompt:
fun buildImports(): List<String> = importedNameToPkg.mapNotNull { (name, pkg) ->
        if (pkg == "kotlin" || pkg == "kotlinx.cinterop") {
            // Is already imported either by default or with '*':
            null
        } else {
            "import $pkg.${name.asSimpleName()}"
        }

Response:
}.sorted()

}

internal fun getTopLevelPropertyDeclarationName(scope: KotlinScope, property: PropertyStub): String {
    val receiverName = property.receiverType?.underlyingTypeFqName
    return getTopLevelPropertyDeclarationName(scope, receiverName, property.name)
}

// Try to use the provided name. If failed, mangle it with underscore and try again:<|endoftext|>


Prompt:
build("assemble")

            testAddDependencyInLib_modifyProject()

            build("assemble") {
                assertTasksExecuted(":lib:$compileKotlinTaskName")
                assertTasksUpToDate(":app:$compileKotlinTaskName")
                assertCompiledKotlinSources(

Response:
subProject("lib").projectPath.resolve("src").allKotlinSources.relativizeTo(projectPath),
                    output
                )
            }
        }
    }

    @DisplayName("ABI change in lib after lib clean")
    @GradleTest
    override fun testAbiChangeInLib_afterLibClean(gradleVersion: GradleVersion) {<|endoftext|>


Prompt:
<!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>ENTRY2;<!>
    constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())
    constructor() : this(UserKlass(), UserKlass())
}

Response:
enum class EnumerationAEC(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {
    <!ENUM_ENTRY_SHOULD_BE_INITIALIZED!>ENTRY1,<!>
    ENTRY2();
    constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())<|endoftext|>


Prompt:
assertTrue(arg1("").zipWithNext { a: Char, b: Char -> a.toString() + b }.isEmpty())
        assertTrue(arg1("a").zipWithNext { a: Char, b: Char -> a.toString() + b }.isEmpty())
    }

    @Test fun zipWithNextPairs() = withOneCharSequenceArg { arg1 ->

Response:
assertEquals(listOf('a' to 'b', 'b' to 'c'), arg1("abc").zipWithNext())
        assertTrue(arg1("").zipWithNext().isEmpty())
        assertTrue(arg1("a").zipWithNext().isEmpty())
    }

    @Test
    fun chunked() = withOneCharSequenceArg { arg1 ->
        val size = 7<|endoftext|>


Prompt:
is ConeUnmatchedTypeArgumentsError ->
                ErrorClassTypeQualifierBuilder.createQualifiersForUnmatchedTypeArgumentsType(coneDiagnostic, builder)
            else -> error("Unsupported ${coneDiagnostic::class}")
        }
    }

    override val nullability: KtTypeNullability get() = withValidityAssertion { coneType.nullability.asKtNullability() }

Response:
override val errorMessage: String get() = withValidityAssertion { coneDiagnostic.reason }

    override val annotationsList: KtAnnotationsList by cached {
        KtFirAnnotationListForType.create(coneType, builder)
    }

    override val candidateClassSymbols: Collection<KtClassLikeSymbol> by cached {<|endoftext|>


Prompt:
fun box(): String {
    val f = object : Foo() {}
    val f2 = object : Foo(2) {}
    val b = object : Bar() {}

    f.args.let { if (it != "1") return "Fail 1: $it" }
    f2.args.let { if (it != "2") return "Fail 2: $it" }

Response:
TF.args.let { if (it != "1") return "Fail 3: $it" }
    TF2.args.let { if (it != "2") return "Fail 4: $it" }
    b.args.let { if (it != "1") return "Fail 5: $it" }
    b.baseArgs.let { if (it != "1") return "Fail 6: $it" }<|endoftext|>


Prompt:
fun createCompilerJvmOptions(): KotlinJvmCompilerOptions

    /**
     * Creates a Kotlin compile task.
     */
    @Deprecated(
        message = "Replaced by registerKotlinJvmCompileTask with module name",
        replaceWith = ReplaceWith("registerKotlinJvmCompileTask(taskName: String, moduleName: String)")
    )

Response:
fun registerKotlinJvmCompileTask(taskName: String): TaskProvider<out KotlinJvmCompile>

    /**
     * Creates a Kotlin JVM compile task.
     *
     * @param taskName The name of the task to be created.
     * @param moduleName The name of the module for which the task is being created.<|endoftext|>


Prompt:
val c: String = notInPlaceRun { c }

    val d: String by simpleDelegate(<!UNINITIALIZED_VARIABLE!>d<!>)
    val e: String by inPlaceDelegate { <!UNINITIALIZED_VARIABLE!>e<!> }
    val f: String by notInPlaceDelegate { f }

    val g: Int

Response:
val h = 1.also { g = 2 }
    <!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>val i: Int<!>
    val j by lazy { <!CAPTURED_MEMBER_VAL_INITIALIZATION!>i<!> = 2; 1 }
    val k: Int
        get() {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.services.moduleStructure
import java.io.File

class ClassicFrontendFailingTestSuppressor(testServices: TestServices) : AbstractFailingTestSuppressor(testServices) {

    override fun testFile(): File {
        return testServices.moduleStructure.originalTestDataFiles.first()
    }

Response:
override fun hasFailure(failedAssertions: List<WrappedException>): Boolean {
        return failedAssertions.any {
            when (it) {
                is WrappedException.FromFacade -> it.facade is ClassicFrontendFacade
                is WrappedException.FromHandler -> it.handler.artifactKind == FrontendKinds.ClassicFrontend
                else -> false
            }
        }
    }<|endoftext|>


Prompt:
return sb.toString() != desc
    }

    override fun requiresPropertySignature(descriptor: FirProperty, desc: String): Boolean {
        return desc != mapTypeDefault(descriptor.returnTypeRef)
    }

    private fun mapTypeDefault(typeRef: FirTypeRef): String? {

Response:
val classId = typeRef.coneTypeSafe<ConeClassLikeType>()?.classId
        return if (classId == null) null else ClassMapperLite.mapClass(classId.asString())
    }
}<|endoftext|>


Prompt:
internal const val HEADER_CACHE_DIR_NAME = "__header_cache__"

internal fun prettyHash(hash: Int): String = hash.toUInt().toString(16).padStart(8, '0')

/**
 * Returns the expression to be parsed by Kotlin as string literal with given contents,
 * i.e. transforms `foo$bar` to `"foo\$bar"`.
 */

Response:
internal fun String.quoteAsKotlinStringLiteral(): String = buildString {
    append('"')

    this@quoteAsKotlinStringLiteral.forEach { c ->
        when (c) {
            in charactersAllowedInKotlinStringLiterals -> append(c)
            '$' -> append("\\$")<|endoftext|>


Prompt:
val BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED: KtDiagnosticFactory0 by error0<KtTypeReference>()
    val REIFIED_TYPE_PARAMETER_NO_INLINE: KtDiagnosticFactory0 by error0<KtTypeParameter>(SourceElementPositioningStrategies.REIFIED_MODIFIER)

Response:
val TYPE_PARAMETERS_NOT_ALLOWED: KtDiagnosticFactory0 by error0<KtDeclaration>(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST)
    val TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER: KtDiagnosticFactory0 by error0<KtTypeParameter>()<|endoftext|>


Prompt:
setClasspath(project.files("a.jar", "b.jar"))
        }

        project.configurationResult.await()
        assertEquals(
            project.files("a.jar", "b.jar").files,
            kotlin.jvm().mainRun.await()?.task?.get()?.classpath?.files
        )
    }

    @Test

Response:
fun `test - jvmRun task is already registered`() = buildProjectWithMPP().runLifecycleAwareTest {
        val kotlin = multiplatformExtension
        kotlin.jvm()
        tasks.register("jvmRun")
        configurationResult.await()
        checkDiagnostics("jvmRunTask-conflict")
    }

    @Test<|endoftext|>


Prompt:
import org.junit.Assert
import java.io.File

private const val library = "inline fun<T> foo(fn: () -> T): T = fn()"
private const val script = "import foo\nval x = foo { 0 }"

class ReplCompilerJava8Test : KtUsefulTestCase() {
    private lateinit var tmpdir: File

    override fun setUp() {

Response:
super.setUp()
        tmpdir = KotlinTestUtils.tmpDirForTest(this)

        File(tmpdir, "library.kt").writeText(library)

        val configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.FULL_JDK).apply {<|endoftext|>


Prompt:
inline operator fun setValue(thisRef: Any?, kProperty: Any, newValue: T) {
        _value = newValue
    }
}

class C {
    val delegatedVal by Mut(1)
    var delegatedVar by Mut(2)
    val delegatedValByProvider by Provider(1)
    var delegatedVarByProvider by Provider(2)
}

Response:
val topLevelDelegatedVal by Mut(1)
var topLevelDelegatedVar by Mut(2)
val topLevelDelegatedValByProvider by Provider(1)
var topLevelDelegatedVarByProvider by Provider(2)

fun box(): String {
    val localDelegatedVal by Mut(1)
    var localDelegatedVar by Mut(2)<|endoftext|>


Prompt:
VERSION_REQUIREMENT_TABLE,
        JVM_EXT_PACKAGE_MODULE_NAME,
        JVM_EXT_PACKAGE_LOCAL_VARIABLE_LIST,
        JS_EXT_PACKAGE_FQ_NAME,
        BUILT_INS_EXT_PACKAGE_FQ_NAME,
        KLIB_EXT_PACKAGE_FQ_NAME
    }

Response:
fun difference(old: ProtoBuf.Package, new: ProtoBuf.Package): EnumSet<ProtoBufPackageKind> {
        val result = EnumSet.noneOf(ProtoBufPackageKind::class.java)

        if (!checkEqualsPackageFunction(old, new)) result.add(ProtoBufPackageKind.FUNCTION_LIST)<|endoftext|>


Prompt:
callsInPlace(init, InvocationKind.EXACTLY_ONCE)
    }
    return FirConstructorBuilder().apply(init).build()
}

@OptIn(ExperimentalContracts::class)
inline fun buildConstructorCopy(original: FirConstructor, init: FirConstructorBuilder.() -> Unit): FirConstructor {
    contract {

Response:
callsInPlace(init, InvocationKind.EXACTLY_ONCE)
    }
    val copyBuilder = FirConstructorBuilder()
    copyBuilder.source = original.source
    copyBuilder.resolvePhase = original.resolvePhase
    copyBuilder.moduleData = original.moduleData
    copyBuilder.origin = original.origin
    copyBuilder.attributes = original.attributes.copy()<|endoftext|>


Prompt:
fun Array<String>?.assertFilePathsDontContain(pathSubString: String) {
            if (this == null) return
            val badFiles = filter { it.contains(pathSubString) }
            if (badFiles.isEmpty()) return
            fail("Following files contain unexpected '$pathSubString' substring in their paths: \n${badFiles.joinToString("\n")}")

Response:
}

        compileLinuxX64.createCompilerArguments(default).libraries.assertFilePathsDontContain("linux_x64")
        compileLinuxArm64.createCompilerArguments(default).libraries.assertFilePathsDontContain("linux_arm64")<|endoftext|>


Prompt:
class E<T> {
    T getT() {
        return null;
    }
}

interface I1<P, A, F> {}
interface I2<S> {}

// FILE: test.kt
fun test() {
    val t = X.E.t

Response: <!DEBUG_INFO_EXPRESSION_TYPE("(X<(I1<(kotlin.Any..kotlin.Any?), (kotlin.Any..kotlin.Any?), (kotlin.Any..kotlin.Any?)>..I1<(kotlin.Any..kotlin.Any?), (kotlin.Any..kotlin.Any?),<|endoftext|>


Prompt:
override val converter: Constructor<Frontend2BackendConverter<FirOutputArtifact, IrBackendInput>>
        get() = ::Fir2IrJsResultsConverter

    override val backendFacade: Constructor<BackendFacade<IrBackendInput, BinaryArtifacts.KLib>>
        get() = ::FirJsKlibBackendFacade

Response:
override fun configure(builder: TestConfigurationBuilder) {
        builder.configureFirParser(FirParser.Psi)
        super.configure(builder)
    }
}

open class AbstractClassicJsLibraryAbiReaderTest : AbstractJsLibraryAbiReaderTest<ClassicFrontendOutputArtifact>() {
    final override val frontend: FrontendKind<*><|endoftext|>


Prompt:
private fun classExportability(klass: IrClass): Exportability {
        when (klass.kind) {
            ClassKind.ANNOTATION_CLASS ->
                return Exportability.Prohibited("Class ${klass.fqNameWhenAvailable} with kind: ${klass.kind}")

            ClassKind.OBJECT,
            ClassKind.CLASS,
            ClassKind.INTERFACE,

Response:
ClassKind.ENUM_CLASS,
            ClassKind.ENUM_ENTRY -> {
            }
        }

        if (klass.isJsImplicitExport()) {
            return Exportability.Implicit
        }

        if (klass.isSingleFieldValueClass)
            return Exportability.Prohibited("Inline class ${klass.fqNameWhenAvailable}")

        return Exportability.Allowed<|endoftext|>


Prompt:
suspend inline fun suspendInlineAcceptsVCAnyNullable(i: Int, vc: VCAnyNullable) {
        result = vc
    }

    suspend inline fun suspendInlineAcceptsVCInt(i: Int, vc: VCInt) {
        result = vc
    }

Response:
suspend inline fun suspendInlineAcceptsVCIntNullable(i: Int, vc: VCIntNullable) {
        result = vc
    }

    suspend inline fun suspendInlineAcceptsVCString_Null(i: Int, vc: VCString?) {
        result = vc
    }<|endoftext|>


Prompt:
expect interface StringDemoInterface

interface KotlinXStringDemoInterface {
    val value: String
}

expect fun StringDemoInterface.plusK(): <!NO_ACTUAL_FOR_EXPECT{JS}!>String<!>

// MODULE: js()()(common, intermediate)
// TARGET_PLATFORM: JS

// FILE: StringDemoInterfaceJs.kt

Response: actual typealias StringDemoInterface = KotlinXStringDemoInterface<|endoftext|>


Prompt:
private fun compareByDomainCapacity(type1: PrimitiveType, type2: PrimitiveType): Int {
            return if (type1.isIntegral && type2.isIntegral) type1.byteSize - type2.byteSize else type1.ordinal - type2.ordinal
        }

Response:
private fun docForConversionFromFloatingToIntegral(fromFloating: PrimitiveType, toIntegral: PrimitiveType): String {
            require(fromFloating.isFloatingPoint)
            require(toIntegral.isIntegral)

            val thisName = fromFloating.capitalized
            val otherName = toIntegral.capitalized<|endoftext|>


Prompt:
import org.jetbrains.kotlin.serialization.deserialization.DeserializationConfiguration

open class CompilerDeserializationConfiguration(
    protected val languageVersionSettings: LanguageVersionSettings
) : DeserializationConfiguration {

    final override val skipMetadataVersionCheck = languageVersionSettings.getFlag(AnalysisFlags.skipMetadataVersionCheck)

Response:
final override val skipPrereleaseCheck = languageVersionSettings.getFlag(AnalysisFlags.skipPrereleaseCheck)

    final override val reportErrorsOnPreReleaseDependencies =
        !skipPrereleaseCheck && !languageVersionSettings.isPreRelease() && !KotlinCompilerVersion.isPreRelease()<|endoftext|>


Prompt:
expectOrder("x(4) in low(1) .. 3", "LX") { assertFalse(x(4) in low(1) .. 3) }
    expectOrder("x(4) !in low(1) .. high(3)", "LHX") { assertTrue(x(4) !in low(1) .. high(3)) }

Response:
expectOrder("4 !in low(1) .. high(3)", "LH") { assertTrue(4 !in low(1) .. high(3)) }
    expectOrder("x(4) !in 1 .. high(3)", "HX") { assertTrue(x(4) !in 1 .. high(3)) }<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY

fun <T> emptyList(): List<T> = null!!

fun <T> foo() {
    typealias LT = List<T>

Response:
val a: <!UNRESOLVED_REFERENCE!>LT<!> = <!CANNOT_INFER_PARAMETER_TYPE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>()

    fun localFun(): <!UNRESOLVED_REFERENCE!>LT<!> {
        typealias LLT = List<T><|endoftext|>


Prompt:
private val utilityInternalProperties = listOf(
    KOTLIN_INTERNAL_DIAGNOSTICS_USE_PARSABLE_FORMATTING,
    KOTLIN_INTERNAL_DIAGNOSTICS_SHOW_STACKTRACE,
    KOTLIN_INTERNAL_DIAGNOSTICS_COMPILER_ARGUMENTS_LOG_LEVEL
)

/*
Expected format

Response:
w: [DIAGNOSTIC_ID | WARNING] first line of diagnostic's text
or (fatals don't have 'w:' or 'e:' prefix):
      [DIAGNOSTIC_ID | FATAL] Fatal diagnostic
 */
private val DIAGNOSTIC_START_REGEX = """\s*([we]:)?\s*\[\w+ \| \w+].*""".toRegex()<|endoftext|>


Prompt:
public val KtPropertySymbol.setterDeprecationStatus: DeprecationInfo?
        get() = withValidityAssertion { analysisSession.symbolInfoProvider.getSetterDeprecation(this) }

    public val KtPropertySymbol.javaGetterName: Name
        get() = withValidityAssertion {
            analysisSession.symbolInfoProvider.getJavaGetterName(this)

Response:
}

    public val KtPropertySymbol.javaSetterName: Name?
        get() = withValidityAssertion {
            analysisSession.symbolInfoProvider.getJavaSetterName(this)
        }

    /** Gets the set of applicable targets for an annotation class symbol. Returns `null` if the symbol is not an annotation class. */<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.calls.tower.StubTypesBasedInferenceSession
import org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver
import org.jetbrains.kotlin.resolve.calls.tower.PSIPartialCallInfo
import org.jetbrains.kotlin.types.error.ErrorUtils

Response:
import org.jetbrains.kotlin.types.TypeConstructor
import org.jetbrains.kotlin.types.UnwrappedType
import org.jetbrains.kotlin.util.OperatorNameConventions

class DelegateInferenceSession(
    val variableDescriptor: VariableDescriptorWithAccessors,
    val expectedType: UnwrappedType?,<|endoftext|>


Prompt:
}

            typeExpression
        }

        val callExpression = with (function) {
            assert(argumentTypes.size == parameters.size)
            val arguments = argumentTypes.mapIndexed { index, type ->
                "${type}(${parameters[index].name})"
            }
            when {
                isCxxInstanceMethod -> {

Response:
val parametersPart = arguments.drop(1).joinToString()
                    "(${parameters[0].name})->${name}($parametersPart)"
                }
                isCxxConstructor -> {
                    val parametersPart = arguments.drop(1).joinToString()
                    "new(${parameters[0].name}) ${cxxReceiverClass!!.spelling}($parametersPart)"
                }<|endoftext|>


Prompt:
sb.appendLine("After")
    } catch (e: Throwable) {
        sb.appendLine("Caught Throwable")
    }

    sb.appendLine("Done")

    assertEquals("""
        Before
        Caught Throwable
        Done

    """.trimIndent(), sb.toString())
    return "OK"
}

fun foo() {

Response:
throw Error("Error happens")
    sb.appendLine("After in foo()")
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.findTopMostOverriddenDescriptors
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import java.util.*

Response:
fun getReceiverTypePredicate(resolvedCall: ResolvedCall<*>, receiverValue: ReceiverValue): TypePredicate? {
    val callableDescriptor = resolvedCall.resultingDescriptor ?: return null

    when (receiverValue) {
        resolvedCall.extensionReceiver -> {
            val receiverParameter = callableDescriptor.extensionReceiverParameter<|endoftext|>


Prompt:
expression.transformChildrenVoid()
                        parameterMapping[expression.symbol]?.let { return irSet(it.symbol, expression.value) }
                        return expression
                    }

                    override fun visitReturn(expression: IrReturn): IrExpression {
                        expression.transformChildrenVoid()
                        if (expression.returnTargetSymbol == irConstructor.symbol) {

Response:
return irReturn(irBlock(expression.startOffset, expression.endOffset) {
                                +expression.value
                                +genReturnValue()
                            })
                        }

                        return expression
                    }
                })
            }
            +irReturn(genReturnValue())
        }
    }

    private fun getInlineClassBackingField(irClass: IrClass): IrField =<|endoftext|>


Prompt:
final override fun visitRawContractDescription(rawContractDescription: FirRawContractDescription, data: D): FirContractDescription {
        return transformRawContractDescription(rawContractDescription, data)
    }

    open fun transformResolvedContractDescription(resolvedContractDescription: FirResolvedContractDescription, data: D): FirContractDescription {
        return transformElement(resolvedContractDescription, data)
    }

Response:
final override fun visitResolvedContractDescription(resolvedContractDescription: FirResolvedContractDescription, data: D): FirContractDescription {
        return transformResolvedContractDescription(resolvedContractDescription, data)
    }
}<|endoftext|>


Prompt:
get() = IntRange(0, lastIndex)
public val LongArray.indices: IntRange
    get() = IntRange(0, lastIndex)
public val FloatArray.indices: IntRange
    get() = IntRange(0, lastIndex)
public val DoubleArray.indices: IntRange
    get() = IntRange(0, lastIndex)
public val BooleanArray.indices: IntRange

Response:
get() = IntRange(0, lastIndex)
public val CharArray.indices: IntRange
    get() = IntRange(0, lastIndex)

public inline fun <T> Array<out T>.isEmpty(): Boolean {
    return size == 0
}

public val <T> Array<out T>.lastIndex: Int
    get() = size - 1
public val ByteArray.lastIndex: Int<|endoftext|>


Prompt:
assertNull(empty.minOfWithOrNull(naturalOrder()) { it.toString() })
        assertNull(empty.maxOfWithOrNull(naturalOrder()) { it.toString() })
        assertFailsWith<NoSuchElementException> { empty.minOfWith(naturalOrder()) { it.toString() } }

Response:
assertFailsWith<NoSuchElementException> { empty.maxOfWith(naturalOrder()) { it.toString() } }
    }

}<|endoftext|>


Prompt:
private fun reportError(internalName: String, vararg another: JvmDeclarationOrigin) {
        val duplicateClasses =
            another.mapNotNull { it.descriptor }.joinToString { DescriptorRenderer.ONLY_NAMES_WITH_SHORT_TYPES.render(it) }

        for (origin in another) {

Response:
state.reportDuplicateClassNameError(origin, internalName, duplicateClasses)
        }
    }
}<|endoftext|>


Prompt: 0x3ff921fb54442d18UL,     0x3ff921fb54442d18UL,     0x3ff921fb54442d18UL,     0x3ff921fb54442d18UL,

Response: 0x3fe921fb54437d2cUL,     0x3fe921fb5442cd40UL,     0x3fe921fb54442d18UL,     0x3ff1b6e192eb77e6UL,<|endoftext|>


Prompt:
CompilerMode.NON_INCREMENTAL_COMPILER -> {
                doCompile(sessionId, daemonReporter, tracer = null) { _, _ ->
                    val exitCode = compiler.exec(messageCollector, Services.EMPTY, k2PlatformArgs)

                    val perfString = compiler.defaultPerformanceManager.renderCompilerPerformance()
                    compilationResults?.also {

Response:
(it as CompilationResults).add(
                            CompilationResultCategory.BUILD_REPORT_LINES.code,
                            arrayListOf(perfString)
                        )
                    }

                    exitCode
                }
            }
            CompilerMode.INCREMENTAL_COMPILER -> {
                val gradleIncrementalArgs = compilationOptions as IncrementalCompilationOptions<|endoftext|>


Prompt:
val currentSubstitutor = constraintSystem.build().currentSubstitutor
        val newSubstitution = object : DelegatedTypeSubstitution(currentSubstitutor.substitution) {
            override fun approximateContravariantCapturedTypes() = true
        }

Response:
var expectedType = newSubstitution.buildSubstitutor().substitute(effectiveExpectedType, Variance.IN_VARIANCE)

        if (expectedType == null || TypeUtils.isDontCarePlaceholder(expectedType)) {
            expectedType = argumentTypeResolver.getShapeTypeOfFunctionLiteral(
                functionLiteral,
                context.scope,
                context.trace,<|endoftext|>


Prompt:
val returnType = expression.getter?.owner?.returnType ?: expression.field!!.owner.type

            val getterCallableReference = expression.getter?.owner?.let { getter ->
                getter.dispatchReceiverParameter.let {
                    if (it != null && expression.dispatchReceiver == null)
                        receiverTypes.add(it.type)
                }

Response:
getter.extensionReceiverParameter.let {
                    if (it != null && expression.extensionReceiver == null)
                        receiverTypes.add(it.type)
                }
                val getterKFunctionType = this@WasmPropertyReferenceLowering.context.irBuiltIns.getKFunctionType(
                    returnType,
                    receiverTypes
                )
                IrFunctionReferenceImpl(<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1285
package foo

class A {
    operator fun component1(): Int = 1
}
operator fun A.component2(): String = "n"

fun box(): String {
    val list = Array<A>(1, { A() })

    var i = 0;
    var s = ""
    for ((a, b) in list) {

Response:
i = a;
        s = b;
    }

    if (i != 1) return "i != 1, it: " + i
    if (s != "n") return "s != 'n', it: " + s

    return "OK"
}<|endoftext|>


Prompt:
delegateOperatorCall: Call,
        delegateOperatorResults: OverloadResolutionResults<FunctionDescriptor>,
        delegateExpression: KtExpression
    ): Boolean {
        val resolutionErrorFactory = when {
            delegateOperatorResults.isSingleResult ||
                    delegateOperatorResults.isIncomplete ||

Response:
delegateOperatorResults.resultCode == OverloadResolutionResults.Code.MANY_FAILED_CANDIDATES ->
                DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE

            delegateOperatorResults.isAmbiguity -> DELEGATE_SPECIAL_FUNCTION_AMBIGUITY

            else -> null
        }

        resolutionErrorFactory?.let {<|endoftext|>


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

import org.jetbrains.kotlin.KtSourceElement
import org.jetbrains.kotlin.config.JvmAnalysisFlags
import org.jetbrains.kotlin.config.LanguageVersionSettings
import org.jetbrains.kotlin.fir.*

Response:
import org.jetbrains.kotlin.fir.analysis.CheckersComponent
import org.jetbrains.kotlin.fir.analysis.FirOverridesBackwardCompatibilityHelper
import org.jetbrains.kotlin.fir.analysis.checkers.FirInlineCheckerPlatformSpecificComponent<|endoftext|>


Prompt:
internal fun Project.setupCInteropPropagatedDependencies() {
    val kotlin = this.multiplatformExtensionOrNull ?: return

    kotlin.forAllSharedNativeCompilations { compilation ->
        compilation.compileDependencyFiles += getPropagatedCInteropDependenciesOrEmpty(compilation)
    }

Response:
kotlin.forAllDefaultKotlinSourceSets { sourceSet ->
        addIntransitiveMetadataDependencyIfPossible(
            sourceSet, getPropagatedCInteropDependenciesOrEmpty(sourceSet)
        )
    }
}

internal fun Project.getPropagatedCInteropDependenciesOrEmpty(sourceSet: DefaultKotlinSourceSet): FileCollection =<|endoftext|>


Prompt:
* @see absoluteValue extension property for [Int]
 */
@SinceKotlin("1.2")
@InlineOnly
public actual inline fun abs(n: Int): Int = nativeMath.abs(n)

/**
 * Returns the smaller of two values.
 */
@SinceKotlin("1.2")
@InlineOnly

Response:
public actual inline fun min(a: Int, b: Int): Int = nativeMath.min(a, b)

/**
 * Returns the greater of two values.
 */
@SinceKotlin("1.2")
@InlineOnly
public actual inline fun max(a: Int, b: Int): Int = nativeMath.max(a, b)

/**
 * Returns the absolute value of this value.
 *<|endoftext|>


Prompt:
const val INLINE_CHEAP_SOURCE_MAP = "inline-cheap-source-map"
    const val INLINE_CHEAP_MODULE_SOURCE_MAP = "inline-cheap-module-source-map"
    const val INLINE_SOURCE_MAP = "inline-source-map"
    const val INLINE_NOSOURCES_SOURCE_MAP = "inline-nosources-source-map"

Response:
const val INLINE_NOSOURCES_CHEAP_SOURCE_MAP = "inline-nosources-cheap-source-map"
    const val INLINE_NOSOURCES_CHEAP_MODULE_SOURCE_MAP = "inline-nosources-cheap-module-source-map"
    const val SOURCE_MAP = "source-map"<|endoftext|>


Prompt:
* exponent. Returns the closest float value to the real number.

 * @param s the String that will be parsed to a floating point
 * @param e an int represent the 10 to part
 * @return the float closest to the real number
 * @exception NumberFormatException if the String doesn't represent a positive integer value
 */
@GCUnsafeCall("Kotlin_native_FloatingPointParser_parseFloatImpl")

Response:
private external fun parseFloatImpl(s: String, e: Int): Float

/**
 * Used to parse a string and return either a single or double precision
 * floating point number.
 */
internal object FloatingPointParser {
    /*
     * All number with exponent larger than MAX_EXP can be treated as infinity.
     * All number with exponent smaller than MIN_EXP can be treated as zero.
     * Exponent is 10 based.<|endoftext|>


Prompt:
// WITH_STDLIB

annotation class AllOpen

annotation class Plain(val name: String, val index: Int) {
    companion object {
        @JvmStatic val staticProperty = 42
        @JvmStatic fun staticFun() {}
    }
}

@AllOpen
annotation class MyComponent(val name: String, val index: Int) {
    companion object {

Response:
@JvmStatic val staticProperty = 42
        @JvmStatic fun staticFun() {}
    }
}<|endoftext|>


Prompt:
// FILE: test.kt

fun foo() {
    try {
        mightThrow()
    } catch (e: Throwable) {
        return
    }

    val t = try {
        mightThrow2()
    } catch (e: Throwable) {
        return
    }

    val x = try {
        mightThrow3()
    } catch (e: Throwable) {
        return

Response:
}
}

var throw1 = false
var throw2 = false
var throw3 = false

fun mightThrow() {
    if (throw1) throw Exception()
}

fun mightThrow2() {
    if (throw2) throw Exception()
}

fun mightThrow3(): Int {
    if (throw3) throw Exception()
    return 42
}

fun box() {
    foo()<|endoftext|>


Prompt: modifierFnLock, modifierHyper, modifierNumLock, modifierScrollLock, modifierSuper, modifierSymbol, modifierSymbolLock, view, detail, bubbles, cancelable, composed

Response: };") }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.util.render
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor

/* Make sure that all the variable references and type parameter references are within the scope of the corresponding variables and
   type parameters.
*/
class ScopeValidator(
    private val reportError: ReportError
) {

    fun check(element: IrElement) {

Response:
element.accept(Checker(), Visibles(emptySet(), mutableSetOf()))
    }

    inner class Visibles(val typeParameters: Set<IrTypeParameter>, val values: MutableSet<IrValueDeclaration>) {
        fun visitTypeAccess(element: IrElement, type: IrType) {
            if (type !is IrSimpleType) return<|endoftext|>


Prompt:
val refinedConfiguration = when (refineResults) {
                is ResultWithDiagnostics.Failure ->
                    return DependenciesResolver.ResolveResult.Failure(refineResults.reports.mapScriptReportsToDiagnostics())
                is ResultWithDiagnostics.Success -> {
                    diagnostics.addAll(refineResults.reports.mapScriptReportsToDiagnostics())
                    refineResults.value
                }
            }

Response:
if (refinedConfiguration != scriptCompilationConfiguration) {
                onConfigurationUpdated(script, refinedConfiguration)
            }

            val newClasspath = refinedConfiguration[ScriptCompilationConfiguration.dependencies]
                ?.flatMap { (it as JvmDependency).classpath } ?: emptyList()

            return DependenciesResolver.ResolveResult.Success(
                // TODO: consider returning only increment from the initial config<|endoftext|>


Prompt:
if (spilledVariables != setOf("label" to "1", "I$0" to "0", "L$0" to "a0", "L$1" to "null")) return "FAIL 1: $spilledVariables"
    c?.resume(Unit)

Response:
if (spilledVariables != setOf("label" to "4", "I$0" to "0", "L$0" to "null", "L$1" to "null")) return "FAIL 2: $spilledVariables"
    c?.resume(Unit)<|endoftext|>


Prompt:
package test

annotation class Ann(
        val p1: Int,
        val p2: Int,
        val p3: Long,
        val p4: Long,
        val p5: Int
)

@Ann(
    p1 = java.lang.Integer.MAX_VALUE + 1,
    p2 = 1 + 1,

Response:
p3 = <!ARGUMENT_TYPE_MISMATCH!>java.lang.Integer.MAX_VALUE + 1<!>,
    p4 = <!ARGUMENT_TYPE_MISMATCH!>1.toInt() + 1.toInt()<!>,
    p5 = 1.toInt() + 1.toInt()
) class MyClass<|endoftext|>


Prompt:
val x = 1
        const val y = ""
    }

    <!ANNOTATION_CLASS_MEMBER!>constructor(s: Int) {}<!>
    <!ANNOTATION_CLASS_MEMBER!>init {}<!>
    <!ANNOTATION_CLASS_MEMBER!>fun function() {}<!>

Response:
<!ANNOTATION_CLASS_MEMBER!>val property get() = Unit<!>
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.cfg.pseudocode.instructions.KtElementInstruction
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicInstruction
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicKind

Response:
import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.ReadValueInstruction
import org.jetbrains.kotlin.cfg.pseudocodeTraverser.TraversalOrder
import org.jetbrains.kotlin.cfg.pseudocodeTraverser.traverse<|endoftext|>


Prompt:
it.findFieldIncludingSupertypes(name)?.let { return it }
        }

        return parent?.findField(javaClass, name)
    }

    private fun JavaClass.enclosingClasses(): List<JavaClass> = arrayListOf<JavaClass>().also { classes ->
        classes.add(this)

Response:
outerClass?.let { classes.addAll(it.enclosingClasses()) }
    }

}<|endoftext|>


Prompt:
is FirExplicitSimpleImportingScope -> KtScopeKind.ExplicitSimpleImportingScope(indexInTower)
        is FirExplicitStarImportingScope -> KtScopeKind.ExplicitStarImportingScope(indexInTower)
        is FirDefaultSimpleImportingScope -> KtScopeKind.DefaultSimpleImportingScope(indexInTower)

Response:
is FirDefaultStarImportingScope -> KtScopeKind.DefaultStarImportingScope(indexInTower)

        is FirScriptDeclarationsScope -> KtScopeKind.ScriptMemberScope(indexInTower)

        else -> unexpectedElementError("scope", firScope)
    }

    private fun createPackageScope(fqName: FqName): KtFirPackageScope {<|endoftext|>


Prompt:
public class Test {
    public static class Test2 {
        public Integer foo(Integer x) { return 1; }
        public static class Test4 {
            public Integer foo(Integer x) { return 1; }
        }
        public class Test5 {
            public Integer foo(Integer x) { return 1; }
        }
    }
    public class Test3 {
        public Integer foo(Integer x) { return 1; }

Response:
public class Test5 {
            public Integer foo(Integer x) { return 1; }
        }
    }
}

// FILE: main.kt
import test.Test

fun main(x: Test) {<|endoftext|>


Prompt:
public inline fun kotlin.ByteArray.runningReduce(operation: (acc: kotlin.Byte, kotlin.Byte) -> kotlin.Byte): kotlin.collections.List<kotlin.Byte>

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

Response:
public inline fun kotlin.CharArray.runningReduce(operation: (acc: kotlin.Char, kotlin.Char) -> kotlin.Char): kotlin.collections.List<kotlin.Char>

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