Prompt:
public open override fun subSequence(startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence

    @kotlin.internal.IntrinsicConstEvaluation
    public open override fun toString(): kotlin.String

    public companion object of String {
    }
}

Response:
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS})
@kotlin.annotation.Retention(value = AnnotationRetention.BINARY)
@kotlin.SinceKotlin(version = "1.8")
@kotlin.ExperimentalSubclassOptIn
public final annotation class SubclassOptInRequired : kotlin.Annotation {<|endoftext|>


Prompt:
val inv = ::bar3<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
        inv()
    }
}

fun poll73(): Flow<String> {
    return flow {
        val inv = ::bar4<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
        inv
    }
}

Response:
fun poll74(): Flow<String> {
    return flow {
        val inv = ::bar5<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
        inv
    }
}

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


Prompt:
val x: Out<A> = materializeOutOfAAndB() // OI: inferred type A is not a subtype of B; `F` is instantiated as `A`, so upper bounds was violated
    val y: Inv<A> = <!TYPE_MISMATCH!>materializeInvOfAAndB()<!> // OI and NI: required B, found A

Response:
val z: Out<A> = wrapAAndBToOut(<!TYPE_MISMATCH!>a<!>) // OI and NI: required B, found A
}<|endoftext|>


Prompt: // library.kt:27 box: xFoo$iv:int=1:int, $i$f$foo:int=0:int, xBar1\5$iv:int=1:int, xBar2\5$iv:int=2:int, xBar3\5$iv:int=3:int, $i$f$bar\5\8:int=0:int,

Response: xBaz1\6$iv:int=100:int, xBaz2\6$iv:int=101:int, xBaz3\6$iv:int=102:int, $i$f$baz\6\46:int=0:int, $i$f$x2\8\51:int=0:int<|endoftext|>


Prompt:
getNonTrivialComputation(rightExpression, bindingTrace, moduleDescriptor) ?: return ConditionalDataFlowInfo.EMPTY

        val effects = EqualsFunctor(false).invokeWithArguments(leftComputation, rightComputation)

        val equalsContextInfo = InfoCollector(ESReturns(ESConstants.trueValue), builtIns).collectFromSchema(effects)

Response:
val notEqualsContextInfo = InfoCollector(ESReturns(ESConstants.falseValue), builtIns).collectFromSchema(effects)

        return ConditionalDataFlowInfo(
            equalsContextInfo.toDataFlowInfo(languageVersionSettings, builtIns),
            notEqualsContextInfo.toDataFlowInfo(languageVersionSettings, builtIns)
        )
    }<|endoftext|>


Prompt:
levelAdjustment = if (!flags.isInner && parentTypeParameterResolver != null) parentTypeParameterResolver.level + 1 else 0
            )

            val memberDeclarations = proto.declarationList.memoryOptimizedMapNotNull { declaration ->
                deserializeDeclaration(declaration, containingEntity = thisClassEntity, thisClassTypeParameterResolver)
            }

            return AbiClassImpl(

Response:
qualifiedName = qualifiedName,
                signatures = deserializeIdSignature(proto.base.symbol).toAbiSignatures(),
                annotations = annotations,
                modality = modality,
                kind = when (val kind = flags.kind) {
                    ClassKind.CLASS -> AbiClassKind.CLASS
                    ClassKind.INTERFACE -> AbiClassKind.INTERFACE<|endoftext|>


Prompt:
public inline val SelectionMode.Companion.PRESERVE: SelectionMode get() = "preserve".toJsString().unsafeCast<SelectionMode>()

/* please, don't implement this interface! */
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface CanvasFillRule : JsAny {
    companion object
}

Response:
public inline val CanvasFillRule.Companion.NONZERO: CanvasFillRule get() = "nonzero".toJsString().unsafeCast<CanvasFillRule>()

public inline val CanvasFillRule.Companion.EVENODD: CanvasFillRule get() = "evenodd".toJsString().unsafeCast<CanvasFillRule>()

/* please, don't implement this interface! */<|endoftext|>


Prompt:
"allExceptVarargConversionInlineReified" to allExceptVarargConversion(::inlineReifiedF),
        "allExceptDefaultConversionInlineReified" to allExceptDefaultConversion(::inlineReifiedF),
        "allConversionsInlineReified" to allConversions(::inlineReifiedF),
    )

    for ((name1, ref1) in allRefs) {

Response:
for ((name2, ref2) in allRefs) {
            if (name1 != name2) {
                if (ref1 == ref2) {
                    return "$name1 and $name2 wrappers should not be equal"
                }
            }
        }
    }

    return "OK"
}<|endoftext|>


Prompt: expectFailure(linkage("Reference to class 'ClassThatBecomesPrivate' can not be evaluated: Private class declared in module <lib1> can not be accessed in module <lib2>")) { getAnnotationClassWithParameterOfParameterThatBecomesPrivate2() }

Response: expectFailure(linkage("Reference to class 'ClassThatBecomesPrivate' can not be evaluated: Private class declared in module <lib1> can not be accessed in module <lib2>")) { getAnnotationClassWithParameterOfParameterThatBecomesPrivate2Inline() }<|endoftext|>


