Prompt:
private fun getInfoForDeclaration(symbol: FirBasedSymbol<*>): Fork? {
        val root = rootFunction ?: return null
        if (root == symbol) return null
        val cachedMap = buildInfoForRoot(root)
        return cachedMap[symbol]
    }

Response:
private fun buildInfoForRoot(root: FirFunctionSymbol<*>): Map<FirBasedSymbol<*>, Fork> {
        assignedLocalVariablesByDeclaration?.let { return it }

        val data = MiniCfgBuilder.MiniCfgData()
        MiniCfgBuilder().visitElement(root.fir, data)

        assignedLocalVariablesByDeclaration = data.forks<|endoftext|>


Prompt:
assertEquals(false, nullToNotNullI(AIE()), "AIE? is II")
    assertEquals(false, nullToNotNullI(AIF()), "AIF? is II")
    assertEquals(true, nullToNotNullI(AIJ()), "AIJ? is II")
    assertEquals(false, nullToNotNullI(BAIA()), "BAIA? is II")

Response:
assertEquals(false, nullToNotNullI(BAIAIF()), "BAIAIF? is II")
    assertEquals(true, nullToNotNullI(BAIAIJ()), "BAIAIJ? is II")
    assertEquals(false, nullToNotNullI(C()), "C? is II")<|endoftext|>


Prompt:
for (e in other) min = minOf(min, e)
    return min
}

/**
 * Returns the smaller of the given values.
 */
@SinceKotlin("1.4")
public actual fun minOf(a: Byte, vararg other: Byte): Byte {
    var min = a
    for (e in other) min = minOf(min, e)
    return min
}

/**

Response:
* Returns the smaller of the given values.
 */
@SinceKotlin("1.4")
public actual fun minOf(a: Short, vararg other: Short): Short {
    var min = a
    for (e in other) min = minOf(min, e)
    return min
}

/**
 * Returns the smaller of the given values.
 */
@SinceKotlin("1.4")<|endoftext|>


Prompt:
@kotlin.jvm.JvmName(name = "sumOfFloat")
public fun kotlin.sequences.Sequence<kotlin.Float>.sum(): kotlin.Float

@kotlin.jvm.JvmName(name = "sumOfInt")
public fun kotlin.sequences.Sequence<kotlin.Int>.sum(): kotlin.Int

Response:
@kotlin.jvm.JvmName(name = "sumOfLong")
public fun kotlin.sequences.Sequence<kotlin.Long>.sum(): kotlin.Long

@kotlin.jvm.JvmName(name = "sumOfShort")
public fun kotlin.sequences.Sequence<kotlin.Short>.sum(): kotlin.Int<|endoftext|>


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


Prompt:
if (resultingSize < 0) throw OutOfMemoryError("File $this is too big to fit in memory.")

    return@use extra.buffer.copyInto(
        destination = result.copyOf(resultingSize),
        destinationOffset = result.size,
        startIndex = 0, endIndex = extra.size()
    )
}

Response:
private class ExposingBufferByteArrayOutputStream(size: Int) : ByteArrayOutputStream(size) {
    val buffer: ByteArray get() = buf
}

/**
 * Sets the content of this file as an [array] of bytes.
 * If this file already exists, it becomes overwritten.
 *
 * @param array byte array to write into this file.
 */<|endoftext|>


