Prompt:
package org.jetbrains.kotlin.gradle.internal.testing

import jetbrains.buildServer.messages.serviceMessages.ServiceMessage
import jetbrains.buildServer.messages.serviceMessages.ServiceMessageParserCallback
import jetbrains.buildServer.messages.serviceMessages.TestFailed
import org.gradle.api.GradleException

Response:
import org.jetbrains.kotlin.gradle.internal.testing.TCServiceMessageOutputStreamHandler.Companion.MESSAGE_LIMIT_BYTES
import org.slf4j.Logger
import java.io.ByteArrayOutputStream
import java.io.IOException
import java.io.OutputStream

/**
 * Provides output stream that handles lines and parsing it for TeamCity server messages.<|endoftext|>


Prompt:
// This file was generated automatically. See compiler/ir/ir.tree/tree-generator/ReadMe.md.
// DO NOT MODIFY IT MANUALLY.

package org.jetbrains.kotlin.ir.visitors

import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement

Response:
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.types.IrType

/**
 * Auto-generated by [org.jetbrains.kotlin.ir.generator.print.TypeTransformerPrinter]
 */<|endoftext|>


Prompt: fooLamdbdaVar\21:int=2:int, barParam\22:int=2:int, $i$f$bar\22\56:int=0:int, barVar\22:int=2:int, barLambdaParam\23:int=1:int, $i$a$-bar-TestKt$box$1$1\23\236\21:int=0:int,

Response: barLamdbdaVar\23:int=3:int<|endoftext|>


Prompt:
public int getSize() {
        return 0;
    }

    @Override
    public void add(int i, Integer integer) {}

    @Override
    public Integer removeAt(int i) {
        return null;
    }

    @Override
    public Integer get(int index) {
        return null;
    }

    @Override
    public Integer set(int i, Integer integer) {

Response:
return null;
    }
}

// FILE: 1.kt
class A : Java1()<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
import org.jetbrains.kotlin.psi.KtDestructuringDeclarationEntry

class KtFirDestructuringDeclarationReference(
    element: KtDestructuringDeclarationEntry
) : KtDestructuringDeclarationReference(element), KtFirReference {

Response:
override fun canRename(): Boolean = false //todo

    override fun KtAnalysisSession.resolveToSymbols(): Collection<KtSymbol> {
        check(this is KtFirAnalysisSession)
        val fir = expression.getOrBuildFirSafe<FirProperty>(firResolveSession) ?: return emptyList()
        return listOfNotNull(<|endoftext|>


Prompt:
import b.<!UNRESOLVED_REFERENCE!>constant<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>fff<!>     //function from val
import b.<!UNRESOLVED_REFERENCE!>constant<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>dValue<!>  //property from val

Response:
import b.constant
import b.E.Companion.f      //val from companion object
import <!UNRESOLVED_REFERENCE!>smth<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>illegal<!><|endoftext|>


Prompt:
LONG -> KmAnnotationArgument.ULongValue(intValue.toULong())
            else -> error("Cannot read value of unsigned type: $type")
        }
    }

    return when (type) {
        BYTE -> KmAnnotationArgument.ByteValue(intValue.toByte())
        CHAR -> KmAnnotationArgument.CharValue(intValue.toInt().toChar())

Response:
SHORT -> KmAnnotationArgument.ShortValue(intValue.toShort())
        INT -> KmAnnotationArgument.IntValue(intValue.toInt())
        LONG -> KmAnnotationArgument.LongValue(intValue)
        FLOAT -> KmAnnotationArgument.FloatValue(floatValue)
        DOUBLE -> KmAnnotationArgument.DoubleValue(doubleValue)<|endoftext|>


Prompt:
public fun assertSame(message: String?, expected: Any?, actual: Any?): Unit {
        assertTrue({ messagePrefix(message) + "Expected <$expected>, actual <$actual> is not same." }, actual === expected)
    }

    /**
     * Asserts that the specified values are not the same instance.
     *
     * @param message the message to report if the assertion fails.
     */

Response:
public fun assertNotSame(message: String?, illegal: Any?, actual: Any?): Unit {
        assertTrue({ messagePrefix(message) + "Expected not same as <$actual>." }, actual !== illegal)
    }

    /**
     * Asserts that the specified value is `null`.
     *
     * @param message the message to report if the assertion fails.
     */<|endoftext|>


Prompt:
NullPointer(llvm.int32Type), NullPointer(llvm.int8Type), NullPointer(llvm.int8PtrType),
                    debugOperationsSize, debugOperations)
        } else {
            class FieldRecord(val offset: Int, val type: Int, val name: String)

            val fields = context.getLayoutBuilder(irClass).getFields(llvm).map {

Response:
val index = llvmDeclarations.fieldIndices[it.irFieldSymbol]!!
                FieldRecord(
                        LLVMOffsetOfElement(llvmTargetData, bodyType, index).toInt(),
                        mapRuntimeType(LLVMStructGetTypeAtIndex(bodyType, index)!!),
                        it.name)
            }<|endoftext|>


Prompt:
): CDPMethodInvocationResult
}

private suspend inline fun <reified T : CDPMethodInvocationResult> CDPRequestEvaluator.evaluateRequest(
    noinline body: (Int) -> Pair<String, CDPMethodCallEncodingInfo>
) = genericEvaluateRequest(body) as T

/**

Response:
* The [`Runtime` domain](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/) of Chrome DevTools protocol.
 */
class Runtime(private val requestEvaluator: CDPRequestEvaluator) {

    /**
     * Enables reporting of execution contexts creation by means of [Runtime.Event.ExecutionContextCreated] event.<|endoftext|>


Prompt:
get() = rootPackageJsonFile.getFile()

    @get:PathSensitive(PathSensitivity.RELATIVE)
    @get:IgnoreEmptyDirectories
    @get:NormalizeLineEndings
    @get:InputFiles
    val packageJsonFiles: List<RegularFile> by lazy {
        rootResolver.projectResolvers.values
            .flatMap { it.compilationResolvers }

Response:
.map { it.compilationNpmResolution }
            .map { resolution ->
                val name = resolution.npmProjectName
                packagesDir.map { it.dir(name).file(NpmProject.PACKAGE_JSON) }.get()
            }
    }

    @TaskAction
    fun resolve() {<|endoftext|>


Prompt:
val interopObjCProtocol = interopClass(InteropFqNames.objCProtocolName)

    val interopObjCRelease = interopFunction("objc_release")

    val interopObjCRetain = interopFunction("objc_retain")

    val interopObjcRetainAutoreleaseReturnValue = interopFunction("objc_retainAutoreleaseReturnValue")

Response:
val interopCreateObjCObjectHolder = interopFunction("createObjCObjectHolder")

    val interopCreateKotlinObjectHolder = interopFunction("createKotlinObjectHolder")
    val interopUnwrapKotlinObjectHolderImpl = interopFunction("unwrapKotlinObjectHolderImpl")

    val interopCreateObjCSuperStruct = interopFunction("createObjCSuperStruct")<|endoftext|>


Prompt:
IrConstKind.String -> buildLiteralExpression(
                            source = null,
                            ConstantValueKind.String,
                            argument.value as String,
                            setType = true
                        )
                    }
                }
            }
        }
    }

    private object GeneratedForMetadata : GeneratedDeclarationKey()

    private inner class Provider : FirAdditionalMetadataProvider() {

Response:
override fun findGeneratedAnnotationsFor(declaration: FirDeclaration): List<FirAnnotation> {
            val irAnnotations = extractGeneratedIrDeclarations(declaration).takeUnless { it.isEmpty() } ?: return emptyList()
            return irAnnotations.map { it.toFirAnnotation() }
        }<|endoftext|>


Prompt:
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty

internal sealed class SlotType {
    // An object is statically allocated on stack.
    object STACK : SlotType()

    // Frame local arena slot can be used.
    object ARENA : SlotType()

    // Return slot can be used.
    object RETURN : SlotType()

Response:
// Return slot, if it is an arena, can be used.
    object RETURN_IF_ARENA : SlotType()

    // Param slot, if it is an arena, can be used.
    class PARAM_IF_ARENA(val parameter: Int) : SlotType()

    // Params slot, if it is an arena, can be used.<|endoftext|>


Prompt:
* UNEXPECTED BEHAVIOUR
 * ISSUES: KT-30376
 */
fun case_2(x: Class?) {
    if ((x as Class).prop_8?.prop_8?.prop_8?.prop_8 !== null) {
        <!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
        <!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<|endoftext|>


Prompt:
fieldAnnotations, static, overriddenNode, defaultMethodsImplementationSourceNode, oldGetter, modality, oldField
    ).also {
        updateAnnotationsAndPropertyFromOldProperty(oldProperty, context, it)
    }
}

fun createIntermediateNodeForStandaloneMfvcField(
    parent: IrClass,
    context: JvmBackendContext,
    oldField: IrField,

Response:
): IntermediateMfvcNode {
    val type = oldField.type
    require(type is IrSimpleType && type.needsMfvcFlattening()) { "Expected MFVC but got ${type.render()}" }
    return createIntermediateMfvcNode(
        parent, context, type, makeTypeArgumentsFromType(type), MethodFullNameMode.Getter, listOf(oldField.name),<|endoftext|>


Prompt:
private fun generateGenericArrayCheck(argument: IrExpression) =
                JsIrBuilder.buildCall(isArraySymbol).apply { putValueArgument(0, argument) }

            private fun generateNumberCheck(argument: IrExpression) =
                JsIrBuilder.buildCall(context.intrinsics.isNumberSymbol).apply { putValueArgument(0, argument) }

Response:
private fun generateComparableCheck(argument: IrExpression) =
                JsIrBuilder.buildCall(context.intrinsics.isComparableSymbol).apply { putValueArgument(0, argument) }

            private fun generateCharSequenceCheck(argument: IrExpression) =<|endoftext|>


Prompt:
reporter.reportOn(
                    defaultValue.source,
                    ComposeErrors.ABSTRACT_COMPOSABLE_DEFAULT_PARAMETER_VALUE,
                    context
                )
            }
        }

        // Composable main functions are not allowed.
        if (declaration.symbol.isMain(context.session)) {

Response:
reporter.reportOn(declaration.source, ComposeErrors.COMPOSABLE_FUN_MAIN, context)
        }

