Prompt:
package org.jetbrains.kotlin.gradle.targets.js.testing

data class KotlinTestRunnerCliArgs(
    val moduleNames: List<String> = listOf(),
    val include: Collection<String> = listOf(),
    val exclude: Collection<String> = listOf(),

Response:
val ignoredTestSuites: IgnoredTestSuitesReporting = IgnoredTestSuitesReporting.reportAllInnerTestsAsIgnored
) {
    fun toList(): List<String> = mutableListOf<String>().also { args ->
        if (include.isNotEmpty()) {
            args.add("--include")
            args.add(include.joinToString(","))
        }<|endoftext|>


Prompt:
package org.jetbrains.sir.lightclasses

import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.symbols.*
import org.jetbrains.kotlin.sir.*
import org.jetbrains.kotlin.sir.builder.buildTypealias

Response:
import org.jetbrains.kotlin.sir.providers.SirDeclarationProvider
import org.jetbrains.kotlin.sir.providers.SirSession
import org.jetbrains.kotlin.sir.providers.source.KotlinSource
import org.jetbrains.kotlin.sir.providers.utils.withSirAnalyse<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T: UserInterfaceA> testTypeParameterWithMultipleDifferentUpperBoundsAB() where T: UserInterfaceB {}
fun <T: UserInterfaceA> testTypeParameterWithMultipleDifferentUpperBoundsAB() where T: UserInterfaceC {}

Response:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T: UserInterfaceB> testTypeParameterWithMultipleDifferentUpperBoundsAC() where T: UserInterfaceA {}
fun <T: UserInterfaceC> testTypeParameterWithMultipleDifferentUpperBoundsAC() where T: UserInterfaceA {}<|endoftext|>


Prompt:
return toConeKotlinTypeProbablyFlexible(
                session, typeParameterStack, source?.fakeElement(KtFakeSourceElementKind.Enhancement)
            )
    }

    // It's either overrides Collection.contains(Object) or Collection.containsAll(Collection<?>) or similar methods
    private fun FirNamedFunctionSymbol.hasErasedParameters(): Boolean {

Response:
// We're only interested in Java declarations with erased parameters.
        // Removing this check would also return true for substitution overrides for raw types,
        // which leads to false positives like NOTHING_TO_OVERRIDE.
        // See compiler/testData/diagnostics/tests/rawTypes/rawTypeOverrides.kt.
        if (!this.isJavaOrEnhancement) return false<|endoftext|>


Prompt:
assertCompilerArgument(":compileKotlin", "-language-version $nextKotlinLanguageVersion")
            }
        }
    }

    @DisplayName("JVM: build report is not printed")
    @JvmGradlePluginTests
    @GradleTest
    fun buildReportNotPrinted(gradleVersion: GradleVersion) {
        project(
            "incrementalMultiproject",

Response:
gradleVersion,
            buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.WARN)
        ) {
            build("build") {
                assertOutputDoesNotContain(
                    "##### 'kotlin.experimental.tryNext' results #####"
                )
            }
        }
    }

    @DisplayName("JVM: report is printed at the end of the build")<|endoftext|>


Prompt:
assertEquals("super", `super`)
    assertEquals("this", `this`)
    assertEquals("throw", `throw`)
    assertEquals("true", `true`)
    assertEquals("try", `try`)
    assertEquals("typealias", `typealias`)
    assertEquals("val", `val`)
    assertEquals("var", `var`)

Response:
assertEquals("when", `when`)
    return "OK"
}<|endoftext|>