Prompt:
environment: KotlinCoreProjectEnvironment,
        modules: List<KtModule>,
        sourceFiles: List<PsiFileSystemItem>,
        languageVersionSettings: LanguageVersionSettings,
        jdkHome: Path?,
    ) {
        val project = environment.project
        val javaFileManager = project.getService(JavaFileManager::class.java) as KotlinCliJavaFileManagerImpl

Response:
val javaModuleFinder = CliJavaModuleFinder(jdkHome?.toFile(), null, javaFileManager, project, null)
        val javaModuleGraph = JavaModuleGraph(javaModuleFinder)

        val allSourceFileRoots = sourceFiles.map { JavaRoot(it.virtualFile, JavaRoot.RootType.SOURCE) }<|endoftext|>


Prompt:
// Do not create clone for arrays deserialized from metadata in the old (1.0) runtime, because clone is declared there anyway
            if (classDescriptor.classProto.functionList.any { functionProto ->
                    classDescriptor.c.nameResolver.getName(functionProto.name) == CloneableClassScope.CLONE_NAME
                }) {
                return emptyList()
            }

Response:
return listOf(
                createCloneForArray(
                    classDescriptor, cloneableType.memberScope.getContributedFunctions(name, NoLookupLocation.FROM_BUILTINS).single()
                )
            )
        }

        if (!settings.isAdditionalBuiltInsFeatureSupported) return emptyList()

        return getAdditionalFunctions(classDescriptor) {<|endoftext|>


Prompt:
object Constants {
    const val A = 30
    const val B = 40
}

class ClassConstants {
    companion object {
        const val C = 50
    }
}
fun foo(state: Int) {
    when (state) {
        Constants.A -> return
        Constants.B -> return
        ClassConstants.C -> return
        else -> return
    }
}

Response: // 1 LOOKUPSWITCH<|endoftext|>


Prompt:
val typeConstructorDeclaration = lhs.type.constructor.declarationDescriptor
            val typeClass = typeConstructorDeclaration
                ?: throw AssertionError("Unexpected type constructor for ${lhs.type}: $typeConstructorDeclaration")
            IrClassReferenceImpl(
                ktClassLiteral.startOffsetSkippingComments, ktClassLiteral.endOffset, resultType,

Response:
context.symbolTable.referenceClassifier(typeClass), lhs.type.toIrType()
            )
        }
    }

    fun generateCallableReference(ktCallableReference: KtCallableReferenceExpression): IrExpression {
        val resolvedCall = getResolvedCall(ktCallableReference.callableReference)!!
        val resolvedDescriptor = resolvedCall.resultingDescriptor<|endoftext|>


Prompt:
private fun expectMinMax(min: Short, max: Short, elements: ShortArray) {
        assertEquals(min, elements.minOrNull())
        assertEquals(max, elements.maxOrNull())
        assertEquals(min, elements.min())
        assertEquals(max, elements.max())
    }

    @Test
    fun minMax() {

Response:
expectMinMax(1, 1, shortArrayOf(1))
        expectMinMax(1, 2, shortArrayOf(1, 2))
        expectMinMax(1, Short.MAX_VALUE, shortArrayOf(1, 2, Short.MAX_VALUE))

    }

    @Test
    fun minMaxEmpty() {
        val empty = shortArrayOf()<|endoftext|>


Prompt: if (w != null || <!SENSELESS_COMPARISON!>this.w != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number"), DEBUG_INFO_SMARTCAST!>this.w<!>.funT()

Response: if (w != null || <!SENSELESS_COMPARISON!>this.w != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number"), DEBUG_INFO_SMARTCAST!>this.w<!>.funAny()<|endoftext|>


Prompt:
if (cache !is CachedLibraries.Cache.PerFile) {
                require(library.isInteropLibrary())
                continue
            }

            val libraryCacheRootDir = File(cache.path)
            val cachedFiles = libraryCacheRootDir.listFiles.map { it.name }

            val actualFilesWithFqNames = library.getFilesWithFqNames()

Response:
libraryFilesWithFqNames[library] = actualFilesWithFqNames
            val actualFiles = actualFilesWithFqNames.withIndex()
                    .associate { CacheSupport.cacheFileId(it.value.fqName, it.value.filePath) to it.index }
                    .toMutableMap()

            for (cachedFile in cachedFiles) {<|endoftext|>


Prompt:
open fun testScripting(gradleVersion: GradleVersion) {
        project("scripting", gradleVersion) {
            val appSubProject = subProject("app")
            val scriptTemplateSubProject = subProject("script-template")
            appSubProject.disableLightTreeIfNeeded()
            scriptTemplateSubProject.disableLightTreeIfNeeded()

Response:
build("assemble", buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)) {
                assertCompiledKotlinSources(
                    listOf(
                        appSubProject.kotlinSourcesDir().resolve("world.greet.kts").relativeTo(projectPath),
                        scriptTemplateSubProject.kotlinSourcesDir().resolve("GreetScriptTemplate.kt").relativeTo(projectPath)<|endoftext|>


Prompt:
override fun visitFunctionReference(expression: IrFunctionReference) {
                visitAnonymousDeclaration(expression)
            }

            override fun visitGetValue(expression: IrGetValue) {
                super.visitGetValue(expression)
                if (
                    expression.symbol.owner in inlinableParameters ||

Response:
expression.type.getClass()?.let { classesToRegenerate.contains(it) } == true
                ) {
                    saveDeclarationsFromStackIntoRegenerationPool()
                }
            }

            override fun visitCall(expression: IrCall) {
                if (expression.symbol == context.ir.symbols.singleArgumentInlineFunction) {<|endoftext|>


Prompt:
resultTypeResolver: ResultTypeResolver
    ): TypeConstructorMarker {
        val expectedType = argument.expectedType
            ?: throw IllegalStateException("Postponed argument's expected type must not be null")

        val expectedTypeConstructor = expectedType.typeConstructor()

        return when (argument) {
            is LambdaWithTypeVariableAsExpectedTypeMarker ->

Response:
getNonReflectFunctionTypeConstructor(parametersNumber, functionTypeKind)
            is PostponedCallableReferenceMarker -> {
                val computedResultType = resultTypeResolver.findResultType(
                    this@computeResultingFunctionalConstructor,
                    notFixedTypeVariables.getValue(expectedTypeConstructor),
                    TypeVariableDirectionCalculator.ResolveDirection.TO_SUPERTYPE
                )<|endoftext|>


Prompt:
}
            }
            true
        }

        Assert.assertTrue(
            "Too few (<= 10) pom.xml files found. Something must be wrong in the test or in the project structure",
            poms.size > 10
        )

        if (!poms.map(Pom::version).areEqual()) {
            Assert.fail(

Response:
"Some versions in pom.xml files are different. Please change the versions so that they are equal:\n\n" +
                        poms.joinToString(separator = "\n") { (path, version) -> "$version $path" }
            )
        }
    }

    private fun loadValueFromPomXml(filePath: String, query: List<String>): String? {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.utils.printer.PrettyPrinter
import org.jetbrains.kotlin.lexer.KtKeywordToken

public interface KtCallableSignatureRenderer {
    public fun renderCallableSignature(
        analysisSession: KtAnalysisSession,
        symbol: KtCallableSymbol,
        keyword: KtKeywordToken?,

Response:
declarationRenderer: KtDeclarationRenderer,
        printer: PrettyPrinter,
    )

    public object FOR_SOURCE : KtCallableSignatureRenderer {
        override fun renderCallableSignature(
            analysisSession: KtAnalysisSession,
            symbol: KtCallableSymbol,
            keyword: KtKeywordToken?,<|endoftext|>


Prompt:
// MEMBER_NAME_FILTER: property
package properties

@Target(
    AnnotationTarget.TYPE,
    AnnotationTarget.PROPERTY,
    AnnotationTarget.VALUE_PARAMETER,
    AnnotationTarget.FIELD,
    AnnotationTarget.PROPERTY_SETTER,
    AnnotationTarget.PROPERTY_GETTER,
)
annotation class Anno(val position: String)

Response:
const val constant = 0

class My<caret>Class(
    @property:Anno("property $constant")
    @get:Anno("get $constant")
    @set:Anno("set $constant")
    @setparam:Anno("set $constant")
    @field:Anno("field $constant")
    @param:Anno("param $constant")<|endoftext|>


Prompt:
// Always filter resources configuration because it resolves klibs for dependency graph inheritance
                        explicitlyEnabled || project.kotlinPropertiesProvider.mppResourcesResolutionStrategy == KotlinTargetResourcesResolutionStrategy.ResourcesConfiguration
                    }
            )
            it.archivesFromDependencies.from(
                project.kotlinPropertiesProvider.mppResourcesResolutionStrategy.resourceArchives(compilation)
            )

Response:
it.outputDirectory.set(
                project.layout.buildDirectory.dir("$MULTIPLATFORM_RESOURCES_DIRECTORY/resources-from-dependencies/${targetName}")
            )
        }
    }

    private fun resolveResourcesFromSelf(
        compilation: KotlinCompilation<*>,
        target: KotlinTarget,<|endoftext|>


Response: lineNumber=102, colNumber=37)<|endoftext|>


Prompt:
//     (ICONST or other integers creating instruction)
                //     (ACONST_NULL or ALOAD)
                //     ICONST_0
                //     INVOKESTATIC InlineMarker.mark
                //     INVOKE* suspendingFunction$default(..., Continuation;ILjava/lang/Object)Ljava/lang/Object;
                assert(paramTypes.size >= 3) {

Response:
"${suspensionPoint.name}${suspensionPoint.desc} shall have 3+ parameters"
                }
            } else {
                // Expected pattern here:
                //     ALOAD 0
                //     ICONST_0
                //     INVOKESTATIC InlineMarker.mark
                //     INVOKE* suspendingFunction(..., Continuation;)Ljava/lang/Object;<|endoftext|>


Prompt:
private fun Class<*>.getMethodOrNull(name: String, vararg parameterTypes: Class<*>): Method? =
    try {
        getMethod(name, *parameterTypes)
    } catch (e: NoSuchMethodException) {
        null
    }

private fun getGeneratedClass(classLoader: ClassLoader, className: String): Class<*> =

Response:
classLoader.loadClassOrNull(className) ?: error("No class file was generated for: $className")

object TestProcessServer {

    const val DEBUG_TEST = "--debugTest"

    private val executor = Executors.newFixedThreadPool(1)!!

    @Volatile
    private var isProcessingTask = true

    @Volatile<|endoftext|>


Prompt:
import org.gradle.api.provider.Provider
import org.gradle.api.services.BuildService
import org.gradle.api.services.BuildServiceParameters
import org.gradle.api.tasks.Internal
import org.gradle.tooling.events.FinishEvent
import org.gradle.tooling.events.OperationCompletionListener

Response:
import org.gradle.tooling.events.task.TaskExecutionResult
import org.gradle.tooling.events.task.TaskFailureResult
import org.gradle.tooling.events.task.TaskFinishEvent
import org.gradle.tooling.events.task.TaskSkippedResult
import org.gradle.util.GradleVersion<|endoftext|>


Prompt:
assertEquals("something", String(Files.readAllBytes(file)))
    }

    @Test
    fun testDeletingNotExistingFileOnFailure() {
        val file = workingDir.resolve("1.txt")
        useTransaction {
            deleteFile(file)
        }
        assertFalse(Files.exists(file))
    }

    @Test

Response:
fun testChangesAreRevertedOnExecutionException() {
        val file1 = workingDir.resolve("1.txt")
        val file2 = workingDir.resolve("2.txt")
        Files.write(file1, "something".toByteArray())
        assertThrows<Exception> {
            useTransaction {
                registerAddedOrChangedFile(file1)<|endoftext|>


Prompt: // library.kt:8 box: $i$f$foo\56\65:int=0:int, array\56:java.lang.Integer[]=java.lang.Integer[], myClass\56:MyClass=MyClass, this_\67:MyClass=MyClass, $i$f$f1\67\515:int=0:int

Response: // library.kt:28 box: $i$f$foo\56\65:int=0:int, array\56:java.lang.Integer[]=java.lang.Integer[], myClass\56:MyClass=MyClass, this_\67:MyClass=MyClass, $i$f$f1\67\515:int=0:int,<|endoftext|>


Prompt:
private const val INLINE_MARKER_AFTER_INLINE_SUSPEND_ID = 7
private const val INLINE_MARKER_BEFORE_UNBOX_INLINE_CLASS = 8
private const val INLINE_MARKER_AFTER_UNBOX_INLINE_CLASS = 9

Response:
internal inline fun getMethodNode(classData: ByteArray, classType: Type, crossinline match: (Method) -> Boolean): SMAPAndMethodNode? {
    var node: MethodNode? = null
    var sourceFile: String? = null
    var sourceMap: String? = null
    ClassReader(classData).accept(object : ClassVisitor(Opcodes.API_VERSION) {<|endoftext|>


Prompt:
val arguments = qualifiedAccess.orderedArguments(callee) ?: return
        val argumentVariables = Array(arguments.size) { i ->
            arguments[i]?.let { argument ->
                getOrCreateVariableIfRealAndStable(flow, argument)
                    // Only apply contract information to argument if it has not been reassigned in a lambda.

Response:
.takeIf { callArgsExit == null || isSameValueIn(callArgsExit, argument, flow) }
            }
        }
        if (argumentVariables.all { it == null }) return

        val typeParameters = callee.typeParameters
        val typeArgumentsSubstitutor = if (typeParameters.isNotEmpty() && qualifiedAccess is FirQualifiedAccessExpression) {<|endoftext|>


Prompt:
parameterObjectOption: (ParameterObjectOption, K) -> CreatorLike<Map<out K, V>, V, A, C>,
    assertionCreator: C.(M) -> Unit
) {}

private fun <K, V> createGetParameterObject(
    plant: AssertionPlant<Map<out K, V>>,
    key: K

Response:
) = null as ParameterObject<Map<out K, V>, V>

private fun <K, V : Any, M> containsNullable(
    plant: AssertionPlant<Map<out K, V?>>,
    pairs: List<Pair<K, M>>,
    assertionCreator: AssertionPlantNullable<V?>.(M) -> Unit
) = contains(<|endoftext|>


Prompt:
// so `fun remember` wasn't transformed yet, then we have to transform it now.
                val createDecoysTransformer = CreateDecoysTransformer(
                    context, symbolRemapper, signatureBuilder, stabilityInferencer, metrics
                )
                with(createDecoysTransformer) {
                    if (!it.isDecoy()) {
                        visitSimpleFunction(it) as IrSimpleFunction
                        updateParents()

Response:
composerParamTransformer.visitSimpleFunction(
                            it.getComposableForDecoy().owner as IrSimpleFunction
                        ) as IrSimpleFunction
                    } else {
                        it.getComposableForDecoy().owner as IrSimpleFunction
                    }
                }
            }
        }.symbol
    }

    override fun lower(module: IrModuleFragment) {<|endoftext|>


Prompt:
* NOTE: for-loop operators
 * UNEXPECTED BEHAVIOUR
 * ISSUES: KT-36898, KT-62356
 */
package testPackCase8

fun case8 () {
    val iterable: Iterable = Iterable()
    for (i in <!NOT_FUNCTION_AS_OPERATOR!>iterable<!>) {
        println(i)
    }
}

Response:
class Iterable() {
    //  operator fun iterator() : CharIterator = TODO()
}
val Iterable.iterator: Inv
    get() = Inv('c')

class Inv(val c: Char) {
    operator fun invoke(): CharIterator = object : CharIterator() {
        private var index = 0

        override fun nextChar(): Char {
            index++; return c
        }<|endoftext|>


Prompt:
// WITH_STDLIB
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*

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

@Suppress("UNSUPPORTED_FEATURE")
inline class IC(val s: String)

Response:
var c: Continuation<Any>? = null

suspend fun <T> suspendMe(): T = suspendCoroutine {
    @Suppress("UNCHECKED_CAST")
    c = it as Continuation<Any>
}

interface I {
    suspend fun foo(s: String): IC
}

class D: I {
    override suspend fun foo(s: String): IC = suspendMe()
}<|endoftext|>


Prompt:
*/
    fun put(key: K, value: D, oldValue: D?): S {
        @Suppress("UNCHECKED_CAST")
        // Avoid a copy instance creation if new value is the same
        if (value == oldValue) return this as S
        return copy(map.put(key, value))
    }

Response:
override fun getOrNull(key: K): D? = this[key].getOrElse(null as D?)
    override fun asMap() = this

    fun retainAll(predicate: (K) -> Boolean): S = copy(map.removeAll(map.keySet().filterNot(predicate)))<|endoftext|>


Prompt:
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
            fun get(): Any?<!> = null

Response:
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeGetter
            fun get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>): Any?<!> = null<|endoftext|>


Prompt:
suspend fun <T> AsyncSequence<T>.toList(): List<T> {
    val out = arrayListOf<T>()
    for (e in this@toList) out += e // fails at this line
    return out
}

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

fun box(): String {

Response:
val seq = asyncGenerate {
        yield("O")
        yield("K")
    }

    var res = listOf<String>()

    builder {
        res = seq.toList()
    }

    if (res.size > 2) return "fail 1: ${res.size}"

    return res[0] + res[1]
}<|endoftext|>


Prompt:
package org.jetbrains.kotlin.ir.util

import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.ir.symbols.IrFileSymbol

Response:
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.ir.util.render as newRender

/**
 * [IdSignature] is a unique key that corresponds to each Kotlin Declaration. It is used to reference declarations in klib.
 * It has to be stable and unique. It’s a bit similar to JVM signature but more Kotlin-specific.
 *<|endoftext|>


Prompt:
package org.jetbrains.kotlin.konan.test.blackbox.support.settings

import org.jetbrains.kotlin.konan.test.blackbox.AbstractNativeSimpleTest

/**
 * All instances of test classes.
 *
 * [allInstances] - all test class instances ordered from innermost to outermost
 * [enclosingTestInstance] - the outermost test instance
 */

Response:
internal class SimpleTestInstances(val allInstances: List<Any>) {
    val enclosingTestInstance: AbstractNativeSimpleTest
        get() = allInstances.firstOrNull() as AbstractNativeSimpleTest
}<|endoftext|>


Prompt:
*
 * @sample samples.collections.Collections.Aggregates.runningFold
 */
@SinceKotlin("1.4")
public inline fun <R> CharSequence.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List<R> {
    if (isEmpty()) return listOf(initial)

Response:
val result = ArrayList<R>(length + 1).apply { add(initial) }
    var accumulator = initial
    for (index in indices) {
        accumulator = operation(index, accumulator, this[index])
        result.add(accumulator)
    }
    return result
}

/**
 * Returns a list containing successive accumulation values generated by applying [operation] from left to right<|endoftext|>


Prompt:
val platformNN = J.staticNN
    // @Nullable platform type
    val platformN = J.staticN
    // platform type with no annotation
    val platformJ = J.staticJ

    if (platformNN) {}
    if (<!CONDITION_TYPE_MISMATCH!>platformN<!>) {}
    if (platformJ) {}

    while (platformNN) {}

Response:
while (<!CONDITION_TYPE_MISMATCH!>platformN<!>) {}
    while (platformJ) {}

    do {} while (platformNN)
    do {} while (<!CONDITION_TYPE_MISMATCH!>platformN<!>)
    do {} while (platformJ)

    platformNN && false<|endoftext|>


Prompt:
lateinit var result1: String
lateinit var result2: String

class Test(val x: String) {
    fun test(a: String) {
        if (result1 != a) throw AssertionError("result1: $result1")
        result2 = a
    }

    init {
        fun test() {
            fun test1() {
                result1 = x
            }
            test1()

Response:
}
        test()
    }
}

fun box(): String {
    val t = Test("OK")
    t.test("OK")

    return result2
}<|endoftext|>


Prompt: <!JS_PLAIN_OBJECT_CAN_EXTEND_ONLY_OTHER_JS_PLAIN_OBJECTS!>C<!>

Response:
@JsPlainObject
external interface E

@JsPlainObject
external interface F

@JsPlainObject
external interface DEF: D, E, F

external interface G: A, C, <!IMPLEMENTING_OF_JS_PLAIN_OBJECT_IS_NOT_SUPPORTED!>E<!><|endoftext|>


Prompt:
// !LANGUAGE: -SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER

fun foo1(f: suspend () -> String) {}
fun foo2(f: suspend (Int) -> String) {}
fun foo3(f: suspend () -> Unit) {}

fun bar(): String = ""

fun test(
    f0: suspend () -> String,

Response:
f1: () -> String,
    f2: (Int) -> String,
    f3: () -> Unit,
) {
    foo1 { "str" }
    foo1(f0)

    foo1(f1)
    foo2(f2)
    foo3(f3)

    foo1(::bar)<|endoftext|>


Prompt:
diagnosticReporter: DiagnosticReporter,
    compatibilityMode: CompatibilityMode,
    cleanFiles: List<KotlinFileSerializedData>,
    dependencies: List<Dependency>,
    createModuleSerializer: (
        irDiagnosticReporter: IrDiagnosticReporter,
        irBuiltins: IrBuiltIns,
        compatibilityMode: CompatibilityMode,

Response:
normalizeAbsolutePaths: Boolean,
        sourceBaseDirs: Collection<String>,
        languageVersionSettings: LanguageVersionSettings,
        shouldCheckSignaturesOnUniqueness: Boolean,
    ) -> IrModuleSerializer<*>,
    metadataSerializer: KlibSingleFileMetadataSerializer<SourceFile>,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.declarations.impl.FirPropertyAccessorImpl
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.expressions.FirBlock
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertyAccessorSymbol

Response:
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
import org.jetbrains.kotlin.fir.types.ConeSimpleKotlinType
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource<|endoftext|>


Prompt:
val TEXTURE29: Int
        val TEXTURE30: Int
        val TEXTURE31: Int
        val ACTIVE_TEXTURE: Int
        val REPEAT: Int
        val CLAMP_TO_EDGE: Int
        val MIRRORED_REPEAT: Int
        val FLOAT_VEC2: Int
        val FLOAT_VEC3: Int

Response:
val FLOAT_VEC4: Int
        val INT_VEC2: Int
        val INT_VEC3: Int
        val INT_VEC4: Int
        val BOOL: Int
        val BOOL_VEC2: Int
        val BOOL_VEC3: Int
        val BOOL_VEC4: Int
        val FLOAT_MAT2: Int<|endoftext|>


Prompt:
<!DEBUG_INFO_CALL("fqName: Case2.foo; typeCall: function")!>foo({1}, {1})<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>foo({1}, {1})<!>
    }
}

// TESTCASE NUMBER: 3
class Case3() {

Response:
fun foo(x: ()->CharSequence, x1: String = ""): Unit = TODO() // (3)
    fun foo(x: ()->String, z: Any = ""): String = TODO() // (4)

    fun boo() = ""

    val boo = 1

    fun case() {<|endoftext|>


Prompt:
propagateLambdaAnalysisDiagnostics(diagnosticHolderForLambda, candidate)
        }

        val errorCandidates = mutableSetOf<SimpleResolutionCandidate>()
        val successfulCandidates = mutableSetOf<SimpleResolutionCandidate>()

        for (candidate in candidates) {
            if (candidate.isSuccessful) {
                successfulCandidates += candidate
            } else {

Response:
errorCandidates += candidate
            }
        }
        return when {
            successfulCandidates.isNotEmpty() -> successfulCandidates
            else -> errorCandidates
        }
    }

    private fun propagateLambdaAnalysisDiagnostics(
        diagnosticHolder: KotlinDiagnosticsHolder.SimpleHolder,
        candidate: SimpleResolutionCandidate
    ) {<|endoftext|>


Prompt:
package org.jetbrains.kotlin.serialization.deserialization

import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.descriptors.deserialization.AdditionalClassPartsProvider

Response:
import org.jetbrains.kotlin.descriptors.deserialization.ClassDescriptorFactory
import org.jetbrains.kotlin.descriptors.deserialization.PlatformDependentDeclarationFilter
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.metadata.ProtoBuf<|endoftext|>


Prompt:
var a = ""
    var b = 0
    val r = object: Runnable {
        override fun run() {
            b += 2
            a += "b"
        }
    }
    r.run()
    c()
    r.run()
    Result.a += a
    Result.b += b
}
suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {

Response:
var a = ""
    var b = 0
    val r = object: Runnable {
        override fun run() {
            b += 3
            a += "c"
        }
    }
    r.run()
    c()
    r.run()
    Result.a += a
    Result.b += b
}

// FILE: inlineSite.kt
import kotlin.coroutines.*<|endoftext|>


Prompt:
fun mangledInternal() = NameAndStability(getInternalMangledName(baseName, encodeSignature(descriptor)), true)
            fun mangledPrivate() = NameAndStability(getPrivateMangledName(baseName, descriptor), false)

            val effectiveVisibility = descriptor.ownEffectiveVisibility

            val containingDeclaration = descriptor.containingDeclaration
            return when (containingDeclaration) {

Response:
is PackageFragmentDescriptor -> when {
                    effectiveVisibility.isPublicAPI -> mangledAndStable()

                    effectiveVisibility == DescriptorVisibilities.INTERNAL -> mangledInternal()

                    else -> regularAndUnstable()
                }
                is ClassDescriptor -> when {
                    // valueOf() is created in the library with a mangled name for every enum class<|endoftext|>


Prompt:
fun HandlersStepBuilder<BinaryArtifacts.Jvm, ArtifactKinds.Jvm>.inlineHandlers() {
    useHandlers(
        ::BytecodeInliningHandler,
        ::SMAPDumpHandler
    )
}

fun TestConfigurationBuilder.configureModernJavaTest(jdkKind: TestJdkKind, jvmTarget: JvmTarget) {
    defaultDirectives {

Response:
JvmEnvironmentConfigurationDirectives.JDK_KIND with jdkKind
        JvmEnvironmentConfigurationDirectives.JVM_TARGET with jvmTarget
        +ConfigurationDirectives.WITH_STDLIB
        +CodegenTestDirectives.USE_JAVAC_BASED_ON_JVM_TARGET
        +CodegenTestDirectives.IGNORE_DEXING
    }
}<|endoftext|>


Prompt:
/**
     * The most precise time source available in the platform.
     *
     * This time source returns its readings from a source of monotonic time when it is available in a target platform,
     * and resorts to a non-monotonic time source otherwise.
     *
     * The function [markNow] of this time source returns the specialized [ValueTimeMark] that is an inline value class

Response:
* wrapping a platform-dependent time reading value.
     */
    public object Monotonic : TimeSource.WithComparableMarks {
        override fun markNow(): ValueTimeMark = MonotonicTimeSource.markNow()
        override fun toString(): String = MonotonicTimeSource.toString()

        /**<|endoftext|>


Prompt:
fun <T> case3(case: T): T where T : A3, T : B3 = case

// TESTCASE NUMBER: 4
fun case4() {
    fun <T> case4(case: T): T where T : A4, T : B4 = case

    val x = case4(C4())
    checkSubtype<A4>(x)

Response:
checkSubtype<B4>(x)
}

class C4: A4, B4

interface A4 {
    fun fooA() = "A"
}

interface B4 {
    fun fooB() = "B"
}

// TESTCASE NUMBER: 5
fun case5() {
    val x =  "" case5 object : A5, B5 {}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.expressions.impl.IrClassReferenceImpl
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.name.FqName

Response:
import org.jetbrains.kotlin.types.Variance

// true if the class should be processed by the parcelize plugin
val IrClass.isParcelize: Boolean
    get() = kind in ParcelableExtensionBase.ALLOWED_CLASS_KINDS && hasAnnotation(PARCELIZE_CLASS_FQNAME)<|endoftext|>


Prompt:
checkExactType<Buildee<TargetType>>(<!TYPE_MISMATCH("Buildee<TargetType>; Buildee<Any>"), TYPE_MISMATCH("Buildee<Any>; Buildee<TargetType>")!>buildee<!>)
}

class TargetType
class DifferentType

fun consumeDifferentType(value: DifferentType) {}

class Buildee<TV> {

Response:
fun setTypeVariable(value: TV) { storage = value }
    fun getTypeVariable(): TV = storage
    private var storage: TV = null!!
}

fun <PTV> parallelBuild(
    instructionsA: Buildee<PTV>.(PTV) -> Unit,
    instructionsB: Buildee<PTV>.(PTV) -> Unit
): Buildee<PTV> {<|endoftext|>


Prompt: val WASM_IMPORT_EXPORT_VARARG_PARAMETER: KtDiagnosticFactory0 by error0<KtElement>()

Response: val WASM_IMPORT_EXPORT_UNSUPPORTED_PARAMETER_TYPE: KtDiagnosticFactory1<ConeKotlinType> by error1<KtElement, ConeKotlinType>(SourceElementPositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT)<|endoftext|>


Prompt:
assertHasDiagnostic(KotlinToolingDiagnostics.InconsistentTargetCompatibilityForKotlinAndJavaTasks)
            }

            javaSourcesDir().resolve("demo").run {
                createDirectories()
                resolve("HelloWorld.java").writeText(
                    //language=Java
                    """
                    package demo;

                    public class HelloWorld {

Response:
public static void main(String[] args) {
                            System.out.println("Hello world!");
                        }
                    }
                    """.trimIndent()
                )
            }

            build(":compileKotlin") {
                assertHasDiagnostic(KotlinToolingDiagnostics.InconsistentTargetCompatibilityForKotlinAndJavaTasks)
            }
        }
    }<|endoftext|>


Prompt:
// jspecify_nullness_mismatch, jspecify_nullness_mismatch
    <!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>, x)<!>.foo()

Response:
// jspecify_nullness_mismatch
    <!RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>a.field<!>.foo()

    // jspecify_nullness_mismatch<|endoftext|>


Prompt:
open class A(val value: String) {
    fun component1() = value
}

interface B {
    fun component1(): Any
}

class C(value: String) : A(value), B

fun box(): String {
    val c = C("OK")
    val b: B = c
    val a: A = c
    if (b.component1() != "OK") return "Fail 1"

Response:
if (a.component1() != "OK") return "Fail 2"
    return c.component1()
}<|endoftext|>


Prompt:
OPTIONAL_JVM_INLINE_ANNOTATION
value class IcInt<T: Int>(val x: T)
OPTIONAL_JVM_INLINE_ANNOTATION
value class IcLong<T: Long>(val x: T)

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

fun box(): String {

Response:
if (IcInt(42) == id(IcInt(24))) return "Error 1"
    if (IcInt(42) != id(IcInt(42))) return "Error 2"
    if (id(IcInt(42)) == IcInt(24)) return "Error 3"
    if (id(IcInt(42)) != IcInt(42)) return "Error 4"<|endoftext|>


Prompt:
@Target(AnnotationTarget.EXPRESSION, AnnotationTarget.LOCAL_VARIABLE)
@Retention(AnnotationRetention.SOURCE)
annotation class Ann

fun foo(arg: Int): Int {
    if (@Ann arg == 0) {
        @Ann return 1
    }
    @Ann if (arg == 1) {
        return (@Ann 1)
    }
    return 42
}

Response:
data class Two(val x: Int, val y: Int)

fun bar(two: Two) {
    val (@Ann x, @Ann y) = two
}<|endoftext|>


Prompt:
override fun visitStringConcatenation(expression: IrStringConcatenation, data: IrDeclaration) {
            super.visitStringConcatenation(expression, data)
            toStringMethod.enqueue(data, "string concatenation")
        }
    }

    private fun addReachabilityInfoIfNeeded(
        from: IrDeclaration,
        to: IrDeclaration,

Response:
description: String,
        isContagiousOverridableDeclaration: Boolean,
    ) {
        reachabilityInfos?.add(ReachabilityInfo(from, to, description, isContagiousOverridableDeclaration))
    }

    protected fun IrDeclaration.enqueue(
        from: IrDeclaration,
        description: String,
        isContagious: Boolean = true,
    ) {<|endoftext|>


Prompt:
arr<!UNREACHABLE_CODE!>[<!>break<!UNREACHABLE_CODE!>]<!>
    }

    while (true) {
        arr[1] <!UNREACHABLE_CODE!>=<!> break
    }

    while (true) {
        break
        <!UNREACHABLE_CODE!>foo(1)<!>

Response:
}

    while (true) {
        var <!UNUSED_VARIABLE!>x<!> = 1
        break
        <!UNREACHABLE_CODE!>x = 2<!>
    }

    while (true) {
        var <!UNUSED_VARIABLE!>x<!> = 1<|endoftext|>


Prompt:
repository.getLibraries(target).toList().ifNotEmpty { NativeLibrariesToCommonize(target, this) }
            }

            libraries.forEachWithTarget { target, librariesOrNull ->
                if (librariesOrNull == null)
                    logger.warning(
                        "No libraries found for target ${target}. This target will be excluded from commonization."
                    )
            }
            libraries

Response:
}
    }

    private fun commonizeAndSaveResults(libraries: TargetDependent<NativeLibrariesToCommonize?>) {
        runCommonization(
            CommonizerParameters(
                outputTargets = outputTargets,
                targetProviders = libraries.map { target, targetLibraries -> createTargetProvider(target, targetLibraries) },
                manifestProvider = createManifestProvider(libraries),<|endoftext|>


Prompt:
firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }
    add(FirErrors.CONST_VAL_WITH_NON_CONST_INITIALIZER) { firDiagnostic ->
        ConstValWithNonConstInitializerImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }

Response:
add(FirErrors.WRONG_SETTER_PARAMETER_TYPE) { firDiagnostic ->
        WrongSetterParameterTypeImpl(
            firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
            firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b),<|endoftext|>


Prompt:
@Deprecated("Use inline extension function with body using dynamic")
public annotation class nativeInvoke

@Target(CLASS, FUNCTION, PROPERTY)
internal annotation class library(public val name: String = "")

@Target(CLASS)
internal annotation class marker

/**
 * Gives a declaration (a function, a property or a class) specific name in JavaScript.
 *
 * This may be useful in the following cases:

Response:
*
 *   * There are two functions for which the compiler gives same name in JavaScript, you can
 *     mark one with `@JsName(...)` to prevent the compiler from reporting error.
 *   * You are writing a JavaScript library in Kotlin. The compiler produces mangled names
 *     for functions with parameters, which is unnatural for usual JavaScript developer.<|endoftext|>


Prompt: // library.kt:26 box: m:int=2:int, m1:int=2:int, xg$iv:int=0:int, $i$f$g:int=0:int, $i$f$bar\2\8:int=0:int

Response: // library.kt:27 box: m:int=2:int, m1:int=2:int, xg$iv:int=0:int, $i$f$g:int=0:int, $i$f$bar\2\8:int=0:int, wbar\2$iv:int=2:int<|endoftext|>


Prompt:
.failures.withClosure<Throwable> { listOfNotNull(it.cause) }
            assertFalse(executedAfterLifecycleFinished.getAndSet(true))
            if (thrownException !in exceptions) fail("Expected 'thrownException' in lifecycle.finished")
        }

        /* Provoking an exception during project.evaluate() */
        val exceptionWasProvoked = AtomicBoolean()

Response:
project.tasks.whenObjectAdded {
            assertFalse(exceptionWasProvoked.getAndSet(true))
            throw thrownException
        }
        runCatching { project.evaluate() }
        assertTrue(exceptionWasProvoked.get(), "Exception during '.evaluate()' was not provoked")<|endoftext|>


Prompt:
if (this.e != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>e<!>.propNullableT
        if (this.e != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>e<!>.propNullableAny

Response:
if (this.e != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>e<!>.funT()
        if (this.e != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Char")!>e<!>.funAny()<|endoftext|>


Prompt: buildScriptContent.replace(PLUGIN_MARKER_VERSION_PLACEHOLDER, KOTLIN_VERSION)

Response:
/** Copies the logic of Gradle [`mavenLocal()`](https://docs.gradle.org/3.4.1/dsl/org.gradle.api.artifacts.dsl.RepositoryHandler.html#org.gradle.api.artifacts.dsl.RepositoryHandler:mavenLocal())
 */
private object MavenLocalUrlProvider {<|endoftext|>


Prompt:
fun Long.id() = this

fun String.drop2() = if (length >= 2) subSequence(2, length) else null

fun String.anyLength(): Any = length

fun doSimple(s: String?) = s?.length == 3

fun doLongReceiver(x: Long) = x?.id() == 3L

Response:
fun doChain(s: String?) = s?.drop2()?.length == 1

fun doIf(s: String?) =
        if (s?.length == 1) "A" else "B"

fun doCmpWithAny(s: String?) =
        s?.anyLength() == 3

fun doIfNot(s: String?) =<|endoftext|>


Prompt:
import org.jetbrains.kotlin.light.classes.symbol.isLateInit
import org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightMethodBase
import org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightClassModifierList

Response:
import org.jetbrains.kotlin.light.classes.symbol.withSymbol
import org.jetbrains.kotlin.name.SpecialNames

internal class SymbolLightSetterParameter(
    ktAnalysisSession: KtAnalysisSession,
    private val containingPropertySymbolPointer: KtSymbolPointer<KtPropertySymbol>,
    parameterSymbol: KtValueParameterSymbol,<|endoftext|>


Prompt:
return "new(${parameters.generateTypeScriptString(indent)}): ${returnType.toTypeScript(indent)};"
    }

    private fun ExportedProperty.generateTypeScriptString(indent: String, prefix: String, esModules: Boolean = false): String {
        val extraIndent = "$indent    "
        val optional = if (isOptional) "?" else ""

Response:
val containsUnresolvedChar = !name.isValidES5Identifier()
        val memberName = if (containsUnresolvedChar) "\"$name\"" else name
        val isObjectGetter = irGetter?.origin == JsLoweredDeclarationOrigin.OBJECT_GET_INSTANCE_FUNCTION<|endoftext|>


Prompt:
private fun MappedByteBuffer.parseZip64CentralDirectoryRecordsNumberAndOffset(): Pair<Int, Int> {
    var endOfCentralDirectoryOffset = capacity() - END_OF_CENTRAL_DIR_ZIP64_SIZE
    while (endOfCentralDirectoryOffset >= 0) {

Response:
// header of "End of central directory" (see https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT)
        if (getInt(endOfCentralDirectoryOffset) == 0x06064b50) break
        endOfCentralDirectoryOffset--
    }

    val entriesNumber = getLong(endOfCentralDirectoryOffset + 32)<|endoftext|>


Prompt:
origin = when {
                origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB -> origin
                fir.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR
                origin == IrDeclarationOrigin.FAKE_OVERRIDE -> origin
                origin == IrDeclarationOrigin.DELEGATED_MEMBER -> origin

Response:
fir.getter is FirDefaultPropertyGetter -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR
                else -> origin
            },
            firAccessor = fir.getter,
            isSetter = false,
            firParentProperty = fir,
            firParentClass = containingClass,
            symbol = it,
            parent = this@Fir2IrLazyProperty.parent,<|endoftext|>


Prompt:
false,
                    false
                )
                scopeKind = LexicalScopeKind.PROPERTY_HEADER
            }
            else -> TODO("${declaration::class}")
        }

        val result = LexicalWritableScope(
            parent,
            descriptor,
            false,
            LocalRedeclarationChecker.DO_NOTHING,
            scopeKind
        )

Response:
val typeParameters = descriptorResolver.resolveTypeParametersForDescriptor(
            descriptor,
            result,
            result,
            declaration.typeParameters,
            trace
        )

        descriptorResolver.resolveGenericBounds(declaration, descriptor, result, typeParameters, trace)

        return result
    }

    private class LazyObjCProtocolImpl(<|endoftext|>


Prompt:
val lastLineImports = lexicalScopeAfterLastLine.parentsWithSelf.first { it is ImportingScope } as ImportingScope
            val scopesForThisLine = fileScopeFactory.createScopesForFile(linePsi, lastLineImports, false)
            val combinedLexicalScopes = if (hasImports)

Response:
lexicalScopeAfterLastLine.replaceImportingScopes(scopesForThisLine.importingScope)
            else
                lexicalScopeAfterLastLine

            return FileScopes(combinedLexicalScopes, scopesForThisLine.importingScope, scopesForThisLine.importForceResolver)
        }
    }
}<|endoftext|>


Prompt:
ensure(1)
            data[size++] = value
        }

        fun addChainable(value: Int): IntArrayList {
            add(value)
            return this
        }

        operator fun get(index: Int): Int = data[index]
        operator fun set(index: Int, value: Int) {
            data[index] = value
        }
    }

Response:
val size = BENCHMARK_SIZE * 100

    //Benchmark
    fun testChainable() {
        val list = IntArrayList()
        for (i in 0..size) {
            list.addChainable(i)
        }
        for (i in 0..size) {
            list[i] = i * 2
        }
        var sum = 0<|endoftext|>


Prompt:
for (i in 0 until size) {
            if (i != 0 && i % Integer.SIZE == 0) {
                masks.add(mask)
                mask = 0
            }
            mask = mask or if (bits.get(i)) 1 shl (i % Integer.SIZE) else 0
        }
        masks.add(mask)

        return masks
    }

Response:
fun generateOnStackIfNeeded(callGenerator: CallGenerator, isConstructor: Boolean): Boolean {
        val toInts = toInts()
        if (!toInts.isEmpty()) {
            for (mask in toInts) {
                callGenerator.putValueIfNeeded(<|endoftext|>


Prompt:
fun takeWithNullableReference(a: WithNullableReference) {}

// FILE: test.kt

fun foo(a: WithPrimitive?, b: WithPrimitive) {
    takeWithPrimitive(a!!) // unbox
    takeWithPrimitive(a) // unbox
    takeWithPrimitive(b!!)
}

fun bar(a: WithReference?, b: WithReference) {

Response:
takeWithReference(a!!)
    takeWithReference(a)
    takeWithReference(b!!)
}

fun baz(a: WithNullableReference?, b: WithNullableReference) {
    takeWithNullableReference(a!!) // unbox
    takeWithNullableReference(a) // unbox
    takeWithNullableReference(a!!) // unbox<|endoftext|>


Prompt:
// Here we're dividing the build process onto two phases:
        // 1. build bag of edges and direct edges array;
        // 2. build reversed edges array from the direct edges array.
        // This is to lower memory usage (all of these edges structures are more or less equal by size),
        // and by that we're only holding references to two out of three of them.

Response:
private fun buildConstraintGraph(nodesMap: MutableMap<DataFlowIR.Node, Node>,
                                         functions: Map<DataFlowIR.FunctionSymbol, DataFlowIR.Function>,
                                         typeHierarchy: TypeHierarchyImpl,
                                         rootSet: List<DataFlowIR.FunctionSymbol>
        ): ConstraintGraphBuildResult {<|endoftext|>


Prompt:
assertFalse(eqFloatChar(1.toFloat(), 1.toChar()))
    assertFalse(eqFloatCharQ(0.toFloat(), 0.toChar()))
    assertFalse(eqFloatCharQ(0.toFloat(), 1.toChar()))
    assertFalse(eqFloatCharQ(0.toFloat(), null))
    assertFalse(eqFloatCharQ(0.toFloat(), undefined))

Response:
assertFalse(eqFloatCharQ(1.toFloat(), 0.toChar()))
    assertFalse(eqFloatCharQ(1.toFloat(), 1.toChar()))
    assertFalse(eqFloatCharQ(1.toFloat(), null))
    assertFalse(eqFloatCharQ(1.toFloat(), undefined))
    assertFalse(eqFloatQChar(0.toFloat(), 0.toChar()))<|endoftext|>


Prompt:
//        "Ţ" to 354,
//        "ţ" to 355,
//        "Т" to 1058,
//        "т" to 1090,
//        "⃛" to 8411,
//        "⌕" to 8981,
//        "𝔗" to 120087,
//        "𝔱" to 120113,

Response:
//        "∴" to 8756,
//        "∴" to 8756,
//        "∴" to 8756,
//        "Θ" to 920,
//        "θ" to 952,
//        "ϑ" to 977,
//        "ϑ" to 977,
//        "≈" to 8776,<|endoftext|>


Prompt:
load(descriptorVar, descType)
        iconst(index)

        val sti = getSerialTypeInfo(property, propertyType)
        val useSerializer = stackValueSerializerInstanceFromSerializer(expressionCodegen, codegen, sti, this@SerializerCodegenImpl)
        val unknownSer = (!useSerializer && sti.elementMethodPrefix.isEmpty())
        if (unknownSer) {

Response:
aconst(codegen.typeMapper.mapType(property.type))
            AsmUtil.wrapJavaClassIntoKClass(this)
        }

        fun produceCall(isUpdatable: Boolean) {
            invokeinterface(
                kInputType.internalName,<|endoftext|>


Prompt:
private fun HEAD.commonHead() {
    meta { charset = "utf-8" }
    script(src = "https://code.jquery.com/jquery-3.4.0.slim.min.js") {

Response:
integrity = "sha256-ZaXnYkHGqIhqTbJ6MB4l9Frs/r7U4jlx7ir8PJYBqbI="
        @Suppress("SpellCheckingInspection")
        attributes["crossorigin"] = "anonymous"
    }
}<|endoftext|>


Prompt:
* Returns `true` if array has at least one element.
 *
 * @sample samples.collections.Collections.Aggregates.any
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun UShortArray.any(): Boolean {
    return storage.any()
}

/**

Response:
* Returns `true` if at least one element matches the given [predicate].
 *
 * @sample samples.collections.Collections.Aggregates.anyWithPredicate
 */
@SinceKotlin("1.3")
@ExperimentalUnsignedTypes
@kotlin.internal.InlineOnly
public inline fun UIntArray.any(predicate: (UInt) -> Boolean): Boolean {<|endoftext|>


Prompt:
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
 *
 * SPEC VERSION: 0.1-313
 * MAIN LINK: expressions, when-expression -> paragraph 4 -> sentence 1
 * NUMBER: 1
 * DESCRIPTION:  it is possible to  replace the else condition with an always-true condition
 */

// FILE: JavaEnum.java

enum JavaEnum {
    Val_1,

Response:
Val_2,
}

// FILE: KotlinClass.kt

// TESTCASE NUMBER: 1
fun case1() {
    val z = JavaEnum.Val_1
    val when2 = <!NO_ELSE_IN_WHEN!>when<!> (z) {
        JavaEnum.Val_1 -> { }<|endoftext|>


Prompt:
"removeAll(listOf(present))"            to { removeAll(listOf(present)) },
        "removeAll(emptyList())"                to { removeAll(emptyList()) },
        "removeAll(this.toList())"              to { removeAll(this.toList()) },

        "retainAll(listOf(present))"            to { retainAll(listOf(present)) },

Response:
"retainAll(emptyList())"                to { retainAll(emptyList()) },
        "retainAll(this.toList())"              to { retainAll(this.toList()) },

        "clear()"                               to { clear() },

        "iterator().apply { next() }.remove()"  to { iterator().apply { next() }.remove() }
    )<|endoftext|>


Prompt:
interface WrongExportedDeclaration : KtFirDiagnostic<KtElement> {
        override val diagnosticClass get() = WrongExportedDeclaration::class
        val kind: String
    }

    interface NonExportableType : KtFirDiagnostic<KtElement> {
        override val diagnosticClass get() = NonExportableType::class
        val kind: String
        val type: KtType

Response:
}

    interface NonConsumableExportedIdentifier : KtFirDiagnostic<KtElement> {
        override val diagnosticClass get() = NonConsumableExportedIdentifier::class
        val name: String
    }

    interface NamedCompanionInExportedInterface : KtFirDiagnostic<KtElement> {<|endoftext|>


Prompt: p:foo.bar.D1(getValue) p:foo.bar.D1(provideDelegate) p:foo.bar.D1(setValue) p:java.lang(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate)

Response: p:kotlin.comparisons(provideDelegate) p:kotlin.io(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate)*/D1()<|endoftext|>


Prompt:
@Synchronized
    override operator fun set(key: FqName, value: Set<FqName>) {
        if (value.isNotEmpty()) {
            super.set(key, value)
        } else {
            remove(key)
        }
    }

    @Synchronized
    fun removeValues(key: FqName, removed: Set<FqName>) {

Response:
this[key] = this[key].orEmpty() - removed
    }

}

internal class SubtypesMap(
    storageFile: File,
    icContext: IncrementalCompilationContext,
) : ClassOneToManyMap(storageFile, icContext)

internal class SupertypesMap(
    storageFile: File,
    icContext: IncrementalCompilationContext,<|endoftext|>


Prompt:
fun fn5(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any) {}
fun fn6(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any, x5: Any) {}

Response:
fun fn7(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any) {}
fun fn8(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any) {}<|endoftext|>


Prompt:
val correspondingDeclaredSuperType = superTypeRefs.firstOrNull {
                            it.coneType.fullyExpandedType(session).classId == classId
                        }?.coneTypeSafe<ConeClassLikeType>()?.fullyExpandedType(session) ?: return@let null

                        if (superType.typeArguments.isEmpty() && correspondingDeclaredSuperType.typeArguments.isNotEmpty() ||

Response:
superType == correspondingDeclaredSuperType
                        ) {
                            correspondingDeclaredSuperType
                        } else {
                            null
                        }
                    }
                /*
                 * See tests:
                 *   DiagnosticsTestGenerated$Tests$ThisAndSuper.testGenericQualifiedSuperOverridden
                 *   DiagnosticsTestGenerated$Tests$ThisAndSuper.testQualifiedSuperOverridden
                 */<|endoftext|>


Prompt:
val (typeQualifierResolver, aClass) = buildTypeQualifierResolverAndFindClass("A")

        assertMethodHasUnwrappedAnnotation(
            aClass, typeQualifierResolver,
            "nullable",
            "@javax.annotation.Nonnull(when = When.UNKNOWN)"
        )

        assertMethodHasUnwrappedAnnotation(

Response:
aClass, typeQualifierResolver,
            "checkForNull",
            "@javax.annotation.CheckForNull()"
        )

        assertMethodHasUnwrappedAnnotation(
            aClass, typeQualifierResolver,
            "nonNull",
            "@javax.annotation.Nonnull()"
        )

        assertMethodHasUnwrappedAnnotation(<|endoftext|>


Prompt:
return if (type1.ordinal > type2.ordinal) type1 else type2
        }

        fun getOperatorReturnType(kind1: PrimitiveType, kind2: PrimitiveType): PrimitiveType {
            require(kind1 != PrimitiveType.BOOLEAN) { "kind1 must not be BOOLEAN" }

Response:
require(kind2 != PrimitiveType.BOOLEAN) { "kind2 must not be BOOLEAN" }
            return maxByDomainCapacity(maxByDomainCapacity(kind1, kind2), PrimitiveType.INT)
        }
    }

    private val typeDescriptions: Map<PrimitiveType, String> = mapOf(<|endoftext|>


Prompt:
@Test
fun `nothing new collected`() {
    GC.collect()
    GC.collect()
    val stat = GC.lastGCInfo
    assertNotNull(stat)
    for (key in stat.sweepStatistics.keys) {
        assertEquals(stat.sweepStatistics[key]!!.sweptCount, 0L)
    }
}

object Global {

Response:
val x = listOf(1, 2, 3)
}

@Test
fun `stable refs in root set`() {
    GC.collect()
    val stat0 = GC.lastGCInfo
    assertNotNull(stat0)
    val rootSet0 = stat0.rootSet
    assertNotNull(rootSet0)
    val x = listOf(1, 2, 3)<|endoftext|>


Prompt:
@ExperimentalWasmDsl
    fun wasmJs(name: String, configure: Action<KotlinWasmJsTargetDsl>) = wasmJs(name) { configure.execute(this) }

    @ExperimentalWasmDsl
    fun wasmJs(configure: Action<KotlinWasmJsTargetDsl>) = wasmJs { configure.execute(this) }

Response:
@ExperimentalWasmDsl
    fun wasmWasi(
        name: String = "wasmWasi",
        configure: KotlinWasmWasiTargetDsl.() -> Unit = { },
    ): KotlinWasmWasiTargetDsl =
        configureOrCreate(
            name,
            @Suppress("DEPRECATION")<|endoftext|>


Prompt:
override suspend fun resolve(
            artifactCoordinates: String,
            options: ExternalDependenciesResolver.Options,
            sourceCodeLocation: SourceCode.LocationWithId?
        ): ResultWithDiagnostics<List<File>> {
            if (!acceptsArtifact(artifactCoordinates)) throw Exception("Path is invalid")
            val file = doResolve(artifactCoordinates)

Response:
?: return makeResolveFailureResult("Failed to resolve '$artifactCoordinates'", sourceCodeLocation)
            return ResultWithDiagnostics.Success(listOf(file))
        }

        override fun addRepository(
            repositoryCoordinates: RepositoryCoordinates,
            options: ExternalDependenciesResolver.Options,
            sourceCodeLocation: SourceCode.LocationWithId?<|endoftext|>


Prompt:
original.name.identifier.startsWith(StandardNames.DATA_CLASS_COMPONENT_PREFIX)
    }

    private fun IrDeclaration.isExportedSyntheticEnumEntriesProperty(): Boolean {
        return this is IrSimpleFunction &&
                parentEnumClassOrNull?.isExported(context) == true &&

Response:
(body as? IrSyntheticBody)?.kind == IrSyntheticBodyKind.ENUM_ENTRIES
    }

    private fun IrDeclaration.excludeFromJsExport() {
        annotations += generateJsExportIgnoreCall()
    }

    private fun generateJsExportIgnoreCall(): IrConstructorCall {<|endoftext|>


Prompt:
assertEquals(16.0F, listOf(1, 2, 3, 4, 5).maxOf { (-2.0F).pow(it) })

        assertIsPositiveZero(listOf(1.0, -1.0).shuffled().maxOf { it * 0.0 })

Response:
assertIsPositiveZero(listOf(1.0F, -1.0F).shuffled().maxOf { it * 0.0F }.toDouble())
    }

    @Test fun maxOfWith() {
        val data = listOf("abca", "bcaa", "cabb")<|endoftext|>


Prompt:
KtSimpleVariableAccess.Read
                    )
                } else {
                    KtCompoundVariableAccessCall(
                        variablePartiallyAppliedSymbol,
                        fir.unwrapLValue()?.toTypeArgumentsMapping(variablePartiallyAppliedSymbol) ?: emptyMap(),

Response:
KtCompoundAccess.IncOrDecOperation(operationPartiallyAppliedSymbol, incOrDecOperationKind, incDecPrecedence),
                    )
                }
            }
        }
        return null
    }

    private data class CompoundArrayAccessPartiallyAppliedSymbols(
        val operationPartiallyAppliedSymbol: KtPartiallyAppliedFunctionSymbol<KtFunctionSymbol>,<|endoftext|>


Prompt:
//        "Ш" to 1064,
//        "ш" to 1096,
//        "↓" to 8595,
//        "←" to 8592,
//        "∣" to 8739,
//        "∥" to 8741,
//        "→" to 8594,

Response:
//        "↑" to 8593,
//        "" to 173,
//        "&shy" to 173,
//        "Σ" to 931,
//        "σ" to 963,
//        "ς" to 962,
//        "ς" to 962,
//        "∼" to 8764,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.library.metadata.resolver.KotlinLibraryResolveResult
import org.jetbrains.kotlin.storage.StorageManager

interface KlibResolvedModuleDescriptorsFactory {

    val moduleDescriptorFactory: KlibMetadataModuleDescriptorFactory

    /**

Response:
* Given the [resolvedLibraries] creates the list of [ModuleDescriptorImpl]s with properly installed
     * inter-dependencies. The result of this method is returned in a form of [KlibResolvedModuleDescriptors] instance.
     *
     * Please use this method with care: Unless this method accepts `null` for [builtIns], it is not recommended to<|endoftext|>


Prompt:
val nameParts = parts.dropLast(deps.size)

                val platformIndex = when (nameParts.size) {
                    1 -> 0
                    else -> if (nameParts.last() == TEST_SOURCE_ROOT_SUFFIX) 0 else 1
                }

                val additionalDependencies = mutableListOf<String>().apply {

Response:
if (nameParts[platformIndex] != COMMON_SOURCE_ROOT_NAME)
                        add(partsToQualifiedName(nameParts.take(platformIndex) + COMMON_SOURCE_ROOT_NAME + nameParts.drop(platformIndex + 1)))
                    if (nameParts.last() == TEST_SOURCE_ROOT_SUFFIX)
                        add(partsToQualifiedName(nameParts.dropLast(1)))<|endoftext|>


Prompt:
val cachedInfo = headerToCachedInfo[header] ?: notFoundIcError("artifact for module ${header.moduleName}")
            val actualCrossModuleHash = references.crossModuleReferencesHashForIC()
            if (header.associatedModule == null && cachedInfo.crossModuleReferencesHash != actualCrossModuleHash) {
                header.associatedModule = cachedInfo.artifact.loadJsIrModule()
            }

Response:
header.associatedModule?.let {
                cachedInfo.crossModuleReferencesHash = actualCrossModuleHash
                cachedInfo.commitModuleInfo()
            }
        }
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.utils.PathUtil
import java.io.PrintStream
import java.net.URL
import java.net.URLConnection
import java.util.function.Predicate
import kotlin.system.exitProcess

abstract class CLITool<A : CommonToolArguments> {

Response:
fun exec(errStream: PrintStream, vararg args: String): ExitCode =
        exec(errStream, Services.EMPTY, defaultMessageRenderer(), args)

    fun exec(errStream: PrintStream, messageRenderer: MessageRenderer, vararg args: String): ExitCode =
        exec(errStream, Services.EMPTY, messageRenderer, args)

    protected fun exec(<|endoftext|>


Prompt:
*/
@SinceKotlin("1.4")
public inline fun IntArray.reduceOrNull(operation: (acc: Int, Int) -> Int): Int? {
    if (isEmpty())
        return null
    var accumulator = this[0]
    for (index in 1..lastIndex) {
        accumulator = operation(accumulator, this[index])
    }
    return accumulator
}

Response:
/**
 * Accumulates value starting with the first element and applying [operation] from left to right
 * to current accumulator value and each element.
 *
 * Returns `null` if the array is empty.
 *
 * @param [operation] function that takes current accumulator value and an element,
 * and calculates the next accumulator value.
 *<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker

Response:
import org.jetbrains.kotlin.fir.analysis.checkers.isTopLevel
import org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors
import org.jetbrains.kotlin.fir.declarations.FirClass
import org.jetbrains.kotlin.fir.declarations.FirDeclaration<|endoftext|>


Prompt:
) {
    private val isJavaSamConversionWithEqualsHashCode =
        context.config.languageVersionSettings.supportsFeature(LanguageFeature.JavaSamConversionEqualsHashCode)

    /**
     * @see java.lang.invoke.LambdaMetafactory
     */
    fun getLambdaMetafactoryArguments(
        reference: IrFunctionReference,
        samType: IrType,

Response:
plainLambda: Boolean
    ): MetafactoryArgumentsResult {
        val samClass = samType.getClass()
            ?: throw AssertionError("SAM type is not a class: ${samType.render()}")

        var semanticsHazard = false
        var abiHazard = false
        var inliningHazard = false
        var shouldBeSerializable = false
        var functionHazard = false<|endoftext|>


Prompt:
) : CodeMetaInfo {
    override var renderConfiguration: FirDiagnosticCodeMetaRenderConfiguration = renderConfiguration
        private set

    override val start: Int
        get() = range.startOffset

    override val end: Int
        get() = range.endOffset

    override val tag: String
        get() = renderConfiguration.getTag(this)

Response:
override val attributes: MutableList<String> = mutableListOf()

    override fun asString(): String = renderConfiguration.asString(this)

    fun replaceRenderConfiguration(renderConfiguration: FirDiagnosticCodeMetaRenderConfiguration) {
        this.renderConfiguration = renderConfiguration
    }
}

class FirDiagnosticCodeMetaRenderConfiguration(
    val renderSeverity: Boolean = false,<|endoftext|>


Prompt:
else InlineClassAbi.mangledNameFor(context, function, mangleReturnTypes = false, useOldMangleRules = false)
    }

    private fun makeAndAddGroupedValueParametersFrom(
        sourceFunction: IrFunction,
        includeDispatcherReceiver: Boolean,
        substitutionMap: Map<IrTypeParameterSymbol, IrType>,
        targetFunction: IrFunction,

Response:
): List<RemappedParameter> {
        val newFlattenedParameters = mutableListOf<RemappedParameter>()
        if (sourceFunction.dispatchReceiverParameter != null && includeDispatcherReceiver) {
            newFlattenedParameters.add(
                sourceFunction.parentAsClass.thisReceiver!!.grouped(
                    "\$dispatchReceiver",
                    substitutionMap,<|endoftext|>


Prompt:
override var nonFatalDiagnostics: MutableOrEmptyList<ConeDiagnostic>,
    override var argumentList: FirArgumentList,
    override var explicitReceiver: FirExpression,
    override val componentIndex: Int,
) : FirComponentCall() {
    override var calleeReference: FirNamedReference = FirSimpleNamedReference(source, Name.identifier("component$componentIndex"))

Response:
override val origin: FirFunctionCallOrigin = FirFunctionCallOrigin.Operator

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


Prompt:
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name

Response:
import org.jetbrains.kotlin.util.OperatorNameConventions

/** Builds a [HeaderInfo] for iteration over iterables using the `get / []` operator and an index. */
abstract class IndexedGetIterationHandler(
    protected val context: CommonBackendContext,
    private val canCacheLast: Boolean
) : HeaderInfoHandler<IrExpression, Nothing?> {<|endoftext|>


Prompt:
* not in partial as before the inroducing new posponed arguments analysis.
         *
         * It happens due to the lack of rerun stages after fixation variables
         * (stage 5 – see `fixVariablesOrReportNotEnoughInformation` in `KotlinConstraintSystemCompleter.kt`).
         * Rerun is need as fixation of variables can be make lambda available for analysis.
         *

Response:
* TODO: add tests with lambdas, which can't be analyzed in partial mode, but if can, the code will be successfully resolved.
         */
        ArrayList<W>().foo(y.unwrap { it })
    }
}<|endoftext|>


Prompt:
* ```
     */
    private fun modifyFunctionAccessExpression(
        oldExpression: IrFunctionAccessExpression,
        accessorSymbol: IrFunctionSymbol
    ): IrFunctionAccessExpression {
        val newExpression = when (oldExpression) {
            is IrCall -> IrCallImpl.fromSymbolOwner(
                oldExpression.startOffset, oldExpression.endOffset,

Response:
oldExpression.type,
                accessorSymbol as IrSimpleFunctionSymbol, oldExpression.typeArgumentsCount,
                origin = oldExpression.origin
            )
            is IrDelegatingConstructorCall -> IrDelegatingConstructorCallImpl.fromSymbolOwner(
                oldExpression.startOffset, oldExpression.endOffset,
                context.irBuiltIns.unitType,<|endoftext|>


Prompt:
"kobjcclassinfo:$internalName"
        }
        val classInfoGlobal = staticData.createGlobal(
                runtime.kotlinObjCClassInfo,
                classInfoSymbolName,
                isExported = isExported
        ).apply {
            setConstant(true)
        }

Response:
val bodyOffsetGlobal = staticData.createGlobal(llvm.int32Type, "kobjcbodyoffs:$internalName")

        return KotlinObjCClassLlvmDeclarations(classInfoGlobal, bodyOffsetGlobal)
    }

    override fun visitValueParameter(declaration: IrValueParameter) {
        // In some cases because of inconsistencies of previous lowerings, default values can be not removed.<|endoftext|>


Prompt:
external interface ExternRef

fun notNullExternRef(): ExternRef = js("'abc'")

fun notNull2ExternRef(): ExternRef = js("null")

fun nullExternRef(): ExternRef? = js("'abc'")

fun null2ExternRef(): ExternRef? = js("null")

fun testExterRef() {

Response:
check(notNullExternRef() != null)
    checkNPE { notNull2ExternRef() }
    check(nullExternRef() != null)
    check(null2ExternRef() == null)
}

class StructRefImpl
typealias StructRef = JsReference<StructRefImpl>

fun notNullStructRef(x: StructRef): StructRef = js("x")<|endoftext|>


Prompt:
dataClassMembersGenerator.generateBodiesForMultiFieldValueClassMembers(klass, irClass)
                }
                if (irClass.isData) {
                    dataClassMembersGenerator.generateBodiesForDataClassMembers(klass, irClass)
                }
            }

            annotationGenerator.generate(irClass, klass)
            if (irPrimaryConstructor != null) {

Response:
declarationStorage.leaveScope(irPrimaryConstructor.symbol)
            }
        }
        declarationStorage.leaveScope(irClass.symbol)
    }

    fun <T : IrFunction> convertFunctionContent(irFunction: T, firFunction: FirFunction?, containingClass: FirClass?): T {
        conversionScope.withParent(irFunction) {
            if (firFunction != null) {<|endoftext|>


Prompt:
private fun isOuterForLoopRangeVariable(
            expression: KtExpression,
            variableDescriptor: CallableDescriptor,
            c: ResolutionContext<*>
    ): Boolean {
        for (parent in expression.parents) {
            if (parent is KtForExpression) {
                val rangeExpression = parent.loopRange as? KtSimpleNameExpression ?: continue

Response:
val rangeResolvedCall = rangeExpression.getResolvedCall(c.trace.bindingContext) ?: continue
                if (rangeResolvedCall.resultingDescriptor == variableDescriptor) {
                    return true
                }
            }
        }
        return false
    }
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutorByConstructorMap
import org.jetbrains.kotlin.resolve.calls.model.*

Response:
import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults
import org.jetbrains.kotlin.resolve.calls.tower.*
import org.jetbrains.kotlin.resolve.calls.util.BuilderLambdaLabelingInfo
import org.jetbrains.kotlin.resolve.calls.util.replaceArguments<|endoftext|>


Prompt:
if (!funWithReturnsFalseAndInvertCondition(value_1 !is String)) println(value_1.length)
    if (funWithReturnsNotNull(value_1 is String) != null) println(value_1.length)
    if (!(funWithReturnsNotNull(value_1 is String) == null)) println(value_1.length)
}

// TESTCASE NUMBER: 9

Response:
fun case_9(value_1: String?) {
    if (funWithReturnsTrue(value_1 != null)) println(value_1.length)
    if (funWithReturnsTrueAndInvertCondition(value_1 == null)) println(value_1.length)
    if (!funWithReturnsFalse(value_1 != null)) println(value_1.length)<|endoftext|>


Prompt:
val companionObjectSymbol: FirRegularClassSymbol?
        get() = fir.companionObjectSymbol

    val resolvedContextReceivers: List<FirContextReceiver>
        get() {
            if (fir.contextReceivers.isEmpty()) return emptyList()
            lazyResolveToPhase(FirResolvePhase.TYPES)
            return fir.contextReceivers
        }

Response:
}

class FirAnonymousObjectSymbol(packageFqName: FqName) : FirClassSymbol<FirAnonymousObject>(
    ClassId(packageFqName, SpecialNames.ANONYMOUS_FQ_NAME, isLocal = true)
)

class FirTypeAliasSymbol(classId: ClassId) : FirClassLikeSymbol<FirTypeAlias>(classId), TypeAliasSymbolMarker {<|endoftext|>


Prompt:
): DeprecationsProvider = getDeprecationsAnnotationInfoByUseSiteFromAccessors(
    session = session,
    getter = getter,
    setter = setter,
).toDeprecationsProvider(session.firCachesFactory)

fun getDeprecationsAnnotationInfoByUseSiteFromAccessors(
    session: FirSession,
    getter: FirFunction?,

Response:
getterAnnotations: List<FirAnnotation>? = getter?.annotations,
    setter: FirFunction?,
    setterAnnotations: List<FirAnnotation>? = setter?.annotations,
): DeprecationAnnotationInfoPerUseSiteStorage = buildDeprecationAnnotationInfoPerUseSiteStorage {<|endoftext|>


Prompt:
lookupSuperTypes(firJavaClass.symbol, lookupInterfaces = true, deep = true, session).mapTo(this) { superType ->
                val originalClassId = superType.lookupTag.classId
                JavaToKotlinClassMap.mapKotlinToJava(originalClassId.asSingleFqName().toUnsafe()) ?: originalClassId
            }
        }
    }

Response:
private val isList: Boolean = firKotlinClass.classId == StandardClassIds.List

    // It's ok to have a super set of actually available member names
    private val myCallableNames: Set<Name> by lazy {
        if (firKotlinClass.isFinal) {
            // For final classes we don't need to load HIDDEN members at all because they might not be overridden<|endoftext|>


Prompt:
private fun rewriteNonLabelInstructions() {
            var thisNode = instructions.first
            while (thisNode != null) {
                thisNode = when (thisNode) {
                    is JumpInsnNode ->
                        rewriteJumpInsn(thisNode)
                    is LineNumberNode ->
                        rewriteLineNumberNode(thisNode)
                    is LookupSwitchInsnNode ->

Response:
rewriteLookupSwitchInsn(thisNode)
                    is TableSwitchInsnNode ->
                        rewriteTableSwitchInsn(thisNode)
                    is FrameNode ->
                        rewriteFrameNode(thisNode)
                    else ->
                        thisNode.next
                }
            }
        }

        private fun rewriteLineNumberNode(oldLineNode: LineNumberNode): AbstractInsnNode? =<|endoftext|>


Prompt:
internal class JvmArgumentNullabilityAssertionsLowering(context: JvmBackendContext) : FileLoweringPass,
    IrElementTransformer<AssertionScope> {

    enum class AssertionScope {
        Enabled, Disabled
    }

    private val isWithUnifiedNullChecks = context.config.unifiedNullChecks

Response:
private val isCallAssertionsDisabled = context.config.isCallAssertionsDisabled
    private val isReceiverAssertionsDisabled = context.config.isReceiverAssertionsDisabled

    private val specialBridgeMethods = SpecialBridgeMethods(context)

    override fun lower(irFile: IrFile) = irFile.transformChildren(this, AssertionScope.Enabled)<|endoftext|>


Prompt:
0 -> <!BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY!>break<!>
                1 -> foo { <!BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY!>break<!> }

Response:
2 -> foo(@SomeAnnotation { <!BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY!>break<!> })
                3 -> foo(fun () { <!BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY!>break<!> })<|endoftext|>


Prompt:
// !LANGUAGE: +EnumEntries +PrioritizedEnumEntries
// WITH_STDLIB
// FIR_DUMP

package pckg

enum class A {
    ;

    companion object
}

val A.Companion.entries: Int get() = 0

fun test() {
    A.entries
    A.Companion.entries

    with(A) {

Response:
this.entries
        entries
    }

    with(A.Companion) {
        entries
    }

    val aCompanion = A.Companion
    aCompanion.entries
}<|endoftext|>


Prompt:
testDecode(Base64.Mime, "Zm[@]9vYg==", "foob".encodeToByteArray())
        testDecode(Base64.Mime, "Zm9v-Yg==", "foob".encodeToByteArray())
        testDecode(Base64.Mime, "Zm9vYg=(%^)=", "foob".encodeToByteArray())

Response:
testDecode(Base64.Mime, "Zm\u00FF9vYg==", "foob".encodeToByteArray())
        testDecode(Base64.Mime, "\uFFFFZm9vYg==", "foob".encodeToByteArray())<|endoftext|>


Prompt:
internal val deprecatedMppProperties: List<String> = listOf(
    KOTLIN_MPP_ENABLE_COMPATIBILITY_METADATA_VARIANT,
    KOTLIN_MPP_ENABLE_GRANULAR_SOURCE_SETS_METADATA,
    KOTLIN_MPP_HIERARCHICAL_STRUCTURE_BY_DEFAULT,

Response:
KOTLIN_MPP_HIERARCHICAL_STRUCTURE_SUPPORT,
    KOTLIN_NATIVE_DEPENDENCY_PROPAGATION,
)

private val propertiesSetByPlugin: Set<String> = setOf(
    KOTLIN_MPP_ENABLE_GRANULAR_SOURCE_SETS_METADATA,
)<|endoftext|>


Prompt:
fun hashCode(param: String): Int {
        return 1
    }

    override fun hashCode(x: Int) = x + 1
}

open class Super {
    override fun equals(other: Any?): Boolean {
        return super.equals(other)
    }

    override fun hashCode(): Int {
        return 1
    }
}

Response:
data object OverridenInSuper: Super() {
    <!DATA_OBJECT_CUSTOM_EQUALS_OR_HASH_CODE!>override<!> fun equals(other: Any?): Boolean {
        return super.equals(other)
    }
}<|endoftext|>


Prompt:
// TESTCASE NUMBER: 13
fun case_13(value_1: Int, value_2: List<Int>, value_3: List<List<List<List<Int>>>>) {
    when (value_1) {
        value_2[0], value_3[0][-4][1][-1] -> {}
    }
}

// TESTCASE NUMBER: 14

Response:
fun case_14(value_1: Any, value_2: Class, value_3: Class?, value_4: Int) {
    fun __fun_1(): () -> Unit { return fun() { } }

    when (value_1) {
        funWithoutArgs(), __fun_1()(), value_2.fun_2(value_4) -> {}<|endoftext|>


Prompt:
Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
            or a positive number if it's greater than other.
        """.trimIndent()
        method {
            appendDoc(doc)
            annotations += intrinsicConstEvaluationAnnotation
            signature {
                isOverride = true
                methodName = "compareTo"
                parameter {

Response:
name = "other"
                    type = PrimitiveType.CHAR.capitalized
                }
                returnType = PrimitiveType.INT.capitalized
            }
        }.modifyGeneratedCompareTo()
    }

    private fun ClassBuilder.generatePlus() {
        method {
            appendDoc("Adds the other Int value to this value resulting a Char.")
            annotations += intrinsicConstEvaluationAnnotation<|endoftext|>


Prompt:
@Composable fun Wrap(content: @Composable (x: Int) -> Unit) {
                content(123)
            }
            @Composable fun App(x: Int) {
                print(x)
                Wrap { a ->
                    print(a)
                    print(x)
                    Wrap { b ->
                        print(x)
                        print(a)
                        print(b)
                    }

Response:
}
            }
        """,
        """
            public final class TestKt {
              public final static Wrap(Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;I)V
              public final static App(ILandroidx/compose/runtime/Composer;I)V
              final static INNERCLASS TestKt%App%1 null null<|endoftext|>


Prompt:
extensionReceiverParameter.substituteTopLevelType(approximatedExtensionReceiver)
            )
            approximated = true
        }
    }

    var valueParameterApproximated = false
    val newParameters = descriptor.valueParameters.map {
        val approximatedType = approximate(it.type.unwrap(), toSuper = false)
        if (approximatedType != null) {

Response:
valueParameterApproximated = true
            // invoking constructor explicitly as substitution on value parameters is not supported
            ValueParameterDescriptorImpl(
                it.containingDeclaration, it.original, it.index, it.annotations,
                it.name, outType = approximatedType, it.declaresDefaultValue(),
                it.isCrossinline, it.isNoinline, it.varargElementType, it.source
            )<|endoftext|>


Prompt: baz1LambdaVar\4$iv:int=1:int, baz1Param\5$iv:int=2:int, $i$f$baz1\5\60:int=0:int, baz1Var\5$iv:int=3:int

Response: // library.kt:21 box: mainVar:int=1:int, fooParam$iv:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=1:int, bazParam\1$iv:int=1:int, $i$f$baz\1\7:int=0:int, bazVar\1$iv:int=3:int,<|endoftext|>


Prompt:
0x10a05..0x10a06,
    0x10a0c..0x10a0f,
    0x10a38..0x10a3a,
    0x10a3f..0x10a3f,
    0x10ae5..0x10ae6,
    0x10d24..0x10d27,

Response:
0x10eab..0x10eac,
    0x10f46..0x10f50,
    0x11001..0x11001,
    0x11038..0x11046,
    0x1107f..0x11081,
    0x110b3..0x110b6,
    0x110b9..0x110ba,<|endoftext|>


Prompt:
}

// FILE: main.kt
fun main(x2: Runnable) {
    val x1 = {}
    val x3 = arrayOf<String>()

    Test.foo1({}, <!TYPE_INFERENCE_CANDIDATE_WITH_SAM_AND_VARARG!>arrayOf()<!>)
    Test.foo1({}, *arrayOf())

Response:
Test.foo1({}, <!TYPE_INFERENCE_CANDIDATE_WITH_SAM_AND_VARARG!>x3<!>)
    Test.foo1({}, *arrayOf(""))

    Test.foo1(x1, <!TYPE_INFERENCE_CANDIDATE_WITH_SAM_AND_VARARG!>arrayOf()<!>)<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE
annotation class Ann(vararg val i: Boolean)
fun foo() {
    val a1 = 1 > 2
    val a2 = 1 == 2
    val a3 = a1 == a2
    val a4 = a1 > a2

    @Ann(

Response:
<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>a1<!>,
            <!ANNOTATION_ARGUMENT_MUST_BE_CONST!>a2<!>,
            <!ANNOTATION_ARGUMENT_MUST_BE_CONST!>a3<!>,<|endoftext|>


Prompt:
private fun <T : Comparable<T>> expectMinMax(min: T, max: T, elements: Iterable<T>) {
        assertEquals(min, elements.minOrNull())
        assertEquals(max, elements.maxOrNull())
        assertEquals(min, elements.min())
        assertEquals(max, elements.max())
    }

    @Test
    fun minMax() {

Response:
expectMinMax("a", "a", listOf("a"))
        expectMinMax("a", "bcd", listOf("a", "bcd"))
        expectMinMax("a", "e", listOf("a", "bcd", "e"))
        expectMinMax(1, Int.MAX_VALUE, listOf(1, 2, Int.MAX_VALUE))<|endoftext|>


Prompt:
fun test31(i: Int, j: Int) {
    var x: Any? = materialize()
    require(x is String)
    do {
        x.<!UNRESOLVED_REFERENCE!>length<!>
        do {
            x.<!UNRESOLVED_REFERENCE!>length<!>
        } while (i < 10)
        x = ""

Response:
}while (j < 10)
}

fun test32(i: Int, j: Int) {
    var x: Any? = materialize()
    require(x is String)
    do {
        x.length
        do {
            x.length
        } while (i < 10)
        x += ""
    } while (j < 10)
}<|endoftext|>


Prompt:
KotlinBuiltIns.isULong(targetType) -> invokeUnsignedIntegerCoercionFunction(targetType, "toULong")
                else -> throw AssertionError("Unexpected target type for integer coercion: $targetType")
            }
        }
    }

    // In JVM, we don't convert values resulted from calling built-in operators on integer literals to another integer type.

Response:
// The reason is that doing so would change behavior, which we want to avoid, see KT-42321.
    // At the same time, such structure seems possible to achieve only via the magical integer value type, but inferring the result of
    // the operator call based on an expected type is deprecated behavior which is going to be removed in the future, see KT-38895.<|endoftext|>


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

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

Response:
import org.jetbrains.kotlin.backend.jvm.functionByName
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrFile
import org.jetbrains.kotlin.ir.expressions.IrCall
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl<|endoftext|>


Prompt:
private val packageCache = session.firCachesFactory.createCache(::computePackage)

    override val symbolNamesProvider: FirSymbolNamesProvider = object : FirCompositeCachedSymbolNamesProvider(
        session,
        providers.map { it.symbolNamesProvider },
    ) {

Response:
override fun computeTopLevelClassifierNames(packageFqName: FqName): Set<Name>? =
            super.computeTopLevelClassifierNames(packageFqName).also {
                ensureNotNull(it) { "classifier names in package $packageFqName" }
            }

        override val hasSpecificCallablePackageNamesComputation: Boolean get() = true<|endoftext|>


Prompt:
"автолавка",
"автолиз",
"автолитография",
"автолюбитель",
"автолюбительство",
"автомагистраль",

Response:
"автомат",
"автоматизация",
"автоматизирование",
"автоматизировать",
"автоматизироваться",<|endoftext|>


Prompt:
internal fun <PropType : Any?, T : Property<PropType>> T.chainedDisallowChanges(): T =
    apply {
        disallowChanges()
    }

internal fun <PropType : Any?, T : SetProperty<PropType>> T.chainedDisallowChanges(): T =
    apply {
        disallowChanges()
    }

// Before 5.0 fileProperty is created via ProjectLayout

Response:
// https://docs.gradle.org/current/javadoc/org/gradle/api/model/ObjectFactory.html#fileProperty--
internal fun Project.newFileProperty(initialize: (() -> File)? = null): RegularFileProperty {
    val regularFileProperty = project.objects.fileProperty()

    return regularFileProperty.apply {
        if (initialize != null) {<|endoftext|>


Prompt:
return if (apiVersion >= versionArgument) builder.irTrue() else builder.irFalse()
    }

    private fun isInInlineFunInKotlinRuntime(currentFunction: IrFunction?): Boolean {
        return currentFunction != null && currentFunction.isInline
                && currentFunction.getPackageFragment().packageFqName.startsWith(StandardNames.BUILT_INS_PACKAGE_NAME)

Response:
}

    private val IrFunction.isApiVersionIsAtLeast: Boolean
        get() {
            return isTopLevelInPackage("apiVersionIsAtLeast", StandardNames.KOTLIN_INTERNAL_FQ_NAME)
                    && valueParameters.size == 3
                    && valueParameters[0].type.isInt()
                    && valueParameters[1].type.isInt()<|endoftext|>


Prompt:
val catchParameter = buildVariable(
                    builder.parent, startOffset, endOffset,
                    IrDeclarationOrigin.CATCH_PARAMETER,
                    Name.identifier("e"),
                    context.irBuiltIns.throwableType
            )
            catches += irCatch(
                    catchParameter,
                    result = irBlock {

Response:
+irCall(context.ir.symbols.processUnhandledException).apply {
                            putValueArgument(0, irGet(catchParameter))
                        }
                        +irCall(context.ir.symbols.terminateWithUnhandledException).apply {
                            putValueArgument(0, irGet(catchParameter))
                        }
                    }
            )
        }
    }

    return entryPoint
}<|endoftext|>


Prompt:
// IGNORE_BACKEND_K2: NATIVE
// IGNORE_BACKEND_K2: WASM
// IGNORE_BACKEND_K2: JS, JS_IR, JS_IR_ES6
// IGNORE_LIGHT_ANALYSIS

// CHECK_TYPE_WITH_EXACT

// IGNORE_BACKEND_K1: ANY
// ISSUE: KT-60274

Response:
import kotlin.reflect.KProperty

class Buildee<CT> {
    fun materialize(): CT = UserKlass() as CT
}

fun <FT> build(
    instructions: Buildee<FT>.() -> Unit
): Buildee<FT> {
    return Buildee<FT>().apply(instructions)
}

class UserKlass<|endoftext|>


Prompt:
val enumEntryStub: EnumEntryStub,
                override val annotations: List<AnnotationStub> = emptyList()
        ) : Getter()
    }

    sealed class Setter : PropertyAccessor() {

        override val parameters: List<FunctionParameterStub> = emptyList()

        class SimpleSetter(

Response:
override val annotations: List<AnnotationStub> = emptyList()
        ) : Setter()

        class ExternalSetter(
                override val annotations: List<AnnotationStub> = emptyList()
        ) : Setter()

        class MemberAt(
                val offset: Long,
                override val annotations: List<AnnotationStub> = emptyList(),<|endoftext|>


Prompt:
fun foo(e: E): String = when (e) {
    E.A -> "A"
    E.B -> "B"
    else -> ""
}

fun bar(e: E?): String = when (e) {
    E.A -> "A"
    E.B -> "B"
    else -> "" // no warning
}

fun foo(b: Boolean) = when (b) {

Response:
true -> 1
    false -> 0
    else -> -1
}

fun useJava(): String {
    val me = MyEnum.getInstance()
    return when (me) {
        MyEnum.SINGLE -> "OK"
        else -> "FAIL" // no warning
    }
}<|endoftext|>


Prompt:
project.configurations.maybeCreate(EmbeddedComponents.CONFIGURATION_NAME)
        project.extensions.create("pill", PillExtension::class.java)

        // 'jpsTest' does not require the 'tests-jar' artifact
        project.configurations.create("jpsTest")

        if (project == project.rootProject) {
            project.tasks.register("pill") {

Response:
dependsOn(":pill:pill-importer:pill")

                if (System.getProperty("pill.android.tests", "false") == "true") {
                    TaskUtils.useAndroidSdk(this)
                    TaskUtils.useAndroidJar(this)
                }
            }

            project.tasks.register("unpill") {<|endoftext|>


Prompt:
// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses

OPTIONAL_JVM_INLINE_ANNOTATION
value class Foo(val a: String) {
    fun test(): String {
        return a + inlineFun()
    }
}

inline fun inlineFun(): String = "K"

fun box(): String {

Response:
val f = Foo("O")
    return f.test()
}<|endoftext|>


Prompt:
val nativeCompilerOptionsHelperFqName = FqName(
        "${nativeInterfaceFqName.asString()}$IMPLEMENTATION_HELPERS_SUFFIX"
    )
    withPrinterToFile(fileFromFqName(srcDir, nativeCompilerOptionsHelperFqName)) {
        generateCompilerOptionsHelper(
            nativeInterfaceFqName,

Response:
nativeCompilerOptionsHelperFqName,
            commonCompilerHelper,
            k2NativeCompilerArgumentsFqName,
            nativeOptions
        )
    }
}

private fun generateJsDceOptions(
    apiSrcDir: File,
    commonToolOptions: GeneratedOptions,
    withPrinterToFile: (targetFile: File, Printer.() -> Unit) -> Unit<|endoftext|>


Prompt:
Outer<Int>().Inner("", y, 1) checkType { _<Outer<Int>.Inner<String>>() }
    Outer<Int>().Inner<CharSequence, String, Int>("", y, 1) checkType { _<Outer<Int>.Inner<CharSequence>>() }

Response:
Outer<Int>().Inner("", x, 1) checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Outer<Int>.Inner<Any>>() }
    Outer<Int>().Inner<CharSequence, String, Int>("", <!ARGUMENT_TYPE_MISMATCH!>x<!>, 1)
}<|endoftext|>


Prompt:
materialized: Boolean,
    ): Type {
        if (type.isError()) {
            val name = type.getNameForErrorType() ?: NON_EXISTENT_CLASS_NAME
            val jvmType = Type.getObjectType(name)
            with(context) { sw?.writeGenericType(type, jvmType, mode) }
            return jvmType
        }

Response:
val typeConstructor = type.typeConstructor()

        if (type is SimpleTypeMarker) {
            val builtInType = mapBuiltInType(type, AsmTypeFactory, mode)
            if (builtInType != null) {
                val asmType = boxTypeIfNeeded(builtInType, mode.needPrimitiveBoxing)<|endoftext|>


Prompt:
import kotlin.script.experimental.api.asSuccess
import kotlin.script.experimental.dependencies.impl.makeResolveFailureResult

@ExperimentalContracts
class ResolversTest : ResolversTestBase() {

    private fun <T> withTempFile(body: (file: File) -> T): T {
        val file = Files.createTempFile(null, null).toFile()

Response:
file.deleteOnExit()
        try {
            return body(file)
        } finally {
            file.delete()
        }
    }

    private fun getNonExistingFile() = withTempFile { it }.also { assertFalse(it.exists()) }

    fun testFileSystemResolver() {
        withTempFile { file ->

            val resolver = FileSystemDependenciesResolver()<|endoftext|>


Prompt:
// Number after an exponent were validated already.
        s.forEach {
            if (it < '0' || it > '9') {
                throw NumberFormatException()
            }
        }

        length = s.length
        if (length == 0)
            throw NumberFormatException()

        end = length
        while (end > 1 && s[end - 1] == '0')
            --end

Response:
start = 0
        while (start < end - 1 && s[start] == '0')
            start++

        if (end != length || start != 0) {
            shift = length - end
            if (e <= 0 || Int.MAX_VALUE - e > shift) {
                e += shift
            }
            s = s.substring(start, end)
        }<|endoftext|>


Prompt: ExpectedData(0x9c9e5be0943d4b05UL, 0xc738a77a9a55f0e2UL, 0x705221addedd81dfUL, 0xfd9bd8d397abcfa3UL, 0x8ccf0004aa86b795UL),

Response: ExpectedData(0x3898bca4dfd6638dUL, 0x9b82567ab6560796UL, 0x891b69462b41c224UL, 0x8eccc7e4f3af3b51UL, 0x381e54c3c8f1c7d0UL),<|endoftext|>


Prompt:
* Returns a view with the [JsReadonlyMap] methods to consume it in JavaScript as a regular readonly Map.
     * Structural changes in the base map are synchronized with the view.
     */
    @ExperimentalJsExport
    @ExperimentalJsCollectionsApi
    @SinceKotlin("2.0")

Response:
public fun asJsReadonlyMapView(): JsReadonlyMap<K, V> = createJsReadonlyMapViewFrom(this)
}

/**
 * A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving
 * the value corresponding to each key. Map keys are unique; the map holds only one value for each key.<|endoftext|>


Prompt:
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtAnonymousInitializer
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.psi.KtPureClassOrObject

Response:
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.typeUtil.*<|endoftext|>


Prompt:
val mset = MS()
    val hashSet = HashSet<String>()

    safeAsReturnsNull("set as? MutableIterable") { set as? MutableIterable<*> }
    safeAsReturnsNull("set as? MutableCollection") { set as? MutableCollection<*> }
    safeAsReturnsNull("set as? MutableSet") { set as? MutableSet<*> }

Response:
safeAsReturnsNonNull("mset as? MutableIterable") { mset as? MutableIterable<*> }
    safeAsReturnsNonNull("mset as? MutableCollection") { mset as? MutableCollection<*> }
    safeAsReturnsNonNull("mset as? MutableSet") { mset as? MutableSet<*> }<|endoftext|>


Prompt:
// MODULE: context

// FILE: context.kt
fun test() {
    1.ext
}

val Int.ext: String
    get() {
        <caret_context>return "foo"
    }

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

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

Response: this@ext.dec()<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Number?")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Number")!>y<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>z<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Number"), DEBUG_INFO_SMARTCAST!>y<!>.inv()
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>z<!>.inv()
    }
}<|endoftext|>


Prompt:
override fun getContributedDescriptors(
        kindFilter: DescriptorKindFilter,
        nameFilter: (Name) -> Boolean,
        changeNamesForAliased: Boolean
    ): Collection<DeclarationDescriptor> = emptyList()
}

class CompositePrioritizedImportingScope(
    private val primaryScope: ImportingScope,
    private val secondaryScope: ImportingScope,
) : ImportingScope {

Response:
override val parent: ImportingScope?
        get() = primaryScope.parent ?: secondaryScope.parent

    override fun getContributedPackage(name: Name): PackageViewDescriptor? {
        return primaryScope.getContributedPackage(name) ?: secondaryScope.getContributedPackage(name)
    }

    override fun getContributedDescriptors(
        kindFilter: DescriptorKindFilter,<|endoftext|>


Prompt:
setOf(CommonizerTarget(LINUX_X64, MACOS_X64)),
            setOf(linuxInterop, macosInterop)
        )

        assertEquals(
            group, findCInteropCommonizerGroup(expectCInteropCommonizerDependent(nativeMain))
        )

        assertEquals(

Response:
group, findCInteropCommonizerGroup(expectCInteropCommonizerDependent(expectSharedNativeCompilation(nativeMain)))
        )

        assertNull(
            findCInteropCommonizerDependent(nativeTest),
            "Expected 'nativeTest' to not be CInteropCommonizer dependent"
        )
    }

    @Test<|endoftext|>


Prompt:
// FIR_IDENTICAL
// FILE: A.java

public class A extends B {
    public int getFoo() { return 0; }
}

// FILE: F.java

public class F extends B {
    public final int getFoo() { return 0; }
}

// FILE: main.kt

open class B {
    open val foo: Int = 1
}

Response:
class C1 : A() {
    override val foo: Int = 2
}

class C2 : F() {
    <!OVERRIDING_FINAL_MEMBER!>override<!> val foo: Int = 3
}<|endoftext|>


Prompt:
fun `test - simple resolved binary dependency`() {
        val dependency = TestIdeaKotlinInstances.simpleResolvedBinaryDependency
        val binary = TestIdeaKotlinDependencySerializer().serialize(dependency)
        val deserialized = deserializeIdeaKotlinDependencyWithBackwardsCompatibleClasses(binary)

Response:
val deserializedCopied = deserialized.copy<IdeaKotlinResolvedBinaryDependency>()

        assertEquals(dependency.coordinates, deserializedCopied.coordinates)
        assertEquals(dependency.binaryType, deserializedCopied.binaryType)
        assertEquals(dependency.classpath, deserializedCopied.classpath)<|endoftext|>


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

Response:
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) tailrec fun testIdenticalPresenceOfTailrecModifier()<!> {}
    <!CONFLICTING_OVERLOADS!>tailrec fun testIdenticalPresenceOfTailrecModifier()<!> {}<|endoftext|>


Prompt:
override fun <R, D> accept(contractDescriptionVisitor: ContractDescriptionVisitor<R, D>, data: D): R =
        contractDescriptionVisitor.visitLogicalAnd(this, data)
}

class LogicalNot(val arg: BooleanExpression) : BooleanExpression {

Response:
override fun <R, D> accept(contractDescriptionVisitor: ContractDescriptionVisitor<R, D>, data: D): R =
        contractDescriptionVisitor.visitLogicalNot(this, data)
}<|endoftext|>


Prompt:
//If a receiver type is not null, then this safe expression is useless, and we don't need to make the result type nullable.
        val expressionType = trace.getType(expression.receiverExpression)
        return expressionType != null && TypeUtils.isNullableType(expressionType)
    }

    internal fun bind(trace: BindingTrace, resolvedCall: ResolvedCall<*>) {

Response:
(resolvedCall as? NewAbstractResolvedCall<*>)?.let { bind(trace, it) }
        (resolvedCall as? NewVariableAsFunctionResolvedCallImpl)?.let { bind(trace, it) }
    }

    fun reportDiagnostics(
        context: BasicCallResolutionContext,
        trace: BindingTrace,
        resolvedCall: NewAbstractResolvedCall<*>,<|endoftext|>


Prompt:
private val currentTransformerPhase = ThreadLocal.withInitial<FirResolvePhase?> { null }

    inline fun lazyResolveToPhaseInside(phase: FirResolvePhase, resolve: () -> Unit) {
        checkIfCanLazyResolveToPhase(phase)

        val previousPhase = currentTransformerPhase.get()
        currentTransformerPhase.set(phase)
        try {
            resolve()

Response:
} finally {
            currentTransformerPhase.set(previousPhase)
        }
    }

    private fun checkIfCanLazyResolveToPhase(requestedPhase: FirResolvePhase) {
        val currentPhase = currentTransformerPhase.get() ?: return

        if (!currentPhase.isItAllowedToCallLazyResolveTo(requestedPhase)) {<|endoftext|>


Prompt:
* * cleaners that are referenced from globals will not be garbage collected at all,
 * * cleaners that become unreferenced just before exiting main() might not be garbage collected,
     because the GC might not get a chance to run.
 *
 * @param resource an object for which to perform [cleanupAction]
 * @param cleanupAction a cleanup to perform on [resource]. Must not capture anything.
 */

Response:
// TODO: Consider just annotating the lambda argument rather than hardcoding checking
// by function name in the compiler.
@ExperimentalNativeApi
@SinceKotlin("1.9")
@ExportForCompiler
public fun <T> createCleaner(resource: T, cleanupAction: (resource: T) -> Unit): Cleaner =
        createCleanerImpl(resource, cleanupAction)

@ExperimentalNativeApi<|endoftext|>