        // Disallow composable setValue operators
        if (declaration.isOperator &&
            declaration.nameOrSpecialName == OperatorNameConventions.SET_VALUE
        ) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.unwrapParenthesesLabelsAndAnnotations
import org.jetbrains.kotlin.utils.exceptions.errorWithAttachment
import org.jetbrains.kotlin.utils.exceptions.withPsiEntry

internal class KtFirExpressionInfoProvider(

Response:
override val analysisSession: KtFirAnalysisSession,
    override val token: KtLifetimeToken,
) : KtExpressionInfoProvider(), KtFirAnalysisSessionComponent {
    override fun getReturnExpressionTargetSymbol(returnExpression: KtReturnExpression): KtCallableSymbol? {<|endoftext|>


Prompt:
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION

// FILE: foo.kt

package test

typealias ClassAlias = ClassSample
typealias ObjectAlias = ObjectSample
typealias EnumAlias = EnumSample

class ClassSample {
    class Nested {
        fun func() {}
    }

    fun func() {}
}

object ObjectSample {

Response:
class Nested {
        fun func() {}
    }

    fun func() {}
}

enum class EnumSample {
    Entry;

    class Nested {
        fun func() {}
    }

    fun func() {}
}

// FILE: test.kt

fun foo(
    a0: test.ClassSample.Nested,<|endoftext|>


Prompt:
assertFails { sb.setRange(sb.length + 1, sb.length + 2, "") }
        }
    }

    @Test
    fun toCharArray() {
        StringBuilder("my toCharArray test").let { sb ->
            val chars = CharArray(10) { '_' }

            sb.toCharArray(chars, 8, 0, 2)

Response:
assertEquals("________my", chars.concatToString())
            sb.toCharArray(chars, 3, 6, 11)
            assertEquals("___harArmy", chars.concatToString())
            sb.toCharArray(chars, 0, 16, 19)
            assertEquals("estharArmy", chars.concatToString())

            sb.setLength(5)<|endoftext|>


Prompt:
package org.jetbrains.kotlin.test.preprocessors

import org.jetbrains.kotlin.test.model.TestFile
import org.jetbrains.kotlin.test.services.ReversibleSourceFilePreprocessor
import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.isExternalAnnotation

/**

Response:
* This preprocessor is required to drop '//' comments from the file to avoid exceptions from XML parser
 */
class ExternalAnnotationsSourcePreprocessor(testServices: TestServices) : ReversibleSourceFilePreprocessor(testServices) {
    override fun process(file: TestFile, content: String): String = if (file.isExternalAnnotation) {<|endoftext|>


Prompt:
signature: (Function) -> Signature
): Set<Bridge<Signature, Function>> {
    // If it's an abstract function, no bridges are needed: when an implementation will appear in some concrete subclass, all necessary
    // bridges will be generated there
    if (function.isAbstract) return setOf()

    val fake = !function.isDeclaration

Response:
// If it's a concrete fake override and all of its super-functions are concrete, then every possible bridge is already generated
    // into some of the super-classes and will be inherited in this class
    if (fake && function.getOverridden().none { it.isAbstract }) return setOf()

    val implementation = findConcreteSuperDeclaration(function) ?: return setOf()<|endoftext|>


Prompt:
|  KObjHeader* result = ${cname}_instance(result_holder.slot());
            |  return $objectClassC { .pinned = CreateStablePointer(result)};
            |}
            """.trimMargin()
        } else ""
        return "$typeGetter$instanceGetter"
    }

    fun makeEnumEntryDeclaration(): String {

Response:
assert(isEnumEntry)
        val enumClass = declaration.containingDeclaration as ClassDescriptor
        val enumClassC = typeTranslator.translateType(enumClass.defaultType)

        return """
              |extern "C" KObjHeader* $cname(KObjHeader**);
              |static $enumClassC ${cname}_impl(void) {<|endoftext|>


Prompt:
package kotlin.script.experimental.jvm

import java.lang.reflect.InvocationTargetException
import kotlin.reflect.KClass
import kotlin.script.experimental.api.*
import kotlin.script.experimental.impl._languageVersion

open class BasicJvmScriptEvaluator : ScriptEvaluator {

    override suspend operator fun invoke(

Response:
compiledScript: CompiledScript,
        scriptEvaluationConfiguration: ScriptEvaluationConfiguration
    ): ResultWithDiagnostics<EvaluationResult> = try {
        compiledScript.getClass(scriptEvaluationConfiguration).onSuccess { scriptClass ->

            // configuration shared between all module scripts
            val sharedConfiguration = scriptEvaluationConfiguration.getOrPrepareShared(scriptClass.java.classLoader)<|endoftext|>


Prompt:
xs.forEach(this::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>contains<!>) // resolved to (2) in 1.7.0-RC, should be error "Type checking has run into a recursive problem"
}

fun Any.contains(vararg xs: Int) {} // 2

fun box(): String {

Response:
object : Foo() {}.contains(1)
    return "OK"
}<|endoftext|>


Prompt:
contract { returns(false) implies (this@case_25_1 == null || this@case_25_1 !is String || value_1 == null) }
    return !(this@case_25_1 == null || this@case_25_1 !is String || value_1 == null)
}
fun <T> T?.case_25_2(value_1: Int?): Boolean? {

Response:
contract { returnsNotNull() implies (this@case_25_2 == null || this@case_25_2 !is String || value_1 == null) }
    return if (this@case_25_2 == null || this@case_25_2 !is String || value_1 == null) true else null
}
fun <T> T?.case_25_3(value_1: Int?): Boolean? {<|endoftext|>


Prompt:
LLFirSessionConfigurator.configure(this)
        }
    }

    abstract fun createDanglingFileSession(module: KtDanglingFileModule, contextSession: LLFirSession): LLFirSession

    protected fun doCreateDanglingFileSession(
        module: KtDanglingFileModule,
        contextSession: LLFirSession,

Response:
additionalSessionConfiguration: context(DanglingFileSessionCreationContext) LLFirDanglingFileSession.() -> Unit,
    ): LLFirSession {
        val danglingFile = module.file
        val platform = module.platform

        val builtinsSession = LLFirBuiltinsSessionFactory.getInstance(project).getBuiltinsSession(platform)<|endoftext|>


Prompt:
// this class is transformed and original not used so we should remove original one after inlining
                        result.addClassToRemove(oldClassName)
                    }

                    if (transformResult.reifiedTypeParametersUsages.wereUsedReifiedParameters()) {
                        ReifiedTypeInliner.putNeedClassReificationMarker(mv)

Response:
result.reifiedTypeParametersUsages.mergeAll(transformResult.reifiedTypeParametersUsages)
                    }

                    for (classBuilder in childInliningContext.continuationBuilders.values) {
                        classBuilder.done(inliningContext.state.config.generateSmapCopyToAnnotation)
                    }
                } else {
                    result.addNotChangedClass(oldClassName)
                }
            }<|endoftext|>


Prompt:
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_1.<!UNRESOLVED_REFERENCE!>length<!>)
        <!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_2?.<!UNRESOLVED_REFERENCE!>toByte<!>())
    }

Response:
if (funWithReturnsNull(value_1 is Float? && value_1 != null && value_2 != null) != null) {
        println(value_1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>dec<!>())<|endoftext|>


Prompt:
getSymbolsFromImportingScope(importScopeContext, fqName, KtScopeKind.DefaultStarImportingScope::class).ifNotEmpty { return this }
        return emptyList()
    }

    private fun KtAnalysisSession.getSymbolsFromDeclaration(name: Name, owner: KtDeclaration): List<KtSymbol> = buildList {

Response:
if (owner is KtNamedDeclaration) {
            if (owner.nameAsName == name) {
                add(owner.getSymbol())
            }
        }
        if (owner is KtTypeParameterListOwner) {
            for (typeParameter in owner.typeParameters) {
                if (typeParameter.nameAsName == name) {
                    add(typeParameter.getTypeParameterSymbol())
                }<|endoftext|>


Prompt:
primaryArtifactContent.resolve("sourceSetA-cinterop/interopA0"), interopA0MetadataFile,
                        "Expected correct content for extracted 'interopA0'"
                    )
                }

                /* Assertions on interopA1 */
                run {

Response:
val interopA1MetadataFile = sourceSetAInteropMetadataFiles.firstOrNull { it.name == "interopA1.klib" }
                        ?: fail("Failed to find 'interopA1.klib")
                    assertZipContentEquals(
                        temporaryFolder,<|endoftext|>


Prompt:
val boundB = Scheme(Token("one"), listOf(Scheme(Token("two"))))
        assertEquals(boundA, boundB)
    }

    @Test
    fun testSerialization() {
        val uiToken = Token("androidx.compose.ui.UI")
        val ui = Scheme(uiToken)
        val a = Open(-1)

Response:
val aScheme = Scheme(a)
        val z = Open(0)
        val one = Open(1)
        val oneScheme = Scheme(one)
        val schemes = listOf(
            ui,
            Scheme(z, listOf(Scheme(z))),
            Scheme(Token("This is a really long token with special chars [],_,123")),<|endoftext|>


Prompt:
// test.kt:17 box
// test.kt:7 box
// test.kt:8 box
// test.kt:17 box
// test.kt:18 box
// test.kt:10 box
// test.kt:16 box
// test.kt:17 box
// test.kt:11 box
// test.kt:12 box
// test.kt:17 box
// test.kt:18 box

Response:
// test.kt:13 box

// EXPECTATIONS JS_IR
// test.kt:16 box
// test.kt:7 box
// test.kt:16 box
// test.kt:11 box
// test.kt:13 box

// EXPECTATIONS WASM
// test.kt:6 $box
// test.kt:16 $box (12, 4, 12, 4)<|endoftext|>


Prompt:
typeParameterName.lowercase()
                }
            }

            return ValueParameterDescriptorImpl(
                containingDeclaration, null, index,
                Annotations.EMPTY,
                Name.identifier(name),
                typeParameter.defaultType,
                declaresDefaultValue = false,
                isCrossinline = false,
                isNoinline = false,
                varargElementType = null,

Response:
SourceElement.NO_SOURCE
            )
        }
    }
}<|endoftext|>


Prompt:
fun isSubtypeForTypeMismatch(context: ConeInferenceContext, subtype: ConeKotlinType, supertype: ConeKotlinType): Boolean {
    val subtypeFullyExpanded = subtype.fullyExpandedType(context.session)
    val supertypeFullyExpanded = supertype.fullyExpandedType(context.session)

Response:
return AbstractTypeChecker.isSubtypeOf(context, subtypeFullyExpanded, supertypeFullyExpanded)
}

fun FirCallableDeclaration.isVisibleInClass(parentClass: FirClass): Boolean {
    return symbol.isVisibleInClass(parentClass.symbol, symbol.resolvedStatus)
}<|endoftext|>


Prompt:
package org.jetbrains.kotlin.config

enum class JVMAssertionsMode(val description: String) {
    ALWAYS_ENABLE("always-enable"),
    ALWAYS_DISABLE("always-disable"),
    JVM("jvm"),
    LEGACY("legacy");

    companion object {
        @JvmField
        val DEFAULT = LEGACY

Response:
@JvmStatic
        fun fromStringOrNull(string: String?) = entries.find { it.description == string }

        @JvmStatic
        fun fromString(string: String?) = fromStringOrNull(string) ?: DEFAULT
    }
}<|endoftext|>


Prompt:
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = "delegation"

    operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
        // setValue
    }

    operator fun provideDelegate(thisRef: Any?, property: KProperty<*>): Delegate {
        // side effect
        return Delegate()
    }

Response: }<|endoftext|>


Prompt: select(id(::foo5), id { x: A -> }, id { x: B -> }, id { <!DEBUG_INFO_EXPRESSION_TYPE("C")!>it<!> })

Response:
val x2: (Int) -> Unit = selectNumber(id(::foo6), id { x -> <!DEBUG_INFO_EXPRESSION_TYPE("{Comparable<*> & Number}")!>x<!> }, id { <!DEBUG_INFO_EXPRESSION_TYPE("{Comparable<*> & Number}")!>it<!> })
}<|endoftext|>