Prompt:
if (!context.config.languageVersionSettings.supportsFeature(LanguageFeature.EnumEntries)) {
            return
        }
        irFile.transformChildrenVoid(this)
    }

    private var state: EntriesMappingState? = null

    private inner class EntriesMappingState {
        val mappings = mutableMapOf<IrClass /* enum */, IrField>()

Response:
val mappingsClass by lazy {
            context.irFactory.buildClass {
                name = Name.identifier("EntriesMappings")
                origin = JvmLoweredDeclarationOrigin.ENUM_MAPPINGS_FOR_ENTRIES
            }.apply {
                createImplicitParameterDeclarationWithWrappedDescriptor()
            }
        }<|endoftext|>


Prompt:
public fun containsMatchIn(input: CharSequence): Boolean

    /**
     * Replaces all occurrences of this regular expression in the specified [input] string with specified [replacement] expression.
     *
     * The replacement string may contain references to the captured groups during a match. Occurrences of `${name}` or `$index`

Response:
* in the replacement string will be substituted with the subsequences corresponding to the captured groups with the specified name or index.
     * In case of `$index`, the first digit after '$' is always treated as a part of group reference. Subsequent digits are incorporated
     * into `index` only if they would form a valid group reference. Only the digits '0'..'9' are considered as potential components<|endoftext|>


Prompt:
val next = current.originalForSubstitutionOverride ?: return current
        current = next
    } while (true)
}

inline fun <reified D : FirCallableDeclaration> D.unwrapUseSiteSubstitutionOverrides(): D {
    var current = this

    do {
        if (current.origin != FirDeclarationOrigin.SubstitutionOverride.CallSite) return current

Response:
val next = current.originalForSubstitutionOverride ?: return current
        current = next
    } while (true)
}

inline fun <reified S : FirCallableSymbol<*>> S.unwrapUseSiteSubstitutionOverrides(): S {
    return fir.unwrapUseSiteSubstitutionOverrides().symbol as S
}<|endoftext|>


Prompt:
package org.jetbrains.kotlin.objcexport.tests

import org.jetbrains.kotlin.objcexport.KtObjCExportFile
import org.jetbrains.kotlin.objcexport.StableFileOrder
import org.jetbrains.kotlin.objcexport.testUtils.InlineSourceCodeAnalysis

Response:
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotEquals

class TranslationOrderTest(
    private val inlineSourceCodeAnalysis: InlineSourceCodeAnalysis,
) {

    @Test
    fun `test - StableFileOrder - sort by packageName`() {
        val files = inlineSourceCodeAnalysis.createKtFiles {<|endoftext|>


Prompt:
fun getsBaseProp(): String = super.baseProp

    fun callsInterfaceFun(): String = super.interfaceFun()
}

fun box(): String {
    val d = Derived()

    val test1 = d.callsBaseFun()
    if (test1 != "Base.baseFun()") return "Failed: d.callsBaseFun()==$test1"

Response:
val test2 = d.callsUnambiguousFun()
    if (test2 != "Base.unambiguous()") return "Failed: d.callsUnambiguousFun()==$test2"

    val test3 = d.getsBaseProp()
    if (test3 != "Base.baseProp") return "Failed: d.getsBaseProp()==$test3"<|endoftext|>


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

import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin

Response:
import org.jetbrains.kotlin.backend.jvm.JvmSymbols
import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound
import org.jetbrains.kotlin.backend.jvm.ir.isInlineClassType
import org.jetbrains.kotlin.backend.jvm.ir.isOptionalAnnotationClass<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbolOrigin
import org.jetbrains.kotlin.analysis.api.symbols.KtValueParameterSymbol
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer
import org.jetbrains.kotlin.analysis.api.types.KtType

Response:
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.name.CallableId

class KtFe10DescDefaultPropertyGetterSymbol(<|endoftext|>


Prompt:
public fun ShortArray.maxWith(comparator: Comparator<in Short>): Short? {
    return maxWithOrNull(comparator)
}

@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)"))
@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")

Response:
@Suppress("CONFLICTING_OVERLOADS")
public fun IntArray.maxWith(comparator: Comparator<in Int>): Int? {
    return maxWithOrNull(comparator)
}

@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)"))<|endoftext|>


Prompt:
// EXPECTATIONS FIR JVM_IR
// test.kt:17 box:
// test.kt:4 <init>: x:java.lang.String="X":java.lang.String, y:java.lang.String="Y":java.lang.String
// test.kt:17 box:

Response:
// test.kt:14 foo: a:MyPair=MyPair, block:kotlin.jvm.functions.Function1=TestKt$<lambda>
// test.kt:20 box$lambda$0:
// test.kt:6 component1:
// test.kt:20 box$lambda$0:<|endoftext|>


Prompt:
assert(symbol.owner.isAssignable) { "Only assignable IrValues can be set" }
    }
    return IrSetValueImpl(
        constructorIndicator = null,
        startOffset = startOffset,
        endOffset = endOffset,
        type = type,
        symbol = symbol,
        value = value,
        origin = origin,
    )
}

fun IrSpreadElementImpl(

Response:
startOffset: Int,
    endOffset: Int,
    expression: IrExpression,
) = IrSpreadElementImpl(
    constructorIndicator = null,
    startOffset = startOffset,
    endOffset = endOffset,
    expression = expression,
)

fun IrStringConcatenationImpl(
    startOffset: Int,
    endOffset: Int,
    type: IrType,<|endoftext|>


Prompt:
abstract class AbstractDeclarationVisitor : TranslatorVisitor<Unit>()  {
    override fun emptyResult(context: TranslationContext) { }

    open val enumInitializerName: JsName?
        get() = null

    override fun visitClassOrObject(classOrObject: KtClassOrObject, context: TranslationContext) {

Response:
ClassTranslator.translate(classOrObject, context, enumInitializerName)
        val descriptor = BindingUtils.getClassDescriptor(context.bindingContext(), classOrObject)
        context.export(descriptor)
    }

    override fun visitProperty(expression: KtProperty, context: TranslationContext) {
        val descriptor = BindingUtils.getPropertyDescriptor(context.bindingContext(), expression)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.declarations.FirTypeParameter
import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnresolvedSymbolError
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
import org.jetbrains.kotlin.fir.scopes.impl.toConeType

Response:
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
import org.jetbrains.kotlin.fir.types.ConeErrorType
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
import org.jetbrains.kotlin.fir.types.typeContext<|endoftext|>


Prompt:
val mlitr = MLItr()

    safeAsReturnsNull("litr as? MutableIterator") { litr as? MutableIterator<*> }
    safeAsReturnsNull("litr as? MutableListIterator") { litr as? MutableListIterator<*> }
    safeAsReturnsNonNull("mlitr as? MutableIterator") { mlitr as? MutableIterator<*> }

Response:
safeAsReturnsNonNull("mlitr as? MutableListIterator") { mlitr as? MutableListIterator<*> }

    val it = It() as Any
    val mit = MIt()
    val arrayList = ArrayList<String>()

    safeAsReturnsNull("it as? MutableIterable") { it as? MutableIterable<*> }<|endoftext|>


Prompt:
override fun getTextRange() = kotlinOrigin?.textRange ?: TextRange.EMPTY_RANGE
    override fun getTextOffset() = kotlinOrigin?.textOffset ?: 0
    override fun getStartOffsetInParent() = kotlinOrigin?.startOffsetInParent ?: 0
    override fun isWritable() = kotlinOrigin?.isWritable ?: false

Response:
override fun getNavigationElement() = kotlinOrigin?.navigationElement ?: this
    override fun getUseScope() = kotlinOrigin?.useScope ?: super.getUseScope()
    override fun getContainingFile() = parent.containingFile
    override fun getPresentation() = (kotlinOrigin ?: this).let { ItemPresentationProviders.getItemPresentation(it) }<|endoftext|>


Prompt:
import kotlin.test.assertNull
import kotlin.test.assertTrue

// Compile .def and .kt files in most straightforward way to check the structure of packages created by `cinterop` tool into interop klib.
// Same test sources are also checked with new native test infra using its package renaming feature.

// This demonstrates the behavior of cinterop tool:

Response:
//   how the packages are arranged in klib in different combinations of compound filenames and package directives.
// Cinterop tool here is executed directly, not under new test system, which might modify sources before compilation.
// The most important test is dotFnameRoot.kt, where the order of package parts is counterintuitive:
//   filename is `root1.root2.def`, and the resulting package is `root2.root1`<|endoftext|>


Prompt:
"LinkedListWithAtomicsBenchmark" to BenchmarkEntryWithInit.create(::LinkedListWithAtomicsBenchmark, { ensureNext() }),
                    "Inheritance.baseCalls" to BenchmarkEntryWithInit.create(::InheritanceBenchmark, { baseCalls() }),

Response:
"ChainableBenchmark.testChainable" to BenchmarkEntryWithInit.create(::ChainableBenchmark, { testChainable() }),
                    "BunnymarkBenchmark.testBunnymark" to BenchmarkEntryWithInit.create(::BunnymarkBenchmark, { testBunnymark() }),<|endoftext|>


Prompt:
fun FirSymbolProvider.getClassDeclaredPropertySymbols(classId: ClassId, name: Name): List<FirVariableSymbol<*>> {
    val classMemberScope = getClassDeclaredMemberScope(classId)
    return classMemberScope?.getProperties(name).orEmpty()
}

Response:
inline fun <reified T : FirBasedSymbol<*>> FirSymbolProvider.getSymbolByTypeRef(typeRef: FirTypeRef): T? {
    val lookupTag = (typeRef.coneTypeSafe<ConeSimpleKotlinType>()?.fullyExpandedType(session) as? ConeLookupTagBasedType)?.lookupTag
        ?: return null<|endoftext|>


Prompt:
builder.setOuterType(outerBuilder)
            }
        }
    }

    private fun typeArgument(typeProjection: TypeProjection): ProtoBuf.Type.Argument.Builder {
        val builder = ProtoBuf.Type.Argument.newBuilder()

        if (typeProjection.isStarProjection) {

Response:
builder.projection = ProtoBuf.Type.Argument.Projection.STAR
        } else {
            val projection = projection(typeProjection.projectionKind)

            if (projection != builder.projection) {
                builder.projection = projection
            }

            if (useTypeTable()) {
                builder.typeId = typeId(typeProjection.type)
            } else {<|endoftext|>


Prompt:
takeByte(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>2 % 1<!>)

    takeByte(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>2.plus(1)<!>)
    takeByte(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>2.minus(1)<!>)

Response:
takeByte(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>2.times(1)<!>)
    takeByte(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>2.div(1)<!>)<|endoftext|>


Prompt:
p02: Any, p03: Any, p04: Any, p05: Any, p06: Any, p07: Any, p08: Any, p09: Any, p10: Any,
    p11: Any, p12: Any, p13: Any, p14: Any, p15: Any, p16: Any, p17: Any, p18: Any, p19: Any, p20: Any,

Response:
p21: Any, p22: Any, p23: Any, p24: Any, p25: Any, p26: Any, p27: Any, p28: Any, p29: Any, p30: Any
): Any = Any()

fun box(): String {
    @Suppress("DEPRECATION_ERROR")
    Test.test(::f as kotlin.jvm.functions.FunctionN<Any>)<|endoftext|>


Prompt:
return getBooleanOptionValue(BooleanOption.KAPT_VERBOSE)
        }

        fun Project.isIncrementalKapt(): Boolean {
            return getBooleanOptionValue(BooleanOption.KAPT_INCREMENTAL_APT)
        }

        fun Project.isInfoAsWarnings(): Boolean {

Response:
return getBooleanOptionValue(BooleanOption.KAPT_INFO_AS_WARNINGS)
        }

        fun Project.isIncludeCompileClasspath(): Boolean {
            return getBooleanOptionValue(BooleanOption.KAPT_INCLUDE_COMPILE_CLASSPATH)
        }

        fun Project.isKaptKeepKdocCommentsInStubs(): Boolean {<|endoftext|>


Prompt:
// FIR_IDENTICAL
// MODULE: m1
// FILE: a.kt
package a.b

class c {
    fun ab_c() {}
}

// MODULE: m2
// FILE: b.kt
package a

class b<T> {
    class c {
        fun a_bc() {}
    }
}

// MODULE: m3(m1, m2)

Response:
// FILE: c.kt
import a.b.c

fun test(ab_c: c) {
    ab_c.ab_c()

    val ab_c2: a.b.c = a.b.c()
    ab_c2.ab_c()

    val ab_c3 = a.b.c()
    ab_c3.ab_c()
}<|endoftext|>


Prompt: p19: Any?): Any? = call(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19)

Response: override fun invoke(p1: Any?, p2: Any?, p3: Any?, p4: Any?, p5: Any?, p6: Any?, p7: Any?, p8: Any?, p9: Any?, p10: Any?, p11: Any?, p12: Any?, p13: Any?, p14: Any?, p15: Any?, p16: Any?, p17: Any?, p18: Any?,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.IrCall
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrTypeOperator
import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl

Response:
import org.jetbrains.kotlin.ir.expressions.putArgument
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid<|endoftext|>


Prompt:
}

fun loadPluginsForTests(configuration: CompilerConfiguration): ExitCode {
    var pluginClasspath: Iterable<String> = emptyList()
    val kotlinPaths = PathUtil.kotlinPathsForCompiler
    val libPath = kotlinPaths.libPath.takeIf { it.exists() && it.isDirectory } ?: File(".")

Response:
val (jars, _) =
        PathUtil.KOTLIN_SCRIPTING_PLUGIN_CLASSPATH_JARS.map { File(libPath, it) }.partition { it.exists() }
    pluginClasspath = jars.map { it.canonicalPath } + pluginClasspath<|endoftext|>


Prompt:
public fun kotlin.CharArray.sortedArray(): kotlin.CharArray

public fun kotlin.DoubleArray.sortedArray(): kotlin.DoubleArray

public fun kotlin.FloatArray.sortedArray(): kotlin.FloatArray

public fun kotlin.IntArray.sortedArray(): kotlin.IntArray

Response:
public fun kotlin.LongArray.sortedArray(): kotlin.LongArray

public fun kotlin.ShortArray.sortedArray(): kotlin.ShortArray

@kotlin.SinceKotlin(version = "1.3")
@kotlin.ExperimentalUnsignedTypes
public fun kotlin.UByteArray.sortedArray(): kotlin.UByteArray<|endoftext|>


Prompt:
declarations.filter { it is IrFunction && it.isAtomicExtension() }.forEach { atomicExtension ->
                atomicExtension as IrFunction
                declarations.add(transformAtomicExtension(atomicExtension, this, false))
                declarations.add(transformAtomicExtension(atomicExtension, this, true))
                // the original atomic extension is removed
                declarations.remove(atomicExtension)

Response:
}
        }

        private fun transformAtomicExtension(
            atomicExtension: IrFunction,
            parent: IrDeclarationContainer,
            isArrayReceiver: Boolean
        ): IrFunction {
            /**
             * At this step, only signature of the atomic extension is changed,
             * the body is just copied and will be transformed at the next step by AtomicFunctionCallTransformer.
             *<|endoftext|>


Prompt:
@DeprecatedSinceKotlin(warningSince = "1.9")
public object Debugging {
    public var forceCheckedShutdown: Boolean by kotlin.native.runtime.Debugging::forceCheckedShutdown

    public val isThreadStateRunnable: Boolean by kotlin.native.runtime.Debugging::isThreadStateRunnable
}

Response:
@GCUnsafeCall("Kotlin_Debugging_isPermanent")
@InternalForKotlinNative
public external fun Any.isPermanent() : Boolean

@GCUnsafeCall("Kotlin_Debugging_isLocal")
@InternalForKotlinNative
public external fun Any.isLocal() : Boolean<|endoftext|>


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

Response:
0x400921fb54442d18UL,     0x400921fb54442d18UL,     0x400921fb54442d18UL,     0x400921fb54442d18UL,
            0xc00921fb54442d18UL,     0x8000000000000000UL,     0x8000000000000000UL,     0x8000000000000000UL,<|endoftext|>


Prompt:
private fun errorType() = ErrorUtils.createErrorType(ErrorTypeKind.SYNTHETIC_ELEMENT_ERROR_TYPE)
        val ERROR_CONTEXT = SyntheticElementResolveContext(errorType(), errorType(), null, errorType(), null, null, null)
    }

    private val widgetReceivers by lazy {
        val receivers = ArrayList<WidgetReceiver>(4)

Response:
receivers += WidgetReceiver(activity, mayHaveCache = true)
        receivers += WidgetReceiver(dialog, mayHaveCache = false)
        fragment?.let { receivers += WidgetReceiver(it, mayHaveCache = true) }
        supportFragment?.let { receivers += WidgetReceiver(it, mayHaveCache = true) }
        receivers
    }<|endoftext|>


Prompt:
@Deprecated(message = "", level = DeprecationLevel.HIDDEN) constructor(arg: Invariant<T>)
    }
    fun <T: UserInterfaceA> TestTypeParameterWithMultipleIdenticalUpperBoundsBC(arg: Invariant<T>) where T: UserInterfaceB {}

Response:
class TestTypeParameterWithMultipleIdenticalUpperBoundsBCReverse<T: UserInterfaceA> where T: UserInterfaceB {
        constructor(arg: Invariant<T>)
    }<|endoftext|>


Prompt:
assertNotEquals(nullProtoObj2.hashCode(), obj1.hashCode())
    assertNotEquals(nullProtoObj2.hashCode(), obj2.hashCode())
    assertNotEquals(nullProtoObj2.hashCode(), nullProtoObj1.hashCode())
    assertNotEquals(nullProtoObj2.hashCode(), arr1.hashCode())

Response:
assertNotEquals(nullProtoObj2.hashCode(), arr2.hashCode())

    assertNotEquals(arr1.hashCode(), obj1.hashCode())
    assertNotEquals(arr1.hashCode(), obj2.hashCode())
    assertNotEquals(arr1.hashCode(), nullProtoObj1.hashCode())<|endoftext|>


Prompt:
// !OPT_IN: kotlin.contracts.ExperimentalContracts

/*
 * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE)
 *
 * SECTIONS: contracts, declarations, contractBuilder, effects, returns
 * NUMBER: 1
 * DESCRIPTION: Using equality with expressions in implies.
 * ISSUES: KT-26178
 */

import kotlin.contracts.*

Response:
// TESTCASE NUMBER: 1
fun case_1(x: Any?): Boolean {
    contract { returns(true) implies (x == <!ERROR_IN_CONTRACT_DESCRIPTION!>-.15f<!>) }
    return x !is Number
}

// TESTCASE NUMBER: 2
fun case_2(x: Any?): Boolean {<|endoftext|>


Prompt:
if (declaration.isExpect) return
            super.check(declaration, context, reporter)
        }
    }

    object ForExpectClass : FirNotImplementedOverrideSimpleEnumEntryChecker(MppCheckerKind.Common) {
        override fun check(declaration: FirClass, context: CheckerContext, reporter: DiagnosticReporter) {

Response:
if (!declaration.isExpect) return
            super.check(declaration, context, reporter)
        }
    }

    override fun check(declaration: FirClass, context: CheckerContext, reporter: DiagnosticReporter) {
        if (!declaration.isEnumClass) return<|endoftext|>


Prompt:
@kotlin.internal.InlineOnly
public inline fun <R> IntArray.minOfWith(comparator: Comparator<in R>, selector: (Int) -> R): R {
    if (isEmpty()) throw NoSuchElementException()
    var minValue = selector(this[0])
    for (i in 1..lastIndex) {
        val v = selector(this[i])

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

/**
 * Returns the smallest value according to the provided [comparator]
 * among all values produced by [selector] function applied to each element in the array.
 *
 * @throws NoSuchElementException if the array is empty.
 */<|endoftext|>


Prompt:
val methodSignature = JvmMemberSignature.Method(name = methodNode.name, desc = methodNode.desc)
        inlineFunctionsAndAccessors[methodSignature]!! to snapshotMethod(methodNode, classNode.version)
    }

    return ExtraInfo(classSnapshotExcludingMembers, constantSnapshots, inlineFunctionOrAccessorSnapshots)
}

/**

Response:
* [ClassVisitor] which visits only members satisfying the given criteria (`[shouldVisitField] == true` or `[shouldVisitMethod] == true`).
 */
class SelectiveClassVisitor(
    cv: ClassVisitor,
    private val shouldVisitField: (JvmMemberSignature.Field, isPrivate: Boolean, isConstant: Boolean) -> Boolean,<|endoftext|>


Prompt:
assertEquals(kclasses[Double::class], 4)
        assertEquals(kclasses[DoubleArray::class], 5)
        assertEquals(kclasses[Float::class], 6)
        assertEquals(kclasses[FloatArray::class], 7)
        assertEquals(kclasses[Long::class], 8)
        assertEquals(kclasses[LongArray::class], 9)

Response:
assertEquals(kclasses[ULong::class], 10)
        assertEquals(kclasses[ULongArray::class], 11)
        assertEquals(kclasses[Int::class], 12)
        assertEquals(kclasses[IntArray::class], 13)
        assertEquals(kclasses[UInt::class], 14)
        assertEquals(kclasses[UIntArray::class], 15)<|endoftext|>


Prompt:
add(FirWebCommonErrors.NAMED_COMPANION_IN_EXTERNAL_INTERFACE) { firDiagnostic ->
        NamedCompanionInExternalInterfaceImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }

Response:
add(FirWebCommonErrors.JSCODE_ARGUMENT_NON_CONST_EXPRESSION) { firDiagnostic ->
        JscodeArgumentNonConstExpressionImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }
}<|endoftext|>


Prompt:
assertEquals(null, TestClass.fooNWrapperN?.fooN?.s)
    TestClass.fooNWrapperN = null
    assertEquals("null (object)", describeValueOfProperty(TestClass, "fooNWrapperN"))
    assertEquals(null, TestClass.fooNWrapperN?.fooN?.s)

Response:
assertEquals("null (object)", describeValueOfProperty(TestClass, "nativeFooWrapper"))
    TestClass.nativeFooWrapper = NativeFooWrapper(NativeFoo("Berlin"))
    assertEquals("NativeFoo('Berlin') (object)", describeValueOfProperty(TestClass, "nativeFooWrapper"))<|endoftext|>


Prompt:
package test.time

import kotlin.test.*
import kotlin.time.*
import kotlin.time.Duration.Companion.nanoseconds

class TimeMarkJVMTest {

    @Test
    fun longDurationElapsed() {

Response:
TimeMarkTest().testLongAdjustmentElapsedPrecision(TimeSource.Monotonic, { waitDuration -> Thread.sleep((waitDuration * 1.1).inWholeMilliseconds) })
    }

    @Test
    fun defaultTimeMarkAdjustmentInfinite() {
        val baseMark = TimeSource.Monotonic.markNow()
        val longDuration = Long.MAX_VALUE.nanoseconds<|endoftext|>


Prompt:
private val declarationsProvider: SirDeclarationProvider,
) : SirDeclarationProvider {

    private val visitedDeclarations: MutableMap<KtDeclarationSymbol, SirDeclaration> = mutableMapOf()

    override fun KtDeclarationSymbol.sirDeclaration(): SirDeclaration {
        return visitedDeclarations.getOrPut(this@sirDeclaration) {

Response:
with(declarationsProvider) { this@sirDeclaration.sirDeclaration() }
        }
    }

}<|endoftext|>


Prompt:
* expressions, prefix-expressions, logical-not-expression -> paragraph 1 -> sentence 2
 * expressions, prefix-expressions, logical-not-expression -> paragraph 3 -> sentence 1
 * NUMBER: 1
 * DESCRIPTION:
 */

class A(var a: Int) {
    var isCalled = false
    operator fun not(): A {
        isCalled = true
        return A(a)
    }
}

Response:
fun box(): String {
    val a = A(-1)
    val a1 = !a
    if (!a1.isCalled && a.isCalled) {
        return "OK"
    }
    return "NOK"
}<|endoftext|>


Prompt:
fun main(p: String?, p2: String?) {
    // Generates IFNULL and GOTO
    while (!(p == null)) {
        "loop"
    }

    // Generates IFNULL and GOTO
    while (p2 != null) {
        "loop"
    }
}

//0 ICONST_0
//0 ICONST_1
//0 ACONST_NULL

Response:
//2 IFNULL
//2 IF
//2 GOTO<|endoftext|>


Prompt:
_size++
            modCount = list.modCount
        }

        override fun get(index: Int): E {
            checkForComodification()
            AbstractList.checkElementIndex(index, _size)

            return list[fromIndex + index]
        }

        override fun removeAt(index: Int): E {
            checkForComodification()

Response:
AbstractList.checkElementIndex(index, _size)

            val result = list.removeAt(fromIndex + index)
            _size--
            modCount = list.modCount
            return result
        }

        override fun set(index: Int, element: E): E {
            checkForComodification()
            AbstractList.checkElementIndex(index, _size)<|endoftext|>


Prompt:
fun testR0xE10() {
    // with possible local optimizations
    if (1 in 1L..<3L != range0.contains(1)) throw AssertionError()
    if (1 !in 1L..<3L != !range0.contains(1)) throw AssertionError()

Response:
if (!(1 in 1L..<3L) != !range0.contains(1)) throw AssertionError()
    if (!(1 !in 1L..<3L) != range0.contains(1)) throw AssertionError()
    // no local optimizations
    if (element10 in 1L..<3L != range0.contains(element10)) throw AssertionError()<|endoftext|>


Prompt:
abstract var a: /*p:local.declarations*/Int
        abstract fun foo()
    }

    class LocalC : LocalI() {
        override var a = 1

        override fun foo() {}

        var b = "bbb"

        fun bar() = b
    }

    val o = object {
        val a = "aaa"

Response:
fun foo(): LocalI = /*p:kotlin(Nothing)*/null as LocalI
    }

    localFun()
    1./*p:kotlin.Int(getLOCALExtFun) p:kotlin.Int(getLocalExtFun)*/localExtFun()

    val c = LocalC()
    c.a
    c.b
    c.foo()
    c.bar()<|endoftext|>


Prompt:
*/
    public fun getAndSet(newValue: T): T = this::value.getAndSetField(newValue)

    /**
     * Atomically sets the value to the given [new value][newValue] if the current value equals the [expected value][expected],
     * returns true if the operation was successful and false only if the current value was not equal to the expected value.
     *

Response:
* Provides sequential consistent ordering guarantees and cannot fail spuriously.
     *
     * Comparison of values is done by reference.
     */
    public fun compareAndSet(expected: T, newValue: T): Boolean = this::value.compareAndSetField(expected, newValue)

    /**
     * Atomically sets the value to the given [new value][newValue] if the current value equals the [expected value][expected]<|endoftext|>


Prompt:
6 -> null
    }
}

// TESTCASE NUMBER: 2
fun case_2(value_1: Int, value_2: Byte, value_3: TypesProvider) {
    when (value_1) {
        1 -> -.09 % 10L
        3 -> value_2 / -5
        2 -> value_3.getChar() - 11 + 90
        4 -> 100
    }

Response:
}

// TESTCASE NUMBER: 3
fun case_3(value_1: Int, value_2: Boolean, value_3: Long) {
    when (value_1) {
        1 -> value_2
        2 -> !value_2
        3 -> getBoolean() && value_2
        5 -> getChar() != 'a'
        6 -> getList() === getAny()<|endoftext|>


Prompt:
private val K_PACKAGE_CACHE = createCache { KPackageImpl(it) }

// This function is invoked on each reflection access to Java classes, properties, etc. Performance is critical here.
@Suppress("UNCHECKED_CAST")

Response:
internal fun <T : Any> getOrCreateKotlinClass(jClass: Class<T>): KClassImpl<T> = K_CLASS_CACHE.get(jClass) as KClassImpl<T>

internal fun <T : Any> getOrCreateKotlinPackage(jClass: Class<T>): KDeclarationContainer = K_PACKAGE_CACHE.get(jClass)<|endoftext|>


Prompt:
* If any of elements is `NaN` returns `NaN`.
 */
@SinceKotlin("1.4")
public fun Array<out Float>.minOrNull(): Float? {
    if (isEmpty()) return null
    var min = this[0]
    for (i in 1..lastIndex) {
        val e = this[i]
        min = minOf(min, e)
    }

Response:
return min
}

/**
 * Returns the smallest element or `null` if there are no elements.
 */
@SinceKotlin("1.4")
public fun <T : Comparable<T>> Array<out T>.minOrNull(): T? {
    if (isEmpty()) return null
    var min = this[0]
    for (i in 1..lastIndex) {
        val e = this[i]<|endoftext|>


Prompt:
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
// see https://youtrack.jetbrains.com/issue/KT-21515

abstract class <!CYCLIC_SCOPES_WITH_COMPANION!>DerivedAbstract<!> : C.Base() {
    open class Data
}

public class C {

Response:
open class <!CYCLIC_SCOPES_WITH_COMPANION!>Base<!> ()

    class Foo : <!DEPRECATED_ACCESS_BY_SHORT_NAME!>Data<!>()

    companion <!CYCLIC_SCOPES_WITH_COMPANION!>object<!> : DerivedAbstract()
}<|endoftext|>


Prompt:
lateinit var sourceModule: KtSourceModule
        val currentArchitectureTarget = HostManager.host
        val nativePlatform = NativePlatforms.nativePlatformByTargets(listOf(currentArchitectureTarget))
        val session = buildStandaloneAnalysisAPISession {
            registerProjectService(KtLifetimeTokenProvider::class.java, KtAlwaysAccessibleLifetimeTokenProvider())

Response:
buildKtModuleProvider {
                platform = nativePlatform
                val kLib = addModule(
                    buildKtLibraryModule {
                        val compiledKLibRoot = compileToNativeKLib(testDataPath("resolveAgainstNativeKLib/klibSrc"))
                        addBinaryRoot(compiledKLibRoot)
                        platform = nativePlatform
                        libraryName = "klib"
                    }
                )<|endoftext|>


Prompt:
public fun kotlin.sequences.Sequence<kotlin.Float>.average(): kotlin.Double

@kotlin.jvm.JvmName(name = "averageOfInt")
public fun kotlin.sequences.Sequence<kotlin.Int>.average(): kotlin.Double

@kotlin.jvm.JvmName(name = "averageOfLong")

Response:
public fun kotlin.sequences.Sequence<kotlin.Long>.average(): kotlin.Double

@kotlin.jvm.JvmName(name = "averageOfShort")
public fun kotlin.sequences.Sequence<kotlin.Short>.average(): kotlin.Double

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


Prompt:
* Used for the primary script definition selection as well as to assign a kotlin-specific file type to the files with the extension in Intellij IDEA
 * For Intellij IDEA support, it is important to have this extension set to a non-ambiguous name.
 * See also {@link ScriptCompilationConfigurationKeys#filePathPattern} parameter for more fine-grained script definition selection
 */

Response:
val ScriptCompilationConfigurationKeys.fileExtension by PropertiesCollection.key<String>("kts")

/**
 * Additional (to the filename extension) RegEx pattern with that the script file path is checked
 * It is used in the hosts that may have several script definitions registered and need to distinguish script file types not only by extension<|endoftext|>


Prompt:
staticY1; staticY2; staticY4; staticY5; staticY6
        staticY1.x; staticY1.y; staticY2.x; staticY2.y; staticY4.x; staticY4.y; staticY5.x; staticY5.y; staticY6.x; staticY6.y

Response:
staticY1 = staticY1; staticY2 = staticY2; staticY6 = staticY6

        staticZ1; staticZ2; staticZ4; staticZ5; staticZ6
        staticZ1 = staticZ1; staticZ2 = staticZ2; staticZ6 = staticZ6<|endoftext|>


Prompt:
// The library's directory is added in libraries.repos.
                addArg("-library", it.absolutePath)
            }
        }
        addFileArgs("-library", libraries.klibFiles)
        addArgs("-library", libraries.artifacts.map { it.artifact.canonicalPath })

        addArgIfNotNull("-target", konanTarget.visibleName)

Response:
addArgIfNotNull("-language-version", languageVersion)
        addArgIfNotNull("-api-version", apiVersion)
        addArgIfNotNull("-entry", entryPoint)

        addKey("-g", enableDebug)
        addKey("-nostdlib", noStdLib)
        addKey("-nomain", noMain)
        addKey("-opt", enableOptimizations)<|endoftext|>


Prompt:
} else if ((j and 0x7fffffff) >= 0x4090cc00) {    /* z <= -1075 */
        if (((j - 0xc090cc00) or i.toLong()) != 0L)        /* z < -1075 */
            return s * tiny * tiny        /* underflow */
        else {

Response:
if (p_l <= z - p_h) return s * tiny * tiny    /* underflow */
        }
    }
    /*
     * compute 2**(p_h+p_l)
     */
    i = j and 0x7fffffff
    k = (i shr 20) - 0x3ff
    n = 0<|endoftext|>


Prompt:
val inv = ::bar4 <!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>in<!> setOf(::foo4)
        <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
    }
}

fun poll84(): Flow<String> {
    return flow {

Response:
val inv = ::bar5 in setOf(::foo5)
        inv
    }
}

fun poll85(): Flow<String> {
    return flow {
        val inv = ::Foo6 in setOf(::Foo6)
        inv
    }
}

fun poll86(): Flow<String> {
    return flow {<|endoftext|>


Prompt:
// FILE: test.kt

class A

fun bar(a: A) = A()

fun box() {
    val a = A()
    bar(
            bar(
                    bar(a)
            )
    )
}

// EXPECTATIONS JVM_IR
// test.kt:9 box
// test.kt:4 <init>
// test.kt:9 box

Response:
// test.kt:12 box
// test.kt:6 bar
// test.kt:4 <init>
// test.kt:6 bar
// test.kt:11 box
// test.kt:6 bar
// test.kt:4 <init>
// test.kt:6 bar
// test.kt:10 box
// test.kt:6 bar
// test.kt:4 <init><|endoftext|>


Prompt:
val bar = Bar2<Int>()
    bar.value = 1
    takeStarBar2(bar)
    println(bar.value) // CCE: String cannot be cast to Number
}

// --- from Java (not-null) --- //

fun takeStarFoo3(x: Foo3<*>) {

Response:
x.value = <!ASSIGNMENT_TYPE_MISMATCH!>"test"<!>
    x.value <!NONE_APPLICABLE!>+=<!> "test"
}

fun main5() {
    val foo = Foo3<Int>()
    foo.value = 1
    takeStarFoo3(foo)<|endoftext|>


Prompt:
private fun applySourceMap(nodes: List<JsNode>) {
        var lastGroup: SourceMapGroup? = null
        var lastGroupIndex = 0
        var lastSegment: SourceMapSegment? = null
        var lastSegmentIndex = 0

        fun findCorrespondingSegment(node: SourceInfoAwareJsNode): SourceMapSegment? {

Response:
val source = node.source as? JsLocation ?: return null
            val group = sourceMap.groups.getOrElse(source.startLine) { return null }

            if (lastGroup != group) {
                if (lastGroup != null) {
                    val segmentsToSkip = lastGroup!!.segments.drop(lastSegmentIndex).toMutableList()<|endoftext|>


Prompt:
@GradleTest
    override fun testAbiChangeInLib_changeMethodSignature_tracked(gradleVersion: GradleVersion) {
        super.testAbiChangeInLib_changeMethodSignature_tracked(gradleVersion)
    }

    @Disabled("KT-57147")
    @GradleTest

Response:
override fun testNonAbiChangeInLib_changeMethodBody_tracked(gradleVersion: GradleVersion) {
        super.testNonAbiChangeInLib_changeMethodBody_tracked(gradleVersion)
    }

    @Disabled("KT-57147")
    @GradleTest
    override fun testAbiChangeInLib_changeMethodSignature(gradleVersion: GradleVersion) {<|endoftext|>


Prompt:
import java.lang.reflect.Method

internal fun wrapWithMuteInDatabase(testCase: TestCase, f: () -> Unit): (() -> Unit)? {
    return wrapWithMuteInDatabase(testCase.javaClass, testCase.name, f)
}

class RunnerFactoryWithMuteInDatabase : ParametersRunnerFactory {

Response:
override fun createRunnerForTestWithParameters(testWithParameters: TestWithParameters?): Runner {
        return object : BlockJUnit4ClassRunnerWithParameters(testWithParameters) {
            override fun isIgnored(child: FrameworkMethod): Boolean {
                val methodWithParametersKey = parametrizedMethodKey(child, name)

                return super.isIgnored(child)<|endoftext|>


Prompt:
override fun headerFilterOnly(vararg includeDirs: Any) = headerFilterOnly(includeDirs.toList())
        override fun headerFilterOnly(includeDirs: Collection<Any>) {
            headerFilterDirs += files(*includeDirs.toTypedArray())
        }
    }

    override fun getName(): String = params.name

    internal val identifier = params.identifier

Response:
override var dependencyFiles: FileCollection = files()

    val interopProcessingTaskName get() = params.interopProcessingTaskName

    @Deprecated("Deprecated. Please, use definitionFile.", ReplaceWith("definitionFile"))
    val defFileProperty: Property<File> = params.services.objectFactory.property<File>().convention(<|endoftext|>


Prompt:
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
import java.security.MessageDigest

const val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"

open class IncrementalJvmCache(
    targetDataRoot: File,

Response:
icContext: IncrementalCompilationContext,
    targetOutputDir: File?,
) : AbstractIncrementalCache<JvmClassName>(
    workingDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME),
    icContext,
), IncrementalCache {
    companion object {
        private const val PROTO_MAP = "proto"<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.FirWhileLoop
import org.jetbrains.kotlin.analysis.api.fir.getResolvedSymbolOfNameReference
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.getOrBuildFirSafe
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession

Response:
import org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession
import org.jetbrains.kotlin.analysis.api.fir.buildSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
import org.jetbrains.kotlin.psi.KtForExpression<|endoftext|>


Prompt:
copyBuilder.moduleData = original.moduleData
    copyBuilder.origin = original.origin
    copyBuilder.attributes = original.attributes.copy()
    copyBuilder.status = original.status
    copyBuilder.returnTypeRef = original.returnTypeRef
    copyBuilder.receiverParameter = original.receiverParameter
    copyBuilder.deprecationsProvider = original.deprecationsProvider

Response:
copyBuilder.containerSource = original.containerSource
    copyBuilder.dispatchReceiverType = original.dispatchReceiverType
    copyBuilder.contextReceivers.addAll(original.contextReceivers)
    copyBuilder.valueParameters.addAll(original.valueParameters)
    copyBuilder.body = original.body
    copyBuilder.contractDescription = original.contractDescription
    copyBuilder.name = original.name<|endoftext|>


Prompt:
get() = get(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, LanguageVersionSettingsImpl.DEFAULT)
    set(value) = put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, value)

val LanguageVersionSettings.isLibraryToSourceAnalysisEnabled: Boolean
    get() = getFlag(AnalysisFlags.libraryToSourceAnalysis)

Response:
val LanguageVersionSettings.areExpectActualClassesStable: Boolean
    get() {
        return getFlag(AnalysisFlags.muteExpectActualClassesWarning) || supportsFeature(LanguageFeature.ExpectActualClasses)
    }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.psi.KtWhenEntry
import org.jetbrains.kotlin.psi.KtWhenExpression
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.constants.ConstantValue
import org.jetbrains.kotlin.resolve.constants.NullValue

Response:
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.org.objectweb.asm.Label
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
import java.util.*<|endoftext|>


Prompt:
private fun addMethodsFromDataClass(result: MutableList<KtLightMethod>, classOrObjectSymbol: KtNamedClassOrObjectSymbol) {
        if (!classOrObjectSymbol.isData) return

        fun createMethodFromAny(ktFunctionSymbol: KtFunctionSymbol) {

Response:
// Similar to `copy`, synthetic members from `Any` should refer to `data` class as origin, not the function in `Any`.
            val lightMemberOrigin = classOrObjectDeclaration?.let { LightMemberOriginForDeclaration(it, JvmDeclarationOriginKind.OTHER) }
            result.add(
                SymbolLightSimpleMethod(
                    ktAnalysisSession = this@KtAnalysisSession,
                    ktFunctionSymbol,<|endoftext|>


Prompt: 0xbff921fb54442d18UL,     0xbff921fb54442d18UL,     0xbff921fb54434d1bUL,     0xbff921fb54450d16UL,

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


Prompt:
this.supertypes = mutableListOf<JavaClassifierType>().apply {
                addIfNotNull(superName?.convertInternalNameToClassifierType())
                interfaces?.forEach {
                    addIfNotNull(it.convertInternalNameToClassifierType())
                }
            }
        }
    }

    private fun parseClassSignature(signature: String) {

Response:
val iterator = StringCharacterIterator(signature)
        this.typeParameters =
            signatureParser
                .parseTypeParametersDeclaration(iterator, context)
                .also(context::addTypeParameters)

        val supertypes = SmartList<JavaClassifierType>()
        supertypes.addIfNotNull(signatureParser.parseClassifierRefSignature(iterator, context))<|endoftext|>


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

Response: $i$a$-f2-LibraryKt$foo$2\64\510\56:int=0:int<|endoftext|>


Prompt: // library.kt:53 box: $i$f$foo\1\64:int=0:int, array\1:java.lang.Integer[]=java.lang.Integer[], myClass\1:MyClass=MyClass

Response: // library.kt:14 box: $i$f$foo\1\64:int=0:int, array\1:java.lang.Integer[]=java.lang.Integer[], myClass\1:MyClass=MyClass, this_\52:MyClass=MyClass, $i$f$f2\52\480:int=0:int<|endoftext|>


Prompt:
val b: B<X, Y> = B(a)
        // crash here
    }
}

class C<X, Z, Y : X>

class D<X, Z, Y : X>(foo: C<X, Z, Y>) {
    fun test(a: C<Y, Y, Y>) {

Response:
val d: D<X, Y, Y> = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>D(a)<!>
    }
}<|endoftext|>


Prompt:
return builtIns.getArrayType(Variance.INVARIANT, componentType)
    }

    override fun KotlinTypeMarker.isArrayOrNullableArray(): Boolean {
        require(this is KotlinType, this::errorMessage)
        return KotlinBuiltIns.isArray(this)
    }

Response:
override fun KotlinTypeMarker.hasAnnotation(fqName: FqName): Boolean {
        require(this is KotlinType, this::errorMessage)
        return annotations.hasAnnotation(fqName)
    }

    override fun KotlinTypeMarker.getAnnotationFirstArgumentValue(fqName: FqName): Any? {<|endoftext|>


Prompt:
fun incrementAndGetOrdinal(): Long
}

/**
 * This class is used for counting builds involving Kotlin withing one Gradle daemon
 * One instance is kept available via JMX bean after build completion. If other builds are executed with other version
 * of Kotlin plugin, they are still able to reuse this build counter vis JXM interface
 */
class DaemonReuseCounter private constructor() : IDaemonReuseCounterMXBean {

Response:
private val count = AtomicLong()

    override fun getOrdinal(): Long {
        return count.get()
    }

    override fun incrementAndGetOrdinal(): Long {
        return count.incrementAndGet()
    }

    companion object {
        // Do not rename this bean otherwise compatibility with the older Kotlin Gradle Plugins would be lost<|endoftext|>


Prompt:
} else if (contracts.case_4(value_1, value_2) == false) {
        println(value_2)
    } else if (contracts.case_4(value_1, value_2) == null) {
        <!UNSAFE_IMPLICIT_INVOKE_CALL!>value_2<!>()
    }
}

Response:
// TESTCASE NUMBER: 5
fun case_5(value_1: Number?, value_2: String?) {
    when (value_2.case_5(value_1)) {
        true -> {
            println(value_2<!UNSAFE_CALL!>.<!>length)
            println(value_1<!UNSAFE_CALL!>.<!>toByte())
        }<|endoftext|>


Prompt:
fun shouldCheckGradleRegisteredTasks(gradleVersion: GradleVersion) {
        buildNewKnLibraryDslCocoapodsProjectWithTasks(gradleVersion) {
            buildAndAssertAllTasks(
                listOf(
                    "shared:generateMylibStaticLibraryLinuxX64Podspec",
                    "shared:generateMyslibSharedLibraryLinuxX64Podspec",

Response:
"shared:generateMyframeFrameworkIosArm64Podspec",
                    "shared:generateMyfatframeFatFrameworkPodspec",
                    "shared:generateSharedXCFrameworkPodspec",
                    "lib:generateGrooframeFrameworkIosArm64Podspec",
                    "lib:generateGrooxcframeXCFrameworkPodspec",<|endoftext|>


Prompt:
package org.jetbrains.kotlin.cfg.pseudocode.instructions.special

import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.cfg.pseudocode.instructions.BlockScope
import org.jetbrains.kotlin.cfg.pseudocode.instructions.InstructionWithNext

Response:
import org.jetbrains.kotlin.cfg.pseudocode.instructions.InstructionVisitor
import org.jetbrains.kotlin.cfg.pseudocode.instructions.InstructionVisitorWithResult

class MarkInstruction(
    element: KtElement,
    blockScope: BlockScope
) : InstructionWithNext(element, blockScope) {<|endoftext|>


Prompt:
sideEffects = SideEffectKind.DEPENDS_ON_STATE
        source = callElement
        coroutineResult = true
        synthetic = true
    }
}

fun KotlinType.refineType() =
    TypeUtils.getAllSupertypes(this).find(KotlinBuiltIns::isPrimitiveTypeOrNullablePrimitiveType) ?: this

/**

Response:
* Tries to get precise statically known primitive type. Takes generic supertypes into account. Doesn't handle smart-casts.
 * This is needed to be compatible with JVM NaN behaviour:
 *
 * // Generics with Double super-type
 * fun <T: Double> foo(v: T) = println(v == v)
 * foo(Double.NaN) // false
 *<|endoftext|>


Prompt:
override fun toString(): String = ${"if (step > 0) \"\$first..\$last step \$step\" else \"\$first downTo \$last step \${-step}\""}

    public companion object {
        /**
         * Creates $progression within the specified bounds of a closed range.
         *

Response:
* The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].
         * In order to go backwards the [step] must be negative.
         *
         * [step] must be greater than `$stepMinValue` and not equal to zero.
         */<|endoftext|>


Prompt:
abstract class AbstractCollectDiagnosticsTest : AbstractAnalysisApiBasedTest() {
    override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {
        doTestByKtFile(mainFile, testServices)
    }

    /**
     * [ktFile] may be a fake file for dangling module tests.
     */

Response:
protected fun doTestByKtFile(ktFile: KtFile, testServices: TestServices) {
        fun TextRange.asLineColumnRange(): String {
            return getLineAndColumnRangeInPsiFile(ktFile, this).toString()
        }

        analyseForTest(ktFile) {
            val diagnosticsInFile =<|endoftext|>


Prompt:
@kotlin.internal.InlineOnly
    public final inline operator fun times(other: kotlin.UByte): kotlin.UInt

    @kotlin.internal.InlineOnly
    public final inline operator fun times(other: kotlin.UInt): kotlin.UInt

    @kotlin.internal.InlineOnly

Response:
public final inline operator fun times(other: kotlin.ULong): kotlin.ULong

    @kotlin.internal.InlineOnly
    public final inline operator fun times(other: kotlin.UShort): kotlin.UInt

    @kotlin.internal.InlineOnly
    public final inline fun toByte(): kotlin.Byte<|endoftext|>


Prompt:
// ISSUE: KT-42130

interface A
interface B : A

fun B.foo(): Boolean = true
fun <T> run(action: () -> T): T = action()

fun foo(a: A): String {
    return when (a) {
        is B -> when {
            run { a.foo() } -> "OK"
            else -> "Fail 1"
        }

Response:
else -> "Fail 2"
    }
}

class C : B

fun box(): String = foo(C())<|endoftext|>


Prompt:
* Checks if the specified [high] and [low] chars are [Char.isHighSurrogate] and [Char.isLowSurrogate] correspondingly.
 */
@ExperimentalNativeApi
// TODO: Consider removing from public API
public fun Char.Companion.isSurrogatePair(high: Char, low: Char): Boolean = high.isHighSurrogate() && low.isLowSurrogate()

Response:
/**
 * Converts the codepoint specified to a char array. If the codepoint is not supplementary, the method will
 * return an array with one element otherwise it will return an array A with a high surrogate in A[0] and
 * a low surrogate in A[1].
 *
 *
 * Note that this function is unstable.
 * In the future it could be deprecated in favour of an overload that would accept a `CodePoint` type.<|endoftext|>


Prompt:
require(reifiedIs<MutableMap.MutableEntry<*, *>>(w)) { "reifiedIs<MutableMap.MutableEntry<*, *>>(w)" }

    reifiedAsSucceeds<Iterator<*>>(w, "reified w as Iterator<*>")

Response:
reifiedAsFailsWithCCE<MutableIterator<*>>(w, "reified w as MutableIterator<*>")
    reifiedAsSucceeds<MutableIterable<*>>(w, "reified w as MutableIterable<*>")<|endoftext|>


Prompt:
import org.jetbrains.kotlin.android.synthetic.descriptors.AndroidSyntheticPackageFragmentDescriptor
import org.jetbrains.kotlin.android.synthetic.descriptors.LazySyntheticElementResolveContext
import org.jetbrains.kotlin.android.synthetic.descriptors.PredefinedPackageFragmentDescriptor

Response:
import org.jetbrains.kotlin.android.synthetic.descriptors.PredefinedPackageFragmentDescriptor.LazyAndroidExtensionsPackageFragmentDescriptor
import org.jetbrains.kotlin.android.synthetic.forEachUntilLast
import org.jetbrains.kotlin.descriptors.ModuleDescriptor<|endoftext|>


Prompt:
assertEquals("300m", opts2.maxMemory)
            assertEquals( -1, DaemonJVMOptionsMemoryComparator().compare(opts, opts2))
            assertEquals("300m", listOf(opts, opts2).maxWithOrNull(DaemonJVMOptionsMemoryComparator())?.maxMemory)

Response:
val myXmxParam = ManagementFactory.getRuntimeMXBean().inputArguments.first { it.startsWith("-Xmx") }
            TestCase.assertNotNull(myXmxParam)
            val myXmxVal = myXmxParam.substring(4)
            System.clearProperty(CompilerSystemProperties.COMPILE_DAEMON_JVM_OPTIONS_PROPERTY.property)<|endoftext|>


Prompt:
"-XX:+UseCodeCacheFlushing",
            "-XX:ReservedCodeCacheSize=${reservedCodeCacheSizeMb}m",
            "-XX:MaxMetaspaceSize=${maxMetaspaceSizeMb}m",
            "-XX:CICompilerCount=2",
            "-Djna.nosys=true"
        )

Response:
val nativeMemoryTracking = project.providers.gradleProperty("kotlin.build.test.process.NativeMemoryTracking")
        if (nativeMemoryTracking.isPresent) {
            jvmArgs("-XX:NativeMemoryTracking=${nativeMemoryTracking.get()}")
        }

        val junit5ParallelTestWorkers =<|endoftext|>


Prompt: $i$f$baz1\21\109:int=0:int, baz1Var\21:int=3:int, baz1BlockParam\23:int=1:int, $i$a$-baz1-LibraryKt$inlineCall$1\23\112\20:int=0:int, baz1LambdaVar\23:int=1:int,

Response: baz1Param\24:int=2:int, $i$f$baz1\24\119:int=0:int, baz1Var\24:int=3:int<|endoftext|>


Prompt:
override fun contains(element: T): Boolean = this@asList.contains(element)
        override fun get(index: Int): T = this@asList[index]
        override fun indexOf(element: T): Int = this@asList.indexOf(element)
        override fun lastIndexOf(element: T): Int = this@asList.lastIndexOf(element)
    }
}

Response:
/**
 * Returns a [List] that wraps the original array.
 */
public actual fun ByteArray.asList(): List<Byte> {
    return object : AbstractList<Byte>(), RandomAccess {
        override val size: Int get() = this@asList.size
        override fun isEmpty(): Boolean = this@asList.isEmpty()<|endoftext|>


Prompt:
NestedType(PossiblyInnerType(classifier, type.arguments, null), emptyList())
            } else {
                NestedType(innerTypesAsList[indexOfParameterizedType], innerTypesAsList.drop(indexOfParameterizedType + 1))
            }
        }
    }

    class NestedType(val root: PossiblyInnerType, val nested: List<PossiblyInnerType>) {

Response:
val allInnerTypes: List<PossiblyInnerType>
            get() = buildList {
                add(root)
                addAll(nested)
            }
    }

    override val typeContext = KtFe10TypeSystemCommonBackendContextForTypeMapping(resolveSession)<|endoftext|>


Prompt:
public inline fun <T, K, V> Array<out T>.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, List<V>> {
    return groupByTo(LinkedHashMap<K, MutableList<V>>(), keySelector, valueTransform)
}

/**
 * Groups values returned by the [valueTransform] function applied to each element of the original array

Response:
* by the key returned by the given [keySelector] function applied to the element
 * and returns a map where each group key is associated with a list of corresponding values.
 *
 * The returned map preserves the entry iteration order of the keys produced from the original array.
 *
 * @sample samples.collections.Collections.Transformations.groupByKeysAndValues
 */<|endoftext|>


Prompt:
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>
        test(<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>)
        <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>.a = 20

Response:
}, <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>this<!>) {
        this.a = 30
    }
}

open class Base(val x: Int)

class Derived : Base(<!NO_THIS!>this<!>.<!UNRESOLVED_REFERENCE!>y<!>) { // FE 1.0 reports NO_THIS here<|endoftext|>


Prompt:
public inline fun FloatArray.sumOf(selector: (Float) -> java.math.BigInteger): java.math.BigInteger {
    var sum: java.math.BigInteger = 0.toBigInteger()
    for (element in this) {
        sum += selector(element)
    }
    return sum
}

/**

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


Prompt:
constructor.startOffset,
                constructor.endOffset,
                OVERRIDING_INITIALIZER_BY_CONSTRUCTOR,
                initMethod.name,
                DescriptorVisibilities.PUBLIC,
                isInline = false,
                isExpect = false,
                irClass.defaultType,
                Modality.OPEN,
                IrSimpleFunctionSymbolImpl(),

Response:
isTailrec = false,
                isSuspend = false,
                isOperator = false,
                isInfix = false,
        ).also { result ->
            result.parent = irClass
            result.createDispatchReceiverParameter()
            result.valueParameters += constructor.valueParameters.map { it.copyTo(result) }

            result.overriddenSymbols += initMethod.symbol<|endoftext|>


Prompt:
val testDependencyKlibsClasspath = testDependencyKlibs.incoming.files.elements.map { elements ->
            elements.joinToString(File.pathSeparator) { location -> location.asFile.absolutePath }
        }

        doFirst {
            systemProperty("testDependencyKlibs", testDependencyKlibsClasspath.get())
        }

Response:
/* Add dependency files as inputs to this test task */
        inputs.files(testDependencyKlibs).withPathSensitivity(PathSensitivity.RELATIVE)
    }

    useJUnitPlatform()
    enableJunit5ExtensionsAutodetection()

    /* Special 'Kotlin in Fleet' flag that can switch test mode to 'local development' */<|endoftext|>


Prompt:
return this
    }

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

    override fun <D> transformDelegatedConstructor(transformer: FirTransformer<D>, data: D): FirConstructorImpl {

Response:
delegatedConstructor = delegatedConstructor?.transform(transformer, data)
        return this
    }

    override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirConstructorImpl {
        body = body?.transform(transformer, data)
        return this
    }

    override fun replaceStatus(newStatus: FirDeclarationStatus) {<|endoftext|>


Prompt:
val descriptorsForImport = descriptorsSelector(getImportScope(directive))
                descriptors = descriptors.concat(descriptorsForImport)
            }

            descriptors.orEmpty()
        }

    fun getImportScope(directive: KtImportInfo): ImportingScope {
        return importedScopesProvider(directive) ?: ImportingScope.Empty
    }

Response:
val allNames: Set<Name>? by components.storageManager.createNullableLazyValue {
        indexedImports.imports.asIterable().flatMapToNullable(ObjectOpenHashSet()) { getImportScope(it).computeImportedNames() }
    }

    fun definitelyDoesNotContainName(name: Name): Boolean {<|endoftext|>


Prompt:
return DummyDelegate(KtDiagnosticFactory1(prop.name, severity, positioningStrategy, psiType))
    }
}

class DiagnosticFactory2DelegateProvider<A, B>(
    private val severity: Severity,
    private val positioningStrategy: AbstractSourceElementPositioningStrategy,
    private val psiType: KClass<*>
) {

Response:
operator fun provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty<Any?, KtDiagnosticFactory2<A, B>> {
        return DummyDelegate(KtDiagnosticFactory2(prop.name, severity, positioningStrategy, psiType))
    }
}

class DiagnosticFactory3DelegateProvider<A, B, C>(
    private val severity: Severity,<|endoftext|>


Prompt:
const val b1 = <!EVALUATED: `-1`!>safeClassCast(10)<!>
const val b2 = <!EVALUATED: `2`!>safeClassCast("10")<!>

// in this example all unsafe cast will be "successful", but will fall when trying to assign

Response:
const val c1 = <!EVALUATED: `1`!>unsafeClassCast<Int>()<!>
const val c2 = <!WAS_NOT_EVALUATED: `
Exception java.lang.ClassCastException: kotlin.Int cannot be cast to kotlin.String<|endoftext|>


Prompt:
private fun Set<Dependency>.checkNoDuplicates(kind: String) {
                fun Map<String, List<Dependency>>.dump(): String = values.flatten().sortedBy { it.moduleName }.joinToString()

                val duplicatedModules = groupBy { it.moduleName }.filterValues { it.size > 1 }
                assertTrue(duplicatedModules.isEmpty()) {

Response:
"There are duplicated $kind module dependencies: ${duplicatedModules.dump()}"
                }

                val duplicatedFiles = groupBy { it.libraryFile.absolutePath }.filterValues { it.size > 1 }
                assertTrue(duplicatedFiles.isEmpty()) {
                    "There are $kind module dependencies with conflicting paths: ${duplicatedFiles.dump()}"
                }
            }
        }<|endoftext|>


Prompt: expectFailure(linkage("Can not get instance of singleton 'EnumClassThatBecomesPrivate.ENTRY': Private enum entry declared in module <lib1> can not be accessed in module <lib2>")) { getAnnotationClassWithParameterThatBecomesPrivate4AsAny().toString() }

Response: expectFailure(linkage("Can not get instance of singleton 'EnumClassThatBecomesPrivate.ENTRY': Private enum entry declared in module <lib1> can not be accessed in module <lib2>")) { getAnnotationClassWithParameterThatBecomesPrivate4AsAnyInline().toString() }<|endoftext|>


Prompt:
override fun <T> put(entry: Entry<T>): T? {
        return extras.put(entry.key, entry)?.let { it.value as T }
    }

    override fun putAll(from: Iterable<Entry<*>>) {
        this.extras.putAll(from.associateBy { it.key })
    }

Response:
override fun <T> get(key: Key<T>): T? {
        return extras[key]?.let { it.value as T }
    }

    override fun <T> remove(key: Key<T>): T? {
        return extras.remove(key)?.let { it.value as T }
    }

    override fun clear() {
        extras.clear()<|endoftext|>


Prompt:
it.resume(a + b)
        COROUTINE_SUSPENDED
    }
    return local(a, b)
}

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

fun box(): String {
    var res = "FAIL"
    builder {
        res = callLocal("O", "K")
    }

Response:
return res
}<|endoftext|>


Prompt:
// This is a workaround
                // for TypeParameters having initial parents (old IrFunctions before deepCopy).
                // Otherwise it doesn't compile on k/js and k/native (can't find symbols).
                // Ideally we will find a solution to remap symbols of TypeParameters in
                // ComposableSingletons properties after ComposerParamTransformer
                // (deepCopy in ComposerParamTransformer didn't help).
                return wrapped

Response:
}
            return irGetComposableSingleton(
                lambdaExpression = wrapped,
                lambdaType = expression.type
            )
        } else {
            return wrapped
        }
    }

    private fun hasTypeParameter(type: IrType): Boolean {
        return type.anyTypeArgument { true }
    }

    private fun irGetComposableSingleton(<|endoftext|>


Prompt:
override fun diagnoseUnknownModuleInfo(infos: List<ModuleInfo>) = throw IllegalStateException("Should not be called for $infos")

    override fun moduleInfoForModuleDescriptor(moduleDescriptor: ModuleDescriptor): M {
        throw IllegalStateException("$moduleDescriptor is not contained in this resolver")
    }
}

data class ModuleContent<out M : ModuleInfo>(

Response:
val moduleInfo: M,
    val syntheticFiles: Collection<KtFile>,
    val moduleContentScope: GlobalSearchScope
)

interface PlatformAnalysisParameters {
    object Empty : PlatformAnalysisParameters
}

interface CombinedModuleInfo : ModuleInfo {
    val containedModules: List<ModuleInfo>
    val platformModule: ModuleInfo
}

/**<|endoftext|>


Prompt:
// old inliner with $iv suffixes.
    val inlineScopesNewFormatToOld = listOf("inlineScopes/newFormatToOld")

    generateTestGroupSuiteWithJUnit5(args, mainClassName) {
        testGroup(testsRoot = "compiler/tests-common-new/tests-gen", testDataRoot = "compiler/testData") {

Response:
testClass<AbstractDiagnosticTest> {
                model("diagnostics/tests", pattern = "^(.*)\\.kts?$", excludedPattern = excludedCustomTestdataPattern)
                model("diagnostics/testsWithStdLib", excludedPattern = excludedCustomTestdataPattern)
            }

            testClass<AbstractDiagnosticUsingJavacTest> {<|endoftext|>


Prompt:
assertEquals("MyObject.Object.Class.a", MyObject.Object.Class.a)
    assertEquals("MyObject.Object.Class.b", MyObject.Object.Class.b)
    assertEquals(142, MyObject.Object.Class.test())

    assertEquals("MyObject.Class().a", MyObject.Class("MyObject.Class().a").a)

Response:
assertEquals("MyObject.Class().b", MyObject.Class("something").b)
    assertEquals(42, MyObject.Class("something").test())
    assertEquals("MyObject.Class.a", MyObject.Class.a)
    assertEquals("MyObject.Class.b", MyObject.Class.b)
    assertEquals(142, MyObject.Class.test())<|endoftext|>


Prompt:
// WITH_STDLIB

import kotlin.test.assertEquals

inline fun foo(x: String, block: (String) -> String) = block(x)

fun box(): String {
    val res = foo("abc") {
        fun bar(y: String) = y + "cde"
        bar(it)
    }

    assertEquals("abccde", res)

Response:
return "OK"
}<|endoftext|>


Prompt:
//language=Gradle
                """
                |plugins {
                |   id("org.jetbrains.kotlin.kapt")
                |${it.substringAfter("plugins {")}
                """.trimMargin()
            }

            build(":app:testDebugUnitTest")

Response:
appProject.kotlinSourcesDir().resolve("com/example/KotlinActivity.kt").appendText(
                //language=kt
                """
                {
                  private val x = 1
                }
                """.trimIndent()
            )

            build(":app:testDebugUnitTest") {<|endoftext|>


Prompt:
// See ObjC instanceOf code generation for details.
            if (expression is IrTypeOperatorCall && expression.operator.callsInstanceOf()
                    && expression.typeOperand.isObjCObjectType()) {
                val objcObjGetter = IrCallImpl.fromSymbolOwner(expression.startOffset, expression.endOffset,
                        objCObjectRawValueGetter.owner.returnType,

Response:
objCObjectRawValueGetter,
                        objCObjectRawValueGetter.owner.typeParameters.size,
                        objCObjectRawValueGetter.owner.valueParameters.size
                ).apply {
                    extensionReceiver = expression.argument
                }
                expressions += objcObjGetter to currentLoop
            }

            if (expression is IrReturnableBlock) {<|endoftext|>


Prompt:
ObjCClassType(referenceClass(classDescriptor).objCName, typeArgs)
        }
    }

    private tailrec fun mapObjCObjectReferenceTypeIgnoringNullability(descriptor: ClassDescriptor): ObjCNonNullReferenceType {
        // TODO: more precise types can be used.

        if (descriptor.isObjCMetaClass()) return ObjCMetaClassType

Response:
if (descriptor.isObjCProtocolClass()) return foreignClassType("Protocol")

        if (descriptor.isExternalObjCClass() || descriptor.isObjCForwardDeclaration()) {
            return if (descriptor.isInterface) {
                val name = descriptor.name.asString().removeSuffix("Protocol")
                foreignProtocolType(name)
            } else {<|endoftext|>


Prompt:
open val ctrlKey: Boolean
    open val shiftKey: Boolean
    open val altKey: Boolean
    open val metaKey: Boolean
    open val repeat: Boolean
    open val isComposing: Boolean
    open val charCode: Int
    open val keyCode: Int
    open val which: Int
    fun getModifierState(keyArg: String): Boolean

    companion object {

Response:
val DOM_KEY_LOCATION_STANDARD: Int
        val DOM_KEY_LOCATION_LEFT: Int
        val DOM_KEY_LOCATION_RIGHT: Int
        val DOM_KEY_LOCATION_NUMPAD: Int
        val NONE: Short
        val CAPTURING_PHASE: Short
        val AT_TARGET: Short
        val BUBBLING_PHASE: Short<|endoftext|>


Prompt:
val ARRAY_BUFFER: Int
        val ELEMENT_ARRAY_BUFFER: Int
        val ARRAY_BUFFER_BINDING: Int
        val ELEMENT_ARRAY_BUFFER_BINDING: Int
        val STREAM_DRAW: Int
        val STATIC_DRAW: Int
        val DYNAMIC_DRAW: Int
        val BUFFER_SIZE: Int

Response:
val BUFFER_USAGE: Int
        val CURRENT_VERTEX_ATTRIB: Int
        val FRONT: Int
        val BACK: Int
        val FRONT_AND_BACK: Int
        val CULL_FACE: Int
        val BLEND: Int
        val DITHER: Int
        val STENCIL_TEST: Int
        val DEPTH_TEST: Int<|endoftext|>


Prompt:
fun fromString(string: String): BackendKind<*>? {
        return when (string) {
            "ClassicBackend" -> ClassicBackend
            "IrBackend" -> IrBackend
            "DeserializedIrBackend" -> DeserializedIrBackend
            else -> null
        }
    }

Response:
fun fromTargetBackend(targetBackend: TargetBackend?): BackendKind<*> {
        if (targetBackend == null) return BackendKind.NoBackend
        return if (targetBackend.isIR) IrBackend
        else ClassicBackend
    }
}

object ArtifactKinds {
    object Jvm : BinaryKind<BinaryArtifacts.Jvm>("JVM")<|endoftext|>


Prompt:
put(
            FirSerializationErrors.INNER_CLASSES_NOT_SUPPORTED,
            "Inner (with reference to outer this) serializable classes are not supported. Remove @Serializable annotation or 'inner' keyword."
        )
        put(
            FirSerializationErrors.COMPANION_OBJECT_AS_CUSTOM_SERIALIZER_DEPRECATED,

Response:
"Class {0} has implicit custom serializer as its companion object. This behaviour is not properly reflected by @Serializable annotation without arguments and therefore is deprecated. " +
                    "To be able to use companion object as the {0} default serializer, please explicitly mention it in the annotation on {0}: @Serializable({0}.Companion::class). " +<|endoftext|>


Prompt:
for (i in (3L downTo 5L).reversed()) {
        list4.add(i)
        if (list4.size > 23) break
    }
    if (list4 != listOf<Long>()) {
        return "Wrong elements for (3L downTo 5L).reversed(): $list4"
    }

    val list5 = ArrayList<Char>()

Response:
for (i in ('a' downTo 'c').reversed()) {
        list5.add(i)
        if (list5.size > 23) break
    }
    if (list5 != listOf<Char>()) {
        return "Wrong elements for ('a' downTo 'c').reversed(): $list5"
    }

    return "OK"
}<|endoftext|>


Prompt:
assertNull(property.setter, "Expected property to have *no* setter")
        assertFalse(property.isLateInit, "Expected property to be *not* lateinit")
        assertFalse(property.isVar, "Expected property to be *not* var")
        assertEquals(Visibilities.Public, property.visibility, "Expected property to be public")

Response:
assertNull(property.extensionReceiver, "Expected property to *not* have extension receiver")
    }

    fun `test simple var property`() {
        val module = createCirTreeFromSourceCode("var x: Int = 42")
        val property = module.assertSingleProperty()
        assertNotNull(property.getter, "Expected property has getter")<|endoftext|>


Prompt:
* Needed for the implementation of IDE intention.
         */
        val actualAnnotationTargetElement: SourceElementMarker,
        val type: IncompatibilityType<K1ExpectActualMatchingContext.AnnotationCallInfo>,
    )

    fun areAnnotationsCompatible(
        expectSymbol: DeclarationSymbolMarker,
        actualSymbol: DeclarationSymbolMarker,

Response:
context: K1ExpectActualMatchingContext<*>,
    ): Incompatibility? = with(context) {
        areAnnotationsCompatible(expectSymbol, actualSymbol)
    }

    private fun K1ExpectActualMatchingContext<*>.areAnnotationsCompatible(
        expectSymbol: DeclarationSymbolMarker,
        actualSymbol: DeclarationSymbolMarker,<|endoftext|>


Prompt:
@Retention(AnnotationRetention.BINARY)
annotation class RefinesInSwift

@RefinesInSwift
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION)
@Retention(AnnotationRetention.BINARY)
public annotation class ShouldRefineInSwift

// FILE: platform.kt

Response:
actual typealias MyHidesFromObjC = kotlin.native.HidesFromObjC
actual typealias MyHiddenFromObjC = kotlin.native.HiddenFromObjC
actual typealias MyRefinesInSwift = kotlin.native.RefinesInSwift
actual typealias MyShouldRefineInSwift = kotlin.native.ShouldRefineInSwift<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !CHECK_TYPE

package h
//+JDK
import java.util.*
import checkSubtype

fun <T> id(t: T) : T = t

fun <T> id1(t: T) = t

fun <R> elem(t: List<R>): R = t.get(0)

Response:
fun <R> elemAndList(r: R, t: List<R>): R = t.get(0)

fun <T> both(t1: T, t2: T) : T = t1

fun test1() {
    val a = elem(list(2))
    val b = id(elem(list(2)))<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNCHECKED_CAST -OPT_IN_USAGE_ERROR -UNUSED_PARAMETER

class Bar

fun <T> materialize() = null as T

interface FlowCollector<in T> {
    suspend fun emit(value: T)
}

interface Flow<T>

Response:
public fun <T> flow(block: suspend FlowCollector<T>.() -> Unit) = materialize<Flow<T>>()

fun foo(total: Int, next: Int) = 10
fun foo(total: Int, next: Float) = 10
fun foo(total: Float, next: Int) = 10

fun call(x: String) {}

suspend fun foo(x: Int) = flow {<|endoftext|>


Prompt:
object V : P()
        class M : P()
    }

    val p: P = object : P() {

    }

    val r = object : P() {

    }
}

class K : P()

object B {
    class <caret>I : P()
}

fun test() {
    class L : P()
    val a = object : P() {

Response:
}
}<|endoftext|>


Prompt:
<!NON_ABSTRACT_FUNCTION_WITH_NO_BODY, NON_ABSTRACT_FUNCTION_WITH_NO_BODY{JVM}!><!WRONG_MODIFIER_TARGET, WRONG_MODIFIER_TARGET{JVM}!>expect<!> fun bar(): String<!>
}

Response:
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt<|endoftext|>


Prompt:
}

const val aSimpleName = <!EVALUATED: `A`!>A::class.simpleName!!<!>
const val aQualifiedName = <!EVALUATED: `test.A`!>A::class.qualifiedName!!<!>

Response: const val aMembers = <!EVALUATED: `val test.A.a: kotlin.Int, val test.A.b: kotlin.String, val test.A.(kotlin.String.)propertyWithExtension: kotlin.Int, fun test.A.(kotlin.Int.)funWithExtension(kotlin.Int): kotlin.Int, fun<|endoftext|>


Prompt:
val parcelCreateLongArray: IrSimpleFunctionSymbol =
        androidOsParcel.owner.addFunction(
            "createLongArray",
            irBuiltIns.primitiveArrayForType.getValue(irBuiltIns.longType).defaultType
        ).symbol

    val parcelCreateStringArray: IrSimpleFunctionSymbol =

Response:
androidOsParcel.owner.addFunction("createStringArray", irBuiltIns.arrayClass.typeWith(irBuiltIns.stringType)).symbol

    val parcelCreateStringArrayList: IrSimpleFunctionSymbol =
        androidOsParcel.owner.addFunction("createStringArrayList", javaUtilArrayList.defaultType).symbol

    val parcelReadBundle: IrSimpleFunctionSymbol =<|endoftext|>


Prompt:
val argumentSource = sourceAttribute?.source

        if (argumentType != null && isExplicitTypeArgumentSource(argumentSource)) {
            if (!isIgnoreTypeParameters || (argumentType.typeArguments.isEmpty() && argumentType !is ConeTypeParameterType)) {
                val intersection =
                    typeSystemContext.intersectTypes(typeParameters[index].resolvedBounds.map { it.coneType })

Response:
val upperBound = substitutor.substituteOrSelf(intersection)
                if (!AbstractTypeChecker.isSubtypeOf(
                        typeSystemContext,
                        argumentType,
                        upperBound,
                        stubTypesEqualToAnything = true
                    )
                ) {
                    if (isReportExpansionError && argumentTypeRef == null) {
                        reporter.reportOn(<|endoftext|>


Prompt:
h.toInt()

    i.toInt()
    j.toByte()

    k.intValue()
    k.byteValue()

    l.intValue()
    l.doubleValue()

    m.intValue()
    m.doubleValue()

    n.intValue()

    o.intValue()
    o.byteValue()

    p.intValue()

Response:
p.shortValue()

    q.intValue()
    q.toByte()

    r.intValue()
}<|endoftext|>


Prompt:
@AndroidGradlePluginTests
class ConfigurationCacheForAndroidIT : AbstractConfigurationCacheIT() {
    @DisplayName("works in android plus kapt project")
    @GradleAndroidTest
    fun testAndroidKaptProject(
        gradleVersion: GradleVersion,
        agpVersion: String,
        jdkVersion: JdkVersions.ProvidedJdk,
    ) {
        project(

Response:
"kapt2/android-dagger",
            gradleVersion,
            buildOptions = defaultBuildOptions.copy(androidVersion = agpVersion),
            buildJdk = jdkVersion.location
        ) {
            gradleProperties.append("\nkapt.incremental.apt=false")

            testConfigurationCacheOf(
                ":app:compileDebugKotlin",<|endoftext|>


Prompt:
// DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS, -MISPLACED_TYPE_PARAMETER_CONSTRAINTS

class MemberScope {

    class TestBasic {
        @Deprecated(message = "", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor()<!>

Response:
<!CONFLICTING_OVERLOADS!>constructor()<!>
    }

    class TestIdenticalPrimaryAndSecondaryConstructorsA <!CONFLICTING_OVERLOADS!>constructor()<!> {
        @Deprecated(message = "", level = DeprecationLevel.HIDDEN) <!CONFLICTING_OVERLOADS!>constructor()<!> : this()<|endoftext|>


Prompt:
StateMachineChecker.suspendHere()
        StateMachineChecker.suspendHere()
        StateMachineChecker.suspendHere()
        StateMachineChecker.suspendHere()
        StateMachineChecker.suspendHere()
    }
    l()
    l()
}

// FILE: inlineSite.kt
import kotlin.coroutines.*
import helpers.*

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

fun box(): String {
    StateMachineChecker.reset()
    var res = "OK"
    builder {
        crossinlineMe {
            res = "FAIL 1"
        }
    }
    StateMachineChecker.check(numberOfSuspensions = 10)
    return res
}<|endoftext|>


Prompt:
// FIR_IDENTICAL
class Key<T>
class Box<T>

fun <T : Any> get(key: Key<in T>): T? = null
fun <T> acceptBox(box: Box<T>) {}

fun <V> test(key: Key<in Box<V>>) {
    // CS of get:

Response:
// Key<CapturedType(in Box<V>)> <: Key<in TypeVariable(T)>
    // If the type is not approximated to subtype before fixation, the type of the lambda parameter `it` becomes Any?
    get(key)?.let { acceptBox(it) }

    val x = get(key)
    x?.let { acceptBox(it) }
}<|endoftext|>


Prompt:
return if (this@case_22_2 == null || this@case_22_2 !is String) true else null
}
fun <T> T?.case_22_3(): Boolean? {
    contract { returns(null) implies (this@case_22_3 == null || this@case_22_3 !is String) }

Response:
return if (this@case_22_3 == null || this@case_22_3 !is String) null else true
}

// TESTCASE NUMBER: 23
fun <T : Number?> T.case_23_1(): Boolean {<|endoftext|>


Prompt:
val konanHome: Provider<String> = kotlinNativeProvider.map { it.bundleDirectory.get().asFile.absolutePath }

    private val runnerSettings = KotlinNativeCompilerRunner.Settings.of(
        kotlinNativeProvider.get().bundleDirectory.getFile().absolutePath,
        kotlinNativeProvider.get().konanDataDir.orNull,
        project
    )

Response:
@TaskAction
    fun compile() {
        val metricsReporter = metrics.get()

        addBuildMetricsForTaskAction(metricsReporter = metricsReporter, languageVersion = null) {
            validatedExportedLibraries()

            val output = outputFile.get()
            output.parentFile.mkdirs()<|endoftext|>


Prompt:
if (!(element22 in 1L..3L) != !range0.contains(element22)) throw AssertionError()
    if (!(element22 !in 1L..3L) != range0.contains(element22)) throw AssertionError()
}

fun testR0xE23() {
    // with possible local optimizations

Response:
if (4L in 1L..3L != range0.contains(4L)) throw AssertionError()
    if (4L !in 1L..3L != !range0.contains(4L)) throw AssertionError()
    if (!(4L in 1L..3L) != !range0.contains(4L)) throw AssertionError()<|endoftext|>


Prompt:
if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?"), DEBUG_INFO_SMARTCAST!>c<!>.funAny()

        if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?")!>c<!>.funNullableT()

Response:
if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?")!>c<!>.funNullableAny()
        if (c != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Unit?")!>c<!><|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.FirElement
import org.jetbrains.kotlin.fir.visitors.FirTransformer
import org.jetbrains.kotlin.fir.visitors.FirVisitor

/**
 * Generated from: [org.jetbrains.kotlin.fir.tree.generator.FirTreeBuilder.statement]
 */

Response:
interface FirStatement : FirAnnotationContainer {
    override val source: KtSourceElement?
    override val annotations: List<FirAnnotation>

    override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R =
        visitor.visitStatement(this, data)

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


Prompt:
package org.jetbrains.kotlin.incremental.storage

import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.IOUtil
import com.intellij.util.io.KeyDescriptor
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.incremental.IncrementalCompilationContext

Response:
import org.jetbrains.kotlin.utils.Printer
import java.io.File

/** [PersistentStorage] that provides a few extra utility methods. */
interface BasicMap<KEY, VALUE> : PersistentStorage<KEY, VALUE> {

    /** Removes all entries. */
    fun clear() {
        synchronized(this) {
            keys.forEach { remove(it) }<|endoftext|>


Prompt:
private fun checkVarargParameters(function: FirFunction, context: CheckerContext, reporter: DiagnosticReporter) {
        val varargParameters = function.valueParameters.filter { it.isVararg }
        if (varargParameters.size > 1) {
            for (parameter in varargParameters) {

Response:
reporter.reportOn(parameter.source, FirErrors.MULTIPLE_VARARG_PARAMETERS, context)
            }
        }

        for (varargParameter in varargParameters) {
            val coneType = varargParameter.returnTypeRef.coneType
            val varargParameterType = when (function) {
                is FirAnonymousFunction -> coneType<|endoftext|>


Prompt:
// TESTCASE NUMBER: 4
fun case_4(value_1: Any): String = when (value_1) {
    <!USELESS_IS_CHECK!>is Any?<!> -> ""
    else -> ""
}

/*
 * TESTCASE NUMBER: 5
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-22996
 */

Response:
fun case_5(value_1: Any?): String = when (value_1) {
    is Double -> ""
    is Int? -> "" // if value is null then this branch will be executed
    is String -> ""
    is Float? -> "" // redundant nullable type check
    is Char -> ""
    is Boolean -> ""
    else -> ""
}

// TESTCASE NUMBER: 6<|endoftext|>


Prompt:
doTest(build = { map {it.toShort()}.toShortArray() }, sortDescending = { from, to -> sortDescending(from, to) }, snapshot = { toList() })
        doTest(build = { map {it.toFloat()}.toFloatArray() }, sortDescending = { from, to -> sortDescending(from, to) }, snapshot = { toList() })

Response:
doTest(build = { map {it.toDouble()}.toDoubleArray() }, sortDescending = { from, to -> sortDescending(from, to) }, snapshot = { toList() })
        doTest(build = { map {'a' + it}.toCharArray() }, sortDescending = { from, to -> sortDescending(from, to) }, snapshot = { toList() })<|endoftext|>


Prompt:
public const val RENDER_DOC_COMMENTS: String = "RENDER_DOC_COMMENTS"
    }
}

public sealed interface InputModule {
    public val name: String
    public val path: Path

    public class Source(
        override val name: String,
        override val path: Path,
    ): InputModule

    public class Binary(
        override val name: String,

Response:
override val path: Path,
    ) : InputModule
}

public data class SwiftExportOutput(
    val swiftApi: Path,
    val kotlinBridges: Path,
    val cHeaderBridges: Path,
)

/**
 * Trivial logging interface that should be implemented
 * by the environment to report messages from Swift export.
 */
public interface SwiftExportLogger {<|endoftext|>


Prompt:
test.allowedMatcher.matchExact(it)
                }

                if (notAllowed.isNotEmpty()) {
                    append(test.message.format(notAllowed.size, notAllowed.joinToString("\n")))
                    appendLine()
                    appendLine()
                }

                val unmatched = test.allowedMatcher.unmatchedExact(allowed)

Response:
if (unmatched.isNotEmpty()) {
                    val testMessage = test.message.format(unmatched.size, "NONE")
                    append(
                        "Unused \"allowed files\" for test:\n" +
                                "`$testMessage`\n" +
                                "Remove exceptions for the test list:${unmatched.joinToString("\n", prefix = "\n")}"
                    )
                    appendLine()<|endoftext|>


Prompt:
targets[x] = if (targetLabel == null) {
                defaultBreakTarget!!
            }
            else {
                breakTargets[targetLabel]!!
            }
        }

        override fun visitContinue(x: JsContinue) {
            val targetLabel = x.label?.name
            targets[x] = if (targetLabel == null) {
                defaultContinueTarget!!

Response:
}
            else {
                continueTargets[targetLabel]!!
            }
        }

        private fun withBreakAndContinue(
                label: JsName?,
                breakTargetStatement: JsStatement,
                continueTargetStatement: JsStatement? = null,
                action: () -> Unit
        ) {
            val oldDefaultBreakTarget = defaultBreakTarget
            val oldDefaultContinueTarget = defaultContinueTarget<|endoftext|>


Prompt:
internal open fun allDefaults(par1: Any = 1, par2: String? = null) {}

    internal open fun someDefaults(par1: Any, par2: String? = null) {}

}

interface InterfaceFunctions {

    fun withAllDefaults(par1: Int = 1, par2: String? = null)

Response:
fun withSomeDefaults(par1: Int, par2: String? = null)

}<|endoftext|>


Prompt:
d checkType { check<Case1>() }
}

// TESTCASE NUMBER: 2
class Case2(var a: Int) {
    operator fun minus(o: Int): Nothing? { TODO() }
    operator fun minus(o: Case2):Nothing? { TODO() }
    operator fun plus(o: Int): Nothing? { TODO() }

Response:
operator fun plus(o: Case2): Nothing? { TODO() }
}

fun case2() {
    val a = Case2(1) + 1
    val b = Case2(1) + Case2( 1)
    val c = Case2(1) - 1
    val d = Case2(1) - Case2( 1)

    a checkType { check<Nothing?>() }<|endoftext|>


Prompt:
@RequiresOptIn
annotation class LookupTagInternals

class ConeClassLikeLookupTagImpl(override val classId: ClassId) : ConeClassLikeLookupTag() {

    init {
        assert(!classId.isLocal) { "You should use ConeClassLookupTagWithFixedSymbol for local $classId!" }
    }

    @LookupTagInternals

Response:
var boundSymbol: WeakPair<FirSession, FirClassLikeSymbol<*>?>? = null

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as ConeClassLikeLookupTagImpl

        if (classId != other.classId) return false<|endoftext|>


Prompt:
public operator fun rangeTo(other: Byte): IntRange =
        IntRange(this.toInt(), other.toInt())

    /** Creates a range from this value to the specified [other] value. */
    public operator fun rangeTo(other: Short): IntRange =
        IntRange(this.toInt(), other.toInt())

    /** Creates a range from this value to the specified [other] value. */

Response:
public operator fun rangeTo(other: Int): IntRange =
        IntRange(this.toInt(), other)

    /** Creates a range from this value to the specified [other] value. */
    public operator fun rangeTo(other: Long): LongRange =
        LongRange(this.toLong(), other)

    /**
     * Creates a range from this value up to but excluding the specified [other] value.<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.PropertyDescriptor

Response:
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.name.CallableId
import org.jetbrains.kotlin.name.Name

internal class KtFe10DescDefaultPropertySetterSymbol(<|endoftext|>


Prompt:
infix fun hasHigherPriorityThan(that: ImportKind): Boolean = this < that

    companion object {
        fun fromScope(scope: FirScope): ImportKind {
            return when (scope) {
                is FirDefaultStarImportingScope -> DEFAULT_STAR
                is FirAbstractStarImportingScope -> STAR
                is FirPackageMemberScope -> PACKAGE

Response:
is FirDefaultSimpleImportingScope -> DEFAULT_EXPLICIT
                is FirAbstractSimpleImportingScope -> EXPLICIT
                else -> LOCAL
            }
        }

        fun fromShortenOption(option: ShortenStrategy): ImportKind? = when (option) {
            ShortenStrategy.SHORTEN_AND_IMPORT -> EXPLICIT<|endoftext|>


Prompt:
val last = rBrace.siblings(forward = false, withItself = false).first { it !is PsiWhiteSpace }
    if (last == lBrace) return PsiChildRange.EMPTY

    return PsiChildRange(first, last)
}

// ----------- Inheritance -----------------------------------------------------------------------------------------------------------------

Response:
fun KtClass.isAbstract(): Boolean = isInterface() || hasModifier(KtTokens.ABSTRACT_KEYWORD)

/**
 * Returns the list of unqualified names that are indexed as the superclass names of this class. For the names that might be imported
 * via an aliased import, includes both the original and the aliased name (reference resolution during inheritor search will sort this out).
 *<|endoftext|>


Prompt:
LiteralExpressionNode(currentGraph, fir, levelCounter)

fun ControlFlowGraphBuilder.createThrowExceptionNode(fir: FirThrowExpression): ThrowExceptionNode =
    ThrowExceptionNode(currentGraph, fir, levelCounter)

fun ControlFlowGraphBuilder.createFinallyBlockExitNode(fir: FirTryExpression): FinallyBlockExitNode =
    FinallyBlockExitNode(currentGraph, fir, levelCounter)

Response:
fun ControlFlowGraphBuilder.createFinallyBlockEnterNode(fir: FirTryExpression): FinallyBlockEnterNode =
    FinallyBlockEnterNode(currentGraph, fir, levelCounter)

fun ControlFlowGraphBuilder.createCatchClauseExitNode(fir: FirCatch): CatchClauseExitNode =
    CatchClauseExitNode(currentGraph, fir, levelCounter)<|endoftext|>


Prompt:
if (javaClass != other?.javaClass) return false

        other as DescriptorKindFilter

        if (excludes != other.excludes) return false
        if (kindMask != other.kindMask) return false

        return true
    }

    override fun hashCode(): Int {
        var result = excludes.hashCode()
        result = 31 * result + kindMask
        return result
    }

Response:
companion object {
        private var nextMaskValue: Int = 0x01
        private fun nextMask() = nextMaskValue.apply { nextMaskValue = nextMaskValue shl 1 }

        val NON_SINGLETON_CLASSIFIERS_MASK: Int = nextMask()
        val SINGLETON_CLASSIFIERS_MASK: Int = nextMask()<|endoftext|>


Prompt:
fun <T> Case2.emptyArray(): Array<T> = TODO()

public fun <T> emptyArray(): Array<T> = TODO()

// FILE: LibtestsPack2.kt
// TESTCASE NUMBER: 2

package testsCase2
fun <T> Case2.emptyArray(): Array<T> = TODO()

Response:
public fun <T> emptyArray(): Array<T> = TODO()

// FILE: TestCase3.kt

/*
 * TESTCASE NUMBER: 3
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-37179
 */
package testsCase3
import libPackageCase3.*
import libPackageCase3Explicit.emptyArray

class Case3(){<|endoftext|>


Prompt:
@file:OptIn(KtAnalysisApiInternals::class)

package org.jetbrains.kotlin.analysis.api

import com.intellij.psi.PsiFile
import org.jetbrains.kotlin.analysis.api.session.KtAnalysisSessionProvider
import org.jetbrains.kotlin.analysis.project.structure.DanglingFileResolutionMode

Response:
import org.jetbrains.kotlin.analysis.project.structure.KtModule
import org.jetbrains.kotlin.analysis.project.structure.KtModuleStructureInternals
import org.jetbrains.kotlin.analysis.project.structure.withDanglingFileResolutionMode
import org.jetbrains.kotlin.psi.KtElement

/**<|endoftext|>


Prompt:
@Suppress("DEPRECATION")
        when (option) {
            SOURCE_OUTPUT_DIR_OPTION -> sourcesOutputDir = File(value)
            CLASS_OUTPUT_DIR_OPTION -> classesOutputDir = File(value)
            STUBS_OUTPUT_DIR_OPTION -> stubsOutputDir = File(value)

Response:
INCREMENTAL_DATA_OUTPUT_DIR_OPTION -> incrementalDataOutputDir = File(value)

            CHANGED_FILES -> changedFiles.add(File(value))
            COMPILED_SOURCES_DIR -> compiledSources.addAll(value.split(File.pathSeparator).map { File(it) })<|endoftext|>


Prompt:
class KtNameReferenceExpression : KtExpressionImplStub<KotlinNameReferenceExpressionStub>, KtSimpleNameExpression {
    constructor(node: ASTNode) : super(node)

    constructor(stub: KotlinNameReferenceExpressionStub) : super(stub, KtStubElementTypes.REFERENCE_EXPRESSION)

Response:
override fun getReferencedName(): String {
        val stub = stub
        if (stub != null) {
            return stub.getReferencedName()
        }
        return KtSimpleNameExpressionImpl.getReferencedNameImpl(this)
    }

    override fun getReferencedNameAsName(): Name {<|endoftext|>


Prompt:
add(CHECKERS_COMPONENT_INTERNAL_FQN)
            addAll(additionalImports)
        }.sorted()

        for (fqn in imports) {
            println("import $fqn")
        }
        println()
    }

    private val Alias.valDeclaration: String
        get() = "val $fieldName: $setType"

Response:
private val Alias.fieldName: String
        get() = removePrefix("Fir").replaceFirstChar(Char::lowercaseChar) + "s"

    private val Alias.allFieldName: String
        get() = "all${fieldName.replaceFirstChar(Char::uppercaseChar)}"

    private val Alias.setType: String
        get() = "Set<$this>"<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM

// WITH_STDLIB

inline fun <reified T> jaggedArrayOfNulls(): Array<Array<T>?> = arrayOfNulls<Array<T>>(1)

fun box(): String {
    val x1 = jaggedArrayOfNulls<String>().javaClass.simpleName

Response:
if (x1 != "String[][]") return "fail1: $x1"

    val x2 = jaggedArrayOfNulls<Array<String>>().javaClass.simpleName
    if (x2 != "String[][][]") return "fail2: $x2"

    val x3 = jaggedArrayOfNulls<IntArray>().javaClass.simpleName<|endoftext|>


Prompt:
fun <T> Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List<T> = TODO()
        <!DEBUG_INFO_CALL("fqName: testsCase2.Case2.case1_0.listOf; typeCall: extension function")!>listOf(elements1 = arrayOf(1), body = { "" })<!>

Response:
fun case1_1() {
            fun <T> Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List<T> = TODO()<|endoftext|>


Prompt:
inheritedFun: CallableMemberDescriptor,
        jvmDefaultMode: JvmDefaultMode
    ): CallableMemberDescriptor? {
        val classDescriptor = inheritedFun.containingDeclaration
        if (classDescriptor !is ClassDescriptor || classDescriptor.getSuperClassNotAny() == null) return null
        val classMembers =

Response:
inheritedFun.overriddenDescriptors.filter { !isInterface(it.containingDeclaration) && !isAnnotationClass(it.containingDeclaration) }
        val implicitDefaultImplsDelegate =
            classMembers.firstOrNull {
                //TODO: additional processing for platform dependent method is required (https://youtrack.jetbrains.com/issue/KT-42697)<|endoftext|>


Prompt:
private fun FirTypeProjection.createDeepCopy(): FirTypeProjection {
        return when (val original = this) {
            is FirTypeProjectionWithVariance -> buildTypeProjectionWithVariance {
                source = original.source
                typeRef = when (val originalTypeRef = original.typeRef) {
                    is FirUserTypeRef -> createDeepCopyOfTypeRef(originalTypeRef)
                    else -> originalTypeRef

Response:
}
                variance = original.variance
            }
            is FirStarProjection -> buildStarProjection { source = original.source }
            is FirPlaceholderProjection -> buildPlaceholderProjection { source = original.source }
            else -> shouldNotBeCalled()
        }
    }
}<|endoftext|>


Prompt:
sourceSet.dependsOn.forEach { it.addReverseDependencyTo(sourceSet) }

            val platformCompilations = sourceSet.internal.awaitPlatformCompilations()
            val distinctSourceSetTrees = platformCompilations.map { KotlinSourceSetTree.orNull(it) }.toSet()

            val totalDistinctSourceSetTrees = distinctSourceSetTrees.size

Response:
@Suppress("KotlinConstantConditions")
            when {
                totalDistinctSourceSetTrees > 1 -> badSourceSets[sourceSet] = distinctSourceSetTrees
                totalDistinctSourceSetTrees == 1 -> goodSourceSets[sourceSet] = distinctSourceSetTrees.single()
                // case when source set has no platform compilation and thus its totalDistinctSourceSetTrees == 0<|endoftext|>


Response:
import org.jetbrains.kotlin.test.builders.CompilerStepsNames.RAW_IR_HANDLERS_STEP_NAME
import org.jetbrains.kotlin.test.builders.CompilerStepsNames.WASM_ARTIFACTS_HANDLERS_STEP_NAME<|endoftext|>


Prompt:
fun main() {

}

fun main(args: Array<Int>) {

}

fun main(args: Array<in String>) {

}

fun main(args: Array<String>): Unit? {

    return Unit
}

fun Any.main(args: Array<String>) {

}

// method: ImpostorMainsKt::main

Response:
// jvm signature:     ([Ljava/lang/String;)V
// generic signature: null<|endoftext|>


Prompt:
configuration.add(ComponentRegistrar.PLUGIN_COMPONENT_REGISTRARS, ScriptingCompilerConfigurationComponentRegistrar())
        configuration.add(CompilerPluginRegistrar.COMPILER_PLUGIN_REGISTRARS, ScriptingK2CompilerPluginRegistrar())

Response:
return KotlinCoreEnvironment.createForTests(disposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
    }

    fun testScriptResolverEnvironmentArgsParsing() {

        val longStr = (1..100).joinToString("\\,") { """\" $it aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \\""" }<|endoftext|>


Prompt:
public final operator fun rangeTo(other: kotlin.Short): kotlin.ranges.LongRange { /* compiled code */ }

    @kotlin.SinceKotlin @kotlin.WasExperimental public final operator fun rangeUntil(other: kotlin.Byte): kotlin.ranges.LongRange { /* compiled code */ }

Response:
@kotlin.SinceKotlin @kotlin.WasExperimental public final operator fun rangeUntil(other: kotlin.Int): kotlin.ranges.LongRange { /* compiled code */ }

    @kotlin.SinceKotlin @kotlin.WasExperimental public final operator fun rangeUntil(other: kotlin.Long): kotlin.ranges.LongRange { /* compiled code */ }<|endoftext|>