Prompt:
import org.jetbrains.kotlin.resolve.constants.StringValue
import org.jetbrains.kotlin.storage.getValue
import org.jetbrains.kotlin.types.error.ErrorTypeKind
import org.jetbrains.kotlin.types.error.ErrorUtils
import org.jetbrains.kotlin.types.SimpleType
import java.util.*

Response:
object JavaAnnotationMapper {
    internal val DEPRECATED_ANNOTATION_MESSAGE = Name.identifier("message")
    internal val TARGET_ANNOTATION_ALLOWED_TARGETS = Name.identifier("allowedTargets")
    internal val RETENTION_ANNOTATION_VALUE = Name.identifier("value")

    fun mapOrResolveJavaAnnotation(<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.IrBranch
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
import org.jetbrains.kotlin.ir.expressions.IrWhen
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.util.IrElementConstructorIndicator

Response:
class IrWhenImpl internal constructor(
    @Suppress("UNUSED_PARAMETER")
    constructorIndicator: IrElementConstructorIndicator?,
    override val startOffset: Int,
    override val endOffset: Int,
    override var type: IrType,
    override var origin: IrStatementOrigin?,
) : IrWhen() {
    override var attributeOwnerId: IrAttributeContainer = this<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & T & T")!>x<!>.toByte()
                <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & T & T")!>x<!>.length

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & T & T")!>x<!>.get(0)
            }
        }
    }
}<|endoftext|>


Prompt:
fun <T> Bar<T>.parameterizedExt() {}

fun test_2_1(x: Any) {
    x as Bar<String>
    x as Bar<Int>

    x.parameterizedExt<String>()
    x.parameterizedExt<Int>()
}

fun test_2_2(x: Any) {
    x as Bar<Int>

Response:
x as Bar<String>

    x.parameterizedExt<String>()
    x.parameterizedExt<Int>()
}<|endoftext|>


Prompt:
// NI_EXPECTED_FILE

// FILE: a.kt
package a
    val foo = bar()

    fun bar() = <!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>foo<!>

// FILE: b.kt
package b
    fun foo() = bar()

Response:
fun bar() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!><!DEBUG_INFO_MISSING_UNRESOLVED!>foo<!>()<!>

// FILE: c.kt
package c
    fun bazz() = bar()<|endoftext|>


Prompt:
specificFeatures.any { (feature, state) ->
                state == LanguageFeature.State.ENABLED && feature.forcesPreReleaseBinariesIfEnabled()
            }

    companion object {
        @JvmField
        val DEFAULT = LanguageVersionSettingsImpl(LanguageVersion.LATEST_STABLE, ApiVersion.LATEST_STABLE)
    }
}

Response:
fun LanguageVersion.isPreRelease(): Boolean {
    if (!isStable) return true

    return KotlinCompilerVersion.isPreRelease() && this == LanguageVersion.LATEST_STABLE
}