Prompt:
fun testFusStatisticsWithConfigurationCache(gradleVersion: GradleVersion, isProjectIsolationEnabled: Boolean) {
        project(
            "simpleProject",
            gradleVersion,
            buildOptions = defaultBuildOptions.copy(
                configurationCache = true,
                projectIsolation = isProjectIsolationEnabled,
                buildReport = listOf(BuildReportType.FILE)
            ),
        ) {
            build(

Response:
"compileKotlin",
                "-Pkotlin.session.logger.root.path=$projectPath",
            ) {
                assertConfigurationCacheStored()
                assertFileContains(
                    fusStatisticsPath,
                    *expectedMetrics,
                    "CONFIGURATION_IMPLEMENTATION_COUNT=1",
                    "NUMBER_OF_SUBPROJECTS=1",<|endoftext|>


Prompt:
"Test class ${irClass.fqNameWhenAvailable ?: irClass.name} must declare a public or internal constructor with no explicit parameters"
            else -> null
        }

        if (exceptionMessage != null) {
            val irBuilder = context.createIrBuilder(fn.symbol)
            body.statements += irBuilder.irCall(context.irBuiltIns.illegalArgumentExceptionSymbol).apply {

Response:
putValueArgument(0, irBuilder.irString(exceptionMessage))
            }

            return
        }

        val classVal = JsIrBuilder.buildVar(irClass.defaultType, fn, initializer = irClass.instance())

        body.statements += classVal

        body.statements += beforeFuns.map {
            JsIrBuilder.buildCall(it.symbol).apply {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualCompatibility
import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualCompatibility.MismatchOrIncompatible
import org.jetbrains.kotlin.serialization.deserialization.IncompatibleVersionErrorData
import org.jetbrains.kotlin.types.Variance

/*

Response:
* This file was generated automatically
 * DO NOT MODIFY IT MANUALLY
 */

internal class UnsupportedImpl(
    override val unsupported: String,
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.Unsupported<|endoftext|>


Prompt: if (y != null || <!SENSELESS_COMPARISON!>this.y != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>y<!>.funAny()

Response: if (y != null || <!SENSELESS_COMPARISON!>this.y != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit? & kotlin.Unit")!>y<!>.funNullableT()<|endoftext|>


Prompt:
override fun visitReturn(expression: IrReturn): IrExpression {
                expression.transformChildrenVoid(this)

                return if (expression.returnTargetSymbol != simplifiedFunction.symbol)
                    expression
                else
                    JsIrBuilder.buildReturn(stateMachineFunction.symbol, expression.value, expression.type)
            }
        })

Response:
val liveLocals = computeLivenessAtSuspensionPoints(functionBody).values.flatten().toSet()

        val localToPropertyMap = hashMapOf<IrValueSymbol, IrFieldSymbol>()
        var localCounter = 0
        // TODO: optimize by using the same property for different locals.
        liveLocals.forEach {<|endoftext|>


Prompt: xBaz1\2$iv:int=100:int, xBaz2\2$iv:int=101:int, xBaz3\2$iv:int=102:int, $i$f$baz\2\31:int=0:int, $i$f$x1\3\35:int=0:int, x1\3$iv:int=1:int

Response: // library.kt:19 box: xFoo$iv:int=1:int, $i$f$foo:int=0:int, xBar1\1$iv:int=0:int, xBar2\1$iv:int=1:int, xBar3\1$iv:int=2:int, $i$f$bar\1\6:int=0:int,<|endoftext|>


Prompt:
* The set of optimizations relies on current compiler configuration.
 * In case of debug we do almost nothing (that's why we need [createLTOPipelineConfigForRuntime]),
 * but for release binaries we rely on "closed" world and enable a lot of optimizations.
 */
internal fun createLTOFinalPipelineConfig(
        context: PhaseContext,
        targetTriple: String,
        closedWorld: Boolean,

Response:
timePasses: Boolean = false,
): LlvmPipelineConfig {
    val config = context.config
    val target = config.target
    val configurables: Configurables = config.platform.configurables
    val cpuModel = getCpuModel(context)
    val cpuFeatures = getCpuFeatures(context)
    val optimizationLevel: LlvmOptimizationLevel = when {<|endoftext|>


Prompt:
@SinceKotlin("1.3")
    const val MAX_VALUE: Char = '\uFFFF'
    const val MIN_HIGH_SURROGATE: Char = '\uD800'
    const val MAX_HIGH_SURROGATE: Char = '\uDBFF'
    const val MIN_LOW_SURROGATE: Char = '\uDC00'

Response:
const val MAX_LOW_SURROGATE: Char = '\uDFFF'
    const val MIN_SURROGATE: Char = MIN_HIGH_SURROGATE
    const val MAX_SURROGATE: Char = MAX_LOW_SURROGATE
    @SinceKotlin("1.3")
    const val SIZE_BYTES: Int = 2<|endoftext|>


Prompt:
private fun generateUtils(outputFile: File) {
    FileWriter(outputFile).use { writer ->
        writer.writeHeader(outputFile)
        writer.appendLine()
        writer.write("""

//workaround about method with receiver
internal fun powWrapper(x: Double, y: Double): Double = x.pow(y)

Response:
private fun getMantissa(d: Double): Double = Double.fromBits(((d.toBits().toULong() and 0x800fffffffffffffUL) or 0x3ff0000000000000UL).toLong())
private fun getExp(d: Double): Int = (((d.toBits() shr 52) and 0x7FF) - 1023).toInt()<|endoftext|>


Prompt:
public fun kotlin.LongArray.toMutableSet(): kotlin.collections.MutableSet<kotlin.Long>

public fun kotlin.ShortArray.toMutableSet(): kotlin.collections.MutableSet<kotlin.Short>

Response:
public fun <T> kotlin.collections.Iterable<T>.toMutableSet(): kotlin.collections.MutableSet<T>

@kotlin.internal.InlineOnly
public inline fun <K, V> kotlin.collections.Map.Entry<K, V>.toPair(): kotlin.Pair<K, V><|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor

enum class ProgressionDirection {
    DECREASING {
        override fun asReversed() = INCREASING
    },
    INCREASING {
        override fun asReversed() = DECREASING

Response:
},
    UNKNOWN {
        override fun asReversed() = UNKNOWN
    };

    abstract fun asReversed(): ProgressionDirection
}

/** Information about a loop that is required by [HeaderProcessor] to build a [ForLoopHeader]. */
sealed class HeaderInfo {
    /**
     * Returns a copy of this [HeaderInfo] with the values reversed.<|endoftext|>


Prompt:
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.platform.TargetPlatform
import org.jetbrains.kotlin.storage.StorageManager
import org.jetbrains.kotlin.utils.sure

class ModuleDescriptorImpl @JvmOverloads constructor(
    moduleName: Name,
    private val storageManager: StorageManager,

Response:
override val builtIns: KotlinBuiltIns,
    // May be null in compiler context, should be not-null in IDE context
    override val platform: TargetPlatform? = null,
    capabilities: Map<ModuleCapability<*>, Any?> = emptyMap(),
    override val stableName: Name? = null,
) : DeclarationDescriptorImpl(Annotations.EMPTY, moduleName), ModuleDescriptor {<|endoftext|>


Prompt:
arguments.addIfNotNull(receiverType?.asTypeProjection())

    parameterTypes.mapIndexedTo(arguments) { index, type ->
        val name = parameterNames?.get(index)?.takeUnless { it.isSpecial }
        val typeToUse = if (name != null) {
            val parameterNameAnnotation = BuiltInAnnotationDescriptor(
                builtIns,

Response:
StandardNames.FqNames.parameterName,
                mapOf(StandardNames.NAME to StringValue(name.asString()))
            )
            type.replaceAnnotations(Annotations.create(type.annotations + parameterNameAnnotation))
        }
        else {
            type
        }
        typeToUse.asTypeProjection()
    }<|endoftext|>


Prompt:
package org.jetbrains.kotlin.gradle.model.builder

import org.jetbrains.kotlin.gradle.model.KotlinProject
import org.junit.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue

class KotlinModelBuilderTest {
    @Test
    fun testCanBuild() {

Response:
val modelBuilder = KotlinModelBuilder("version", null)
        assertTrue(modelBuilder.canBuild(KotlinProject::class.java.name))
        assertFalse(modelBuilder.canBuild("wrongModel"))
    }
}<|endoftext|>


Prompt:
Assert.assertEquals(
                                "Diagnostics should be same",
                                expectedDiag.map { it.toString() },
                                actualDiag.map { it.toString() }
                            )
                        }
                    }
                    else -> {
                        Assert.fail("#$index: Expected $expectedRes, got $res")
                    }
                }
            }

Response:
if (expectedIter.hasNext()) {
                Assert.fail("Expected ${expectedIter.next()} got end of results stream")
            }
        }

        fun checkEvaluateInRepl(
            snippets: Sequence<String>,
            expected: Sequence<Any?>,
            compilationConfiguration: ScriptCompilationConfiguration = simpleScriptCompilationConfiguration,<|endoftext|>


Prompt:
val DOCUMENT_NODE: Short
        val DOCUMENT_TYPE_NODE: Short
        val DOCUMENT_FRAGMENT_NODE: Short
        val NOTATION_NODE: Short
        val DOCUMENT_POSITION_DISCONNECTED: Short
        val DOCUMENT_POSITION_PRECEDING: Short
        val DOCUMENT_POSITION_FOLLOWING: Short

Response:
val DOCUMENT_POSITION_CONTAINS: Short
        val DOCUMENT_POSITION_CONTAINED_BY: Short
        val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short
    }
}

/**
 * Exposes the JavaScript [SVGAElement](https://developer.mozilla.org/en/docs/Web/API/SVGAElement) to Kotlin
 */<|endoftext|>


Prompt:
fun builder(c: suspend () -> Unit) {
    c.startCoroutine(Continuation(EmptyCoroutineContext) {
        it.getOrThrow()
    })
}

fun box(): String {
    builder {
        test("a", "b")
    }

Response: val continuationName = "Continuation at TwoRefsKt\$box\$1.invokeSuspend(twoRefs.kt:46)"<|endoftext|>


Prompt:
int: TInt,
    long: TLong,
    float: TFloat,
    double: TDouble,
    uByte: TUByte,
    uShort: TUShort,
    uInt: TUInt,
    uLong: TULong,
    string: TString,
    function: TFunction,
    externalInterface: TExternalInterface,
    externalOpenClass: TExternalOpenClass,

Response:
externalObject: TExternalObject,
    correctTypeParameter: TCorrectTypeParameter
)

external class CorrectJsInteropTypesAsClassTypeParameterUpperBounds<
        // primitive types
        TBoolean: Boolean,
        TChar: Char,
        TByte: Byte,
        TShort: Short,
        TInt: Int,
        TLong: Long,
        TFloat: Float,<|endoftext|>


Prompt:
if (z3.message != "java.lang.Throwable: test") return "fail 5: ${z3.message}"
    if (z3.cause !== t) return "fail 6: ${z2.cause}"

    var thr4: KFunction0<Throwable> = ::Throwable
    val z4 = thr4()

Response:
if (z4.message !== null) return "fail 7: ${z4.message}"
    if (z4.cause !== null) return "fail 8: ${z4.cause}"

    return z.message!!
}<|endoftext|>


Prompt:
fun <I> id(arg: I): I = arg
fun <S> select(vararg args: S): S = TODO()

fun test(bool: Boolean) {
    val test1 = if (bool) {
        { "1" }
    } else null
    test1

    val test2 = if (bool) {
        id { "2" }
    } else null
    test2

Response:
val test3 = if (bool) {
        Inv { "3" }
    } else null
    test3

    val test4 = if (bool) {
        4 to { "4" }
    } else null
    test4

    val test5 = if (bool) {
        {{ "5" }}
    } else null
    test5

    val test6 = if (bool) {<|endoftext|>


Prompt:
fun addExtras(text: String): String =
            addImports(text, extras)

        fun stripExtras(actualText: StringBuilder) {
            val extras = extras
            val start = actualText.indexOf(extras)
            if (start >= 0) {
                actualText.delete(start, start + extras.length)
            }
        }

Response:
private fun addImports(text: String, imports: String): String {
            var result = text
            val pattern = Pattern.compile("^package [.\\w\\d]*\n", Pattern.MULTILINE)
            val matcher = pattern.matcher(result)
            result = if (matcher.find()) {
                // add imports after the package directive<|endoftext|>


Prompt:
/** Returns startIndex+shift, the next position to match */
    override fun matches(startIndex: Int, testString: CharSequence, matchResult: MatchResultImpl): Int {
        matchResult.saveState()
        return tryToMatch(startIndex, testString, matchResult).also { if (it < 0) matchResult.rollbackState() }
    }

Response:
override fun hasConsumed(matchResult: MatchResultImpl): Boolean = true
}<|endoftext|>


Prompt:
private object A432 { val a = Random.nextInt(100) }
private object A433 { val a = Random.nextInt(100) }
private object A434 { val a = Random.nextInt(100) }
private object A435 { val a = Random.nextInt(100) }
private object A436 { val a = Random.nextInt(100) }

Response:
private object A437 { val a = Random.nextInt(100) }
private object A438 { val a = Random.nextInt(100) }
private object A439 { val a = Random.nextInt(100) }
private object A440 { val a = Random.nextInt(100) }
private object A441 { val a = Random.nextInt(100) }<|endoftext|>


Prompt:
* @sample samples.collections.Collections.Elements.elementAt
 */
public actual fun ShortArray.elementAt(index: Int): Short {
    return elementAtOrElse(index) { throw IndexOutOfBoundsException("index: $index, size: $size}") }
}

/**

Response:
* Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.
 *
 * @sample samples.collections.Collections.Elements.elementAt
 */
public actual fun IntArray.elementAt(index: Int): Int {<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & TypealiasNullableStringIndirect?")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & TypealiasNullableStringIndirect?")!>x<!>?.get(0)
    }
}

/*
 * TESTCASE NUMBER: 10

Response:
* UNEXPECTED BEHAVIOUR
 * ISSUES: KT-28329
 */
fun case_10(x: Any?) {
    if (<!DEPRECATED_IDENTITY_EQUALS!>!!(x !is Interface3) === true<!> && true) else {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><|endoftext|>


Prompt:
var nullableTest: S?
        get() = S("${global.x}$x")
        set(value) {
            global = S("${value!!.x}$x")
        }
}

inline class Z(val x: Int) {
    var nonNullTest: S
        get() = S("${global.x}$x")
        set(value) {

Response:
global = S("${value.x}$x")
        }

    var nullableTest: S?
        get() = S("${global.x}$x")
        set(value) {
            global = S("${value!!.x}$x")
        }
}

inline class A(val x: Any) {
    var nonNullTest: S<|endoftext|>


Prompt:
this.unspecifiedBehavior = this.unspecifiedBehavior or addTestCase.unspecifiedBehavior
    this.issues?.addAll(addTestCase.issues!!)
    this.ranges.addAll(addTestCase.ranges)
}

private fun SpecTestCase.save(
    testCasesByNumbers: TestCasesByNumbers,
    testCasesOfFile: TestCasesByNumbers,

Response:
testCasesByRangesOfFile: NavigableMap<Int, TestCasesByNumbers>,
    caseInfoElements: SpecTestInfoElements<SpecTestInfoElementType>
) {
    val testCaseNumbers =
        caseInfoElements[SpecTestCaseInfoElementType.TESTCASE_NUMBER]!!.content.splitByComma().map {
            it.trim().toIntOrNull()<|endoftext|>


Prompt:
* Call this function when it's known than a != b
     */
    fun disequate(a: DataFlowValue, b: DataFlowValue, languageVersionSettings: LanguageVersionSettings): DataFlowInfo

    fun establishSubtyping(value: DataFlowValue, type: KotlinType, languageVersionSettings: LanguageVersionSettings): DataFlowInfo

    /**

Response:
* Call this function to add data flow information from other to this and return sum as the result
     */
    fun and(other: DataFlowInfo): DataFlowInfo

    /**
     * Call this function to choose data flow information common for this and other and return it as the result
     */
    fun or(other: DataFlowInfo): DataFlowInfo

    companion object {<|endoftext|>


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

// TESTCASE NUMBER: 9
fun case_9(x: Any?) {

Response:
if (!!(x !is TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>)) else {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & TypealiasNullableStringIndirect?")!>x<!><|endoftext|>


Prompt:
// ISSUE: KT-63654

class Klass<in A>(private val action: (A) -> Unit) {
    fun <B> execute(value: B, klassB: Klass<B>) {
        klassB.action(value)
    }
}

fun box(): String {

Response:
Klass { a: Int -> a.inc() }.execute("", Klass { b: String -> b.length })
    return "OK"
}<|endoftext|>


Prompt:
private data class NotInlinedCall(val fromCall: MethodInfo, val inlineMethod: MethodInfo)

    private data class NotInlinedParameter(val parameterClassName: String, val fromCall: MethodInfo)

    private data class MethodInfo(val owner: String, val name: String, val desc: String)

    private open class ClassVisitorWithName : ClassVisitor(Opcodes.API_VERSION) {

Response:
lateinit var className: String

        override fun visit(version: Int, access: Int, name: String, signature: String?, superName: String?, interfaces: Array<String>?) {
            className = name
            super.visit(version, access, name, signature, superName, interfaces)
        }
    }

    private abstract class MethodNodeWithAnonymousObjectCheck(<|endoftext|>


Prompt:
superClassGenerics = superClass.superClassGenerics
    )
}

/**
 * Resolves all [KtCallableSymbol] symbols that are to be translated to ObjC for [this] [KtClassOrObjectSymbol].
 * Note: This will return only 'declared' members (aka members written on this class/interface/object) and 'synthetic'/'generated' members.
 *

Response:
* ## Example regular class
 * ```kotlin
 * open class Base {
 *     fun base() = Unit
 * }
 *
 * class Foo : Base() {
 *     fun foo() = Unit
 * ```
 *
 * In this example `Foo` will return the function `foo` (as declared in `Foo`), but not the function `base` (as declared in `Base` and<|endoftext|>


Prompt:
@property:Ann
    protected var p3: String = ""

    @property:Ann
    protected val p4: String by CustomDelegate()

    @property:Ann
    var propertyWithCustomSetter: Int
        get() = 5
        set(v) {}

Response:
<!INAPPLICABLE_TARGET_ON_PROPERTY_WARNING, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@property:Ann<!>
    fun anotherFun() {<|endoftext|>


Prompt:
private class LazyFutureImpl<T>(private val future: Lazy<Future<T>>) : Future<T>, Serializable {
    override suspend fun await(): T {
        return future.value.await()
    }

    override fun getOrThrow(): T {
        return future.value.getOrThrow()
    }

    private fun writeReplace(): Any {

Response:
return Surrogate(getOrThrow())
    }

    private class Surrogate<T>(private val value: T) : Serializable {
        private fun readResolve(): Any {
            return FutureImpl(Completable(value))
        }
    }
}

/**
 * Simple, with primitive synchronization, replacement for kotlinx.coroutines.CompletableDeferred.
 */<|endoftext|>


Prompt:
increment(result, arraySize)
            }
        }
    }

    private fun IrBuilderWithScope.irArraySize(arrayHandle: ArrayHandle, expression: IrExpression): IrExpression {
        val arraySize = irCall(arrayHandle.sizeGetterSymbol.owner).apply {
            dispatchReceiver = expression
        }
        return arraySize
    }

Response:
private fun hasSpreadElement(expression: IrVararg?) = expression?.elements?.any { it is IrSpreadElement }?:false

    private fun log(msg:() -> String) {
        context.log { "VARARG-INJECTOR:    ${msg()}" }
    }

    abstract inner class ArrayHandle(val arraySymbol: IrClassSymbol) {<|endoftext|>


Prompt:
description = "Include the given native bitcode library.", delimiter = Argument.Delimiters.none
    )
    var nativeLibraries: Array<String>? = null

    @Argument(value = "-no-default-libs", deprecatedName = "-nodefaultlibs", description = "Don't link the libraries from dist/klib automatically.")
    var nodefaultlibs: Boolean = false

Response:
@Argument(
        value = "-no-endorsed-libs",
        description = "Don't link endorsed libraries from the dist automatically. " +
                "This option has been deprecated, as the dist no longer has any endorsed libraries."
    )
    var noendorsedlibs: Boolean = false<|endoftext|>


Prompt:
return visitor.builder.build()
    }

    protected fun serialize(module: JsImportedModule): JsAstProtoBuf.JsImportedModule {
        val moduleBuilder = JsAstProtoBuf.JsImportedModule.newBuilder()
        moduleBuilder.externalName = serialize(module.externalName)
        moduleBuilder.internalName = serialize(module.internalName)

Response:
module.plainReference?.let {
            moduleBuilder.plainReference = serialize(it)
        }
        return moduleBuilder.build()
    }

    protected fun serializeParameter(parameter: JsParameter): JsAstProtoBuf.Parameter {
        val parameterBuilder = JsAstProtoBuf.Parameter.newBuilder()
        parameterBuilder.nameId = serialize(parameter.name)<|endoftext|>


Prompt:
return inlineX.foo2({ z: Int, p: Int -> z + p}, 25, { x: Double, y: Int, z: Int -> z + x + y}, 11.5, 2)
}

fun box(): String {
    if (test1() != 36.5) return "test1: ${test1()}"

Response:
if (test1WithCaptured() != 37.5) return "test1WithCaptured: ${test1WithCaptured()}"
    if (test2() != 65.5) return "test2: ${test2()}"

    return "OK"
}<|endoftext|>


Prompt:
get() = null!!
                val platformPropertyInBothLeafTargets: PlatformInt
                    get() = null!!
            """.trimIndent()

            WATCHOS_ARM64.name withSource """
                val platformPropertyInOneLeafTarget: Int
                    get() = 42
                val platformPropertyInBothLeafTargets: PlatformInt
                    get() = null!!

Response:
""".trimIndent()
        }

        result.assertCommonized(
            "(${LINUX_X64.name}, ${WATCHOS_ARM64.name})", """
            expect val platformPropertyInOneLeafTarget: PlatformInt
            expect val platformPropertyInBothLeafTargets: PlatformInt
        """.trimIndent()
        )
    }<|endoftext|>


Prompt:
assertEquals("abc", pair.second, "pair.second")
    }

    @Test fun partitionCharSequence() = withOneCharSequenceArg("a1b2c3") { data ->
        val pair = data.partition { it.isAsciiDigit() }
        assertContentEquals("123", pair.first, "pair.first")

Response:
assertContentEquals("abc", pair.second, "pair.second")
    }

    @Test fun zipWithNext() = withOneCharSequenceArg { arg1 ->
        assertEquals(listOf("ab", "bc"), arg1("abc").zipWithNext { a: Char, b: Char -> a.toString() + b })<|endoftext|>


Prompt:
// TARGET_BACKEND: JVM

// WITH_REFLECT
// FILE: J.java

public class J {
    public void bar(int x) {}
}

// FILE: K.kt

import kotlin.reflect.full.findParameterByName
import kotlin.test.assertEquals
import kotlin.test.assertNull

fun foo(x: Int) = x

Response:
fun box(): String {
    assertEquals(::foo.parameters.single(), ::foo.findParameterByName("x"))
    assertNull(::foo.findParameterByName("y"))

    assertNull(J::bar.findParameterByName("x"))
    assertNull(J::bar.findParameterByName("y"))

    return "OK"
}<|endoftext|>


Prompt:
val nominalPackageName: PackageName,
    val assertionsMode: AssertionsMode,
)

private typealias SharedModuleGenerator = (sharedModulesDir: File) -> TestModule.Shared?
private typealias SharedModuleCache = (moduleName: String, generator: SharedModuleGenerator) -> TestModule.Shared?

Response:
private class ExtTestDataFileStructureFactory(parentDisposable: Disposable) : TestDisposable(parentDisposable) {
    private val psiFactory = createPsiFactory(parentDisposable = this)

    inner class ExtTestDataFileStructure(originalTestDataFile: File, sourceTransformers: ExternalSourceTransformers) {
        init {
            assertNotDisposed()
        }<|endoftext|>


Prompt: TypealiasNullableString /* = kotlin.String? */")!>x<!>.propNullableT

Response: if (x !== null && <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString /* = kotlin.String */ & TypealiasNullableString /* = kotlin.String? */")!>x<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString /* = kotlin.String */ &<|endoftext|>


Prompt:
variance = when (kind) {
                    ProjectionKind.IN -> Variance.IN_VARIANCE
                    ProjectionKind.OUT -> Variance.OUT_VARIANCE
                    ProjectionKind.INVARIANT -> Variance.INVARIANT
                    ProjectionKind.STAR -> throw IllegalStateException()
                }
            }
        }
    }

Response:
fun resolveAnnotationCall(annotation: FirAnnotationCall): FirAnnotationCall? {
        val reference = annotation.calleeReference as? FirSimpleNamedReference ?: return null
        val annotationClassSymbol = annotation.getCorrespondingClassSymbolOrNull(session)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.plugin.launchInStage
import org.jetbrains.kotlin.gradle.util.assertContainsDiagnostic
import org.jetbrains.kotlin.gradle.util.assertNoDiagnostics
import org.jetbrains.kotlin.gradle.util.buildProjectWithMPP
import org.junit.Test

Response:
import kotlin.test.assertFails

class WasmSourceSetsNotFoundErrorTest {

    @Test
    fun `wasmMain SourceSet`() {
        diagnosticsForTestProjectRequestingMissingSourceSet("wasmMain")
            .assertContainsDiagnostic(KotlinToolingDiagnostics.WasmSourceSetsNotFoundError("wasmMain"))
    }

    @Test<|endoftext|>


Prompt:
// If we don't know the direction, we can't be sure which limit to use.
            return@lazy true
        }

        // Induction variable can NOT overflow if "last" is const and is <= (MAX/MIN_VALUE - step) (depending on direction).
        //
        // Examples that can NOT overflow:
        //   - `0..10` cannot overflow (10 <= MAX_VALUE - 1)

Response:
//   - `0..MAX_VALUE - 1` cannot overflow (MAX_VALUE - 1 <= MAX_VALUE - 1)
        //   - `0..MAX_VALUE - 3 step 3` cannot overflow (MAX_VALUE - 3 <= MAX_VALUE - 3)
        //   - `0 downTo -10` cannot overflow (-10 >= MIN_VALUE - (-1))<|endoftext|>


Prompt:
package org.jetbrains.kotlin.psi

import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElement
import com.intellij.psi.tree.IElementType
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames

Response:
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
import org.jetbrains.kotlin.psi.stubs.KotlinEnumEntrySuperclassReferenceExpressionStub
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes<|endoftext|>


Prompt:
// Writes the service file only; CustomComponentRegistrar is already in classpath.
    private fun writePlugin(): String {
        val jarFile = tmpdir.resolve("plugin.jar")
        ZipOutputStream(jarFile.outputStream()).use {
            val entry = ZipEntry("META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar")

Response:
it.putNextEntry(entry)
            it.write(CustomComponentRegistrar::class.java.name.toByteArray())
        }
        return jarFile.absolutePath
    }

    private val jsirStdlib: String?
        get() = System.getProperty("kotlin.js.full.stdlib.path")

    private val wasmStdlib: String?<|endoftext|>


Prompt:
for (irTypeParameter in irTypeParametersOwner.typeParameters) {
            irTypeParameter.superTypes = irTypeParameter.descriptor.upperBounds.map {
                it.toIrType()
            }
        }
    }

    fun generateInitializerBody(scopeOwnerSymbol: IrSymbol, ktBody: KtExpression): IrExpressionBody =

Response:
createBodyGenerator(scopeOwnerSymbol).generateExpressionBody(ktBody)

    fun generateFakeOverrideDeclaration(memberDescriptor: CallableMemberDescriptor, ktElement: KtPureElement): IrDeclaration? {
        assert(memberDescriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
            "Fake override expected: $memberDescriptor"<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
import org.jetbrains.kotlin.fir.expressions.impl.FirResolvedQualifierImpl

Response:
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.fir.types.FirTypeProjection
import org.jetbrains.kotlin.name.ClassId<|endoftext|>


Prompt:
import org.jetbrains.kotlin.compilerRunner.KotlinToolRunner
import org.jetbrains.kotlin.konan.target.AbstractToolConfig

internal interface KonanToolRunner {
    fun run(args: List<String>)
}

internal fun KonanToolRunner.run(vararg args: String) = run(args.toList())

Response:
private const val runFromDaemonPropertyName = "kotlin.native.tool.runFromDaemon"

@Suppress("DEPRECATION") // calling KotlinToolRunner(project) constructor is deprecated
internal abstract class KonanCliRunner(
        protected val toolName: String,
        project: Project,
        isolatedClassLoadersService: KonanCliRunnerIsolatedClassLoadersService,<|endoftext|>


Prompt:
suspend fun <T> testIntersection(x: T): String where T : () -> String, T : (Int) -> String {
    val a = useSuspendFun(x)
    val b = useSuspendFunInt(x)
    return a + b
}

class Test : () -> String, (Int) -> String {
    override fun invoke(): String = "OKEmpty"

Response:
override fun invoke(p: Int) = "OK$p"
}

fun box(): String {
    var test = "Failed"
    builder {
        test = testIntersection(Test())
    }

    if (test != "OKEmptyOK42") return "failed: $test"

    return "OK"
}<|endoftext|>


Prompt:
case.let { <!DEBUG_INFO_CALL("fqName: testPackCase3.Case3.Companion.get; typeCall: operator extension function")!>1["1"]<!> }
    case.let { <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>1["1"]<!> }

Response:
case.also { <!DEBUG_INFO_CALL("fqName: testPackCase3.Case3.Companion.get; typeCall: operator extension function")!>1["1"]<!> }
    case.also { <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>1["1"]<!> }<|endoftext|>


Prompt:
if (localFunctionSymbol == function.symbol || localThrowsAnnotation == null && overriddenFunctions.isNotEmpty()) {
                    for (overriddenFunction in overriddenFunctions) {
                        val annotation = runUnless(overriddenFunction.isSubstitutionOrIntersectionOverride) {
                            overriddenFunction.getAnnotationByClassId(throwsClassId, context.session)
                        }

Response:
getInheritedThrows(annotation, overriddenFunction)
                    }
                } else {
                    result[localFunctionSymbol] = decodeThrowsFilter(localThrowsAnnotation, context.session)
                }
            }
        }

        getInheritedThrows(throwsAnnotation, function.symbol)

        return result
    }<|endoftext|>


Prompt:
operator fun plus(o: Int): Any? { TODO() }
    operator fun plus(o: Case3): Any? { TODO() }
}

fun case3() {
    val a = Case3(1) + 1
    val b = Case3(1) + Case3( 1)
    val c = Case3(1) - 1
    val d = Case3(1) - Case3( 1)

Response:
a checkType { check<Any?>() }
    b checkType { check<Any?>() }
    c checkType { check<Any?>() }
    d checkType { check<Any?>() }
}<|endoftext|>


Prompt:
val typeProjection = stack.pop()
        if (typeProjection.isStarProjection) continue

        result.add(typeProjection)

        typeProjection.type.arguments.forEach { stack.add(it) }
    }
    return result
}

internal fun KotlinType.getNestedTypeParameters(): List<TypeParameterDescriptor> {

Response:
return getNestedArguments().mapNotNull { typeProjection ->
        typeProjection.type.constructor.declarationDescriptor as? TypeParameterDescriptor
    }
}<|endoftext|>


Prompt:
override val ValueParameterSymbolMarker.parameterName: Name
        get() = asSymbol().name

    override fun TypeAliasSymbolMarker.expandToRegularClass(): RegularClassSymbolMarker? {
        return asSymbol()
            .resolvedExpandedTypeRef
            .coneType
            .fullyExpandedType(actualSession)

Response:
.toSymbol(actualSession) as? FirRegularClassSymbol
    }

    override val RegularClassSymbolMarker.classKind: ClassKind
        get() = asSymbol().classKind
    override val RegularClassSymbolMarker.isCompanion: Boolean
        get() = asSymbol().resolvedStatus.isCompanion
    override val RegularClassSymbolMarker.isInner: Boolean<|endoftext|>


Prompt:
fun testSimpleUIntLoop() {
    var s = 0
    for (i in p1) {
        s = s*10 + i.toInt()
    }
    if (s != 654321) throw AssertionError("$s")
}

val p2 = 1u downTo 6u
fun testEmptyUIntLoop() {
    var s = 0
    for (i in p2) {

Response:
s = s*10 + i.toInt()
    }
    if (s != 0) throw AssertionError("$s")
}

val p3 = 6UL downTo 1UL
fun testSimpleULongLoop() {
    var s = 0
    for (i in p3) {
        s = s*10 + i.toInt()
    }<|endoftext|>


Prompt:
val allDescriptors = descriptor.secondaryConstructors + descriptor.defaultType.memberScope.getContributedDescriptors()
            val (enumEntries, members) = allDescriptors.partition(::isEnumEntry)

            for ((index, enumEntry) in enumEntries.withIndex()) {
                newlineExceptFirst()
                builder.append(subindent)

Response:
appendDescriptor(enumEntry, subindent, index == enumEntries.lastIndex)
            }

            val companionObject = descriptor.companionObjectDescriptor
            if (companionObject != null) {
                newlineExceptFirst()
                builder.append(subindent)
                appendDescriptor(companionObject, subindent)
            }

            for (member in members) {<|endoftext|>


Prompt:
operator fun <V> Ref<V>.provideDelegate(a: Any?, p: KProperty<*>): GenericDelegate<V> = GenericDelegate(this.t)

operator fun <W> GenericDelegate<W>.getValue(a: Any?, p: KProperty<*>): W = this.value

Response:
fun <E> List<Ref<*>>.getElement(i: Int): Ref<E> = this[i] as Ref<E>

@Suppress("UNNECESSARY_NOT_NULL_ASSERTION")
fun test(list: List<Ref<*>>) {
    val data: String by list.getElement(0)!!
    require(data == list[0].t)<|endoftext|>


Prompt:
return if (elementRange.endOffset <= range.endOffset) element else null
}

val PsiElement.textRangeWithoutComments: TextRange
    get() = if (!startsWithComment()) textRange else TextRange(startOffsetSkippingComments, endOffset)

fun PsiElement.startsWithComment(): Boolean = firstChild is PsiComment

// ---------------------------------- Debug/logging ----------------------------------------------------------------------------------------

Response:
fun PsiElement.getElementTextWithContext(): String = org.jetbrains.kotlin.utils.getElementTextWithContext(this)

fun PsiElement.getTextWithLocation(): String = "'${this.text}' at ${PsiDiagnosticUtils.atLocation(this)}"<|endoftext|>


Prompt:
package org.jetbrains.kotlin.backend.konan.llvm.objc

import llvm.*
import org.jetbrains.kotlin.backend.konan.llvm.*

/**
 * This class provides methods to generate Objective-C RTTI and other data.

Response:
* It is mostly based on `clang/lib/CodeGen/CGObjCMac.cpp`, and supports only subset of operations
 * required for our purposes (thus simplified).
 *
 * [finishModule] must be called exactly once after all required data was generated.
 */
internal class ObjCDataGenerator(val codegen: CodeGenerator) {

    val context = codegen.context<|endoftext|>


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

Response:
add(FirErrors.ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE) { firDiagnostic ->
        ActualTypeAliasToClassWithDeclarationSiteVarianceImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }<|endoftext|>


Prompt:
return LanguageFeature.State.DISABLED
                    }

                    override fun isPreRelease(): Boolean = stub()

                    override fun <T> getFlag(flag: AnalysisFlag<T>): T = stub()

                    override val apiVersion: ApiVersion
                        get() = stub()
                    override val languageVersion: LanguageVersion
                        get() = stub()
                }
            ))

Response:
register(FirExtensionService::class, FirExtensionService(this))
        }
    }

    /**
     * Registers default components for [FirSession]
     * They could be overridden by calling a function that registers specific platform components
     */
    @OptIn(SessionConfiguration::class)
    fun FirSession.registerDefaultComponents() {<|endoftext|>


Prompt:
@kotlin.SinceKotlin(version = "1.5")
@kotlin.OverloadResolutionByLambdaReturnType
@kotlin.jvm.JvmName(name = "sumOfUInt")
@kotlin.ExperimentalUnsignedTypes
@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})

Response:
@kotlin.internal.InlineOnly
public inline fun kotlin.UShortArray.sumOf(selector: (kotlin.UShort) -> kotlin.UInt): kotlin.UInt

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


Prompt:
private val defFile: File?,
        private val cppAdapterFile: File,
        private val target: KonanTarget,
) {
    private val typeTranslator = elements.typeTranslator
    private val builtIns = elements.typeTranslator.builtIns

    private val prefix = elements.typeTranslator.prefix
    private lateinit var outputStreamWriter: PrintWriter

    // Primitive built-ins and unsigned types

Response:
private val predefinedTypes = listOf(
            builtIns.byteType, builtIns.shortType,
            builtIns.intType, builtIns.longType,
            builtIns.floatType, builtIns.doubleType,
            builtIns.charType, builtIns.booleanType,
            builtIns.unitType
    ) + UnsignedType.values().map {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.kapt.cli.KaptCliOption.*
import org.jetbrains.kotlin.kapt.cli.KaptCliOption.Companion.ANNOTATION_PROCESSING_COMPILER_PLUGIN_ID
import org.jetbrains.kotlin.kapt3.base.*

Response:
import org.jetbrains.kotlin.kapt3.base.util.KaptLogger
import org.jetbrains.kotlin.kapt3.base.util.doOpenInternalPackagesIfRequired
import org.jetbrains.kotlin.kapt3.util.MessageCollectorBackedKaptLogger
import org.jetbrains.kotlin.platform.TargetPlatform<|endoftext|>


Prompt:
* @sample samples.collections.Collections.Aggregates.none
 */
public fun IntArray.none(): Boolean {
    return isEmpty()
}

/**
 * Returns `true` if the array has no elements.
 *
 * @sample samples.collections.Collections.Aggregates.none
 */
public fun LongArray.none(): Boolean {
    return isEmpty()
}

/**

Response:
* Returns `true` if the array has no elements.
 *
 * @sample samples.collections.Collections.Aggregates.none
 */
public fun FloatArray.none(): Boolean {
    return isEmpty()
}

/**
 * Returns `true` if the array has no elements.
 *
 * @sample samples.collections.Collections.Aggregates.none
 */<|endoftext|>


Prompt:
@Throws(RemoteException::class)
    fun scheduleShutdown(graceful: Boolean): CallResult<Boolean>

    @Throws(RemoteException::class)
    fun compile(
            sessionId: Int,
            compilerArguments: Array<out String>,
            compilationOptions: CompilationOptions,
            servicesFacade: CompilerServicesFacadeBase,
            compilationResults: CompilationResults?

Response:
): CallResult<Int>

    @Throws(RemoteException::class)
    fun classesFqNamesByFiles(
        sessionId: Int,
        sourceFiles: Set<File>
    ): CallResult<Set<String>>

    @Throws(RemoteException::class)
    fun clearJarCache()

    @Throws(RemoteException::class)<|endoftext|>


Prompt:
// MODULE: main

// FILE: generics.kt
@JsExport
fun <T: JsAny?> simple(x: T): T = x

@JsExport
fun <A: JsAny?, B: JsAny?> second(a: A, b: B): B = b

@JsExport
fun <T: JsNumber> simpleWithConstraint(x: T): T = x

Response:
external interface Foo<T: JsAny> : JsAny {
    val foo: T
}

external interface Bar : JsAny {
    val bar: JsString
}

external object Baz : JsAny {
    val baz: JsBoolean
}

fun getBaz(x: Foo<JsBigInt>): JsAny = js("({ baz: x.foo > 0n })")<|endoftext|>


Prompt:
else if (value_2 < 10) "2"
        else "4"
}

/*
 * TESTCASE NUMBER: 9
 * ISSUES: KT-37249
 */
fun case_9(value_1: Int, value_2: String, value_3: String) = when {

Response:
value_1 == 1 -> <!IMPLICIT_CAST_TO_ANY!>try { 4 } catch (e: Exception) { 5 }<!>
    value_1 == 2 -> <!IMPLICIT_CAST_TO_ANY!>try { throw Exception() } catch (e: Exception) { value_2 }<!><|endoftext|>


Prompt:
override val diagnosticClass get() = TypeParametersInAnonymousObject::class
    }

    interface IllegalProjectionUsage : KtFirDiagnostic<PsiElement> {
        override val diagnosticClass get() = IllegalProjectionUsage::class
    }

    interface TypeParametersInEnum : KtFirDiagnostic<PsiElement> {

Response:
override val diagnosticClass get() = TypeParametersInEnum::class
    }

    interface ConflictingProjection : KtFirDiagnostic<KtTypeProjection> {
        override val diagnosticClass get() = ConflictingProjection::class
        val type: KtType
    }<|endoftext|>


Prompt:
override fun processFunctionsByName(name: Name, processor: (FirNamedFunctionSymbol) -> Unit) {
        useSiteMemberScope.processFunctionsByName(name) process@{ original ->
            val function = substitutionOverrideCache.overridesForFunctions.getValue(original, this)
            processor(function)
        }

        return super.processFunctionsByName(name, processor)

Response:
}

    override fun processDirectOverriddenFunctionsWithBaseScope(
        functionSymbol: FirNamedFunctionSymbol,
        processor: (FirNamedFunctionSymbol, FirTypeScope) -> ProcessorAction
    ): ProcessorAction =
        processDirectOverriddenWithBaseScope(
            functionSymbol,
            processor,
            FirTypeScope::processDirectOverriddenFunctionsWithBaseScope,<|endoftext|>


Prompt:
value checkType { _<String>() }
        }

    override var z
        get() = ""
        set(value) {
            value checkType { _<String>() }
        }
}

fun foo(c: C) {
    c.x checkType { _<Int>() }
    c.y checkType { _<String>() }

Response:
c.z checkType { _<String>() }

    c.y = ""
    c.y = <!ASSIGNMENT_TYPE_MISMATCH!>1<!>

    c.z = ""
    c.z = <!ASSIGNMENT_TYPE_MISMATCH!>1<!>
}<|endoftext|>


Prompt:
// SKIP_KT_DUMP
// FIR_IDENTICAL
// TARGET_BACKEND: JVM

// FILE: Java1.java
public class Java1 {
    public static <T> void foo(T t) {}
    public static <T> T bar() {
        return null;
    }
    public static  void foo(Number t) {}
    public static  void foo(Number t, Integer t2) {}

Response:
}

// FILE: Java2.java
public class Java2 extends Java1 { }

// FILE: Java3.java
public class Java3 extends A { }

// FILE: 1.kt

open class A : Java1() {
    open fun test1() = foo(1)
    open fun test2(): Int = bar()
    open fun test3() = foo("")<|endoftext|>


Prompt:
class Out<out T>
class OutPair<out X, out Y>
class In<in Z>
class Inv<E>

open class Open
class Final

fun skipAllOutInvWildcards(): Inv<OutPair<Open, Out<Out<Open>>>> = null!!
// method: FinalReturnTypeKt::skipAllOutInvWildcards

Response:
// generic signature: ()LInv<LOutPair<LOpen;LOut<LOut<LOpen;>;>;>;>;

fun skipAllInvWildcards(): Inv<In<Out<Open>>> = null!!
// method: FinalReturnTypeKt::skipAllInvWildcards
// generic signature: ()LInv<LIn<LOut<+LOpen;>;>;>;<|endoftext|>


Prompt:
fun devNull(obj: Any?) {}

open class A {
    companion object {
        val internal_val = 1
        public val public_val: Int = 2
        private val private_val = 3
        protected val protected_val: Int = 5
    }

    fun fromClass() {
        devNull(internal_val)
        devNull(public_val)
        devNull(private_val)

Response:
devNull(protected_val)
    }
}

fun fromOutside() {
    devNull(A.internal_val)
    devNull(A.public_val)
    devNull(A.<!INVISIBLE_REFERENCE!>private_val<!>)
    devNull(A.<!INVISIBLE_REFERENCE!>protected_val<!>)
}

class B: A() {<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
// SKIP_TXT

/*
 * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
 *

Response:
* SPEC VERSION: 0.1-280
 * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-with-named-parameters -> paragraph 1 -> sentence 2
 * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-named-parameters -> paragraph 2 -> sentence 1
 * NUMBER: 3<|endoftext|>


Prompt:
}
}

private fun Printer.printMangledNames(computedMangledNames: List<ComputedMangledName>, prefix: String) {
    val distinctNames = computedMangledNames.distinctBy { it.value }

    // If mangled names computed from all three representations (descriptors, IR, FIR) and modes match,
    // print just one mangled name.

Response:
distinctNames.singleOrNull()?.let {
        println("//   $prefix: ${it.value}")
        return
    }

    if (distinctNames.same { it.compatibleMode }) {
        // If the mangled names differ only by the mangler used (but not the compatibility mode), print
        // only mangled names from each mangler.
        computedMangledNames<|endoftext|>


Prompt:
* or interface in the `-Xjvm-default=all` mode, where only JVM default methods are generated, without `DefaultImpls`.
 *
 * Annotating an existing class with this annotation is a binary incompatible change. Therefore this annotation makes
 * the most sense for _new_ classes in libraries which opted into the compatibility mode.
 *
 * Used only with `-Xjvm-default=all-compatibility`.
 */

Response:
@SinceKotlin("1.4")
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS)
public annotation class JvmDefaultWithoutCompatibility

/**
 * Forces the compiler to generate compatibility accessors for the annotated interface in the `DefaultImpls` class.<|endoftext|>


Prompt:
* The default strategy.
     */
    public fun useInProcessStrategy(): CompilerExecutionStrategyConfiguration

    /**
     * Marks the compilation to be run in Kotlin daemon launched as a separate process and shared across similar compilation requests.

Response:
* See Kotlin daemon documentation here: https://kotlinlang.org/docs/gradle-compilation-and-caches.html#the-kotlin-daemon-and-how-to-use-it-with-gradle
     * @param jvmArguments a list of JVM startup arguments for the daemon
     */
    public fun useDaemonStrategy(
        jvmArguments: List<String>,<|endoftext|>


Prompt:
public inline fun kotlin.DoubleArray.dropWhile(predicate: (kotlin.Double) -> kotlin.Boolean): kotlin.collections.List<kotlin.Double>

public inline fun kotlin.FloatArray.dropWhile(predicate: (kotlin.Float) -> kotlin.Boolean): kotlin.collections.List<kotlin.Float>

Response:
public inline fun kotlin.IntArray.dropWhile(predicate: (kotlin.Int) -> kotlin.Boolean): kotlin.collections.List<kotlin.Int>

public inline fun kotlin.LongArray.dropWhile(predicate: (kotlin.Long) -> kotlin.Boolean): kotlin.collections.List<kotlin.Long><|endoftext|>


Prompt:
addStableJavaScriptName(targetSymbol, overriddenSymbol, context)
            if (targetSymbol is FirPropertySymbol && overriddenSymbol is FirPropertySymbol) {
                addStableJavaScriptName(targetSymbol.getterSymbol, overriddenSymbol.getterSymbol, context)

Response:
addStableJavaScriptName(targetSymbol.setterSymbol, overriddenSymbol.setterSymbol, context)
            }
        }

        fun addAllSymbolsFrom(symbols: Collection<FirCallableSymbol<*>>, sessionHolder: SessionHolder) {
            for (symbol in symbols) {
                when (symbol) {<|endoftext|>


Prompt:
reporter.reportOn(source, FirErrors.DEPRECATION, referencedSymbol, message, context)
        }
    }

    internal val DeprecatedOverrideOfHiddenReplacements: Map<String, String?> = mapOf(
        "getFirst" to "first()",
        "getLast" to "last()",
        "toArray" to null,
    )

Response:
internal fun getDeprecatedOverrideOfHiddenMessage(callableName: String?): String {
        val getFirstOrLastReplacement = DeprecatedOverrideOfHiddenReplacements[callableName]
        return if (getFirstOrLastReplacement != null) {
            "This declaration will be renamed in a future version of Kotlin. Please consider using the '$getFirstOrLastReplacement' stdlib extension if the collection supports fast random access."<|endoftext|>


Prompt:
graph(b to a, c to b)
        doTest(a, setOf())
        doTest(b, setOf())
        doTest(c, setOf())
    }

    // Declaration "c" overrides two declarations "a" and "b"

    fun testAbstractDeclarationOverridesTwoAbstractDeclarations() {
        val a = v("-D1")

Response:
val b = v("-D2")
        val c = v("-D3")
        graph(c to a, c to b)
        doTest(c, setOf())
    }

    fun testAbstractDeclarationOverridesAbstractAndConcreteDeclarations() {
        val a = v("-D1")
        val b = v("+D2")
        val c = v("-D3")<|endoftext|>


Prompt:
}

private fun throwIllegalArgumentType(index: Int, name: String, expectedJvmType: Class<*>): Nothing {
    val kotlinClass = when {
        expectedJvmType == Class::class.java -> KClass::class
        expectedJvmType.isArray && expectedJvmType.componentType == Class::class.java ->

Response:
@Suppress("CLASS_LITERAL_LHS_NOT_A_CLASS") Array<KClass<*>>::class // Workaround KT-13924
        else -> expectedJvmType.kotlin
    }
    // For arrays, also render the type argument in the message, e.g. "... not of the required type kotlin.Array<kotlin.reflect.KClass>"
    val typeString =<|endoftext|>


Prompt:
""
        else ", but captures at:\n    ${captures.joinToString("\n    ") {
            val location = it.getCompilerMessageLocation(irFile)!!
            val relativePath = File(location.path).descendantRelativeTo(cwd).path
            val capturedValueName = if (it is IrGetValue) ": ${it.symbol.owner.name.asString()}" else ""

Response:
"$relativePath:${location.line}:${location.column}$capturedValueName"
        }}"

        reportError(expression,
                "${callee.fqNameForIrSerialization} must take an unbound, non-capturing function or lambda$formattedCaptures")
    }

    override fun visitCall(expression: IrCall) {
        expression.acceptChildrenVoid(this)<|endoftext|>


Prompt:
gradleBuildScript().modify(::transformBuildScriptWithPluginsDsl)

        build("publish") {
            assertSuccessful()
        }
    }

    companion object {
        fun List<String>.containsSequentially(vararg elements: String): Boolean {
            check(elements.isNotEmpty())
            return Collections.indexOfSubList(this, elements.toList()) != -1

Response:
}
    }
}<|endoftext|>


Prompt:
return "${addressToString(startAddress)}: $indent i32   : ${value.owner}    ;; $name\n"
    }

    override val sizeInBytes: Int = INT_SIZE_BYTES
}