Prompt:
fun render(effectDeclaration: FirEffectDeclaration) {
        printer.newLine()
        printer.println("[Effect declaration] <")
        effectDeclaration.effect.accept(this, null)
        printer.println()
        printer.println(">")
    }

    internal fun render(legacyRawContractDescription: FirLegacyRawContractDescription) {

Response:
printer.renderInBraces("<", ">") {
            legacyRawContractDescription.contractCall.accept(visitor)
            printer.newLine()
        }
    }

    internal fun render(rawContractDescription: FirRawContractDescription) {
        printer.renderInBraces("<", ">") {<|endoftext|>


Prompt:
assertEquals(30L, 10L + 20.toByte())

    assertEquals(30.0, 20.0 + 10L)
    assertEquals(30.0f, 20.0f + 10L)
    assertEquals(20L, 10 + 10L)
    assertEquals(20L, 10.toShort() + 10L)

Response:
assertEquals(20L, 10.toByte() + 10L)

    assertEquals(20L, 30 - 10L)

    assertEquals(100L, 10 * 10L)
    assertEquals(100.0, 10.0 * 10L)

    assertEquals(100L, 10L * 10)
    assertEquals(100.0, 10L * 10.0)<|endoftext|>


Prompt:
val dummyArgumentExpressions = dummyExpressionFactory.createDummyExpressions(parameters.size)

        val bindingTrace = DelegatingBindingTrace(
            bindingContext, "Temporary trace for filtering shadowed declarations",
            filter = NO_DIAGNOSTICS
        )
        for ((expression, parameter) in dummyArgumentExpressions.zip(parameters)) {

Response:
bindingTrace.recordType(expression, parameter.varargElementType ?: parameter.type)
            bindingTrace.record(BindingContext.PROCESSED, expression, true)
        }

        val firstVarargIndex = parameters.withIndex().firstOrNull { it.value.varargElementType != null }?.index
        val useNamedFromIndex =<|endoftext|>


Prompt:
if (-1 in 3..1 != range1.contains(-1)) throw AssertionError()
    if (-1 !in 3..1 != !range1.contains(-1)) throw AssertionError()
    if (!(-1 in 3..1) != !range1.contains(-1)) throw AssertionError()

Response:
if (!(-1 !in 3..1) != range1.contains(-1)) throw AssertionError()
    // no local optimizations
    if (element2 in 3..1 != range1.contains(element2)) throw AssertionError()
    if (element2 !in 3..1 != !range1.contains(element2)) throw AssertionError()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource

@FirBuilderDsl
interface FirVariableBuilder : FirDeclarationBuilder {
    abstract override var source: KtSourceElement?
    abstract override var resolvePhase: FirResolvePhase
    abstract override val annotations: MutableList<FirAnnotation>

Response:
abstract override var moduleData: FirModuleData
    abstract override var origin: FirDeclarationOrigin
    abstract override var attributes: FirDeclarationAttributes
    abstract var status: FirDeclarationStatus
    abstract var returnTypeRef: FirTypeRef
    abstract var receiverParameter: FirReceiverParameter?
    abstract var deprecationsProvider: DeprecationsProvider
    abstract var containerSource: DeserializedContainerSource?<|endoftext|>


Prompt:
reporter.reportOn(superTypeRef.source, FirErrors.CLASS_INHERITS_JAVA_SEALED_CLASS, context)
                continue
            }
            val superClassPackage = superClass.classId.packageFqName
            if (superClassPackage != subclassPackage) {

Response:
reporter.reportOn(superTypeRef.source, FirErrors.SEALED_INHERITOR_IN_DIFFERENT_PACKAGE, context)
            }
            if (superClass.moduleData != declaration.moduleData && !superClass.isExpect) {<|endoftext|>


Prompt:
* Returns `this` value if it _does not_ satisfy the given [predicate] or `null`, if it does.
 *
 * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#takeif-and-takeunless).
 */
@kotlin.internal.InlineOnly
@SinceKotlin("1.1")

Response:
public inline fun <T> T.takeUnless(predicate: (T) -> Boolean): T? {
    contract {
        callsInPlace(predicate, InvocationKind.EXACTLY_ONCE)
    }
    return if (!predicate(this)) this else null
}

/**
 * Executes the given function [action] specified number of [times].
 *<|endoftext|>


Prompt:
LLVMWriteBitcodeToFile(llvmModule, outputFile.canonicalPath)
}

internal val CheckExternalCallsPhase = createSimpleNamedCompilerPhase<NativeGenerationState, Unit>(
        name = "CheckExternalCalls",
        description = "Check external calls",
        postactions = getDefaultLlvmModuleActions(),
) { context, _ ->

Response:
checkLlvmModuleExternalCalls(context)
}

internal val RewriteExternalCallsCheckerGlobals = createSimpleNamedCompilerPhase<NativeGenerationState, Unit>(
        name = "RewriteExternalCallsCheckerGlobals",
        description = "Rewrite globals for external calls checker after optimizer run",
        postactions = getDefaultLlvmModuleActions(),<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.calls.inference.BuilderInferenceSession
import org.jetbrains.kotlin.resolve.calls.inference.ComposedSubstitutor
import org.jetbrains.kotlin.resolve.calls.inference.components.EmptySubstitutor

Response:
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutorByConstructorMap
import org.jetbrains.kotlin.resolve.calls.model.*<|endoftext|>


Prompt: CompilerSystemProperties.COMPILE_DAEMON_LOG_PATH_PROPERTY.value?.let { opts.jvmParams.add("D${CompilerSystemProperties.COMPILE_DAEMON_LOG_PATH_PROPERTY.property}=\"$it\"") }

Response:
CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value?.let { opts.jvmParams.add("D${CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.property}") }
    }<|endoftext|>


Prompt:
public inline fun kotlin.UByteArray.onEachIndexed(action: (index: kotlin.Int, kotlin.UByte) -> kotlin.Unit): kotlin.UByteArray

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

Response:
public inline fun kotlin.UIntArray.onEachIndexed(action: (index: kotlin.Int, kotlin.UInt) -> kotlin.Unit): kotlin.UIntArray

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


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

import org.jetbrains.kotlin.backend.jvm.codegen.ClassCodegen
import org.jetbrains.kotlin.builtins.StandardNames.COLLECTIONS_PACKAGE_FQ_NAME
import org.jetbrains.kotlin.codegen.AsmUtil

Response:
import org.jetbrains.kotlin.fileClasses.internalNameWithoutInnerClasses
import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType<|endoftext|>


Prompt:
"https://maven.pkg.jetbrains.space/kotlin/p/kotlin/eap", root,
                setOf("repo/scripts/cache-redirector.settings.gradle.kts")
            ),
            RepoAllowList(

Response:
"https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev", root,
                setOf("repo/scripts/cache-redirector.settings.gradle.kts")
            ),
            RepoAllowList(
                "kotlin/ktor", root,<|endoftext|>


Prompt:
useDirectives(Directives)
        }
    }

    override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {
        val provider = FileBasedKotlinDeclarationProvider(mainFile)
        assertContains(provider.findFilesForFacadeByPackage(mainFile.packageFqName), mainFile)

Response:
checkByDirectives(testServices.moduleStructure, provider)
        checkByVisitor(mainFile, provider)
    }

    private fun checkByDirectives(moduleStructure: TestModuleStructure, provider: FileBasedKotlinDeclarationProvider) {
        for (directive in moduleStructure.allDirectives[Directives.CLASS]) {
            val classId = ClassId.fromString(directive)<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("C")!>c<!>, <!DEBUG_INFO_EXPRESSION_TYPE("D")!>d<!>, <!DEBUG_INFO_EXPRESSION_TYPE("E")!>e<!>)

Response: } } } } }<|endoftext|>


Prompt:
}

    @Test
    fun testValuesGenerics() {
        Assumptions.assumeTrue(targets.testTarget.family.isAppleFamily)
        val testName = "values_generics"

        val testCase = generateObjCFrameworkTestCase(
            TestKind.STANDALONE_NO_TR, extras, "ValuesGenerics",
            listOf(

Response:
testSuiteDir.resolve(testName).resolve("$testName.kt"),
                testSuiteDir.resolve("objcexport/values.kt"),
            ),
            freeCompilerArgs = TestCompilerArgs(listOf("-opt-in=kotlinx.cinterop.ExperimentalForeignApi"))
        )<|endoftext|>


Prompt:
@Suppress("MUST_BE_INITIALIZED")
private var symbolMap: dynamic

private fun getSymbolWeakMap(): dynamic {
    if (symbolWeakMap === VOID) {
        symbolWeakMap = js("new WeakMap()")
    }
    return symbolWeakMap
}

private fun getSymbolMap(): dynamic {
    if (symbolMap === VOID) {

Response:
symbolMap = js("new Map()")
    }
    return symbolMap
}

@Suppress("UNUSED_PARAMETER")
private fun symbolIsSharable(symbol: dynamic) = js("Symbol.keyFor(symbol)") != VOID

private fun getSymbolHashCode(value: dynamic): Int {<|endoftext|>


Prompt:
package kotlin

/**
 * Returns the detailed description of this throwable with its stack trace.
 *
 * The detailed description includes:
 * - the short description (see [Throwable.toString]) of this throwable;
 * - the complete stack trace;
 * - detailed descriptions of the exceptions that were [suppressed][suppressedExceptions] in order to deliver this exception;

Response:
* - the detailed description of each throwable in the [Throwable.cause] chain.
 */
@SinceKotlin("1.4")
public actual fun Throwable.stackTraceToString(): String = ExceptionTraceBuilder().buildFor(this)

/**
 * Prints the [detailed description][Throwable.stackTraceToString] of this throwable to console error output.
 */<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.IGNORE_LEAKED_INTERNAL_TYPES
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact

Response:
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.services.TestServices

class FirResolvedTypesVerifier(testServices: TestServices) : FirAnalysisHandler(testServices, failureDisablesNextSteps = true) {
    override val directiveContainers: List<DirectivesContainer><|endoftext|>


Prompt:
if (funWithReturnsNotNull(value_1 != null) == null) println(value_1<!UNSAFE_CALL!>.<!>length)
    if (funWithReturnsNotNullAndInvertCondition(value_1 == null) == null) println(value_1<!UNSAFE_CALL!>.<!>length)

Response:
if (funWithReturnsNull(value_1 != null) != null) println(value_1<!UNSAFE_CALL!>.<!>length)
    if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1<!UNSAFE_CALL!>.<!>length)
}

// TESTCASE NUMBER: 10<|endoftext|>


Prompt:
typeOf<JsSourceMapEmbedMode?>(),
        typeOf<String?>(),
        possibleValues = listOf(
            K2JsArgumentConstants.SOURCE_MAP_SOURCE_CONTENT_NEVER,
            K2JsArgumentConstants.SOURCE_MAP_SOURCE_CONTENT_ALWAYS,
            K2JsArgumentConstants.SOURCE_MAP_SOURCE_CONTENT_INLINING

Response:
).map { "\"$it\"" },
        fromKotlinOptionConverterProp = """
        this?.let { ${typeOf<JsSourceMapEmbedMode>()}.fromMode(it) }
        """.trimIndent(),
        toKotlinOptionConverterProp = """
        this?.mode
        """.trimIndent()
    )<|endoftext|>


Prompt:
import org.jetbrains.kotlin.test.services.assertions

abstract class AbstractAnalysisApiExpressionPsiTypeProviderTest : AbstractAnalysisApiBasedTest() {
    override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {

Response:
val declarationAtCaret = when (val element = testServices.expressionMarkerProvider.getSelectedElement(mainFile)) {
            is KtExpression -> element
            is KtValueArgument -> element.getArgumentExpression()!!
            else -> error("Unexpected element: $element of ${element::class}")
        }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.resolve.ResolutionMode
import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirAbstractBodyResolveTransformerDispatcher
import org.jetbrains.kotlin.fir.visitors.transformSingle

Response:
internal sealed class LLFirAbstractBodyTargetResolver(
    resolveTarget: LLFirResolveTarget,
    resolvePhase: FirResolvePhase,
    protected val llImplicitBodyResolveComputationSession: LLImplicitBodyResolveComputationSession = LLImplicitBodyResolveComputationSession(),
) : LLFirTargetResolver(resolveTarget, resolvePhase) {<|endoftext|>


Prompt:
if (!(element0 !in 3L until 1L) != range1.contains(element0)) throw AssertionError()
}

fun testR1xE1() {
    // with possible local optimizations
    if ((-1).toShort() in 3L until 1L != range1.contains((-1).toShort())) throw AssertionError()

Response:
if ((-1).toShort() !in 3L until 1L != !range1.contains((-1).toShort())) throw AssertionError()
    if (!((-1).toShort() in 3L until 1L) != !range1.contains((-1).toShort())) throw AssertionError()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
import org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol
import org.jetbrains.kotlin.fir.resolve.withCombinedAttributesFrom

Response:
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl
import org.jetbrains.kotlin.fir.utils.exceptions.withConeTypeEntry<|endoftext|>


Prompt:
fun <T : Number?> T.case_11_1(): Boolean? {
    contract { returns(null) implies (this@case_11_1 != null) }
    return if (this@case_11_1 != null) null else true
}
fun <T : Number?> T.case_11_2(): Boolean? {
    contract { returns(null) implies (this@case_11_2 != null) }

Response:
return if (this@case_11_2 != null) null else true
}

// FILE: main.kt

import contracts.*

// TESTCASE NUMBER: 1
fun case_1(value_1: Any?) {
    value_1.case_1()<|endoftext|>


Prompt:
fun testUnreachableExtensionValPropertyDeclaration() {
        val (output, exitCode) = compileKotlin("source.kt", tmpdir, expectedFileName = null)
        assertEquals("Output:\n$output", ExitCode.COMPILATION_ERROR, exitCode)
    }

    fun testAnonymousObjectTypeMetadata() = doTestAnonymousObjectTypeMetadata()

Response:
fun testAnonymousObjectTypeMetadataKlib() = doTestAnonymousObjectTypeMetadata(listOf("-Xmetadata-klib"))

    /**
     * This test does exactly the same as [testAnonymousObjectTypeMetadataKlib] but using the old (now deprecated)
     * CLI argument `-Xexpect-actual-linker` instead of its successor `-Xmetadata-klib`.
     *<|endoftext|>


Prompt:
if (fnNStr.invoke(NStr("nstr")).string != "nstr") throw AssertionError()

    val fnNStr2: (NStr2<String>) -> NStr2<String> = ::fooNStr2
    if (fnNStr2.invoke(NStr2(null)).string != null) throw AssertionError()

Response:
if (fnNStr2.invoke(NStr2("nstr2")).string != "nstr2") throw AssertionError()

    return "OK"
}<|endoftext|>


Prompt:
return getFunctionalClassKindWithArity(packageFqName, className)?.kind
    }

    fun getFunctionalClassKindWithArity(packageFqName: FqName, className: String): KindWithArity? {
        val kinds = knownKindsByPackageFqName[packageFqName] ?: return null
        for (kind in kinds) {

Response:
if (!className.startsWith(kind.classNamePrefix)) continue
            val arity = toInt(className.substring(kind.classNamePrefix.length)) ?: continue
            return KindWithArity(kind, arity)
        }
        return null
    }

    fun hasKindWithSpecificPackage(packageFqName: FqName): Boolean {<|endoftext|>


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

class TestInlineFunctionVsConstructorReverse {

Response:
<!CONFLICTING_OVERLOADS!>constructor()<!>
}
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) inline fun TestInlineFunctionVsConstructorReverse()<!> {}

class TestTailrecFunctionVsConstructor {<|endoftext|>


Prompt:
fun localFun() = x
            y3 = localFun()
        }

        fun method() = x
        val y4 = method()

        val anonObject = object {
            override fun toString() = x
        }
        val y5 = anonObject.toString()

        init {
            assertEquals(x, y1)
            assertEquals(x, y2)

Response:
assertEquals(x, y3)
            assertEquals(x, y4)
            assertEquals(x, y5)
        }
    }
}

fun box() = Test.x + Anno.x<|endoftext|>


Prompt:
if (!descriptor.isTopLevelInPackage("contains", "kotlin.ranges")) return false

    val extensionReceiverType = descriptor.extensionReceiverParameter?.type ?: return false

    val rangeElementType = getRangeOrProgressionElementType(extensionReceiverType) ?: return false
    if (!isPrimitiveNumberType(rangeElementType)) return false

Response:
val argumentType = descriptor.valueParameters.singleOrNull()?.type ?: return false
    if (!isPrimitiveNumberType(argumentType)) return false

    return true
}

fun isPrimitiveProgressionReverse(descriptor: CallableDescriptor) =
    descriptor.isTopLevelExtensionOnType("reversed", "kotlin.ranges") {<|endoftext|>


Prompt:
import kotlin.io.path.*
import kotlin.test.assertContains
import kotlin.test.assertEquals
import kotlin.test.assertTrue

@OsCondition(supportedOn = [OS.MAC], enabledOnCI = [OS.MAC])
@DisplayName("CocoaPods plugin tests")
@NativeGradlePluginTests

Response:
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0)
@OptIn(EnvironmentalVariablesOverride::class)
class CocoaPodsIT : KGPBaseTest() {

    private val podfileImportPodPlaceholder = "#import_pod_directive"

    private val cocoapodsSingleKtPod = "native-cocoapods-single"<|endoftext|>


Prompt:
scope: IrDeclaration,
        ) = onLambda(argument, callee, parameter, scope)
    },
    null,
)

/**
 * Runs [IrInlineScopeResolver] on this [IrFile] and returns the scope resolver instance.
 */
fun IrFile.findInlineCallSites(context: JvmBackendContext) =

Response: IrInlineScopeResolver(context).apply { accept(this, null) }<|endoftext|>


Prompt:
/*
 * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
 *
 * SPEC VERSION: 0.1-100
 * MAIN LINK: expressions, constant-literals, integer-literals, hexadecimal-integer-literals -> paragraph 1 -> sentence 2
 * NUMBER: 4
 * DESCRIPTION: Hexadecimal integer literals with an underscore in the last position.
 */

Response:
// TESTCASE NUMBER: 1
val value_1 = <!ILLEGAL_UNDERSCORE!>0x3_4_5_6_7_8_____<!>

// TESTCASE NUMBER: 2
val value_2 = <!ILLEGAL_UNDERSCORE!>0X4_______5_______6_______7_<!>

// TESTCASE NUMBER: 3<|endoftext|>


Prompt:
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {}

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

    fun resolved(
        visibility: Visibility,
        modality: Modality,
        effectiveVisibility: EffectiveVisibility

Response:
): FirResolvedDeclarationStatusImpl {
        return FirResolvedDeclarationStatusImpl(visibility, modality, effectiveVisibility, flags)
    }
}

@OptIn(FirImplementationDetail::class)
val FirDeclarationStatus.modifiersRepresentation: Any
    get() = when (this) {
        is FirDeclarationStatusImpl -> rawFlags<|endoftext|>


Prompt:
changedFiles.forEach { configuration.report(CompilerMessageSeverity.LOGGING, "        $it") }

        val dirtyFiles = mutableSetOf<LibraryFile>()

        fun dfs(libraryFile: LibraryFile) {
            dirtyFiles += libraryFile
            reversedPerFileDependencies[libraryFile]?.forEach {
                if (it !in dirtyFiles) dfs(it)

Response:
}
        }

        removedFiles.forEach {
            if (it !in dirtyFiles) dfs(it)
        }
        changedFiles.forEach {
            if (it !in dirtyFiles) dfs(it)
        }
        dirtyFiles.addAll(addedFiles)

        removedFiles.forEach {
            dirtyFiles.remove(it)<|endoftext|>


Prompt:
file?.let(visitor::visitFile)
    }
}

internal class KlibClassExtension : KlibClassExtensionVisitor(), KmClassExtension {

    val annotations: MutableList<KmAnnotation> = mutableListOf()
    val enumEntries: MutableList<KlibEnumEntry> = mutableListOf()
    var uniqId: UniqId? = null

Response:
var file: KlibSourceFile? = null

    override fun visitAnnotation(annotation: KmAnnotation) {
        annotations += annotation
    }

    override fun visitUniqId(uniqId: UniqId) {
        this.uniqId = uniqId
    }

    override fun visitFile(file: KlibSourceFile) {
        this.file = file
    }<|endoftext|>


Prompt:
class M {
  operator fun Int.component1() = this + 1
  operator fun Int.component2() = this + 2
}

fun M.doTest(): String {
    var s = ""
    for ((a, b) in 0.rangeTo(2)) {
      s += "$a:$b;"
    }
    return s
}

fun box(): String {
  val s = M().doTest()

Response:
return if (s == "1:2;2:3;3:4;") "OK" else "fail: $s"
}<|endoftext|>


Prompt:
actualAsInner.append(n.toString() + " ")
    }

    if (actualAsInt.toString() != resultAsInt) {
        throw IllegalStateException("wrong result as int (actual): $actualAsInt ; expected: $resultAsInt")
    }

    if (actualAsInner.toString() != resultAsInner) {

Response:
throw IllegalStateException("wrong result as inner (actual): $actualAsInner ; expected: $resultAsInner")
    }
}

fun box(): String {
    val a1 = uIntArrayOf(1, 2, 3)
    a1.quickSort()

    check(a1, "1 2 3 ", "1 2 3 ")

    val a2 = uIntArrayOf(-1)<|endoftext|>


Prompt:
var hit = false
        call { hit = true; false }
        return hit
    }
}

class ShouldBeEnabled : Checker {
    override fun checkTrue(): Boolean {
        var hit = false
        call { hit = true; true }
        return hit
    }

    override fun checkFalse(): Boolean {
        var hit = false
        call { hit = true; false }
        return hit

Response:
}
}

fun setDesiredAssertionStatus(v: Boolean): Checker {
    val loader = Checker::class.java.classLoader
    loader.setDefaultAssertionStatus(v)
    val c = loader.loadClass(if (v) "ShouldBeEnabled" else "ShouldBeDisabled")
    return c.newInstance() as Checker
}

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


Prompt:
* Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with zero values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].

Response:
* - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf
 */
public expect fun LongArray.copyOf(newSize: Int): LongArray

/**<|endoftext|>


Prompt:
isExpect: Boolean = baseFunction.isExpect,
        callableCopySubstitutionForTypeUpdater: DeferredCallableCopyReturnType?,
        origin: FirDeclarationOrigin.SubstitutionOverride,
    ): FirSimpleFunction {
        // TODO: consider using here some light-weight functions instead of pseudo-real FirMemberFunctionImpl
        // As second alternative, we can invent some light-weight kind of FirRegularClass

Response:
return createCopyForFirFunction(
            fakeOverrideSymbol,
            baseFunction,
            derivedClassLookupTag = derivedClassLookupTag,
            session,
            origin,
            isExpect,
            newDispatchReceiverType,
            newParameterTypes,
            newTypeParameters,
            newReceiverType,
            newContextReceiverTypes,
            newReturnType,<|endoftext|>


Prompt:
upperMain.onlyNativeDistributionDependencies(konanDataDirProperty).assertNotEmpty()

                val commonMain = getCommonizerDependencies("commonMain")
                commonMain.withoutNativeDistributionDependencies(konanDataDirProperty).assertDependencyFilesMatches(".*cinterop-dummy")

Response:
commonMain.onlyNativeDistributionDependencies(konanDataDirProperty).assertNotEmpty()
            }

            build(":compileCommonMainKotlinMetadata")

            build(":compileUpperMainKotlinMetadata")
        }
    }

    @DisplayName("KT-47641 commonizing c-interops does not depend on any source compilation")
    @GradleTest<|endoftext|>


Prompt:
* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4
 * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6
 * NUMBER: 4

Response:
* DESCRIPTION: Top-level non-extension functions named f: callables implicitly imported into the current file;
 */

// FILE: TestCase1.kt
// TESTCASE NUMBER: 1

package tests.case1

import lib.case1.*

interface I
//class A : I
class B : I

fun case1(){<|endoftext|>


Prompt:
"LATEINIT_NULLABLE_BACKING_FIELD",
    "BACKING_FIELD_FOR_DELEGATED_PROPERTY",
    "PROPERTY_MUST_HAVE_GETTER",
    "PROPERTY_MUST_HAVE_SETTER",
    "EXPLICIT_BACKING_FIELD_IN_INTERFACE",

Response:
"EXPLICIT_BACKING_FIELD_IN_ABSTRACT_PROPERTY",
    "EXPLICIT_BACKING_FIELD_IN_EXTENSION",
    "ABSTRACT_PROPERTY_IN_PRIMARY_CONSTRUCTOR_PARAMETERS",
    "LOCAL_VARIABLE_WITH_TYPE_PARAMETERS",<|endoftext|>


Prompt:
* [ComposerParamTransformer] or it still has the @Composable annotation which
     * can be because it is external and hasn't been transformed as the symbol remapper
     * only remaps what is referenced as a symbol this method might not have been
     * referenced directly in this module.
     */
    private val IrFunction.isComposable get() =

Response:
valueParameters.any { it.name == KtxNameConventions.COMPOSER_PARAMETER } ||
            annotations.hasAnnotation(ComposeFqNames.Composable)

    private val IrType.isSamComposable get() =
        samOwnerOrNull()?.isComposable == true

    private val IrType.isComposableLambda get() =<|endoftext|>


Prompt:
lazyResolveToPhase(FirResolvePhase.BODY_RESOLVE)
        return fir.hasBackingField
    }

fun FirDeclaration.getDanglingTypeConstraintsOrEmpty(): List<DanglingTypeConstraint> {
    return when (this) {
        is FirRegularClass -> danglingTypeConstraints
        is FirSimpleFunction -> danglingTypeConstraints

Response:
is FirProperty -> danglingTypeConstraints
        else -> null
    } ?: emptyList()
}

val FirPropertySymbol.correspondingValueParameterFromPrimaryConstructor: FirValueParameterSymbol?
    get() = fir.correspondingValueParameterFromPrimaryConstructor

val FirProperty.correspondingValueParameterFromPrimaryConstructor: FirValueParameterSymbol?
    get() {<|endoftext|>


Prompt:
//        "⧄" to 10692,
//        "/" to 47,
//        "𝕊" to 120138,
//        "𝕤" to 120164,
//        "♠" to 9824,
//        "♠" to 9824,
//        "∥" to 8741,
//        "⊓" to 8851,

Response:
//        "⊓" to 8851,
//        "⊔" to 8852,
//        "⊔" to 8852,
//        "√" to 8730,
//        "⊏" to 8847,
//        "⊑" to 8849,
//        "⊏" to 8847,<|endoftext|>


Prompt:
buildJvm
                .map { jvm ->
                    jvm.javaVersion
                        ?: throw GradleException(
                            "Kotlin could not get java version for the JDK installation: " +
                                    jvm.javaHome?.let { "'$it' " }.orEmpty()
                        )
                }
        )
        .chainedFinalizeValueOnRead()

    @get:Internal

Response:
internal val javaExecutable: RegularFileProperty = objects
        .fileProperty()
        .value(
            buildJvm.flatMap { jvm ->
                projectLayout.file(
                    objects.property<File>(
                        jvm.javaExecutable
                            ?: throw GradleException(
                                "Kotlin could not find 'java' executable in the JDK installation: " +<|endoftext|>


Prompt:
if (!original.isEnhanceable()) {
            return original
        }

        val firMethod = original.fir
        val enhancedParameters = enhanceTypeParameterBoundsForMethod(firMethod)
        return enhanceMethod(
            firMethod,
            original.callableId,
            name,
            enhancedParameters,
            original is FirIntersectionOverrideFunctionSymbol,
            precomputedOverridden
        )

Response:
}

    private fun FirCallableSymbol<*>.isEnhanceable(): Boolean {
        return origin is FirDeclarationOrigin.Java || isEnhanceableIntersection()
    }

    /**
     * Intersection overrides with Java and Kotlin overridden symbols need to be enhanced so that we get non-flexible types
     * in the signature.<|endoftext|>


Prompt:
if (first.keyAt(i) != second.keyAt(i)) return false
        if (first.valueAt(i) != second.valueAt(i)) return false
    }

    return true
}

private fun compareSparseArrays(first: SparseArray<*>?, second: SparseArray<*>?): Boolean {
    if (first === second) return true

Response:
if (first == null || second == null) return false
    if (first.size() != second.size()) return false

    for (i in 0 until first.size()) {
        if (first.keyAt(i) != second.keyAt(i)) return false
        if (first.valueAt(i) != second.valueAt(i)) return false
    }

    return true
}<|endoftext|>


Prompt: abstract <!MANY_IMPL_MEMBER_NOT_IMPLEMENTED, RETURN_TYPE_MISMATCH_ON_INHERITANCE!>class Test11<!> : IInt, IStr by CStr(), IAny by CAny()

Response: abstract <!RETURN_TYPE_MISMATCH_ON_INHERITANCE!>class Test12<!> : IInt, IStr, IAny by CAny()<|endoftext|>


Prompt: $this$mapTo\88:java.lang.Object[]=java.lang.Integer[], destination\88:java.util.Collection=java.util.ArrayList, $i$f$mapTo\88\553:int=0:int

Response: // _Arrays.kt:... box: $i$f$foo\56\65:int=0:int, array\56:java.lang.Integer[]=java.lang.Integer[], myClass\56:MyClass=MyClass, $this$map\87:java.lang.Object[]=java.lang.Integer[], $i$f$map\87\552:int=0:int,<|endoftext|>


Prompt:
"ALWAYS", null -> NullabilityQualifier.NOT_NULL
                    "MAYBE", "NEVER" -> NullabilityQualifier.NULLABLE
                    "UNKNOWN" -> NullabilityQualifier.FORCE_FLEXIBILITY
                    else -> return null
                }
            else -> return null
        }
        return NullabilityQualifierWithMigrationStatus(nullability, reportLevel.isWarning || forceWarning)
    }

Response:
private companion object {
        val JAVA_APPLICABILITY_TYPES = mutableMapOf<String, AnnotationQualifierApplicabilityType>().apply {
            for (type in AnnotationQualifierApplicabilityType.values()) {
                getOrPut(type.javaTarget) { type }
            }
        }
    }
}<|endoftext|>


Prompt:
}

    // not nullable variable
    val en1: Any = En.A
    if (en1 is En) {
        when (<!DEBUG_INFO_SMARTCAST!>en1<!>) {
            En.A -> {}
            En.B -> {}
            En.С -> {}
        }
    }
}

enum class En2 { D, E, F }

Response:
fun useEn(x: En) = x
fun useEn2(x: En2) = x

fun bar(x: Any) {
    if (x is En && <!USELESS_IS_CHECK!>x is En2<!>) {
        when (<!DEBUG_INFO_SMARTCAST!>x<!>) {<|endoftext|>


Prompt:
<!USELESS_IS_CHECK!>value_1 is Any<!> -> {}
    }
}

/*
 * TESTCASE NUMBER: 8
 * NOTE: for a potential analysys of exhaustiveness by enums in whens without a bound value.
 */
fun case_8(value_1: SealedClass) {
    when {
        value_1 is SealedChild1 -> {}

Response:
value_1 is SealedChild2 -> {}
        value_1 is SealedChild3 -> {}
    }
}

// TESTCASE NUMBER: 9
fun case_9(value_1: Int, value_2: IntRange) {
    when {
        value_1 in -10..100L -> {}
        value_1 in value_2 -> {}<|endoftext|>


Prompt: require(complexInlineFun(2.0, DPoint(3.0, 5.0), a4 = DPoint(11.0, 13.0)) == "2.0, ${DPoint(3.0, 5.0)}, 30.0, ${DPoint(11.0, 13.0)}") {

Response:
complexInlineFun(2.0, DPoint(3.0, 5.0), a4 = DPoint(11.0, 13.0))
    }<|endoftext|>


Prompt:
* The list of actual script implicit receiver object, in the same order as specified in {@link ScriptCompilationConfigurationKeys#implicitReceivers}
 */
val ScriptEvaluationConfigurationKeys.implicitReceivers by PropertiesCollection.key<List<Any>>()

/**
 * The map of names to actual provided properties objects, according to the properties specified in
 * {@link ScriptCompilationConfigurationKeys#providedProperties}
 */

Response:
val ScriptEvaluationConfigurationKeys.providedProperties by PropertiesCollection.key<Map<String, Any?>>() // external variables

/**
 * The link to the actual {@link ScriptCompilationConfiguration} object that contains properties used for compiling the script
 */
val ScriptEvaluationConfigurationKeys.compilationConfiguration by PropertiesCollection.key<ScriptCompilationConfiguration>(isTransient = true)

/**<|endoftext|>


Prompt:
visitStarProjection(starProjection)
    }

    open fun visitStarProjection(starProjection: FirStarProjection) {
        visitElement(starProjection)
    }

    final override fun visitPlaceholderProjection(placeholderProjection: FirPlaceholderProjection, data: Nothing?) {
        visitPlaceholderProjection(placeholderProjection)
    }

Response:
open fun visitPlaceholderProjection(placeholderProjection: FirPlaceholderProjection) {
        visitElement(placeholderProjection)
    }

    final override fun visitTypeProjectionWithVariance(typeProjectionWithVariance: FirTypeProjectionWithVariance, data: Nothing?) {
        visitTypeProjectionWithVariance(typeProjectionWithVariance)
    }<|endoftext|>


Prompt:
is KtTypeReference -> unwrapType(type.typeElement)
            is KtNullableType -> type.innerType
            is KtTypeElement -> type
            is KtNameReferenceExpression -> unwrapType(type.parent)
            else -> unexpectedElementError<PsiElement>(type)
        } ?: unexpectedElementError<PsiElement>(type)

Response:
val ktTypeElementFromFirType = unwrapType(fir.psi)

        val classifiersToSkip = expression.parents.takeWhile { it != ktTypeElementFromFirType }.count()
        var classifier: FirClassLikeSymbol<*>? = fir.type.toRegularClassSymbol(session)
        repeat(classifiersToSkip) {<|endoftext|>


Prompt:
val UNSUPPORTED_FEATURE: KtDiagnosticFactory1<Pair<LanguageFeature, LanguageVersionSettings>> by error1<PsiElement, Pair<LanguageFeature, LanguageVersionSettings>>()
    val UNSUPPORTED_SUSPEND_TEST: KtDiagnosticFactory0 by error0<PsiElement>()

Response:
val NEW_INFERENCE_ERROR: KtDiagnosticFactory1<String> by error1<PsiElement, String>()

    // Miscellaneous
    val OTHER_ERROR: KtDiagnosticFactory0 by error0<PsiElement>()

    // General syntax
    val ILLEGAL_CONST_EXPRESSION: KtDiagnosticFactory0 by error0<PsiElement>()<|endoftext|>


Prompt:
model("incremental/changeIncrementalOption", extension = null, excludeParentDirs = true)
            }

            testClass<AbstractIncrementalCacheVersionChangedTest> {
                model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true)
            }

            testClass<AbstractDataContainerVersionChangedTest> {

Response:
model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true)
            }
        }

        testGroup("jps/jps-plugin/jps-tests/test", "jps/jps-plugin/testData") {
            fun TestGroup.TestClass.commonProtoComparisonTests() {<|endoftext|>


Prompt: val x1: suspend (Int) -> Unit = takeSuspend(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit>")!>id { it

Response: }<!>, <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit>")!>{ x -> x }<!>)<|endoftext|>


Prompt:
fun kotlinTestSingleDependencyJvm(gradleVersion: GradleVersion) {
        project("simpleProject", gradleVersion) {
            assertKotlinTestDependency(
                listOf("testImplementation"),
                mapOf("compileTestKotlin" to listOf("kotlin-test-${defaultBuildOptions.kotlinVersion}.jar", "kotlin-test-testng"))

Response:
)
        }
    }

    @JsGradlePluginTests
    @DisplayName("JS: Kotlin test single dependency")
    @GradleTest
    fun kotlinTestSingleDependencyJs(gradleVersion: GradleVersion) {
        project(
            "kotlin-js-plugin-project",
            gradleVersion,
        ) {
            assertKotlinTestDependency(<|endoftext|>


Prompt:
assertEquals(result, lazy.value, "Value must not change after isInitialized is set: $lazy, runs: $runs")
        assertTrue(runs.any { it.value == result }, "Unexpected lazy result value: $result, runs: $runs")
    }

    @Test fun publishOnceLazyRace() {

Response:
racyTest(initialize = { lazy(LazyThreadSafetyMode.PUBLICATION) { Thread.currentThread().id } },
                 access = { lazy, _ -> lazy.value },
                 validate = { result -> result.all { v -> v == result[0] } })
    }

    @Test fun lazyInitializationForcedOnSerialization() {<|endoftext|>


Prompt:
@TypedIntrinsic(IntrinsicType.IDENTITY)
public external fun NativePointed.getRawPointer(): NativePtr

@ExperimentalForeignApi
@TypedIntrinsic(IntrinsicType.IDENTITY)
public external fun CPointer<*>.getRawValue(): NativePtr

@ExperimentalForeignApi

Response:
internal fun CPointer<*>.cPointerToString() = "CPointer(raw=$rawValue)"

/**
 * Returns a pointer to C function which calls given Kotlin *static* function.
 *
 * @param function must be *static*, i.e. an (unbound) reference to a Kotlin function or
 * a closure which doesn't capture any variable
 */
@ExperimentalForeignApi<|endoftext|>


Prompt: $i$a$-filter-LibraryKt$foo$7\30\465\1:int=0:int

Response: // _Collections.kt:... box: $i$f$foo\1\64:int=0:int, array\1:java.lang.Integer[]=java.lang.Integer[], myClass\1:MyClass=MyClass, $this$filter\28:java.lang.Iterable=java.util.ArrayList, $i$f$filter\28\463:int=0:int,<|endoftext|>


Prompt:
constructor(values: Collection<String>) : this() {
        myValues.addAll(values)
    }

    override fun addValue(t: String, weight: Long?) {
        myValues.add(t.replace(SEPARATOR, ","))
    }

    override fun toStringRepresentation(): String {
        return myValues.sorted().joinToString(SEPARATOR)
    }

Response:
override fun getValue() = toStringRepresentation()
}<|endoftext|>


Prompt: <!CONFLICTING_OVERLOADS!>fun <T: Invariant<UserInterface>> testTypeParameterWithVarianceDifferentUpperBoundsCReverse()<!> {}

Response: <!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T: Invariant<*>> testTypeParameterWithVarianceDifferentUpperBoundsCReverse()<!> {}<|endoftext|>


Prompt:
private fun generateCandidate(callInfo: CallInfo, function: FirSimpleFunction, context: ResolutionContext): Candidate {
        val candidateFactory = CandidateFactory(context, callInfo)
        return candidateFactory.createCandidate(
            callInfo,
            symbol = function.symbol,
            explicitReceiverKind = ExplicitReceiverKind.NO_EXPLICIT_RECEIVER,
            scope = null
        )
    }

Response:
private fun generateCallInfo(
        callSite: FirExpression,
        name: Name,
        argumentList: FirArgumentList,
        callKind: CallKind,
        resolutionMode: ResolutionMode,
    ) = CallInfo(
        callSite = callSite,
        callKind = callKind,
        name = name,
        explicitReceiver = null,
        argumentList = argumentList,<|endoftext|>