fun LanguageFeature.forcesPreReleaseBinariesIfEnabled(): Boolean {
    val isFeatureNotReleasedYet = sinceVersion?.isStable != true<|endoftext|>


Prompt:
val sourceSetBOutputDirectory = temporaryFolder.newFolder()
                val sourceSetBInteropMetadataFiles = sourceSetB.cinteropMetadataBinaries.map { cinteropLibrary ->
                    sourceSetBOutputDirectory.resolve("${cinteropLibrary.cinteropLibraryName}.klib").also { file ->
                        cinteropLibrary.copyTo(file)
                    }
                }

Response:
assertEquals(1, sourceSetBInteropMetadataFiles.size, "Expected only one cinterop in sourceSetB")
                val interopB0MetadataFile = sourceSetBInteropMetadataFiles.firstOrNull { it.name == "interopB0.klib" }
                    ?: fail("Failed to find 'interopB0.klib'")
                assertZipContentEquals(<|endoftext|>


Prompt:
val isExact: Boolean,
)

context(KtAnalysisSession)
internal fun KtAnnotatedSymbol.resolveObjCNameAnnotation(): KtResolvedObjCNameAnnotation? {
    val annotation = annotationsList.annotations.find { it.classId?.asSingleFqName() == KonanFqNames.objCName } ?: return null

Response:
return KtResolvedObjCNameAnnotation(
        objCName = annotation.findArgument("name")?.resolveStringConstantValue(),
        swiftName = annotation.findArgument("swiftName")?.resolveStringConstantValue(),
        isExact = annotation.findArgument("exact")?.resolveBooleanConstantValue() ?: false
    )
}<|endoftext|>


Prompt:
CXType_FunctionProto(111),
    CXType_ConstantArray(112),
    CXType_Vector(113),
    CXType_IncompleteArray(114),
    CXType_VariableArray(115),
    CXType_DependentSizedArray(116),
    CXType_MemberPointer(117),
    CXType_Auto(118),

Response:
CXType_Elaborated(119),
    CXType_Pipe(120),
    CXType_OCLImage1dRO(121),
    CXType_OCLImage1dArrayRO(122),
    CXType_OCLImage1dBufferRO(123),
    CXType_OCLImage2dRO(124),<|endoftext|>


Prompt:
gradleVersion: GradleVersion,
        withIC: Boolean,
    ) {
        project(
            "scriptingCustomExtension",
            gradleVersion,
            buildOptions = defaultBuildOptions.copy(
                incremental = withIC,
                logLevel = if (withIC) LogLevel.DEBUG else defaultBuildOptions.logLevel
            )
        ) {
            val appSubproject = subProject("app")

Response:
appSubproject.disableLightTreeIfNeeded()
            val bobGreetSource = appSubproject.kotlinSourcesDir().resolve("bob.greet")
            val bobGreet = bobGreetSource.relativeTo(projectPath)
            val aliceGreet = appSubproject.kotlinSourcesDir().resolve("alice.greet").relativeTo(projectPath)<|endoftext|>


Prompt:
private fun checkInlineTargetVersion(
        callableSymbol: FirCallableSymbol<*>,
        context: CheckerContext,
        reporter: DiagnosticReporter,
        element: FirElement,
    ) {
        val currentJvmTarget = context.session.jvmTargetProvider?.jvmTarget ?: return

        val containingClass = callableSymbol.containingClassLookupTag()

Response:
val binaryClass = if (containingClass != null) {
            val containingClassSymbol = containingClass.toFirRegularClassSymbol(context.session) ?: return

            @OptIn(SymbolInternals::class)
            val sourceElement = containingClassSymbol.fir.sourceElement as? KotlinJvmBinarySourceElement ?: return
            sourceElement.binaryClass
        } else {<|endoftext|>


Prompt:
assertEquals(2, _x.getAndIncrement())
        assertEquals(3, x)
        assertEquals(3, _x.getAndDecrement())
        assertEquals(2, x)
        assertEquals(2, _x.getAndAdd(2))
        assertEquals(4, x)
        assertEquals(7, _x.addAndGet(3))

Response:
assertEquals(7, x)
        assertEquals(8, _x.incrementAndGet())
        assertEquals(8, x)
        assertEquals(7, _x.decrementAndGet())
        assertEquals(7, x)
        assertTrue(_x.compareAndSet(7, 10))
    }

    fun test() {
        testGetValue()<|endoftext|>


Prompt:
version: Int
    ) {
        val module = testModule.toLightDependencyWithVersion(version)
        val moduleDependencies = collectDependencies(
            testModule.dependenciesSymbols,
            withVersion = version
        )
        val klibFile = module.klibFile

Response:
val testCase = makeTestCase(module.name, module.module, COMPILER_ARGS_FOR_KLIB)

        val compilation = LibraryCompilation(
            settings = testRunSettings,
            freeCompilerArgs = testCase.freeCompilerArgs,
            sourceModules = testCase.modules,<|endoftext|>


Prompt:
// KNM_K2_IGNORE

package test

import kotlin.reflect.KClass

class PropertyInitializer {
    annotation class Anno(
        val arrayWithDefault: Array<String> = ["a", "b", "c"],
        val enumWithDefault: E = E.B,
        val klassWithDefault: KClass<E> = E::class,

Response:
//val klassWithDefaultDim: KClass<Array<*>> = Array::class,
        val annotationWithDefault: A1 = A1(E.A, E.B),
        val annotationArrayWithDefault: Array<A1> = [A1(E.A, E.B), A1(E.B, E.A)],
        val bool: Boolean = true,
        val byte: Byte = 1,<|endoftext|>


Prompt:
descriptorSerializerContext
                )
            )

            if (!usesK2) {
                registerNativeExtensions(project, descriptorSerializerContext!!)
            }
        }
    }

    companion object {
        fun checkCompilerVersion(configuration: CompilerConfiguration): Boolean {

Response:
val msgCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY)
            val suppressKotlinVersionCheck = configuration.get(ComposeConfiguration.SUPPRESS_KOTLIN_VERSION_COMPATIBILITY_CHECK)
            if (suppressKotlinVersionCheck != null) {
                msgCollector?.report(
                    CompilerMessageSeverity.WARNING,<|endoftext|>


Prompt:
data class A(val x: Array<Int>, val y: IntArray)

fun foo(x: Array<Int>, y: IntArray) = A(x, y)

fun box(): String {
    val a = Array<Int>(0, {0})
    val b = IntArray(0)
    val (x, y) = foo(a, b)

Response:
return if (a == x && b == y) "OK" else "Fail"
}<|endoftext|>


Prompt:
val future = worker.execute(TransferMode.SAFE, {}) {
            global3.value.a
        }

        val value = future.result
        assertEquals(3, value)
        worker.requestTermination().result
    }

    @Test
    fun globalOnWorkerFrozenBeforePassing() {
        assertEquals(3, global4.value.a)

Response:
global4.value.freeze()

        val worker = Worker.start()
        val future = worker.execute(TransferMode.SAFE, {}) {
            global4.value.a
        }

        val value = future.result
        assertEquals(3, value)
        worker.requestTermination().result
    }

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


Prompt:
internal fun FirCallableSymbol<*>.computeImportableName(useSiteSession: FirSession): FqName? {
    if (callableId.isLocal) return null

    // SAM constructors are synthetic, but can be imported
    if (origin is FirDeclarationOrigin.SamConstructor) return callableId.asSingleFqName()

    // if classId == null, callable is topLevel

Response:
val containingClassId = callableId.classId
        ?: return callableId.asSingleFqName()

    if (this is FirConstructorSymbol) return containingClassId.asSingleFqName()

    val containingClass = getContainingClassSymbol(useSiteSession) ?: return null

    // Java static members, enums, and object members can be imported<|endoftext|>


Prompt:
componentType == Class::class.java -> for (element in value as Array<*>) {
                        v.visitClassLiteral((element as Class<*>).classLiteralValue())
                    }
                    Annotation::class.java.isAssignableFrom(componentType) -> for (element in value as Array<*>) {

Response:
val vv = v.visitAnnotation(componentType.classId) ?: continue
                        processAnnotationArguments(vv, element as Annotation, componentType)
                    }
                    else -> for (element in value as Array<*>) {
                        v.visit(element)
                    }
                }
                v.visitEnd()
            }
            else -> {<|endoftext|>


Prompt:
class SamWrapperTransformer(transformationInfo: SamWrapperTransformationInfo, private val inliningContext: InliningContext) :
    ObjectTransformer<SamWrapperTransformationInfo>(transformationInfo, inliningContext.state) {

    override fun doTransform(parentRemapper: FieldRemapper): InlineResult {
        val classReader = createClassReader()

Response:
val classBuilder = createRemappingClassBuilderViaFactory(inliningContext)

        classReader.accept(object : ClassVisitor(Opcodes.API_VERSION, classBuilder.visitor) {
            override fun visit(version: Int, access: Int, name: String, signature: String?, superName: String, interfaces: Array<String>) {
                classBuilder.defineClass(<|endoftext|>


Prompt:
"aptMode", "<apt|stubs|stubsAndApt|compile>",
        "Annotation processing mode: only apt, only stub generation, both, or with the subsequent compilation",
        cliToolOption = CliToolOption("-Kapt-mode", VALUE)
    ),

    @Deprecated("Do not use in CLI")

Response:
CONFIGURATION("configuration", "<encoded>", "Encoded configuration"),

    SOURCE_OUTPUT_DIR_OPTION(
        "sources",
        "<path>",
        "Output path for generated sources",
        cliToolOption = CliToolOption("-Kapt-sources", VALUE)
    ),

    CLASS_OUTPUT_DIR_OPTION(
        "classes",<|endoftext|>


Prompt:
@JvmName("plus\$Int")
public inline operator fun <T : IntVarOf<*>> CPointer<T>?.plus(index: Int): CPointer<T>? =
        this + index.toLong()

@ExperimentalForeignApi
@JvmName("get\$Int")

Response:
public inline operator fun <T : Int> CPointer<IntVarOf<T>>.get(index: Int): T =
        (this + index)!!.pointed.value

@ExperimentalForeignApi
@JvmName("set\$Int")
public inline operator fun <T : Int> CPointer<IntVarOf<T>>.set(index: Int, value: T) {<|endoftext|>


Prompt:
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
// FILE: a.kt
fun box() = A(0).f()

// FILE: b.kt
OPTIONAL_JVM_INLINE_ANNOTATION
value class A(val i: Int)

Response: fun A.f(xs: Array<String> = Array<String>(1) { "OK" }) = xs[i]<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.inline.InlineUtil

class LiteralFunctionTranslator(context: TranslationContext) : AbstractTranslator(context) {
    fun translate(declaration: KtDeclarationWithBody): JsExpression {
        val finalElement = declaration.finalElement
        val invokingContext = context()

Response:
val descriptor = getFunctionDescriptor(invokingContext.bindingContext(), declaration)

        val lambda = invokingContext.getFunctionObject(descriptor)

        val functionContext = invokingContext
                .newFunctionBodyWithUsageTracker(lambda, descriptor)
                .translateAndAliasParameters(descriptor, lambda.parameters)

        descriptor.valueParameters.forEach {<|endoftext|>


Prompt:
* ./gradlew jvmRun -DmainClass="BarKt"
     *                    ^
     *                    Will execute the 'src/jvmMain/kotlin/Bar' main method.
     * ```
     */
    @ExperimentalKotlinGradlePluginApi
    fun mainRun(configure: KotlinJvmRunDsl.() -> Unit) = project.launch {

Response:
mainRun.await()?.configure()
    }

    var withJavaEnabled = false
        private set

    @Suppress("unused") // user DSL
    fun withJava() {
        if (withJavaEnabled)
            return

        project.multiplatformExtension.targets.find { it is KotlinJvmTarget && it.withJavaEnabled }
            ?.let { existingJavaTarget -><|endoftext|>


Prompt:
@kotlin.ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun kotlin.UShortArray.reverse(): kotlin.Unit

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

Response:
public inline fun kotlin.UShortArray.reverse(fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.Unit

public fun <T> kotlin.collections.MutableList<T>.reverse(): kotlin.Unit

public fun <T> kotlin.Array<out T>.reversed(): kotlin.collections.List<T><|endoftext|>


Prompt:
}
}

fun equalConstants() {
    contract {
        returns() implies (<!ERROR_IN_CONTRACT_DESCRIPTION("only equality comparisons with 'null' allowed"), SENSELESS_COMPARISON!>null == null<!>)
    }
}

fun get(): Int? = null
fun equalNullWithCall() {
    contract {

Response:
returns() implies (<!ERROR_IN_CONTRACT_DESCRIPTION("only references to parameters are allowed in contract description")!>get()<!> == null)
    }
}<|endoftext|>


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

// TESTCASE NUMBER: 1
fun case_1(x: Any?) {
    if (x is Int || false) {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any? & kotlin.Int")!>x<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int"), DEBUG_INFO_SMARTCAST!>x<!>.inv()
    }
}

// TESTCASE NUMBER: 2
fun case_2(x: Any) {
    if (x is Unit || false || false || false || false || false) {<|endoftext|>


Prompt:
}

    fun done() = noMoreFrames && (video?.isQueueEmpty() ?: true) && (audio?.isQueueEmpty() ?: true)

    fun dispose() {
        video?.dispose()
        audio?.dispose()
    }

    private fun needMoreFrames(): Boolean =

Response:
(video?.needMoreFrames() ?: false) || (audio?.needMoreFrames() ?: false)

    fun decodeIfNeeded() {
        if (!needMoreFrames()) return
        if (video?.isQueueAlmostFull() == true) return
        if (audio?.isQueueAlmostFull() == true) return
        memScoped {
            val packet = alloc<AVPacket>()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.types.KtType
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtTypeParameter

Response:
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.types.Variance
import org.jetbrains.kotlin.types.typeUtil.isNullableAny

internal class KtFe10PsiTypeParameterSymbol(
    override val psi: KtTypeParameter,
    override val analysisContext: Fe10AnalysisContext<|endoftext|>


Prompt:
createNonSyntheticValue(expression, MagicKind.UNSUPPORTED_ELEMENT, left)
            }
        }

        private fun generateJumpsToCatchAndFinally() {
            if (catchFinallyStack.isNotEmpty()) {
                with(catchFinallyStack.peek()) {
                    if (tryExpression != null) {
                        onException?.let {

Response:
builder.nondeterministicJump(it, tryExpression, null)
                        }
                        toFinally?.let {
                            builder.nondeterministicJump(it, tryExpression, null)
                        }
                    }
                }
            }
        }

        override fun visitThrowExpression(expression: KtThrowExpression) {
            mark(expression)<|endoftext|>


Prompt:
"lib1/lib1.file1.1.kt" copyTo "lib1.file1.kt"
            "lib1/lib1.file2.kt" copyTo "lib1.file2.kt"
        }
        val lib21 = compileLibrary("lib2", lib11) { "lib2/lib2.kt" copyTo "lib2.kt" }

Response:
val main1 = compileToExecutable("main", lib11, lib21) { "main/main.kt" copyTo "main.kt" }
        assertTrue(main1.executableFile.exists())
        assertTrue(lib1File1KtCacheDir.exists())
        assertTrue(lib1File2KtCacheDir.exists())
        assertTrue(lib2KtCacheDir.exists())<|endoftext|>


Prompt: p00: Int, p01: Int, p02: Int, p03: Int, p04: Int, p05: Int, p06: Int, p07: Int, p08: Int, p09: Int,

Response: p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int,<|endoftext|>


Prompt:
override fun conflict(first: FunctionDescriptor, second: FunctionDescriptor): Boolean =
            !mapper.canHaveSameSelector(first, second, configuration.ignoreInterfaceMethodCollisions)
    }

    private val methodSwiftNames = object : Mapping<FunctionDescriptor, String>() {
        override fun conflict(first: FunctionDescriptor, second: FunctionDescriptor): Boolean {

Response:
if (configuration.disableSwiftMemberNameMangling) return false // Ignore all conflicts.
            return !mapper.canHaveSameSelector(first, second, configuration.ignoreInterfaceMethodCollisions)
        }
        // Note: this condition is correct but can be too strict.
    }

    private inner class PropertyNameMapping(val forSwift: Boolean) : Mapping<PropertyDescriptor, String>() {<|endoftext|>


Prompt:
buildAndFail("assemble", "--continue", buildOptions = buildOptions.copy(parallel = false)) {
                assertEqualsToFile(expectedOutputFile("root-with-continue"), extractProjectsAndTheirDiagnostics())
            }
        }
    }

    @GradleTest
    fun testEarlyTasksMaterializationDoesntBreakReports(gradleVersion: GradleVersion) {

Response:
project("earlyTasksMaterializationDoesntBreakReports", gradleVersion) {
            buildAndFail("assemble") {
                assertEqualsToFile(expectedOutputFile(), extractProjectsAndTheirDiagnostics())
            }
        }
    }

    @GradleTest
    fun testDiagnosticsRenderingWithStacktraceOption(gradleVersion: GradleVersion) {<|endoftext|>


Prompt:
private inline fun <reified T> convertAnyArray(classifier: KClassifier?, args: Sequence<T?>): Any? =
    if (classifier == T::class) args.toList().toTypedArray() // simple case
    else convertAnyArrayImpl<T>(classifier, args)

private fun <T> convertAnyArrayImpl(classifier: KClassifier?, args: Sequence<T?>): Any? {

Response:
val elementClass = (classifier as? KClass<*>) ?: return null

    val argsList = args.toList()
    val result = java.lang.reflect.Array.newInstance(elementClass.java, argsList.size)
    argsList.forEachIndexed { idx, arg ->
        try {
            java.lang.reflect.Array.set(result, idx, arg)<|endoftext|>


Prompt:
private inner class NativeBridge(val kotlinLines: List<String>, val nativeLines: List<String>)

    override fun kotlinToNative(
            nativeBacked: NativeBacked,
            returnType: BridgedType,
            kotlinValues: List<BridgeTypedKotlinValue>,
            independent: Boolean,

Response:
block: NativeCodeBuilder.(nativeValues: List<NativeExpression>) -> NativeExpression
    ): KotlinExpression {

        val kotlinLines = mutableListOf<String>()
        val nativeLines = mutableListOf<String>()

        val kotlinFunctionName = "kniBridge${nextUniqueId++}"<|endoftext|>


Prompt:
defaultFalse("isVar", withGetter = true)
            defaultNull("receiverParameter", "delegate", "getter", "setter", withGetter = true)
        }

        impl(namedArgumentExpression) {
            default("coneTypeOrNull") {
                delegate = "expression"
            }
        }

        impl(spreadArgumentExpression) {
            default("isSpread") {

Response:
value = "true"
                withGetter = true
            }
            default("coneTypeOrNull") {
                delegate = "expression"
            }
        }

        impl(comparisonExpression) {
            default("coneTypeOrNull", "StandardClassIds.Boolean.constructClassLikeType()")
            additionalImports(standardClassIdsType, constructClassLikeTypeImport)
        }<|endoftext|>


Prompt:
const val equalsWithNull2 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, SENSELESS_COMPARISON!>null == null<!>
const val equalsWithNull3 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, SENSELESS_COMPARISON!>TRUE == null<!>

Response: const val equalsWithNull4 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, SENSELESS_COMPARISON!>STR == null<!><|endoftext|>


Prompt:
val varargElementType = valueParameter.varargElementType
        if (varargElementType != null) {
            append("vararg ", valueParameter.name, ": ").appendType(varargElementType)
            append(" /* ").appendType(valueParameter.type).append(" */")
        } else {
            append(valueParameter.name, ": ").appendType(valueParameter.type)
        }

Response:
if (valueParameter.declaresDefaultValue) {
            append(" /* = ... */")
        }
    }

    private fun Printer.appendValueParameters(valueParameters: List<KmValueParameter>) {
        appendCollection(valueParameters, prefix = "(", postfix = ")") { renderValueParameter(it, this) }
    }<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithTwoTypeParameters<*, *> & ClassWithSixTypeParameters<*, kotlin.Nothing, *, *, kotlin.Nothing, *>")!>x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!><!>.ip2test()

Response: <!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *>? & InterfaceWithTwoTypeParameters<*, *> & ClassWithSixTypeParameters<*, *, *, *, *, *>")!>x<!><|endoftext|>


Prompt:
}
        if (expression != null) {
            @Suppress("USELESS_IS_CHECK") // K2 warning suppression, TODO: KT-62472
            if (expression.isNull() && expression is KtConstantExpression) {
                val factory = when (diagnostic) {
                    is ArgumentNullabilityErrorDiagnostic -> NULL_FOR_NONNULL_TYPE

Response:
is ArgumentNullabilityWarningDiagnostic -> NULL_FOR_NONNULL_TYPE_WARNING
                }
                trace.reportDiagnosticOnce(factory.on(expression, diagnostic.expectedType))
            } else {
                val factory = when (diagnostic) {
                    is ArgumentNullabilityErrorDiagnostic -> TYPE_MISMATCH
                    is ArgumentNullabilityWarningDiagnostic -> TYPE_MISMATCH_WARNING
                }<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.NoReflectionInClassPath

internal class SyntheticPropertyWithoutJavaOriginImpl(
    override val originalSymbol: KtFunctionLikeSymbol,
    override val functionName: Name,
    firDiagnostic: KtPsiDiagnostic,

Response:
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.SyntheticPropertyWithoutJavaOrigin

internal class ImplementingFunctionInterfaceImpl(
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,<|endoftext|>


Prompt:
require(!symbol.isCopyCreatedInScope) {
            "callableCopySubstitution was not calculated for callable copy: " +
                    "$symbol with origin ${declaration.origin} and return type ${declaration.returnTypeRef}"
        }

        return resolveDeclaration(declaration)
    }

    @OptIn(PrivateForInline::class)

Response:
protected open fun resolveDeclaration(declaration: FirCallableDeclaration): FirResolvedTypeRef {
        // To properly transform and resolve declaration's type, we need to use its module's session
        val session = declaration.moduleData.session
        val symbol = declaration.symbol

        val (designation, outerBodyResolveContext) = if (declaration in designationMapForLocalClasses) {<|endoftext|>


Prompt:
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC

// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: MyClass, testProtected$default
// FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC

// TESTED_OBJECT_KIND: function

Response:
// TESTED_OBJECTS: MyClass, testPrivate$default
// FLAGS: ACC_STATIC, ACC_SYNTHETIC<|endoftext|>


Prompt:
if (shouldGenerateReceiverAsSingletonReference(receiverClassDescriptor))
                        generateSingletonReference(receiverClassDescriptor, defaultStartOffset, defaultEndOffset, receiver.type)
                    else
                        IrGetValueImpl(
                            defaultStartOffset, defaultEndOffset, irReceiverType,

Response:
context.symbolTable.descriptorExtension.referenceValueParameter(receiverClassDescriptor.thisAsReceiverParameter)
                        )
                }
                is ContextClassReceiver -> loadContextReceiver(receiver, defaultStartOffset, defaultEndOffset)
                is ThisClassReceiver ->
                    generateThisOrSuperReceiver(receiver, receiver.classDescriptor)
                is SuperCallReceiverValue -><|endoftext|>


Prompt:
annotations += annotation
    }

    override fun visitFile(file: KlibSourceFile) {
        this.file = file
    }

    fun accept(visitor: KmFunctionExtension) {
        require(visitor is KlibFunctionExtensionVisitor)
        annotations.forEach(visitor::visitAnnotation)
        uniqId?.let(visitor::visitUniqId)

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

internal class KlibClassExtension : KlibClassExtensionVisitor(), KmClassExtension {

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


Prompt:
}

    override fun visitRegularClass(regularClass: FirRegularClass, data: CheckerContext) {
        checkers.allRegularClassCheckers.check(regularClass, data)
    }

    override fun visitSimpleFunction(simpleFunction: FirSimpleFunction, data: CheckerContext) {
        checkers.allSimpleFunctionCheckers.check(simpleFunction, data)
    }

Response:
override fun visitTypeAlias(typeAlias: FirTypeAlias, data: CheckerContext) {
        checkers.allTypeAliasCheckers.check(typeAlias, data)
    }

    override fun visitConstructor(constructor: FirConstructor, data: CheckerContext) {
        checkers.allConstructorCheckers.check(constructor, data)
    }<|endoftext|>


Prompt:
object Unknown : EffectiveVisibility("unknown") {
        override fun relation(other: EffectiveVisibility, typeCheckerContextProvider: TypeCheckerProviderContext): Permissiveness =
            if (other == Unknown)
                Permissiveness.SAME
            else
                Permissiveness.UNKNOWN

        override fun toVisibility(): Visibility = Visibilities.Unknown
    }

    // Private with File container

Response:
object PrivateInFile : EffectiveVisibility("private-in-file", privateApi = true) {
        override fun relation(other: EffectiveVisibility, typeCheckerContextProvider: TypeCheckerProviderContext): Permissiveness =
            when (other) {
                this -> Permissiveness.SAME
                PrivateInClass, Local -> Permissiveness.MORE
                else -> Permissiveness.LESS
            }<|endoftext|>


Prompt:
assertFalse(eqByteQChar(0.toByte(), 1.toChar()))
    assertFalse(eqByteQChar(1.toByte(), 0.toChar()))
    assertFalse(eqByteQChar(1.toByte(), 1.toChar()))
    assertFalse(eqByteQChar(null, 0.toChar()))
    assertFalse(eqByteQChar(null, 1.toChar()))

Response:
assertFalse(eqByteQChar(undefined, 0.toChar()))
    assertFalse(eqByteQChar(undefined, 1.toChar()))
    assertFalse(eqByteQCharQ(0.toByte(), 0.toChar()))
    assertFalse(eqByteQCharQ(0.toByte(), 1.toChar()))
    assertFalse(eqByteQCharQ(0.toByte(), null))<|endoftext|>


Prompt:
@Suppress("UNCHECKED_CAST")
    override val compilations: NamedDomainObjectContainer<FakeCompilation>
        get() = super.compilations as NamedDomainObjectContainer<FakeCompilation>

    @ExperimentalKotlinGradlePluginApi
    override val compilerOptions: KotlinJvmCompilerOptions
        get() = super.compilerOptions as KotlinJvmCompilerOptions
}

Response:
fun ExternalKotlinTargetDescriptorBuilder<FakeTarget>.defaults() {
    targetName = "fake"
    platformType = KotlinPlatformType.jvm
    targetFactory = TargetFactory(::FakeTarget)
}

fun ExternalKotlinCompilationDescriptorBuilder<FakeCompilation>.defaults(
    kotlin: KotlinMultiplatformExtension,<|endoftext|>


Prompt:
private val autoCacheDir: File get() = buildDir.resolve("__auto_cache__")
    private val icCacheDir: File get() = buildDir.resolve("__ic_cache__")
    private val cacheFlavor: String
        get() = CacheMode.computeCacheDirName(
            testRunSettings.get<KotlinNativeTargets>().testTarget,
            "STATIC",

Response:
testRunSettings.get<OptimizationMode>() == OptimizationMode.DEBUG,
            partialLinkageEnabled = false
        )

    private fun getLibraryFileCache(libName: String, libFileRelativePath: String, fqName: String): File {
        val libCacheDir = icCacheDir.resolve(cacheFlavor).resolve("$libName-per-file-cache")<|endoftext|>


Prompt: // library.kt:24 box: mainVar:int=1:int, $i$f$flaf:int=0:int, flafVar$iv:int=1:int, fooParam\1$iv:int=1:int, $i$f$foo\1\40:int=0:int, fooVar\1$iv:int=1:int,

Response: bazParam\2$iv:int=1:int, $i$f$baz\2\97:int=0:int, bazVar\2$iv:int=3:int, baz1Param\3$iv:int=1:int, $i$f$baz1\3\108:int=0:int, baz1Var\3$iv:int=3:int,<|endoftext|>


Prompt:
@Suppress("UNCHECKED_CAST")
    override fun <E : FirElement, D> transform(transformer: FirTransformer<D>, data: D): E =
        transformer.transformElvisExpression(this, data) as E

    abstract override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?)

Response:
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)

    abstract override fun replaceCalleeReference(newCalleeReference: FirReference)

    abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirElvisExpression<|endoftext|>


Prompt:
val f: () -> Unit = {
        require(b)
        x.value<!UNSAFE_CALL!>.<!>length
        require(c)
        x.value<!UNSAFE_CALL!>.<!>length
    }
    b = true
    f()
}

fun testRequireNotNullViaVariableLambda(x: String?) {

Response:
val a = x != null
    var b = a
    val c = b
    callLambdaWithoutContract { b = true }
    require(b)
    x<!UNSAFE_CALL!>.<!>length
    require(c)
    x<!UNSAFE_CALL!>.<!>length
}<|endoftext|>


Prompt:
private object B252 { val a = B251.a + Random.nextInt(100) }
private object B253 { val a = B252.a + Random.nextInt(100) }
private object B254 { val a = B253.a + Random.nextInt(100) }
private object B255 { val a = B254.a + Random.nextInt(100) }

Response:
private object B256 { val a = B255.a + Random.nextInt(100) }
private object B257 { val a = B256.a + Random.nextInt(100) }
private object B258 { val a = B257.a + Random.nextInt(100) }
private object B259 { val a = B258.a + Random.nextInt(100) }<|endoftext|>


Prompt:
if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char"), DEBUG_INFO_SMARTCAST!>a.e<!>.equals(null)
    if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char"), DEBUG_INFO_SMARTCAST!>a.e<!>.propT

Response:
if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char"), DEBUG_INFO_SMARTCAST!>a.e<!>.propAny
    if (a.e !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Char?")!>a.e<!>.propNullableT<|endoftext|>


Prompt:
use(a, b, c, d, e, f, g, r)
}

fun use(vararg a: Any?) = a

interface Inv<T>

fun <T> exactBound(t: T, l: Inv<T>): T = throw Exception("$t $l")

Response:
fun testExactBound(invS: Inv<String>, invI: Inv<Int>, invB: Inv<Byte>) {
    exactBound(1, <!TYPE_MISMATCH!>invS<!>)
    exactBound(1, invI)

    val b = exactBound(1, invB)
    b checkType { _<Byte>() }
}

interface Cov<out T><|endoftext|>


Prompt:
const val NOENDORSEDLIBS = "no-endorsed-libs"
const val PURGE_USER_LIBS = "Xpurge-user-libs"
const val TEMP_DIR = "Xtemporary-files-dir"
const val PROJECT_DIR = "Xproject-dir"
const val NOPACK = "nopack"

Response:
const val COMPILE_SOURCES = "Xcompile-source"
const val SHORT_MODULE_NAME = "Xshort-module-name"
const val FOREIGN_EXCEPTION_MODE = "Xforeign-exception-mode"
const val DUMP_BRIDGES = "Xdump-bridges"<|endoftext|>


Prompt:
)

    private val unstableFeaturesHint = "The dependent $unitName must enable all unstable language features that its dependency has."

    private val unstableFeaturesCheck = ConsistencyCheck<T, Set<LanguageFeature>?>(
        name = "unstable language feature set",
        getValue = { unit ->
            unit.languageSettings().getValueIfExists {
                enabledLanguageFeatures

Response:
.mapNotNull { parseLanguageFeature(it) }
                    .filterTo(mutableSetOf()) { it.kind == LanguageFeature.Kind.UNSTABLE_FEATURE }
            }
        },
        leftExtendsRightConsistently = { left, right ->
            if (left == null || right == null) true else left.containsAll(right)
        },<|endoftext|>


Prompt:
* Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.
     * The shift distance actually used is therefore always in the range `0..31`.
     */
    @kotlin.internal.IntrinsicConstEvaluation
    public infix fun shr(bitCount: Int): Int

    /**

Response:
* Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros.
     *
     * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.
     * The shift distance actually used is therefore always in the range `0..31`.
     */
    @kotlin.internal.IntrinsicConstEvaluation<|endoftext|>


Prompt: fun test(notRange1: NotRange1, notRange2: NotRange2, notRange3: NotRange3, notRange4: NotRange4, notRange5: NotRange5, notRange6: NotRange6, notRange7: NotRange7, notRange8: NotRange8, range0: Range0, range1: Range1) {

Response:
for (i in <!ITERATOR_MISSING!>notRange1<!>);
  for (i in <!HAS_NEXT_MISSING, NEXT_MISSING!>notRange2<!>);
  for (i in <!NEXT_MISSING!>notRange3<!>);<|endoftext|>


Prompt:
// Add the abstract function symbol to stub function for bridge lowering
            overriddenSymbols = listOf(function.symbol)
            parent = irClass
            dispatchReceiverParameter = function.dispatchReceiverParameter?.copyWithSubstitution(this, substitutionMap)
            extensionReceiverParameter = function.extensionReceiverParameter?.copyWithSubstitution(this, substitutionMap)

Response:
valueParameters = function.valueParameters.map { it.copyWithSubstitution(this, substitutionMap) }
            body = createThrowingStubBody(context, this)
        }
    }

    private fun liftStubMethodReturnType(function: IrSimpleFunction): IrType {
        val klass = when (function.name.asString()) {
            "iterator" -> context.ir.symbols.iterator<|endoftext|>


Prompt: $i$f$baz1\18\108:int=0:int, baz1Var\18:int=3:int, baz1BlockParam\20:int=1:int, $i$a$-baz1-LibraryKt$inlineCall$1\20\111\17:int=0:int, baz1LambdaVar\20:int=1:int,

Response: baz1Param\21:int=2:int, $i$f$baz1\21\118:int=0:int, baz1Var\21:int=3:int, baz2Param\22:int=1:int, $i$f$baz2\22\129:int=0:int<|endoftext|>


Prompt:
it.patchDeclarationParents(ownerFn.parent)
                            it.copyAttributes(property)
                        }
                    }
                }
            } else if (ownerFn.needsComposableRemapping()) {
                if (symbolRemapper.getReferencedSimpleFunction(ownerFn.symbol) == ownerFn.symbol) {
                    // Not remapped yet, so remap now.

Response:
// Remap only once to avoid IdSignature clash (on k/js 1.7.20).
                    symbolRemapper.visitSimpleFunction(ownerFn)
                    visitSimpleFunction(ownerFn).also {
                        it.correspondingPropertySymbol = null
                        it.patchDeclarationParents(ownerFn.parent)
                    }
                }
            }<|endoftext|>


Prompt:
elementType,
                        get(elementType, scope, parcelizeType, strict())
                    )
                )
            }

            in supportedByListSerializer -> {
                val elementType = (irType as IrSimpleType).arguments.single().upperBound(irBuiltIns)
                if (!scope.hasCustomSerializer(elementType) &&
                    classifierFqName in supportedBySimpleListSerializer
                ) {

Response:
val elementTypeAsString = elementType.erasedUpperBound.fqNameWhenAvailable?.asString()
                    val simpleSerializer =
                        if (classifierFqName in BuiltinParcelableTypes.IMMUTABLE_LIST_FQNAMES) {
                            when (elementTypeAsString) {
                                "android.os.IBinder" -> iBinderPersistentListSerializer<|endoftext|>


Prompt:
directLibs.mapNotNull { SearchRoot.lookUpByAbsolutePath(File(it)) }.flatMap { libraryComponentBuilder(it, false) }
    }

    override val searchRoots: List<SearchRoot> by lazy {
        val searchRoots = mutableListOf<SearchRoot?>()

        // Current working dir:

Response:
searchRoots += currentDirHead?.let { SearchRoot(searchRootPath = it, allowLookupByRelativePath = true) }

        // Custom repositories (deprecated, to be removed):
        // TODO: remove after 2.0, KT-61098<|endoftext|>


Prompt:
fun <K> foo21(x: K?): Foo<Foo<OutBar<K>>> = materialize()
fun <K> foo22(x: K?): Foo<Foo<InBar<K>>> = materialize()
fun <K> foo23(x: K?): Foo<Foo<Bar<out K>>> = materialize()

Response:
fun <K> foo24(x: K?): Foo<Foo<Bar<in K>>> = materialize()

fun <K> foo25(x: K?): Bar<out K> = materialize()
fun <K> foo26(x: K?): Foo<out Foo<out Bar<out K>>> = materialize()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.KtFunctionSymbol
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest
import org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider
import org.jetbrains.kotlin.analysis.utils.printer.prettyPrint

Response:
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.assertions
import org.jetbrains.kotlin.types.Variance
import kotlin.collections.single<|endoftext|>


Prompt:
override fun isNewPlaceForBodyGeneration(classProto: ProtoBuf.Class): Boolean =
        JvmFlags.IS_COMPILED_IN_JVM_DEFAULT_MODE.get(classProto.getExtension(JvmProtoBuf.jvmClassFlags))

    override fun getPackage(fqName: FqName): FqName? =

Response:
javaFacade.getPackage(fqName)

    private fun loadAnnotationsFromClassFile(
        kotlinClass: KotlinClassFinder.Result.KotlinClass,
        symbol: FirRegularClassSymbol
    ) {
        val annotations = mutableListOf<FirAnnotation>()
        var hasPublishedApi = false<|endoftext|>


Prompt:
override fun getTargetDescriptors(context: BindingContext): Collection<DeclarationDescriptor> {
        return listOfNotNull(
            context[BindingContext.VARIABLE, element],
            context[BindingContext.COMPONENT_RESOLVED_CALL, element]?.candidateDescriptor
        )
    }

Response:
override fun getRangeInElement() = TextRange(0, element.textLength)

    override fun isReferenceToImportAlias(alias: KtImportAlias): Boolean {
        return super<KtFe10Reference>.isReferenceToImportAlias(alias)
    }

    override fun canRename(): Boolean {<|endoftext|>


Prompt:
override val reason: String get() = "Unresolved name: $prettyReference"

    private val prettyReference: String
        get() = when (val token = operatorToken) {
            null -> name.toString()
            else -> "$name ($token)"
        }
}

class ConeFunctionCallExpectedError(
    val name: Name,
    val hasValueParameters: Boolean,

Response:
override val candidates: Collection<AbstractCandidate>
) : ConeDiagnosticWithCandidates {
    override val reason: String get() = "Function call expected: $name(${if (hasValueParameters) "..." else ""})"
}

class ConeFunctionExpectedError(val expression: String, val type: ConeKotlinType) : ConeDiagnostic {<|endoftext|>


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

fun box(): String {
    for ((index, x) in "".withIndex()) {
        return "Loop over empty String should not be executed"
    }
    return "OK"
}

// 0 withIndex
// 0 iterator
// 0 hasNext

Response:
// 0 next
// 0 component1
// 0 component2
// 1 length
// 1 charAt

// The ICONST_0 is for initializing the index in the lowered for-loop.
// 1 ICONST_0

// JVM_IR_TEMPLATES
// 4 ILOAD
// 4 ISTORE
// 0 IADD
// 0 ISUB
// 0 IINC<|endoftext|>


Prompt:
@PublishedApi
internal class KMutableProperty0Impl<R>(override val name: String, override val getter: KFunction0<R>, val setter: (R) -> Unit)
    : KProperty0ImplBase<R>(), KMutableProperty0<R> {
    override fun set(value: R): Unit {
        setter(value)
    }

Response:
override fun equals(other: Any?): Boolean {
        val otherKProperty = other as? KMutableProperty0Impl<*>
        if (otherKProperty == null) return false
        return name == otherKProperty.name && getter == otherKProperty.getter && setter == otherKProperty.setter
    }

    override fun hashCode(): Int {<|endoftext|>


Prompt:
BlockOrBody.Body(this).makeBodyWithAddedVariables(context, variables, symbol) as IrBody

/**
 * Adds declarations of the variables to the most narrow possible block or body.
 * It adds them before the first usage within the block and inlines initialization of them when possible.
 */

Response:
private fun BlockOrBody.makeBodyWithAddedVariables(context: JvmBackendContext, variables: Set<IrVariable>, symbol: IrSymbol): IrElement {
    if (variables.isEmpty()) return element
    extractVariablesSettersToOuterPossibleBlock(variables)
    val nearestBlocks = findNearestBlocksForVariables(variables, this)<|endoftext|>


Prompt:
@file:Suppress("NO_EXPLICIT_VISIBILITY_IN_API_MODE", "NO_EXPLICIT_RETURN_TYPE_IN_API_MODE") // TODO: Fix in dukat: https://github.com/Kotlin/dukat/issues/124

package org.w3c.dom

import kotlin.js.*
import org.khronos.webgl.*

Response:
import org.w3c.dom.clipboard.*
import org.w3c.dom.css.*
import org.w3c.dom.encryptedmedia.*
import org.w3c.dom.events.*
import org.w3c.dom.mediacapture.*
import org.w3c.dom.mediasource.*
import org.w3c.dom.pointerevents.*<|endoftext|>


Prompt:
<!UNREACHABLE_CODE!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>x<!>.equals(10)<!>
    }
}

/*
 * TESTCASE NUMBER: 16
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28430
 */

Response:
fun case_16(x: Nothing?) {
    <!DEBUG_INFO_CONSTANT, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
    <!DEBUG_INFO_CONSTANT, DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>?.<!NONE_APPLICABLE!>equals<!>(10)<|endoftext|>


Prompt:
}

        val historyFiles = when (historyFilesEither) {
            is Either.Success<Set<File>> -> historyFilesEither.value
            is Either.Error -> {
                reporter.info { "Could not find history files: ${historyFilesEither.reason}" }
                return ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_HISTORY_IS_NOT_FOUND)
            }
        }

Response:
fun analyzeHistoryFiles(): ChangesEither {
            for (historyFile in historyFiles) {
                val allBuilds = BuildDiffsStorage.readDiffsFromFile(historyFile, reporter = reporter)
                    ?: return run {
                        reporter.info { "Could not read diffs from $historyFile" }
                        ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_HISTORY_CANNOT_BE_READ)
                    }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers

import org.gradle.api.Project
import org.jetbrains.kotlin.commonizer.CommonizerOutputFileLayout.resolveCommonizedDirectory
import org.jetbrains.kotlin.commonizer.SharedCommonizerTarget

Response:
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinDependency
import org.jetbrains.kotlin.gradle.idea.tcs.extras.isCommonized
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet<|endoftext|>


Prompt:
public actual inline fun String.toByte(radix: Int): Byte = java.lang.Byte.parseByte(this, checkRadix(radix))

/**
 * Parses the string as a [Short] number and returns the result.
 * @throws NumberFormatException if the string is not a valid representation of a number.
 */
@kotlin.internal.InlineOnly

Response:
public actual inline fun String.toShort(): Short = java.lang.Short.parseShort(this)

/**
 * Parses the string as a [Short] number and returns the result.
 * @throws NumberFormatException if the string is not a valid representation of a number.
 * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.
 */<|endoftext|>


Prompt:
fun report(name: String, infos: List<ModuleInfo>, allModules: Collection<ModuleInfo>): Nothing {
        val message = "$name does not know how to resolve"
        val error = when {
            name.contains(ResolverForProject.resolverForSdkName) -> errorInSdkResolver(message)

Response:
name.contains(ResolverForProject.resolverForLibrariesName) -> errorInLibrariesResolver(message)
            name.contains(ResolverForProject.resolverForModulesName) -> {
                when {
                    infos.isEmpty() -> errorInModulesResolverWithEmptyInfos(message)
                    infos.size == 1 -> {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.CliSealedClassInheritorsProvider
import org.jetbrains.kotlin.resolve.CompilerEnvironment
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices

Response:
import org.jetbrains.kotlin.resolve.constants.EnumValue
import org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.resolve.jvm.JvmPlatformParameters<|endoftext|>


Prompt:
package org.jetbrains.kotlin.fir.resolve.dfa

import kotlinx.collections.immutable.*
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.types.AbstractTypeChecker
import java.util.*

Response:
import kotlin.math.max

abstract class LogicSystem(private val context: ConeInferenceContext) {
    val session: FirSession get() = context.session
    private val nullableNothingType = session.builtinTypes.nullableNothingType.type
    private val anyType = session.builtinTypes.anyType.type

    abstract val variableStorage: VariableStorageImpl<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("T & kotlin.Number? & kotlin.Comparable<kotlin.Int & kotlin.Float>? & T")!>x<!><!UNSAFE_CALL!>.<!>toByte()
    }
}

/*
 * TESTCASE NUMBER: 9
 * ISSUES: KT-1982
 */

Response:
inline fun <reified T : Any> case_9(x: T) {
    if (x is Int? || x is Float?) {
        <!DEBUG_INFO_EXPRESSION_TYPE("T & kotlin.Number & kotlin.Comparable<kotlin.Int & kotlin.Float> & T")!>x<!><|endoftext|>


Prompt:
trace.report(Errors.ANNOTATION_ARGUMENT_KCLASS_LITERAL_OF_TYPE_PARAMETER.on(argumentExpression))
                }
            }
        }
    }

    private fun reportDeprecationWarningOnNonConst(expression: KtExpression, trace: BindingTrace) {

Response:
trace.report(Errors.ANNOTATION_ARGUMENT_IS_NON_CONST.on(expression))
    }

    private fun getArgumentExpressionsForArrayCall(
        expression: KtCallExpression,
        trace: BindingTrace
    ): List<KtExpression>? {
        val resolvedCall = expression.getResolvedCall(trace.bindingContext) ?: return null<|endoftext|>


Prompt:
fun <T : Number?> T.case_5_4(): Boolean? {
    contract { returns(null) implies (this@case_5_4 !is Int || <!SENSELESS_COMPARISON!>this@case_5_4 == null<!>) }

Response:
return if (this@case_5_4 !is Int || <!SENSELESS_COMPARISON!>this@case_5_4 == null<!>) null else true
}

// TESTCASE NUMBER: 6
inline fun <reified T : Any?> T?.case_6_1(): Boolean {<|endoftext|>


Prompt:
graphBuilder.exitTypeOperatorCall(typeOperatorCall).mergeIncomingFlow { _, flow ->
            if (typeOperatorCall.operation !in FirOperation.TYPES) return@mergeIncomingFlow
            addTypeOperatorStatements(flow, typeOperatorCall)
        }
    }

Response:
private fun addTypeOperatorStatements(flow: MutableFlow, typeOperatorCall: FirTypeOperatorCall) {
        val type = typeOperatorCall.conversionTypeRef.coneType
        val operandVariable = getOrCreateVariableIfRealAndStable(flow, typeOperatorCall.argument) ?: return
        when (val operation = typeOperatorCall.operation) {<|endoftext|>


Prompt:
override fun createDelegatingTestReportProcessor(origin: TestResultProcessor, targetName: String) =
        object : TestResultProcessor by origin {
            override fun started(test: TestDescriptorInternal, event: TestStartEvent) {
                val myTest = object : TestDescriptorInternal by test {
                    override fun getDisplayName(): String = "${test.displayName}[$targetName]"

Response:
override fun getClassName(): String? = test.className?.replace('$', '.')
                    override fun getClassDisplayName(): String? = test.classDisplayName?.replace('$', '.')
                }
                origin.started(myTest, event)
            }
        }
}<|endoftext|>


Prompt:
abstract override fun replaceContextReceivers(newContextReceivers: List<FirContextReceiver>)

    abstract override fun replaceControlFlowGraphReference(newControlFlowGraphReference: FirControlFlowGraphReference?)

    abstract override fun replaceValueParameters(newValueParameters: List<FirValueParameter>)

    abstract override fun replaceContractDescription(newContractDescription: FirContractDescription?)

Response:
abstract override fun replaceAnnotations(newAnnotations: List<FirAnnotation>)

    abstract fun replaceDelegatedConstructor(newDelegatedConstructor: FirDelegatedConstructorCall?)

    abstract override fun replaceBody(newBody: FirBlock?)

    abstract override fun <D> transformTypeParameters(transformer: FirTransformer<D>, data: D): FirConstructor<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & kotlin.String?")!>y<!>
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & kotlin.String?"), DEBUG_INFO_SMARTCAST!>y<!>.length
        }
    }
    init { }
}

/*
 * TESTCASE NUMBER: 4

Response:
* UNEXPECTED BEHAVIOUR
 * ISSUES: KT-17694
 */
class Case4 {
    init {
        var y: String? = "xyz"
        if (y != null) {
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>y<!><|endoftext|>


Prompt:
}

            is NullForNotNullType -> FirErrors.NULL_FOR_NONNULL_TYPE.createOn(
                rootCause.argument.source ?: source, rootCause.expectedType.removeTypeVariableTypes(typeContext)
            )

Response:
is NonVarargSpread -> FirErrors.NON_VARARG_SPREAD.createOn(rootCause.argument.source?.getChild(KtTokens.MUL, depth = 1)!!)
            is ArgumentPassedTwice -> FirErrors.ARGUMENT_PASSED_TWICE.createOn(rootCause.argument.source)<|endoftext|>


Prompt:
expressionType: KotlinType,
            dataFlowExtras: DataFlowExtras
        ): RuntimeAssertionInfo? {
            fun assertNotNull(): Boolean {
                if (expectedType.isError || expressionType.isError) return false

                // T : Any, T! = T..T?
                // Let T$ will be copy of T! with enhanced nullability.

Response:
// Cases when nullability assertion needed: T! -> T, T$ -> T

                // Expected type either T?, T! or T$
                if (TypeUtils.isNullableType(expectedType) ||
                    expectedType.hasEnhancedNullability() ||
                    expectedType.isNullableUnderlyingType()
                ) {
                    return false
                }<|endoftext|>


Prompt:
* This function tries to find the solution (set of constraints) that is consistent with some branch of each fork
     * And those constraints are being immediately applied to the system
     */
    override fun resolveForkPointsConstraints() {
        if (constraintsFromAllForkPoints.isEmpty()) return
        val allForkPointsData = constraintsFromAllForkPoints.toList()

Response:
constraintsFromAllForkPoints.clear()

        // There may be multiple fork points:
        // - One from subtyping A<Int> & A<T> <: A<Xv>
        // - Another one from B<String> & B<F> <: B<Yv>
        // Each of them defines two sets of constraints, e.g. for the first for point:<|endoftext|>


Prompt:
// FIR_IDENTICAL
// ISSUE: KT-38667

interface PropKey<T1>
abstract class AnimationBuilder<T2>
class TransitionSpec<S> {
    fun <E> tween(init: AnimationBuilder<E>.() -> Unit): AnimationBuilder<E> = TODO()
    fun <F> PropKey<F>.using(builder: AnimationBuilder<F>) {}
}

Response:
class TransitionDefinition<X> {
    fun transition(fromState: X, init: TransitionSpec<X>.() -> Unit) {}
}

fun <T3> transitionDefinition(init: TransitionDefinition<T3>.() -> Unit) {}

fun main(intProp: PropKey<Int>, w: Int) {
    transitionDefinition {
        transition(w) {
            intProp.using(tween {})<|endoftext|>


Prompt:
val dependents = allCinteropCommonizerDependents()

    val allScopeSets = dependents.map { it.scopes }.toSet()
    val rootScopeSets = allScopeSets.filter { scopeSet ->
        allScopeSets.none { otherScopeSet -> otherScopeSet != scopeSet && otherScopeSet.containsAll(scopeSet) }
    }

Response:
return rootScopeSets.map { scopeSet ->
        val dependentsForScopes = dependents.filter { dependent ->
            scopeSet.containsAll(dependent.scopes)
        }

        CInteropCommonizerGroup(
            targets = dependentsForScopes.map { it.target }.toSet(),<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinTargetWithBinaries
import org.jetbrains.kotlin.gradle.plugin.mpp.isMain

Response:
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode
import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode.DEVELOPMENT<|endoftext|>


Prompt:
package org.jetbrains.kotlin.commonizer.hierarchical

import org.jetbrains.kotlin.commonizer.AbstractInlineSourcesCommonizationTest
import org.jetbrains.kotlin.commonizer.parseCommonizerTarget
import org.jetbrains.kotlin.commonizer.utils.InlineSourceBuilder

Response:
import org.jetbrains.kotlin.commonizer.withAllLeaves

internal fun AbstractInlineSourcesCommonizationTest.ParametersBuilder.registerFakeStdlibIntegersDependency(vararg outputTarget: String) {
    val allTargets = outputTarget.map { parseCommonizerTarget(it) }.withAllLeaves()
    registerDependency(*allTargets.toTypedArray()) {<|endoftext|>


Prompt:
val newDeclaration = super.lowerDictionaryDeclaration(declaration, owner)
        return newDeclaration.copy(
                parents = declaration.parents.mapNotNull { resolveInheritance(it) }
        )
    }

    override fun lowerFileDeclaration(fileDeclaration: IDLFileDeclaration): IDLFileDeclaration {
        currentFile = fileDeclaration

Response:
var newFileDeclaration = super.lowerFileDeclaration(fileDeclaration)
        newFileDeclaration = newFileDeclaration.copy(
                declarations = newFileDeclaration.declarations + anonymousDeclarationsToAdd
        )
        anonymousDeclarationsToAdd.clear()
        return newFileDeclaration
    }<|endoftext|>


Prompt:
todo() <!UNREACHABLE_CODE, USELESS_ELVIS!>?: ""<!>
}

fun testElvis2(s: String?) {
    s ?: todo()

    bar()
}

fun testAnd1(b: Boolean) {
    b && todo()

    bar()
}

Response:
fun testAnd2(<!UNUSED_PARAMETER!>b<!>: Boolean) {
    todo() <!UNREACHABLE_CODE!>&& b<!>
}

fun returnInBinary1(): Boolean {
    (return true) <!UNREACHABLE_CODE!>&& (return false)<!>
}

fun returnInBinary2(): Boolean {<|endoftext|>


Prompt:
basedir.visitFileTree(visitor, followLinks = true)
        assertTrue(didFollowLinks)
    }

    @Test
    fun copyRecursively() {
        val srcRoot = createTestFiles().cleanupRecursively()
        val dstRoot = createTempDirectory().cleanupRecursively()

        srcRoot.resolve("1/2/.dir").createDirectory()

Response:
srcRoot.resolve("1/3/.file").createFile()

        srcRoot.visitFileTree {
            onPreVisitDirectory { directory, _ ->
                if (directory.name.startsWith(".")) {
                    FileVisitResult.SKIP_SUBTREE
                } else {
                    if (directory != srcRoot) {<|endoftext|>


Prompt:
?: (System.getProperty("user.home") + File.separator + ".konan")
        )
    }

    fun getDependenciesRoot(konanDataDir: String? = null): File {
        return getLocalKonanDir(konanDataDir).resolve(DEPENDENCIES_FOLDER_NAME)
    }

Response:
fun getDependencyCacheDir(konanDataDir: String? = null): File {
        return getLocalKonanDir(konanDataDir).resolve(CACHE_FOLDER_NAME)
    }
}<|endoftext|>


Prompt:
if (checkedTypes.contains(typeWithIsNegation)) {
                            trace.report(Errors.DUPLICATE_LABEL_IN_WHEN.on(typeReference))
                        } else {
                            checkedTypes.add(typeWithIsNegation)
                        }
                    }
                    else -> {
                    }
                }
            }
        }
    }

Response:
private fun CompileTimeConstant<*>.isTrivial(
        expression: KtExpression,
        languageVersionSettings: LanguageVersionSettings
    ): Boolean {
        if (usesVariableAsConstant) return false
        if (!languageVersionSettings.supportsFeature(LanguageFeature.ProhibitSimplificationOfNonTrivialConstBooleanExpressions)) {<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1294
/*
 * Copy of JVM-backend test
 * Found at: compiler/testData/codegen/boxInline/simple/simpleDouble.1.kt
 */

package foo

class InlineDouble(val res : Double) {

    inline fun foo(s : () -> Double) : Double {
        val f = "fooStart"

Response:
val z = s()
        return z
    }

    inline fun foo11(s : (l: Double) -> Double) : Double {
        return s(11.0)
    }

    inline fun fooRes(s : (l: Double) -> Double) : Double {
        val z = s(res)
        return z
    }<|endoftext|>


Prompt:
assertTrue(set3.isEmpty(), "Array doesn't have contains, equality contains is used instead")
    }

    @Test fun flatMap() {
        val data = listOf("", "foo", "bar", "x", "")
        val characters = data.flatMap { it.toList() }
        println("Got list of characters ${characters}")
        assertEquals(7, characters.size)

Response:
val text = characters.joinToString("")
        assertEquals("foobarx", text)
    }

    @Test fun filterIntoLinkedList() {
        val data = listOf("foo", "bar")
        val foo = data.filterTo(LinkedList<String>()) { it.startsWith("f") }

        assertTrue {<|endoftext|>


Prompt:
"must": [ ${it(featureValue)} ]
                    }
                }, """
        } }
                ${filteredBuilds.str { builds ->
            """
                "aggs" : {
                    "builds": {
                        "filters" : {
                            "filters": {

Response:
${builds.map { "\"${it.second}\": { \"match\" : { \"buildNumber\" : \"${it.second}\" }}" }
                    .joinToString(",\n")}
                            }
                        },"""
        } }
                    "aggs" : {
                        "metric_build" : {
                            "nested" : {
                                "path" : "benchmarks"
                            },<|endoftext|>


Prompt:
args.classpathAsList, changedFiles, lastBuildInfo, modulesApiHistory, reporter, abiSnapshots, withAbiSnapshot,
                    caches.platformCache, scopes
                )
            }
            is NotAvailableForJSCompiler -> error("Unexpected type for this code path: ${classpathChanges.javaClass.name}.")
        }

        when (changedAndImpactedSymbols) {

Response:
is ChangesEither.Unknown -> {
                reporter.info { "Could not get classpath changes: ${changedAndImpactedSymbols.reason}" }
                return CompilationMode.Rebuild(changedAndImpactedSymbols.reason)
            }
            is ChangesEither.Known -> {
                dirtyFiles.addByDirtySymbols(changedAndImpactedSymbols.lookupSymbols)<|endoftext|>


Prompt:
enum class JvmTarget(val target: String) {
    JVM_1_8("1.8"),
    JVM_9("9"),
    JVM_10("10"),
    JVM_11("11"),
    JVM_12("12"),
    JVM_13("13"),
    JVM_14("14"),
    JVM_15("15"),
    JVM_16("16"),

Response:
JVM_17("17"),
    JVM_18("18"),
    JVM_19("19"),
    JVM_20("20"),
    JVM_21("21"),
    JVM_22("22"),
    ;

    companion object {
        @JvmStatic
        fun fromTarget(target: String): JvmTarget =<|endoftext|>


Prompt:
import org.jetbrains.kotlin.load.java.lazy.LazyJavaResolverContext
import org.jetbrains.kotlin.lombok.config.AccessLevel
import org.jetbrains.kotlin.lombok.config.LombokAnnotations.With
import org.jetbrains.kotlin.lombok.config.toDescriptorVisibility

Response:
import org.jetbrains.kotlin.lombok.utils.*
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.typeUtil.isBoolean

class WithProcessor : Processor {
    override fun contribute(classDescriptor: ClassDescriptor, partsBuilder: SyntheticPartsBuilder, c: LazyJavaResolverContext) {<|endoftext|>


Prompt:
is DebugInfoDiagnosticFactory1 -> DiagnosticWithParameters1Renderer(
                "{0}",
                Renderers.TO_STRING
            ) as DiagnosticRenderer<Diagnostic>
            else -> DefaultErrorMessages.getRendererForDiagnostic(codeMetaInfo.diagnostic)
        }
        if (renderer is AbstractDiagnosticWithParametersRenderer) {

Response:
renderer.renderParameters(codeMetaInfo.diagnostic).mapTo(params) {
                it.toString().replace("\"", "\\\"")
            }
        }
        if (renderSeverity)
            params.add("severity='${codeMetaInfo.diagnostic.severity}'")

        params.add(getAdditionalParams(codeMetaInfo))<|endoftext|>


Prompt:
val dir = createTestFiles().cleanupRecursively()
        val link = createTempDirectory().cleanupRecursively().resolve("link").tryCreateSymbolicLinkTo(dir) ?: return

        link.deleteRecursively()
        assertFalse(link.exists(LinkOption.NOFOLLOW_LINKS))

Response:
testVisitedFiles(listOf("") + referenceFilenames, dir.walkIncludeDirectories(), dir)
    }

    @Test
    fun deleteSymlinkToFile() {
        val file = createTempFile().cleanup()
        val dir = createTestFiles().cleanupRecursively().also { it.resolve("8/link").tryCreateSymbolicLinkTo(file) ?: return }<|endoftext|>


Prompt:
assertFailsWith<IllegalArgumentException> {
            "[a-z](? !\\d)".toRegex(RegexOption.COMMENTS) // (?!X) - ?! shouldn't be separated
        }
    }

    @Test fun matchNamedGroupInCommentsMode() {
        assertFailsWith<IllegalArgumentException> {

Response:
"(? <first>\\d+)".toRegex(RegexOption.COMMENTS) // (?<name>X) - ?< shouldn't be separated
        }
        "( ?< first  > \\d + ) - (?< se c  ond >\\d+)".toRegex(RegexOption.COMMENTS).let { regex ->
            val match = regex.find("123-456")!!<|endoftext|>


Prompt:
package org.jetbrains.kotlin.generators.impl

import org.jetbrains.kotlin.generators.MethodGenerator
import org.jetbrains.kotlin.generators.model.MethodModel
import org.jetbrains.kotlin.generators.model.RunTestMethodModel
import org.jetbrains.kotlin.generators.model.SimpleTestMethodModel

Response:
import org.jetbrains.kotlin.test.util.KtTestUtil
import org.jetbrains.kotlin.utils.Printer

object SimpleTestMethodGenerator : MethodGenerator<SimpleTestMethodModel>() {
    override val kind: MethodModel.Kind
        get() = SimpleTestMethodModel.Kind<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>b<!>.funNullableT()
            <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>b<!>.funNullableAny()
        }
    }
}

// TESTCASE NUMBER: 2

Response:
class Case2_1 : Interface3, InterfaceWithTypeParameter1<Case2_1>
class Case2_2 : Interface3, InterfaceWithTypeParameter1<Case2_2>

fun case_2() {
    val x = select(Case2_1(), Case2_2(), null)

    if (x != null) {<|endoftext|>


Prompt:
class MyClass() {
    @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
    @kotlin.internal.InlineOnly
    inline fun test(s: String = "") {
    }
}

// TESTED_OBJECT_KIND: function
// TESTED_OBJECTS: MyClass, test$default

Response: // FLAGS: ACC_STATIC, ACC_SYNTHETIC<|endoftext|>


Prompt:
instructionElement, valueElement, currentScope, inputValues, kind, valueFactory
            )
            add(instruction)
            return instruction
        }

        override fun merge(expression: KtExpression, inputValues: List<PseudoValue>): MergeInstruction {
            val instruction = MergeInstruction(expression, currentScope, inputValues, valueFactory)
            add(instruction)
            return instruction
        }

Response:
override fun readVariable(
            expression: KtExpression,
            resolvedCall: ResolvedCall<*>,
            receiverValues: Map<PseudoValue, ReceiverValue>
        ) = read(expression, resolvedCall, receiverValues)

        override fun call(
            valueElement: KtElement,
            resolvedCall: ResolvedCall<*>,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.js.test.handlers.JsIrRecompiledArtifactsIdentityHandler
import org.jetbrains.kotlin.js.test.handlers.JsWrongModuleHandler
import org.jetbrains.kotlin.js.test.handlers.createFirJsLineNumberHandler

Response:
import org.jetbrains.kotlin.js.test.handlers.createIrJsLineNumberHandler
import org.jetbrains.kotlin.js.test.ir.AbstractJsIrES6Test
import org.jetbrains.kotlin.js.test.ir.AbstractJsIrTest
import org.jetbrains.kotlin.js.test.utils.configureJsTypeScriptExportTest<|endoftext|>


Prompt:
return context.symbolTable.descriptorExtension.declareProperty(startOffset, endOffset, IrDeclarationOrigin.FAKE_OVERRIDE, propertyDescriptor, propertyDescriptor.isDelegated).apply {
            this.getter = propertyDescriptor.getter?.let {
                FunctionGenerator(declarationGenerator).generateFakeOverrideFunction(it, ktElement)
            }

Response:
this.setter = propertyDescriptor.setter?.let {
                FunctionGenerator(declarationGenerator).generateFakeOverrideFunction(it, ktElement)
            }
            this.linkCorrespondingPropertySymbol()
            this.generateOverrides(propertyDescriptor)
        }
    }<|endoftext|>


Prompt:
// SKIP_TXT
// ISSUE: KT-56138

fun takeLambda1(f: String.() -> String) {}
fun takeLambda2(f: String.(String) -> String) {}

fun test_1() {

Response:
val x1: String.(String) -> String = { <!EXPECTED_PARAMETERS_NUMBER_MISMATCH!>str, <!CANNOT_INFER_PARAMETER_TYPE!>str2<!><!> -> "this" }
    val x2: String.() -> String = { <!UNRESOLVED_REFERENCE!>it<!> }<|endoftext|>


Prompt:
path.mapTo(filtersMap.getValue(binaryModuleData.regular)) { Paths.get(it) }
        }

        @JvmName("dependenciesString")
        fun dependencies(paths: Collection<String>) {
            paths.mapTo(filtersMap.getValue(binaryModuleData.regular)) { Paths.get(it) }
        }

Response:
@JvmName("dependenciesString")
        fun dependencies(moduleData: FirModuleData, paths: Collection<String>) {
            paths.mapTo(
                filtersMap.getOrPut(moduleData) {
                    allRegularDependencies.add(moduleData)
                    mutableSetOf()
                }
            ) {
                Paths.get(it)
            }
        }<|endoftext|>


Prompt:
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
}

fun poll35(flag: Boolean) {
    val inv = when (flag) { true -> ::Foo6 false -> ::Foo6 }
    inv
}

fun poll36(flag: Boolean) {

Response:
val inv = when (flag) { true -> <!IMPLICIT_CAST_TO_ANY, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> false -> <!IMPLICIT_CAST_TO_ANY!>foo7()<!> }
    inv
}

fun poll4() {<|endoftext|>


Prompt:
class DataFrameLikeReturnTypeInjector(session: FirSession) : FirExpressionResolutionExtension(session) {
    companion object {
        val DF_CLASS_ID: ClassId = ClassId.topLevel(FqName.fromSegments(listOf("DataFrame")))
    }

    @OptIn(SymbolInternals::class)

Response:
override fun addNewImplicitReceivers(functionCall: FirFunctionCall): List<ConeKotlinType> {
        val callReturnType = functionCall.resolvedType
        if (callReturnType.classId != DF_CLASS_ID) return emptyList()
        val rootMarker = callReturnType.typeArguments[0]
        if (rootMarker !is ConeClassLikeType) {<|endoftext|>


Prompt:
// We've already had errors in source mode, so it's relevant only for binaries for now
// INCLUDE_JAVA_AS_BINARY

import org.jetbrains.annotations.*;

public class ValueParameterWithWarnings<T> {
    public interface A<T1, T2> {}

    public void foo1(A<@Nullable String, @Nullable T> x) { }

Response:
public void foo2(A<@Nullable String, @NotNull T> x) { }
    public void foo3(A<@NotNull String, @NotNull T> x) { }
    public void foo4(@NotNull T [] x) { }
    public void foo41(@Nullable String x) { }
    public void foo411(T x) { }<|endoftext|>


Prompt:
}

        private var generateDeclaredClassFilter: GenerateClassFilter = GenerateClassFilter.GENERATE_ALL
        fun generateDeclaredClassFilter(v: GenerateClassFilter) =
            apply { generateDeclaredClassFilter = v }

        private var targetId: TargetId? = null
        fun targetId(v: TargetId?) =
            apply { targetId = v }

Response:
private var moduleName: String? = configuration[CommonConfigurationKeys.MODULE_NAME]
        fun moduleName(v: String?) =
            apply { moduleName = v }

        // 'outDirectory' is a hack to correctly determine if a compiled class is from the same module as the callee during
        // partial compilation. Module chunks are treated as a single module.
        // TODO: get rid of it with the proper module infrastructure<|endoftext|>


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

Response:
assertFalse(eqBooleanBooleanQ(true, null))
    assertFalse(eqBooleanBooleanQ(true, undefined))
    assertTrue(eqBooleanQBoolean(false, false))
    assertFalse(eqBooleanQBoolean(false, true))
    assertFalse(eqBooleanQBoolean(true, false))
    assertTrue(eqBooleanQBoolean(true, true))<|endoftext|>


Prompt:
abstract class KtSimpleNameReference(expression: KtSimpleNameExpression) : KtSimpleReference<KtSimpleNameExpression>(expression) {
    // Extension point used by deprecated android extensions.
    abstract fun isReferenceToViaExtension(element: PsiElement): Boolean

    override fun isReferenceTo(candidateTarget: PsiElement): Boolean {
        if (!canBeReferenceTo(candidateTarget)) return false

Response:
if (isReferenceToViaExtension(candidateTarget)) return true
        return super.isReferenceTo(candidateTarget)
    }

    override fun getRangeInElement(): TextRange {
        val element = element.getReferencedNameElement()
        val startOffset = getElement().startOffset
        return element.textRange.shiftRight(-startOffset)
    }<|endoftext|>


Prompt:
testDependencyTransformations("p2") { reports ->
                val report = reports.singleOrNull {
                    it.sourceSetName == "iosArm64Test" &&
                            it.scope == "implementation" &&
                            it.groupAndModule.endsWith(":p1")
                }
                assertNotNull(report, "No single report for 'iosArm64' and implementation scope")

Response:
assertEquals(setOf("commonMain", "iosMain"), report.allVisibleSourceSets)
                assertTrue(report.groupAndModule.endsWith(":p1"))
            }
        }
    }

    @GradleTest
    @DisplayName("KT-52216: [TYPE_MISMATCH] Caused by unexpected metadata dependencies of leaf source sets")<|endoftext|>


Prompt:
v.invokespecial("java/lang/StringBuilder", "<init>", "(Ljava/lang/String;)V", false)
                } else {
                    generator.invokeAppend(JAVA_STRING_TYPE)
                }
            }

            override fun invokeIntrinsic(v: InstructionAdapter) {

Response:
// String::plus has type String.(Any?) -> String, thus we have no argument type information
                // in case of callable reference passed to a generic function, e.g.:
                //      charArrayOf('O', 'K').fold("", String::plus)
                // TODO Make String::plus generic, and invoke proper StringBuilder#append.
                generator.invokeAppend(AsmTypes.OBJECT_TYPE)<|endoftext|>


Prompt:
import org.jetbrains.kotlinx.atomicfu.AbstractAtomicfuJvmIrTest

private class ExcludePattern {
    companion object {
        private const val MEMBER_ALIAS = "(^removeMemberTypeAlias)|(^addMemberTypeAlias)"

        private const val ALL_EXPECT = "(^.*Expect.*)"

        internal val forK2 = listOf(

Response:
ALL_EXPECT, // KT-63125 - Partially related to single-module expect-actual tests, but regexp is really wide
            MEMBER_ALIAS, // KT-55195 - Invalid for K2
        ).joinToString("|")
    }
}

fun main(args: Array<String>) {
    System.setProperty("java.awt.headless", "true")<|endoftext|>


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

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


Prompt:
private data class ComputedMangledName(
    val computedBy: ComputedBy,
    val compatibleMode: Boolean,
    val value: String,
)

/**
 * For each pair in the list, pads its first element with a number of spaces and concatenates it with the second element in such a way
 * that the second elements of each pair are vertically aligned in concatenated strings.
 *

Response:
* In other words, transforms this list:
 *
 * ```kotlin
 * listOf(
 *   Pair("Capacity: ", "normal"),
 *   Pair("Usability: ", "very good"),
 *   Pair("Magic: ", "minimal"),
 * )
 * ```
 *
 * to this:
 *
 * ```kotlin
 * listOf(<|endoftext|>


Prompt:
interface InterfaceWithTypeParameter2<T> {
    fun ip1test2(): T? = null as T?
}

interface InterfaceWithTypeParameter3<T> {
    fun ip1test3(): T? = null as T?
}

interface InterfaceWithFiveTypeParameters1<T1, T2, T3, T4, T5> {
    fun itest() {}
    fun itest1() {}
}

Response:
interface InterfaceWithFiveTypeParameters2<T1, T2, T3, T4, T5> {
    fun itest() {}
    fun itest2() {}
}

interface InterfaceWithFiveTypeParameters3<T1, T2, T3, T4, T5> {
    fun itest() {}
    fun itest3() {}
}

interface InterfaceWithTwoTypeParameters<T, K> {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.js.translate.intrinsic.functions.basic.FunctionIntrinsic
import org.jetbrains.kotlin.js.translate.utils.JsAstUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.types.TypeUtils

Response:
object StringPlusCharFIF : FunctionIntrinsicFactory {
    private class StringPlusAnyIntrinsic(private val leftTypeNullable: Boolean) : FunctionIntrinsic() {
        override fun apply(callInfo: CallInfo, arguments: List<JsExpression>, context: TranslationContext): JsExpression {
            val receiver = callInfo.dispatchReceiver ?: callInfo.extensionReceiver!!<|endoftext|>


Prompt:
b.set(0, 71, true)
        assertNotContainsOnly(b, setOf(), 71)
        b.set(0, 3, false)
        assertNotContainsOnly(b, setOf(0, 1, 2), 71)
        b.set(63, 66, false)
        assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65), 71)

Response:
b.set(68, 71, false)
        assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65, 68, 69, 70), 71)
        b.set(68, 73, false)
        assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65, 68, 69, 70, 71, 72), 73)<|endoftext|>


Prompt:
checkExactType<Buildee<TargetType>>(buildee)
}

class TargetType
class DifferentType

fun consume(value: Any) {}
fun consume(value: DifferentType) {}

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

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


Prompt:
import org.jetbrains.kotlin.ir.interpreter.proxy.reflection.*
import org.jetbrains.kotlin.ir.types.classOrNull
import kotlin.reflect.KCallable
import kotlin.reflect.KFunction
import kotlin.reflect.KType
import kotlin.reflect.KTypeParameter

Response:
internal class KClassState(val classReference: IrClass, override val irClass: IrClass) : ReflectionState() {
    private var _members: Collection<KCallable<*>>? = null
    private var _constructors: Collection<KFunction<*>>? = null
    private var _typeParameters: List<KTypeParameter>? = null
    private var _supertypes: List<KType>? = null<|endoftext|>


Prompt:
class Nested {
            fun fromNested() {
                bar() // Ok
                gav() // Ok
            }
        }
    }
}

class Derived : Base() {
    fun test() {
        foo() // Ok
        gav() // Ok

Response:
<!SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC!>bar<!>()
        <!SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC!>baz<!>()<|endoftext|>


Prompt:
/*
 * KOTLIN PSI SPEC TEST (POSITIVE)
 *
 * SPEC VERSION: 0.1-100
 * MAIN LINK: expressions, constant-literals, real-literals -> paragraph 1 -> sentence 1
 * NUMBER: 1
 * DESCRIPTION: Simple real literals with a different whole-number part and fraction part.
 */

val value = 0.0
val value = 0.00

Response:
val value = 0.000
val value = 0.0000

val value = 00.0
val value = 000.00
val value = 0000.000

val value = 1.0
val value = 22.00
val value = 333.000
val value = 4444.0000
val value = 55555.0
val value = 666666.00
val value = 7777777.000<|endoftext|>


Prompt:
fun testAllModulePathAndNamedModule() {
        try {
            module("main", addModules = listOf("ALL-MODULE-PATH"))
        } catch (e: JavaCompilationError) {
            // Java compilation should fail, it's expected
        }
    }

    fun testJdkModulesFromNamed() {
        module("main")
    }

Response:
fun testJdkModulesFromUnnamed() {
        module("main")
    }

    fun testUnnamedDoesNotReadNotAdded() {
        // Test that although we have moduleA in the module path, it's not in the module graph
        // because we did not provide -Xadd-modules=moduleA
        module("moduleB", listOf(module("moduleA")), addModules = emptyList())
    }<|endoftext|>


Prompt:
if (yielding)
            list.add(item)
        else if (!predicate(item)) {
            list.add(item)
            yielding = true
        }
    return list
}

/**
 * Returns a list containing all elements except first elements that satisfy the given [predicate].
 *
 * @sample samples.collections.Collections.Transformations.drop
 */

Response:
public inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List<Byte> {
    var yielding = false
    val list = ArrayList<Byte>()
    for (item in this)
        if (yielding)
            list.add(item)
        else if (!predicate(item)) {
            list.add(item)
            yielding = true
        }
    return list
}<|endoftext|>


Prompt:
fun interface Base {
    fun doStuff(): String
}

fun interface I : Base

fun interface Proxy : I {

    override fun doStuff(): String = doStuffInt().toString()

    fun doStuffInt(): Int
}

fun runBase(b: Base) = b.doStuff()

fun runI(i: I) = i.doStuff()

Response:
fun runProxy(p: Proxy) = p.doStuff()

fun box(): String {

    if (runI { "i" } != "i") return "fail1"

    if (runProxy { 10 } != "10") return "fail2"

    return runBase { "OK" }
}<|endoftext|>


Prompt:
assertTrue(
            "Compile only dependencies count should be less than compile + runtime\n" +
                    "${compileOnlyFiles.joinToString(prefix = "Compile dependencies:\n\t", separator = "\n\t")}\n" +
                    compileRuntimeFiles.joinToString(prefix = "Compile + Runtime dependencies:\n\t", separator = "\n\t"),

Response:
compileOnlyFiles.count() < compileRuntimeFiles.count()
        )
    }

    fun testTransitiveOption() {
        val dependency = "junit:junit:4.11"

        var transitiveFiles: Iterable<File>

        resolveAndCheck(dependency, options = parseOptions("transitive=true")) { files ->
            transitiveFiles = files
            true
        }<|endoftext|>


Prompt:
isConst = clang_isConstQualifiedType(clang_getCursorType(cursor)) != 0,
                                parentName = receiverType.decl.spelling)
                        )
                    }

                    else -> {
                    }
                }
            }
            CXChildVisitResult.CXChildVisit_Continue
        }
        return CxxMembers(methods, staticFields)
    }

Response:
private fun createStructDef(cursor: CValue<CXCursor>, structType: CValue<CXType>, structDecl: StructDecl? = null): StructDefImpl {
        assert(clang_isCursorDefinition(cursor) != 0)
        val type = clang_getCursorType(cursor)
        val size = clang_Type_getSizeOf(type)<|endoftext|>


Prompt:
val reassignedNames = context.preliminaryLoopVisitor.enterCapturingStatement(statement)
        if (reassignedNames.isEmpty()) return
        // TODO: only choose the innermost variable for each name, KT-59688
        val possiblyChangedVariables = variableStorage.realVariables.values.filter {
            val identifier = it.identifier
            val symbol = identifier.symbol

Response:
// Non-local vars can never produce stable smart casts anyway.
            identifier.dispatchReceiver == null && identifier.extensionReceiver == null &&
                    symbol is FirPropertySymbol && symbol.isVar && symbol.name in reassignedNames
        }
        for (variable in possiblyChangedVariables) {
            logicSystem.recordNewAssignment(flow, variable, context.newAssignmentIndex())
        }<|endoftext|>


Prompt: // test.kt:14 box: $completion:kotlin.coroutines.Continuation=Generated_Box_MainKt$main$1, $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$baz\1\22:int=0:int,

Response: $i$f$bar\2\74:int=0:int<|endoftext|>


Prompt:
@JvmStatic fun preserveEvaluationOrder(statement: JsStatement, canBeExtractedByInliner: (JsNode) -> Boolean): List<JsStatement> {
            val decomposer = with (statement) {
                val extractable = match(canBeExtractedByInliner)
                val containsExtractable = withParentsOfNodes(extractable)
                val nodesWithSideEffect = match {

Response:
!(it is JsLiteral.JsValueLiteral || (it is JsExpression && it.sideEffects == SideEffectKind.PURE))
                }
                val containsNodeWithSideEffect = withParentsOfNodes(nodesWithSideEffect)

                ExpressionDecomposer(containsExtractable, containsNodeWithSideEffect)
            }

            decomposer.accept(statement)<|endoftext|>


Prompt:
println(value_1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>dec<!>())
        println(value_2?.toByte())
        println(o.prop_1<!UNSAFE_CALL!>.<!>plus(3))
    }
}

// TESTCASE NUMBER: 6

Response:
fun case_6(value_1: Any?, value_2: Any) {
    if (funWithReturnsTrue(value_1 !is String || value_2 !is Number)) {
        <!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)<|endoftext|>


Prompt:
package org.jetbrains.kotlin.jps.build

import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder

Response:
abstract class AbstractIncrementalK2FirICLightTreeJvmJpsTest(
    allowNoFilesWithSuffixInTestData: Boolean = false
) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) {
    override fun updateCommandLineArguments(arguments: CommonCompilerArguments) {<|endoftext|>


Prompt:
assertFalse(eqByteQByte(1.toByte(), 0.toByte()))
    assertTrue(eqByteQByte(1.toByte(), 1.toByte()))
    assertFalse(eqByteQByte(null, 0.toByte()))
    assertFalse(eqByteQByte(null, 1.toByte()))
    assertFalse(eqByteQByte(undefined, 0.toByte()))

Response:
assertFalse(eqByteQByte(undefined, 1.toByte()))
    assertTrue(eqByteQByteQ(0.toByte(), 0.toByte()))
    assertFalse(eqByteQByteQ(0.toByte(), 1.toByte()))
    assertFalse(eqByteQByteQ(0.toByte(), null))
    assertFalse(eqByteQByteQ(0.toByte(), undefined))<|endoftext|>


Prompt:
if (s != 12345) throw AssertionError("$s")
}

fun testEmptyULongLoop2() {
    var s = 0
    for (i in M+6UL until M+1UL) {
        s = s*10 + (i-M).toInt()
    }
    if (s != 0) throw AssertionError("$s")
}

Response:
fun testMaxUItoMinUI() {
    val xs = ArrayList<UInt>()
    for (i in MaxUI until MinUI) {
        xs.add(i)
        if (xs.size > 23) break
    }
    if (xs.size > 0) {
        throw AssertionError("Wrong elements for MaxUI..MinUI: $xs")
    }
}<|endoftext|>


Prompt:
val dependencyProjectKotlinExtension = dependencyProject.multiplatformExtensionOrNull
                        ?: return@associate noMapping

                    // Non-default publication layouts are not supported for pom rewriting
                    if (!dependencyProject.kotlinPropertiesProvider.createDefaultMultiplatformPublications)
                        return@associate noMapping

Response:
val resolved = resolvedDependencies[Triple(dependency.group!!, dependency.name, dependency.version!!)]
                        ?: return@associate noMapping

                    val resolvedToConfiguration = resolved.configuration
                    val dependencyTargetComponent: KotlinTargetComponent = run {
                        dependencyProjectKotlinExtension.targets.forEach { target -><|endoftext|>


Prompt:
* the call receiver is the old <this> receiver of the extension.
                 *
                 * The call is replaced with atomic intrinsic call and the new receiver is
                 * the invoked getter of the property reference that is the first parameter of the parent function:
                 *

Response:
* fun AtomicInt.foo(new: Int) {          fun foo$atomicfu(crossinline refGetter: () -> KMutableProperty0<Int>, new: Int) {
                 *   this.compareAndSet(value, new)  --->   refGetter().compareAndSetField(refGetter().get(), new)
                 * }                                      }
                 */<|endoftext|>


Prompt:
private fun Project.reportTestDiagnostic(severity: Severity = WARNING) {
    kotlinToolingDiagnosticsCollector.report(
        project,
        ToolingDiagnostic("TEST_DIAGNOSTIC", "This is a test diagnostic\n\nIt has multiple lines of text", severity)
    )
}

Response:
private fun Project.reportOnePerProjectTestDiagnostic(severity: Severity = WARNING) {
    kotlinToolingDiagnosticsCollector.reportOncePerGradleProject(
        project,
        ToolingDiagnostic(
            "TEST_DIAGNOSTIC_ONE_PER_PROJECT",<|endoftext|>


Prompt:
* Implements `kotlin.test` assertions by delegating them to `org.junit.jupiter.api.Assertions` class.
 */
public object JUnit5Asserter : Asserter {
    override fun assertEquals(message: String?, expected: Any?, actual: Any?) {
        Assertions.assertEquals(expected, actual, message)
    }

Response:
override fun assertNotEquals(message: String?, illegal: Any?, actual: Any?) {
        Assertions.assertNotEquals(illegal, actual, message)
    }

    override fun assertSame(message: String?, expected: Any?, actual: Any?) {
        Assertions.assertSame(expected, actual, message)
    }<|endoftext|>


Prompt:
/**
         * The minimum value of a supplementary code point, `\u0x10000`.
         *
         * Note that this constant is experimental.
         * In the future it could be deprecated in favour of another constant of a `CodePoint` type.
         */
        @ExperimentalNativeApi
        public const val MIN_SUPPLEMENTARY_CODE_POINT: Int = 0x10000

        /**

Response:
* The minimum value of a Unicode code point.
         *
         * Note that this constant is experimental.
         * In the future it could be deprecated in favour of another constant of a `CodePoint` type.
         */
        @ExperimentalNativeApi
        public const val MIN_CODE_POINT: Int = 0x000000

        /**
         * The maximum value of a Unicode code point.
         *<|endoftext|>


Prompt:
elements.copyInto(result, thisSize)
    return result
}

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */
public actual operator fun CharArray.plus(elements: CharArray): CharArray {
    val thisSize = size
    val arraySize = elements.size

Response:
val result = copyOfUninitializedElements(thisSize + arraySize)
    elements.copyInto(result, thisSize)
    return result
}

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */
@kotlin.internal.InlineOnly
public actual inline fun <T> Array<T>.plusElement(element: T): Array<T> {<|endoftext|>


Prompt:
name.asString() == INVOKE_SUSPEND_METHOD_NAME && parentAsClass.origin == JvmLoweredDeclarationOrigin.CONTINUATION_CLASS

private fun IrFunction.isInvokeOfSuspendCallableReference(): Boolean =
    isSuspend && name.asString().let { name -> name == "invoke" || name.startsWith("invoke-") }

Response:
&& parentAsClass.origin == JvmLoweredDeclarationOrigin.FUNCTION_REFERENCE_IMPL
            // References to inline functions don't count since they're not really *references* - the contents
            // of the inline function are copy-pasted into the `invoke` method, and may require a continuation.
            // (TODO: maybe the reference itself should be the continuation, just like lambdas?)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.builders.declarations.*
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.symbols.*

Response:
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.name.*
import org.jetbrains.kotlinx.atomicfu.compiler.backend.common.AbstractAtomicSymbols

class JvmAtomicSymbols(
    context: IrPluginContext,<|endoftext|>


Prompt:
private fun computeAllExcludedDirectories(project: Project, excludedProjects: List<Project>): List<File> {
        val javaExcludedDirectories = project.plugins.findPlugin(IdeaPlugin::class.java)
            ?.model?.module?.excludeDirs?.toList().orEmpty()

Response:
val excludedProjectDirectories = if (project == project.rootProject) excludedProjects.map { it.buildDir } else emptyList()

        return globalExcludedDirectories + javaExcludedDirectories + project.buildDir + excludedProjectDirectories
    }

    private fun parseSourceSets(project: Project): List<PSourceSet> {
        if (!project.plugins.hasPlugin(JavaPlugin::class.java)) {<|endoftext|>


Prompt:
&& DescriptorUtils.isStaticNestedClass(candidateDescriptor.containingDeclaration)
            ) {
                nestedClass = candidateDescriptor.containingDeclaration
            } else if (candidateDescriptor is FakeCallableDescriptorForObject) {
                nestedClass = candidateDescriptor.getReferencedObject()
            }
            if (nestedClass != null) {

Response:
tracing.nestedClassAccessViaInstanceReference(trace, nestedClass, candidateCall.explicitReceiverKind)
                return@checkAndReport OTHER_ERROR
            }
        }

        assert((dispatchReceiver != null) == (candidateCall.resultingDescriptor.dispatchReceiverParameter != null)) {
            "Shouldn't happen because of TaskPrioritizer: $candidateDescriptor"
        }<|endoftext|>


Prompt:
if (isEmpty()) -1 else (31 * (31 * (first xor (first shr 32)).toInt() + (last xor (last shr 32)).toInt()) + (step xor (step ushr 32)).toInt())

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

    public companion object {

Response:
/**
         * Creates ULongProgression within the specified bounds of a closed range.

         * 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 `Long.MIN_VALUE` and not equal to zero.
         */<|endoftext|>


Prompt:
private inline fun <reified T : Any> List<KProperty1<T, *>>.filterToBeDeleted() = filter { prop ->
    prop.findAnnotation<GradleDeprecatedOption>()
        ?.let { it.removeAfter >= LanguageVersion.LATEST_STABLE }
        ?: true
}

Response:
private inline fun <reified T : Any> gradleOptions(): List<KProperty1<T, *>> =
    T::class
        .declaredMemberProperties
        .filter {
            it.findAnnotation<GradleOption>() != null
        }
        .filterToBeDeleted()
        .sortedBy { it.name }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.codegen.intrinsics

import org.jetbrains.kotlin.codegen.Callable
import org.jetbrains.kotlin.codegen.CallableMethod
import org.jetbrains.kotlin.codegen.ExpressionCodegen
import org.jetbrains.kotlin.codegen.StackValue

Response:
import org.jetbrains.kotlin.psi.KtPrefixExpression
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall

class Not : IntrinsicMethod() {
    override fun toCallable(method: CallableMethod): Callable =
            object : IntrinsicCallable(method) {
                override fun invokeMethodWithArguments(<|endoftext|>


Prompt:
// FILE: 1.kt
package a

open class A {
    protected val v = "O"
    protected var w = ""
}

// FILE: 2.kt
import a.*

class B : A() {
    fun foo(): String {
        B::w.set(this, "K")
        return ::v.get() + B::w.get(this)
    }
}

Response: fun box() = B().foo()<|endoftext|>


Prompt:
fun String?.orEmpty(): String = "my local extension for $this"
    fun String?.funWithTrailingLambda( x : Any? = null, body : ()-> String = {""} ): String = body()

    fun case1(s: String?) {

Response:
s.<!DEBUG_INFO_CALL("fqName: sentence3.Case1.orEmpty; typeCall: extension function")!>orEmpty()<!>
        //trailing lambda
        s.<!DEBUG_INFO_CALL("fqName: sentence3.Case1.funWithTrailingLambda; typeCall: extension function")!>funWithTrailingLambda { "ss" }<!><|endoftext|>


Prompt:
@Retention(AnnotationRetention.RUNTIME)
annotation class DependsOnTwo(val unused: String = "", val path1: String = "", val path2: String = "")

private class NullOutputStream : OutputStream() {
    override fun write(b: Int) {}
    override fun write(b: ByteArray) {}

Response:
override fun write(b: ByteArray, off: Int, len: Int) {}
}

internal fun URL.toFile() =
    try {
        File(toURI().schemeSpecificPart)
    } catch (e: java.net.URISyntaxException) {
        if (protocol != "file") null
        else File(file)
    }<|endoftext|>


Prompt:
receiver?.let {
        generateContextReceiverForDelegatingConstructorCall(
            ktDefaultElement.startOffsetSkippingComments,
            ktDefaultElement.endOffset,
            receiver
        )
    }

private fun StatementGenerator.generateContextReceiverForDelegatingConstructorCall(
    defaultStartOffset: Int,
    defaultEndOffset: Int,

Response:
receiver: ContextClassReceiver
): IntermediateValue {
    val irReceiverType = receiver.type.toIrType()
    val contextReceivers = receiver.classDescriptor.contextReceivers
    val receiverParameter = contextReceivers.single { it.value == receiver }
    return object : ExpressionValue(irReceiverType) {
        override fun load(): IrExpression = IrGetValueImpl(<|endoftext|>


Prompt:
superTypeRefs.forEach { it.accept(visitor, data) }
        declarations.forEach { it.accept(visitor, data) }
        annotations.forEach { it.accept(visitor, data) }
    }

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

Response:
transformStatus(transformer, data)
        controlFlowGraphReference = controlFlowGraphReference?.transform(transformer, data)
        transformSuperTypeRefs(transformer, data)
        transformDeclarations(transformer, data)
        transformAnnotations(transformer, data)
        return this
    }<|endoftext|>


Prompt:
res = "";
    call = Z("Z").test(a = {res += "K"; "K"}(), c = {res += "L"; "L"}, b = {res+="O"; "O"}())
    if (res != "KOL" || call != "KOLZ") return "fail 2: $res != KOL or $call != KOLZ"

    res = "";

Response:
call = Z("Z").test(c = {res += "L"; "L"}, a = {res += "K"; "K"}(), b = {res+="O"; "O"}())
    if (res != "KOL" || call != "KOLZ") return "fail 3: $res != KOL or $call != KOLZ"

    return "OK"

}<|endoftext|>


Prompt:
variantCheckRequests[resolvedVariantRequest] = "jvmLibApiElements$variantNamePublishedSuffix"
        }

        try {
            ResolvedVariantChecker().assertResolvedSingleVariantsBatch(consumerProject, variantCheckRequests, consumerBuildOptions)
        } catch (e: AssertionError) {

Response:
collector.addError(AssertionError("Failure with Kotlin version=${withKotlinVersion}", e))
        }
    }
}

class ResolvedVariantChecker {
    data class ResolvedVariantRequest(val subproject: String, val configuration: String, val dependencyFilter: String)

    data class ModuleVariantResult(val moduleName: String, val variantString: String)<|endoftext|>