class ConstantDataIntegerArray(val name: String, val value: List<Long>, private val integerSize: Int) : ConstantDataElement() {
    override fun toBytes(): ByteArray {

Response:
val array = ByteArray(value.size * integerSize)
        repeat(value.size) { i ->
            value[i].toLittleEndianBytesTo(array, i * integerSize, integerSize)
        }
        return array
    }

    override fun dump(indent: String, startAddress: Int): String {
        if (value.isEmpty()) return ""<|endoftext|>


Prompt:
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget

Response:
import org.jetbrains.kotlin.fir.tree.generator.context.generatedType
import org.jetbrains.kotlin.fir.tree.generator.context.type
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
import org.jetbrains.kotlin.fir.types.ConeErrorType<|endoftext|>


Prompt:
abstract override fun createPointer(): KtSymbolPointer<KtAnonymousFunctionSymbol>
}

public abstract class KtSamConstructorSymbol : KtFunctionLikeSymbol(), KtNamedSymbol {
    final override val symbolKind: KtSymbolKind get() = withValidityAssertion { KtSymbolKind.SAM_CONSTRUCTOR }

Response:
abstract override fun createPointer(): KtSymbolPointer<KtSamConstructorSymbol>
}

public abstract class KtFunctionSymbol : KtFunctionLikeSymbol(),
    KtNamedSymbol,
    KtPossibleMemberSymbol,
    KtPossibleMultiplatformSymbol,
    KtSymbolWithModality,
    KtSymbolWithVisibility {<|endoftext|>


Prompt:
override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? =
                visitAnnotationImpl { args ->
                    methodAnnotations += "@" + renderAnnotation(desc, args) + " "
                }

            override fun visitParameterAnnotation(parameter: Int, desc: String, visible: Boolean): AnnotationVisitor? =
                visitAnnotationImpl { args ->

Response:
parameterAnnotations.getOrPut(
                        parameter + methodParamCount - (if (visible) visibleAnnotableParameterCount else invisibleAnnotableParameterCount)
                    ) { arrayListOf() }.add("@" + renderAnnotation(desc, args) + " ")
                }

            override fun visitEnd() {
                val parameterWithAnnotations = parameterTypes.mapIndexed { index, parameter -><|endoftext|>


Prompt:
declaration.collectRealOverrides()
                .onEach {
                    if (isFakeOverride && it.modality == Modality.ABSTRACT) {
                        missedOverrides.add(it)
                    }
                }
                .find { it.modality != Modality.ABSTRACT }
                ?.let {
                    val implClassDeclaration = it.parent as IrClass

Response:
if (implClassDeclaration.shouldCopyFrom()) {
                        val reference = context.getNameForStaticDeclaration(it).makeRef()
                        classModel.postDeclarationBlock.statements += jsAssignment(
                            jsElementAccess(memberName, classPrototypeRef),
                            reference
                        ).makeStmt()
                        if (isFakeOverride) {
                            classModel.postDeclarationBlock.statements += missedOverrides<|endoftext|>


Prompt:
public inline fun <C : MutableCollection<in Int>> IntArray.filterIndexedTo(destination: C, predicate: (index: Int, Int) -> Boolean): C {
    forEachIndexed { index, element ->
        if (predicate(index, element)) destination.add(element)
    }
    return destination
}

/**

Response:
* Appends all elements matching the given [predicate] to the given [destination].
 * @param [predicate] function that takes the index of an element and the element itself
 * and returns the result of predicate evaluation on the element.
 *
 * @sample samples.collections.Collections.Filtering.filterIndexedTo
 */<|endoftext|>


Prompt:
if (a.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>a.s<!>.propNullableAny
    if (a.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>a.s<!>.funT()

Response:
if (a.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>a.s<!>.funAny()
    if (a.s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any?")!>a.s<!>.funNullableT()<|endoftext|>


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

import java.io.File

sealed interface TestCompilationArtifact {
    val logFile: File

    data class KLIB(val klibFile: File) : TestCompilationArtifact {
        val path: String get() = klibFile.path

Response:
val headerKlib: File get() = klibFile.resolveSibling(klibFile.name.replaceAfterLast(".", "header.klib"))
        override val logFile: File get() = klibFile.resolveSibling("${klibFile.name}.log")
    }

    interface KLIBStaticCache : TestCompilationArtifact {
        val cacheDir: File
        val klib: KLIB<|endoftext|>


Prompt:
Errors.UNSUPPORTED.on(
                                resolvedCall.call.callElement,
                                error.message
                            )
                        )

                        is NestedClassViaInstanceReference -> tracing.nestedClassAccessViaInstanceReference(
                            resolvedCall.trace,
                            error.classDescriptor,
                            resolvedCall.explicitReceiverKind
                        )

                        is ErrorDescriptorDiagnostic -> {

Response:
// todo
                            //  return@map null
                        }

                        is ResolvedUsingDeprecatedVisibility -> {
                            reportResolvedUsingDeprecatedVisibility(
                                resolvedCall.call, resolvedCall.candidateDescriptor,
                                resolvedCall.resultingDescriptor, error, resolvedCall.trace
                            )
                        }
                    }
                }
            }<|endoftext|>


Prompt:
if (max < e) max = e
    }
    return max
}

/**
 * Returns the largest element or `null` if there are no elements.
 */
@SinceKotlin("1.4")
@ExperimentalUnsignedTypes
public fun UByteArray.maxOrNull(): UByte? {
    if (isEmpty()) return null
    var max = this[0]

Response:
for (i in 1..lastIndex) {
        val e = this[i]
        if (max < e) max = e
    }
    return max
}

/**
 * Returns the largest element or `null` if there are no elements.
 */
@SinceKotlin("1.4")
@ExperimentalUnsignedTypes
public fun UShortArray.maxOrNull(): UShort? {<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<out kotlin.Number, *> & kotlin.collections.Map<out kotlin.Number, *>?")!>x<!>.funAny()

Response: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map<out kotlin.Number, *> & kotlin.collections.Map<out kotlin.Number, *>?")!>x<!>.funNullableT()<|endoftext|>


Prompt: const val notEqual8 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, FORBIDDEN_IDENTITY_EQUALS!>1u !== uint<!>

Response: const val notEqual9 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER, EQUALITY_NOT_APPLICABLE, FORBIDDEN_IDENTITY_EQUALS!>uint !== int<!><|endoftext|>


Prompt:
is Intermediary.KeepCounting -> if (currentStep.togo == 0) {
                BaseTerminal.Success(count)
            } else {
                count++
                Intermediary.KeepCounting(currentStep.togo - 1)
            }
        }
    }
}

fun box(): String {
    val interpreter = CountingInterpreter()

Response:
var step: Interpreter.Step<CountingInterpreter> = CountingInterpreter.Intermediary.KeepCounting(1)
    while (step is CountingInterpreter.Intermediary) {
        step = interpreter.next(step).invoke()
    }
    return if ((step as BaseTerminal.Success<CountingInterpreter>).result == 1) "OK"  else "NOK"<|endoftext|>


Prompt:
assertTrue(commandWithPrefix.startsWith(expectedPrefix)) {
                "The command should start with $expectedPrefix. Got: $commandWithPrefix"
            }

            val command = commandWithPrefix.removePrefix(expectedPrefix).trimStart()
            val body = lines.drop(1).filterNot(String::isBlank)

            return Step(command, body)
        }

Response:
}
}

internal class LLDBSessionSpec private constructor(private val expectedSteps: List<Step>) {
    fun generateCLIArguments(prettyPrinters: File): List<String> = buildList {
        this += "-b"
        this += "-o"
        this += "command script import ${prettyPrinters.absolutePath}"
        expectedSteps.forEach { step ->
            this += "-o"<|endoftext|>


Prompt: process(C9(), "C9", setOf("I57", "I56", "I60", "I55", "I50", "I1", "I2", "I3", "I4", "I5", "I6", "I7", "I8", "I9", "I10", "I54", "I40", "I53", "I30", "I29", "I28",

Response: "I27", "I26", "I25", "I24", "I23", "I22", "I21", "I52", "I20", "I51", "I10", "I61", "I62", "I63", "I64", "I65", "I66", "I67", "I68", "I69", "I70"))<|endoftext|>


Prompt:
): CirClassType {
            return createInterned(
                classId = classifierId,
                outerType = outerType,
                arguments = arguments,
                isMarkedNullable = isMarkedNullable,
                attachments = attachments,
            )
        }

        private val interner = Interner<CirClassTypeInternedImpl>()
    }
}

/**

Response:
* All attributes are read from the abbreviation type: [KmType.abbreviatedType].
 *
 * This is necessary to properly compare types for type aliases, where abbreviation type represents the type alias itself while
 * expanded type represents right-hand side declaration that should be processed separately.
 */
abstract class CirTypeAliasType : CirClassOrTypeAliasType() {
    abstract val underlyingType: CirClassOrTypeAliasType<|endoftext|>


Prompt:
resolvePhase = FirResolvePhase.ANALYZED_DEPENDENCIES
                                    returnTypeRef = typeArgument
                                    this.name = parameterName
                                    symbol = FirValueParameterSymbol(parameterName)
                                    defaultValue = null
                                    isCrossinline = false
                                    isNoinline = false
                                    isVararg = false
                                }
                            }

Response:
dispatchReceiverType = classId.defaultType(this@klass.typeParameters.map { it.symbol })
                            kind.annotationOnInvokeClassId?.let { annotationClassId ->
                                annotations += buildAnnotation {
                                    annotationTypeRef = annotationClassId
                                        .constructClassLikeType(emptyArray(), isNullable = false)
                                        .toFirResolvedTypeRef()<|endoftext|>


Prompt:
// no local optimizations
    if (element0 in 1u..<3u != range0.contains(element0)) throw AssertionError()
    if (element0 !in 1u..<3u != !range0.contains(element0)) throw AssertionError()
    if (!(element0 in 1u..<3u) != !range0.contains(element0)) throw AssertionError()

Response:
if (!(element0 !in 1u..<3u) != range0.contains(element0)) throw AssertionError()
}

fun testR0xE1() {
    // with possible local optimizations
    if (1u in 1u..<3u != range0.contains(1u)) throw AssertionError()<|endoftext|>


Prompt:
fun <F : Number> three(p1: O, p2: F, p3: I) = Unit
        fun <F : Number> three(p1: I, p2: O, p3: F) = Unit
        fun <F : Number> three(p1: I, p2: F, p3: O) = Unit

Response:
fun <F : Number> three(p1: F, p2: O, p3: I) = Unit
        fun <F : Number> three(p1: F, p2: I, p3: O) = Unit

        inner class Inner2<I2 : StringBuilder>(p1: O, p2: I, p3: I2) {<|endoftext|>


Prompt:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Nothing?")!>x<!>
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char? & kotlin.Nothing?")!>x<!>.hashCode()
    }
}

// TESTCASE NUMBER: 40
fun case_40() {

Response:
val x: Unit? = null
    <!CAN_BE_VAL!>var<!> z = null

    if (x == implicitNullableNothingProperty || <!SENSELESS_COMPARISON!>z === x<!>) {
        <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><|endoftext|>


Prompt:
val newInitializer = revive<FirAnonymousInitializer>(designation)
    initializer.replaceBody(newInitializer.body)
}

private fun needCalculatingLazyBodyForConstructor(firConstructor: FirConstructor): Boolean {

Response:
if (needCalculatingLazyBodyForFunction(firConstructor) || firConstructor.delegatedConstructor is FirLazyDelegatedConstructorCall) {
        return true
    }
    val delegatedConstructor = firConstructor.delegatedConstructor
    if (delegatedConstructor is FirMultiDelegatedConstructorCall) {<|endoftext|>


Prompt: if (y != null || <!SENSELESS_COMPARISON!>this.y != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit"), DEBUG_INFO_SMARTCAST!>this.y<!>.equals(null)

Response: if (y != null || <!SENSELESS_COMPARISON!>this.y != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit"), DEBUG_INFO_SMARTCAST!>this.y<!>.propT<|endoftext|>


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

import junit.framework.TestCase.assertEquals
import junit.framework.TestCase.assertNull
import org.jetbrains.kotlin.incremental.IncrementalCompilationContext
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test

Response:
import org.junit.rules.TemporaryFolder
import java.io.File
import kotlin.test.assertFailsWith

class SourceToOutputFilesMapTest {

    @get:Rule
    val tmpDir = TemporaryFolder()

    private lateinit var srcDir: File
    private lateinit var classesDir: File

    private lateinit var stofMap: SourceToOutputFilesMap<|endoftext|>


Prompt:
return implClass.constructors.singleOrNull { cons ->
            cons.valueParameters.map { it.name }.toSet() == existingValueArguments
        } ?: implClass.addConstructor {
            startOffset = SYNTHETIC_OFFSET
            endOffset = SYNTHETIC_OFFSET
            visibility = DescriptorVisibilities.PUBLIC
        }.apply {

Response:
expression.symbol.owner.valueParameters
                    .filter { it.name in existingValueArguments }
                    .forEach { parameter -> addValueParameter(parameter.name.asString(), parameter.type) }
            createConstructorBody(this, expression.symbol.owner)
        }
    }<|endoftext|>


Prompt:
add(FirErrors.FINITE_BOUNDS_VIOLATION_IN_JAVA) { firDiagnostic ->
        FiniteBoundsViolationInJavaImpl(
            firDiagnostic.a.map { firBasedSymbol ->
                firSymbolBuilder.buildSymbol(firBasedSymbol)
            },
            firDiagnostic as KtPsiDiagnostic,

Response:
token,
        )
    }
    add(FirErrors.EXPANSIVE_INHERITANCE) { firDiagnostic ->
        ExpansiveInheritanceImpl(
            firDiagnostic as KtPsiDiagnostic,
            token,
        )
    }
    add(FirErrors.EXPANSIVE_INHERITANCE_IN_JAVA) { firDiagnostic -><|endoftext|>


Prompt:
open class A0<E> : MutableList<E> {
    override fun add(element: E): Boolean {
        throw UnsupportedOperationException()
    }

    override fun add(index: Int, element: E) {
        throw UnsupportedOperationException()
    }

    override fun addAll(index: Int, elements: Collection<E>): Boolean {
        throw UnsupportedOperationException()
    }

Response:
override fun addAll(elements: Collection<E>): Boolean {
        throw UnsupportedOperationException()
    }

    override fun clear() {
        throw UnsupportedOperationException()
    }

    override fun listIterator(): MutableListIterator<E> {
        throw UnsupportedOperationException()
    }

    override fun listIterator(index: Int): MutableListIterator<E> {<|endoftext|>


Prompt:
OTHER("other", "complex expression");

        override fun toString() = str
    }

    /**
     * Stable means here we do not expect some sudden change of their values,
     * like accessing mutable properties in another thread, so smart casts can be used safely.
     */
    val isStable = kind == Kind.STABLE_VALUE ||
            kind == Kind.STABLE_VARIABLE ||

Response:
kind == Kind.STABLE_COMPLEX_EXPRESSION ||
            kind == Kind.LEGACY_STABLE_LOCAL_DELEGATED_PROPERTY ||
            kind == Kind.LEGACY_ALIEN_BASE_PROPERTY ||
            kind == Kind.LEGACY_ALIEN_BASE_PROPERTY_INHERITED_IN_INVISIBLE_CLASS<|endoftext|>


Prompt:
open inner class ExtFieldGeneratorImpl(field: Descriptors.FieldDescriptor, p: Printer) : FieldGenerator(field, p) {
        val outerClassName = field.file.options.javaOuterClassname.removePrefix("Debug")
        val fieldName = field.name.javaName
        val fullFieldName = "$outerClassName.$fieldName"

Response:
override fun printRepeatedField() {
            p.printlnMultiline(
                """
                if (old.getExtensionCount($fullFieldName) != new.getExtensionCount($fullFieldName)) {
                    $statement
                }
                else {
                    for(i in 0..old.getExtensionCount($fullFieldName) - 1) {<|endoftext|>


Prompt:
a<!UNSAFE_CALL!>.<!>length
    (a <!USELESS_CAST!>as? String<!>)!!
    <!DEBUG_INFO_SMARTCAST!>a<!>.length
}

fun test_3(a: Any?) {
    a as String
    a <!USELESS_CAST!>as String<!>
}

Response:
fun test_4(a: Any?) {
    a as String
    a <!USELESS_CAST!>as? String<!>
}

fun test_5(a: Any?) {
    (a as? String)!!
    <!DEBUG_INFO_SMARTCAST!>a<!>.length
    (a <!USELESS_CAST!>as String<!>)
}<|endoftext|>


Prompt:
withDeclaration: (T, () -> Unit) -> Unit,
        declarationsProvider: (T) -> List<FirDeclaration>,
        crossinline isUsedInControlFlowBuilder: (FirDeclaration) -> Boolean,
    ) {
        val declarations = declarationsProvider(declarationWithMembers)
        if (declarations.none(isUsedInControlFlowBuilder)) return

        withDeclaration(declarationWithMembers) {

Response:
for (declaration in declarations) {
                if (isUsedInControlFlowBuilder(declaration)) {
                    declaration.lazyResolveToPhase(resolverPhase.previous)
                    performResolve(declaration)
                }
            }
        }
    }

    private fun calculateControlFlowGraph(target: FirFile) {
        checkWithAttachment(
            target.controlFlowGraphReference == null,<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.declarations.IrProperty
import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
import org.jetbrains.kotlin.ir.types.defaultType

Response:
import org.jetbrains.kotlin.ir.util.constructors
import org.jetbrains.kotlin.ir.util.isLocal
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.platform.konan.isNative

/**<|endoftext|>


Prompt:
assertFalse(eqCharLongQ(0.toChar(), undefined))
    assertFalse(eqCharLongQ(1.toChar(), 0.toLong()))
    assertFalse(eqCharLongQ(1.toChar(), 1.toLong()))
    assertFalse(eqCharLongQ(1.toChar(), null))
    assertFalse(eqCharLongQ(1.toChar(), undefined))

Response:
assertFalse(eqCharQLong(0.toChar(), 0.toLong()))
    assertFalse(eqCharQLong(0.toChar(), 1.toLong()))
    assertFalse(eqCharQLong(1.toChar(), 0.toLong()))
    assertFalse(eqCharQLong(1.toChar(), 1.toLong()))<|endoftext|>


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

import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.NotFoundClasses
import org.jetbrains.kotlin.ir.IrBuiltIns
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI

Response:
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.lazy.LazyScopedTypeParametersResolver
import org.jetbrains.kotlin.ir.linkage.IrDeserializer
import org.jetbrains.kotlin.ir.linkage.IrProvider<|endoftext|>


Prompt:
}.joinToString(File.pathSeparator))
    }
}

private fun ArrayList<String>.addScriptArguments(arguments: List<String>) {
    if (arguments.isNotEmpty() && arguments.first() != "--") {
        add("--")
    }
    addAll(arguments)
}

class ReplRunner : RunnerWithCompiler() {

Response:
override fun run(classpath: List<URL>, compilerArguments: List<String>, arguments: List<String>, compilerClasspath: List<URL>) {
        val compilerArgs = ArrayList<String>().apply {
            addClasspathArgIfNeeded(classpath)
            addAll(compilerArguments)
            addScriptArguments(arguments)
        }<|endoftext|>


Prompt:
public fun insert(index: Int, value: Any?): StringBuilder

    /**
     * Inserts the string [value] into this string builder at the specified [index] and returns this instance.
     *
     * If [value] is `null`, then the four characters `"null"` are inserted.
     *

Response:
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
     */
    @SinceKotlin("1.4")
    public fun insert(index: Int, value: String?): StringBuilder

    /**
     *  Sets the length of this string builder to the specified [newLength].
     *<|endoftext|>


Prompt:
t = 4
            }
            VV14 -> {
                t = 4
            }
            VV15 -> {
                t = 435
            }
            VV16 -> {
                t = 31
            }
            VV17 -> {
                t = 1
            }
            VV18 -> {
                t = 1
            }
            VV19 -> {
                t = 1
            }

Response:
VV20 -> {
                t = 1
            }
            else -> {
                t = 5
            }
        }
        return t
    }

    private fun stringSwitch(s: String) : Int {
        when(s) {
            "ABCDEFG1" -> return 1
            "ABCDEFG2" -> return 2
            "ABCDEFG2" -> return 3<|endoftext|>


Prompt:
override fun getSubPackagesOf(fqName: FqName, nameFilter: (Name) -> Boolean): Collection<FqName> {
        val result = HashSet<FqName>()
        for (provider in providers) {
            result.addAll(provider.getSubPackagesOf(fqName, nameFilter))
        }
        return result
    }

Response:
override fun toString(): String = debugName
}<|endoftext|>


Prompt:
inline fun <T> tryOrElse(f1: () -> T, f2: () -> T): T {
    try {
        return f1()
    }
    catch (e: Exception) {
        return f2()
    }
}

fun testIt() = "abc" + tryOrElse({ "def" }, { "oops" }) + "ghi"

fun box(): String {

Response:
val test = testIt()
    if (test != "abcdefghi") return "Failed, test==$test"

    return "OK"
}<|endoftext|>


Prompt:
context.scope.ownerDescriptor,
            Annotations.EMPTY,
            CallableMemberDescriptor.Kind.DECLARATION,
            expression.toSourceElement(),
            /* isCoroutine = */ ReflectionTypes.isNumberedKSuspendFunction(type) || referencedFunction.isSuspend
        )

        functionDescriptor.initialize(
            null, null, emptyList(), emptyList(),

Response:
createValueParametersForInvokeInFunctionType(functionDescriptor, type.arguments.dropLast(1)),
            type.arguments.last().type,
            Modality.FINAL,
            DescriptorVisibilities.PUBLIC
        )

        context.trace.record(BindingContext.FUNCTION, expression, functionDescriptor)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.incremental.parsing.classesFqNames
import org.jetbrains.kotlin.incremental.storage.BasicFileToPathConverter
import org.jetbrains.kotlin.incremental.storage.FileLocations
import org.jetbrains.kotlin.incremental.util.BufferingMessageCollector

Response:
import org.jetbrains.kotlin.incremental.util.ExceptionLocation
import org.jetbrains.kotlin.incremental.util.reportException
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
import org.jetbrains.kotlin.name.FqName<|endoftext|>


Prompt:
if (a) {
                val a = someComposableValue()
                used(a)
                val m = Modifier()
                val dismissModifier = if (visible) {
                    m.pointerInput(Unit) { detectTapGestures { onDismiss() } }
                } else {
                    m
                }
                used(dismissModifier)
            }
        }
        """
    )

Response:
@Test
    fun testRememberAfterStaticDefaultParameters() = comparisonPropagation(
        unchecked = """
            import androidx.compose.runtime.*

            enum class Foo {
                A,
                B,
                C,
            }

            @Stable
            fun swizzle(a: Int, b: Int) = a + b

            @Composable<|endoftext|>


Prompt: fun <!UNDERSCORE_IS_RESERVED!>__<!>(<!UNDERSCORE_IS_RESERVED!>___<!>: Int, y: <!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>_<!><Int>?): Int {

Response:
val (_, z) = Pair(<!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>___<!> - 1, 42)
    val (x, <!UNDERSCORE_IS_RESERVED!>__________<!>) = Pair(<!UNDERSCORE_USAGE_WITHOUT_BACKTICKS!>___<!> - 1, 42)<|endoftext|>


Prompt:
A(1, 2f, kotlin.Unit, "", ',', null), B(1, 2f, kotlin.Unit, "", ',', null), C(1, 2f, kotlin.Unit, "", ',', null);

    val x: Char? = '.'
    private val y: Unit? = kotlin.Unit
    protected val z: Int? = 12

Response:
public val u: String? = "..."
    val s: Any?
    val v: Int?
    val w: Number?
    val t: String? = if (u != null) this.u else null

    init {<|endoftext|>


Prompt:
* which are required earlier than the [TYPES] phase or other annotations which are required for some compiler plugins.
     * For some annotations (like [Deprecated] or [Target]) not only the type, but also the arguments are resolved.
     *
     * Also calculates [DeprecationsProvider].
     *
     * This is a [*jumping phase*][FirResolvePhase].
     */

Response:
COMPILER_REQUIRED_ANNOTATIONS,

    /**
     * The compiler generates companion objects which were provided by compiler plugins.
     */
    COMPANION_GENERATION,

    /**
     * The compiler resolves all supertypes of classes and performs type alias expansion.
     * Breaks loops in the type hierarchy if needed.
     *<|endoftext|>