Prompt:
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.annotation.Nonnull;
import javax.annotation.meta.TypeQualifierNickname;
import javax.annotation.meta.When;

@Target({ElementType.METHOD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)

Response:
@Documented
@Nonnull
@TypeQualifierNickname
public @interface NotNull {
}

// FILE: J1.java

import spr.*;

public interface J1<T> {
    @Nullable
    T getFoo();
}

// FILE: J2.java

import spr.*;

public class J2 implements J1<String> {
    @NotNull<|endoftext|>


Prompt:
when (irFunction.valueParameters.size) {
            1 -> AssertionError("Assertion failed").handleUserException(environment)
            2 -> AssertionError(environment.callStack.popState().asString()).handleUserException(environment)
        }
    }
}

internal object DataClassArrayToString : IntrinsicBase() {

Response:
override fun getListOfAcceptableFunctions(): List<String> {
        return listOf("kotlin.internal.ir.dataClassArrayMemberToString")
    }

    private fun arrayToString(array: Any?): String {
        return when (array) {
            null -> "null"
            is Array<*> -> Arrays.toString(array)<|endoftext|>


Prompt:
val INFER_MAIN_MODULE by directive(
        description = "Infer main module automatically using dependency graph",
        applicability = DirectiveApplicability.Global
    )

    val RUN_PLAIN_BOX_FUNCTION by directive(
        description = "",
        applicability = DirectiveApplicability.Global
    )

    val NO_INLINE by directive(

Response:
description = "Disable inline in js module",
        applicability = DirectiveApplicability.Module
    )

    val SKIP_NODE_JS by directive(
        description = "",
        applicability = DirectiveApplicability.Global
    )

    val SKIP_MINIFICATION by directive(
        description = "",
        applicability = DirectiveApplicability.Global
    )<|endoftext|>


Prompt:
<!CONFLICTING_OVERLOADS!>@Deprecated(message = "", level = DeprecationLevel.HIDDEN) fun <T: UserInterface> testTypeParameterWithIdenticalUpperBoundsB(arg: T)<!> {}
<!CONFLICTING_OVERLOADS!>fun <T: UserInterface> testTypeParameterWithIdenticalUpperBoundsB(arg: T)<!> {}

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


Prompt:
dependencyProviders,
            )

            register(
                FirSymbolProvider::class,
                FirCachingCompositeSymbolProvider(
                    this, providers,
                    expectedCachesToBeCleanedOnce = generatedSymbolsProvider != null
                )
            )

            generatedSymbolsProvider?.let { register(FirSwitchableExtensionDeclarationsSymbolProvider::class, it) }

Response:
register(DEPENDENCIES_SYMBOL_PROVIDER_QUALIFIED_KEY, FirCachingCompositeSymbolProvider(this, dependencyProviders))
        }
    }

    private fun FirSession.computeDependencyProviderList(moduleData: FirModuleData): List<FirSymbolProvider> {
        // dependsOnDependencies can actualize declarations from their dependencies. Because actual declarations can be more specific<|endoftext|>


Prompt:
assertEquals(123456789012345L, bigLongConstCopy)
}

// PROPERTY_READ_COUNT: name=longConst count=1 scope=testImportedLongConstInlinedLocally
// PROPERTY_READ_COUNT: name=L42 count=1 scope=testImportedLongConstInlinedLocally

Response:
// PROPERTY_READ_COUNT: name=L_42 count=4 scope=testImportedLongConstInlinedLocally
// PROPERTY_READ_COUNT: name=L84 count=2 scope=testImportedLongConstInlinedLocally
// PROPERTY_READ_COUNT: name=bigLongConst count=1 scope=testImportedLongConstInlinedLocally<|endoftext|>


Prompt:
private class CirClassifierIndexBuilder {
    companion object {
        const val initialCapacity = 1000
    }

    private val typeAliasesByUnderlyingType = CommonizerMap<CirEntityId, MutableList<CirTreeTypeAlias>>(initialCapacity)
    private val classifiersById = CommonizerMap<CirEntityId, CirClassifier>(initialCapacity)

Response:
private val classifierIds = CommonizerSet<CirEntityId>(initialCapacity)

    operator fun invoke(tree: CirTreeRoot) {
        tree.modules.forEach { module -> this(module) }
    }

    operator fun invoke(module: CirTreeModule) {
        module.packages.forEach { pkg -> this(pkg) }
    }<|endoftext|>


Prompt:
@Test
    @TestMetadata("changedExternalDependency")
    fun testChangedExternalDependency() = withRootDir(File("$TEST_SUITE_PATH/externalDependency")) {
        val externalLib = compileLibrary("externalLib") {
            outputDir = "external"
            "externalLib/file1.kt" copyTo "file1.kt"

Response:
"externalLib/file2.kt" copyTo "file2.kt"
        }
        val userLib = compileLibrary("userLib", externalLib) {
            "userLib/file1.kt" copyTo "file1.kt"
            "userLib/file2.kt" copyTo "file2.kt"
        }
        val main = compileToExecutable("main", externalLib, userLib) {<|endoftext|>


Prompt:
internal fun __kernel_sin(x: Double, y: Double, iy: Int): Double {
    var z: Double
    var r: Double
    var v: Double
    var ix: Int
    ix = __HI(x) and 0x7fffffff    /* high word of x */
    if (ix < 0x3e400000)            /* |x| < 2**-27 */ {

Response:
if (x.toInt() == 0) return x
    }        /* generate inexact */
    z = x * x
    v = z * x
    r = S2 + z * (S3 + z * (S4 + z * (S5 + z * S6)))
    if (iy == 0) return x + v * (S1 + z * r)<|endoftext|>


Prompt:
fun checkIntegrationTestOutput(targetName: String) {
                val classReportHtml = projectDir
                    .resolve("build/reports/tests/${targetName}IntegrationTest/classes/com.example.HelloIntegrationTest.html")
                    .readText()

Response:
assertTrue("test[$targetName]" in classReportHtml, "Test report should contain 'test[$targetName]':\n$classReportHtml")
                assertTrue("secondTest" !in classReportHtml, "Test report should not contain 'secondTest':\n$classReportHtml")<|endoftext|>


Prompt:
*   - `acosh(x)` is `NaN` when `x < 1`
 *   - `acosh(+Inf)` is `+Inf`
 */
@SinceKotlin("1.2")
public expect fun acosh(x: Float): Float

/**
 * Computes the inverse hyperbolic tangent of the value [x].
 *

Response:
* The returned value is `y` such that `tanh(y) == x`.
 *
 * Special cases:
 *   - `tanh(NaN)` is `NaN`
 *   - `tanh(x)` is `NaN` when `x > 1` or `x < -1`
 *   - `tanh(1.0)` is `+Inf`<|endoftext|>


Prompt:
override var source: KtSourceElement? = null
    override var coneTypeOrNull: ConeKotlinType? = null
    lateinit var anonymousObject: FirAnonymousObject

    override val annotations: MutableList<FirAnnotation>
        get() = shouldNotBeCalled()

    override fun build(): FirAnonymousObjectExpression {
        return FirAnonymousObjectExpressionImpl(
            source,

Response:
coneTypeOrNull,
            anonymousObject,
        )
    }

}

@OptIn(ExperimentalContracts::class)
inline fun buildAnonymousObjectExpression(init: FirAnonymousObjectExpressionBuilder.() -> Unit): FirAnonymousObjectExpression {
    contract {
        callsInPlace(init, kotlin.contracts.InvocationKind.EXACTLY_ONCE)
    }<|endoftext|>


Prompt:
if (featuresThatForcePreReleaseBinaries.isNotEmpty()) {
            collector.report(
                CompilerMessageSeverity.STRONG_WARNING,
                "Following manually enabled features will force generation of pre-release binaries: ${featuresThatForcePreReleaseBinaries.joinToString()}"
            )
        }

        if (disabledFeaturesFromUnsupportedVersions.isNotEmpty()) {
            collector.report(

Response:
CompilerMessageSeverity.ERROR,
                "The following features cannot be disabled manually, because the version they first appeared in is no longer " +
                        "supported:\n${disabledFeaturesFromUnsupportedVersions.joinToString()}"
            )
        }
    }

    fun toLanguageVersionSettings(collector: MessageCollector): LanguageVersionSettings {
        return toLanguageVersionSettings(collector, emptyMap())
    }<|endoftext|>


Prompt:
* overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 8 -> sentence 1
 * NUMBER: 3
 * DESCRIPTION: a callable reference is itself an argument to an overloaded function call
 */

// TESTCASE NUMBER: 1
class Case1() {

Response:
fun foo(x: () -> Int): String = TODO() // (1.1)
    fun foo(x: () -> Any): Unit = TODO() // (1.2)

    fun case1() {
        foo(::<!DEBUG_INFO_CALL("fqName: x; typeCall: variable")!>x<!>)<|endoftext|>


Prompt:
// JVM_ABI_K1_K2_DIFF: KT-63984
class P {
    var x : Int = 0
        private set

    fun foo() {
        ({ x = 4 }).let { it() }
    }
}

fun box() : String {
    val p = P()
    p.foo()

Response:
return if (p.x == 4) "OK" else "fail"
}<|endoftext|>


Prompt:
syntheticPropertiesScope.processPropertiesByName(name, processor)
    }
}

private val JAVA_ENHANCEMENT_FOR_DECLARED_MEMBERS = scopeSessionKey<FirRegularClassSymbol, FirContainingNamesAwareScope>()

Response:
private val JAVA_ENHANCEMENT_FOR_STATIC_DECLARED_MEMBERS = scopeSessionKey<FirRegularClassSymbol, FirContainingNamesAwareScope>()

private val JAVA_ENHANCEMENT_FOR_ALL_DECLARED_MEMBERS = scopeSessionKey<FirRegularClassSymbol, FirContainingNamesAwareScope>()<|endoftext|>


Prompt:
listOf(
                ":libraryProject:compileKotlinJs",
                ":mainProject:compileKotlinJs",
                ":mainProject:compileProductionExecutableKotlinJs",
                ":mainProject:browserProductionWebpack"
            )
        )
    }

    @MppGradlePluginTests
    @DisplayName("works with Multiplatform")
    @GradleTest

Response:
fun testRelocationMultiplatform(gradleVersion: GradleVersion) {
        val (firstProject, secondProject) = prepareTestProjects("new-mpp-lib-with-tests", gradleVersion)

        checkBuildCacheRelocation(
            firstProject,
            secondProject,
            listOf("build"),
            listOf(
                ":compileCommonMainKotlinMetadata",<|endoftext|>


Prompt:
assertEquals(0, lineNo)
            throw MyException()
        }

        fail()
    }

    @Test(expected = MyException::class)
    fun failure5() {
        // Source code module ID not specified.
        val originalText = """

Response:
|1 org.sample:liba,org.sample:liba-native[2.0] #0[2.0] #2[1.0]
        |${'\t'}/some/path/liba.klib
        |2 org.sample:libb,org.sample:libb-native #0[1.0]<|endoftext|>


Prompt:
import org.jetbrains.kotlin.light.classes.symbol.isOriginEquivalentTo
import org.jetbrains.kotlin.light.classes.symbol.modifierLists.InitializedModifiersBox
import org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightClassModifierList

Response:
import org.jetbrains.kotlin.load.java.structure.LightClassOriginKind
import org.jetbrains.kotlin.psi.KtEnumEntry

internal class SymbolLightClassForEnumEntry(
    private val enumConstant: SymbolLightFieldForEnumEntry,
    private val enumClass: SymbolLightClassBase,
    ktModule: KtModule,<|endoftext|>


Prompt:
// FIR_IDENTICAL
//KT-1680 Warn if non-null variable is compared to null
package kt1680

fun foo() {
    val x = 1
    if (<!SENSELESS_COMPARISON!>x != null<!>) {} // <-- need a warning here!
    if (<!SENSELESS_COMPARISON!>x == null<!>) {}

Response:
if (<!SENSELESS_COMPARISON!>null != x<!>) {}
    if (<!SENSELESS_COMPARISON!>null == x<!>) {}

    val y : Int? = 1
    if (y != null) {}
    if (y == null) {}
}<|endoftext|>


Prompt:
<!RESOLUTION_TO_CLASSIFIER!>Inner<!>(1)
        }
    }
}

fun foo() {
    Outer.<!RESOLUTION_TO_CLASSIFIER!>Inner<!>()
    Outer.<!RESOLUTION_TO_CLASSIFIER!>Inner<!>(1)
}

// FILE: imported.kt
import abc.Outer

Response:
import abc.Outer.Inner

fun bar() {
    <!RESOLUTION_TO_CLASSIFIER!>Inner<!>()
    <!RESOLUTION_TO_CLASSIFIER!>Inner<!>(1)

    with(Outer()) {
        Inner()
        Inner(1)
    }
}<|endoftext|>


Prompt:
fun <T> id(p: T): T = p

fun <A> main() {
    <!CANNOT_INFER_PARAMETER_TYPE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>f<!>()

    val a: A = <!TYPE_PARAMETER_AS_REIFIED!>f<!>()

Response:
f<<!TYPE_PARAMETER_AS_REIFIED!>A<!>>()

    val b: Int = f()
    f<Int>()

    val с: A = id(<!TYPE_PARAMETER_AS_REIFIED!>f<!>())
}<|endoftext|>


Prompt:
// JDK_RELEASE: 9
// CHECK_BYTECODE_TEXT
// 2 CHECKCAST java/lang/ReflectiveOperationException
// 1 LOCALVARIABLE reflective Ljava/lang/ReflectiveOperationException;

fun cond() = true

fun test(iae: IllegalAccessException?, cnfe: ClassNotFoundException?) {
    val reflective = if (cond()) iae else cnfe
}

Response:
fun box(): String {
    test(null, null)
    return "OK"
}<|endoftext|>


Prompt:
assertContains<Any?>(array as Array<Any?>, null)
        }
        testFailureMessage("Expected the array to contain the element.\nArray <${array.contentToString()}>, element <5>.") {
            assertContains(array, "5")
        }
    }

    @Test
    fun testAssertContainsCharArray() {

Response:
val array = charArrayOf('x', 'y', 'z')

        assertContains(array, 'z')

        testFailureMessage("Expected the array to contain the element.\nArray <${array.contentToString()}>, element <5>.") {
            assertContains(array, '5')
        }
    }

    @OptIn(ExperimentalUnsignedTypes::class)
    @Test<|endoftext|>


Prompt:
// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: FAILS_IN_JS_IR
// IGNORE_BACKEND: JS, JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// FILE: test.kt

fun checkEqual(x: Any, y: Any) {

Response:
if (x != y || y != x) throw AssertionError("$x and $y should be equal")
    if (x.hashCode() != y.hashCode()) throw AssertionError("$x and $y should have the same hash code")
}

fun checkNotEqual(x: Any, y: Any) {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.analysis.api.klib.reader.testUtils.render
import org.jetbrains.kotlin.analysis.api.klib.reader.testUtils.testDataDir
import org.jetbrains.kotlin.test.KotlinTestUtils
import kotlin.test.Test
import kotlin.test.fail

Response:
class ReadKlibDeclarationAddressesBlackBoxTest {

    @Test
    fun `test - testProject`() {
        val addresses = readKlibDeclarationAddresses(providedTestProjectKlib) ?: fail("Failed loading klib: $providedTestProjectKlib")
        KotlinTestUtils.assertEqualsToFile(testDataDir.resolve("!testProject.addresses"), addresses.render())<|endoftext|>


Prompt:
is CharArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
            is ShortArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))

Response:
is IntArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
            is LongArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))<|endoftext|>


Prompt:
private fun testCoding(base64: Base64, text: String, encodedText: String) {
        val encodedBytes = ByteArray(encodedText.length) { encodedText[it].code.toByte() }
        val bytes = ByteArray(text.length) { text[it].code.toByte() }
        encodedBytes.inputStream().decodingWith(base64).use { inputStream ->

Response:
assertEquals(text, inputStream.reader().readText())
        }
        encodedBytes.inputStream().decodingWith(base64).use { inputStream ->
            assertContentEquals(bytes, inputStream.readBytes())
        }
        ByteArrayOutputStream().let { outputStream ->
            outputStream.encodingWith(base64).use {
                it.write(bytes)
            }<|endoftext|>


Prompt:
super.visitGetValue(expression)
            }
        })
        blockInfo.variables.forEach {
            if (it.declaration.symbol !in referencedValues) {
                it.explicitEndLabel = continueLabel
            }
        }
    }

    private fun unwindBlockStack(
        endLabel: Label,
        data: BlockInfo,

Response:
nestedTryWithoutFinally: MutableList<TryInfo> = arrayListOf(),
        stop: (LoopInfo) -> Boolean
    ): LoopInfo? {
        @Suppress("RemoveExplicitTypeArguments")
        return data.handleBlock<Nothing> {
            when {
                it is TryWithFinallyInfo -> {
                    genFinallyBlock(it, null, endLabel, data, nestedTryWithoutFinally)<|endoftext|>


Prompt:
fun box(stepId: Int): String {
    val x = test(stepId)
    when (stepId) {
        0 -> if (x != 5) return "Fail, x == $x"
        1 -> if (x != 32) return "Fail, x == $x"
        2 -> if (x != 0) return "Fail, x == $x"

Response:
3 -> if (x != 0) return "Fail, x == $x"
        else -> return "Unkown"
    }
    return "OK"
}<|endoftext|>


Prompt:
*     ↪ project.multiplatformExtension.awaitSourceSets() // <- instead of .sourceSets | suspending until finally available
 * }
 * ```
 *
 * #### Example: Checker that requires platform compilations of a given SourceSet
 * ```kotlin
 * override suspend fun KotlinGradleProjectCheckerContext.runChecks(collector: KotlinToolingDiagnosticsCollector) {

Response:
*      ↪   project.multiplatformExtension.awaitSourceSets().getByName("commonMain") // suspending until all source sets available
 *      ↪       .internal.awaitPlatformCompilations() // suspending until all platform compilations are finally known
 * }
 * ```
 *
 * #### Example: Checker that just wants to run in a given [KotlinPluginLifecycle.Stage]<|endoftext|>


Prompt:
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JsAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")

Response:
annotation class JsAnnotation(val text: String)

@JsAnnotation("property")
@CommonAnnotation("property")
var propertyWithoutBackingField
    @JsAnnotation("getter") @CommonAnnotation("getter") get() = 3.14<|endoftext|>


Prompt:
}
}

class DeclarationScopeProviderForLocalClassifierAnalyzer(
    lazyDeclarationResolver: LazyDeclarationResolver,
    fileScopeProvider: FileScopeProvider,
    private val localClassDescriptorManager: LocalClassDescriptorHolder
) : DeclarationScopeProviderImpl(lazyDeclarationResolver, fileScopeProvider) {

Response:
override fun getResolutionScopeForDeclaration(elementOfDeclaration: PsiElement): LexicalScope {
        if (localClassDescriptorManager.isMyClass(elementOfDeclaration)) {
            return localClassDescriptorManager.getResolutionScopeForClass(elementOfDeclaration as KtClassOrObject)
        }
        return super.getResolutionScopeForDeclaration(elementOfDeclaration)
    }<|endoftext|>


Prompt:
// WITH_STDLIB

import kotlin.test.*

fun sumIB(a:Int, b:Byte  ) = a + b
fun sumIS(a:Int, b:Short ) = a + b
fun sumII(a:Int, b:Int   ) = a + b
fun sumIL(a:Int, b:Long  ) = a + b

Response:
fun sumIF(a:Int, b:Float ) = a + b
fun sumID(a:Int, b:Double) = a + b

fun modID(a:Int, b:Double) = a % b

fun box(): String {
    if (sumIB(2, 3)    != 5)    throw Error()
    if (sumIS(2, 3)    != 5)    throw Error()<|endoftext|>


Prompt:
forceCallKind ?: if (qualifiedAccess is FirFunctionCall) CallKind.Function else CallKind.VariableAccess,
            name,
            explicitReceiver,
            argumentList,
            isImplicitInvoke = qualifiedAccess is FirImplicitInvokeCall,
            isUsedAsGetClassReceiver = isUsedAsGetClassReceiver,
            typeArguments,
            session,
            components.file,

Response:
containingDeclarations,
            origin = origin,
            resolutionMode = resolutionMode,
        )
        towerResolver.reset()
        val result = towerResolver.runResolver(info, resolutionContext, collector)

        var (reducedCandidates, newApplicability) = reduceCandidates(result, explicitReceiver, resolutionContext)<|endoftext|>


Prompt:
arrayOf("2", "-d", "3", "out.txt", "something", "else", "in", "string")) }
        assertTrue("Too many arguments! Couldn't process argument something" in exception.message!!)
    }

    @Test
    fun testUnknownOption() {
        val argParser = ArgParser("testParser")

Response:
val output by argParser.option(ArgType.String, "output", "o", "Output file")
        val input by argParser.option(ArgType.String, "input", "i", "Input file")
        val exception = assertFailsWith<IllegalStateException> {
            argParser.parse(arrayOf("-o", "out.txt", "-d", "-i", "input.txt"))
        }<|endoftext|>


Prompt:
throwable = sourceSet.isRegisteredByKotlinSourceSetConventionAt
        )
    }

    object IosSourceSetConventionUsedWithoutIosTarget : ToolingDiagnosticFactory(WARNING) {
        operator fun invoke(sourceSet: KotlinSourceSet) = build(
            """
                |Accessed '$sourceSet' without registering any ios target:
                |  kotlin {

Response:
|     /* Register at least one of the following targets */
                |     iosX64()
                |     iosArm64()
                |     iosSimulatorArm64()
                |
                |     /* Use convention */
                |     sourceSets.${sourceSet.name}.dependencies {
                |
                |     }
                |  }
            """.trimMargin(),<|endoftext|>


Prompt:
@kotlin.SinceKotlin(version = "1.9")
    @kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class})
    public open override val endExclusive: kotlin.ULong { get; }

    public open override val endInclusive: kotlin.ULong { get; }

Response:
public open override val start: kotlin.ULong { get; }

    public open override operator fun contains(value: kotlin.ULong): kotlin.Boolean

    public open override operator fun equals(other: kotlin.Any?): kotlin.Boolean

    public open override fun hashCode(): kotlin.Int

    public open override fun isEmpty(): kotlin.Boolean<|endoftext|>


Prompt:
block: StateKeeperScope<Entity, Context>.(Entity, Context) -> Unit,
) {
    if (list != null) {
        for (entity in list) {
            if (entity != null) {
                StateKeeperScope<Entity, Context>(entity).block(entity, context)
            }
        }
    }
}

/**
 * Defines a [StateKeeper] using a builder DSL.

Response:
* This function is supposed to be the main entry point for [StateKeeper] creation.
 *
 * @param block a function that defines state preservation rules.
 *  The function collects rules for each individual owner separately.
 *  Nested owners can be handled inside [entity] or [entityList] blocks.
 */<|endoftext|>


Prompt:
class WasmFailingTestSuppressor(testServices: TestServices) : AfterAnalysisChecker(testServices) {
    override fun suppressIfNeeded(failedAssertions: List<WrappedException>): List<WrappedException> {
        val testFile = testServices.moduleStructure.originalTestDataFiles.first()

Response:
val failFile = testFile.parentFile.resolve("${testFile.name}.fail").takeIf { it.exists() }
            ?: return failedAssertions
        if (failedAssertions.any { it is WrappedException.FromFacade }) return emptyList()
        return failedAssertions + AssertionError("Fail file exists but no exception was thrown. Please remove ${failFile.name}").wrap()<|endoftext|>


Prompt:
override fun bar(): Int {
        return 10
    }
    override fun foo(t: Int) { }
}

interface KotlinInterface : Java1

interface KotlinInterface2: Java1 {
    val a: Int
    fun foo(t: Int) { }
    fun bar(): Int {
        return 10
    }
}

Response:
fun test(a:A, b: B, c: C, d: D, e: E, f: F, g: G, h: H){
    b.a
    b.foo(1)
    b.bar()
    d.a
    d.foo("")
    d.bar()
    e.a
    e.bar()
    e.foo(1)
    f.a<|endoftext|>


Prompt:
valueParameterConstraints[adapteeParameter] = parameterConstraint
        }

        return SignatureAdaptationConstraints(
            if (valueParameterConstraints.isEmpty()) emptyMap() else valueParameterConstraints,
            returnTypeConstraint
        )
    }

Response:
private fun computeParameterTypeAdaptationConstraint(adapteeType: IrType, expectedType: IrType): TypeAdaptationConstraint? {
        if (adapteeType !is IrSimpleType)
            throw AssertionError("Simple type expected: ${adapteeType.render()}")
        if (expectedType !is IrSimpleType)
            throw AssertionError("Simple type expected: ${expectedType.render()}")<|endoftext|>


Prompt:
fun foo() = B.prop.toString()
    }
) {/* ClassDeclarationStructureElement */
    constructor()/* DeclarationStructureElement */
}

class G : A(
    {
        fun foo() = B.prop.toString()
    }
) {/* ClassDeclarationStructureElement */
    constructor() : super(
        {

Response:
fun foo() = B.prop.toString()
        }
    )/* DeclarationStructureElement */
}

class H : A {/* ClassDeclarationStructureElement */
    constructor() : super(
        {
            fun foo() = B.prop.toString()
        }
    )/* DeclarationStructureElement */
}<|endoftext|>


Prompt:
J <!TYPE_MISMATCH!>{ <!EXPECTED_PARAMETER_TYPE_MISMATCH!>s: String<!> -> s}<!> // should be prohibited, because SAM value parameter has nullable type
    J { "" + it<!UNSAFE_CALL!>.<!>length }

Response:
J { <!NULL_FOR_NONNULL_TYPE, NULL_FOR_NONNULL_TYPE!>null<!> }
    J { <!TYPE_MISMATCH, TYPE_MISMATCH!>it?.length?.toString()<!> }<|endoftext|>


Prompt:
if (declaration is IrField) {
            declaration.initializer?.let { originalBody ->
                declaration.initializer = context.irFactory.createExpressionBody(
                    startOffset = originalBody.startOffset,
                    endOffset = originalBody.endOffset,
                    expression = originalBody.expression.deepCopyWithSymbols(declaration),
                )
            }
        }

        return null

Response:
}
}<|endoftext|>


Prompt:
* If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.
 *
 * @throws NoSuchElementException if the array is empty.
 */
@SinceKotlin("1.4")
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
@OverloadResolutionByLambdaReturnType
@kotlin.internal.InlineOnly

Response:
public inline fun DoubleArray.maxOf(selector: (Double) -> Double): Double {
    if (isEmpty()) throw NoSuchElementException()
    var maxValue = selector(this[0])
    for (i in 1..lastIndex) {
        val v = selector(this[i])
        maxValue = maxOf(maxValue, v)
    }
    return maxValue
}

/**<|endoftext|>


Prompt:
import org.jetbrains.kotlin.codegen.optimization.fixStack.peek
import org.jetbrains.kotlin.codegen.optimization.fixStack.top
import org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer
import org.jetbrains.kotlin.codegen.pseudoInsns.PseudoInsn

Response:
import org.jetbrains.kotlin.codegen.pseudoInsns.asNotNull
import org.jetbrains.kotlin.codegen.pseudoInsns.isPseudo
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.resolve.jvm.AsmTypes<|endoftext|>


Prompt:
val processorsStatsReportFile: File?,
    val fileReadHistoryReportFile: File?
) : KaptFlags {
    override fun get(flag: KaptFlag) = flags[flag]

    class Builder {
        var projectBaseDir: File? = null
        val compileClasspath: MutableList<File> = mutableListOf()

Response:
val javaSourceRoots: MutableList<File> = mutableListOf()

        val changedFiles: MutableList<File> = mutableListOf()
        val compiledSources: MutableList<File> = mutableListOf()
        var incrementalCache: File? = null
        val classpathChanges: MutableList<String> = mutableListOf()

        var sourcesOutputDir: File? = null<|endoftext|>


Prompt:
visitor!!.visitTypeParameterDescriptor(this, null)
    }

    override fun toString(): String = super.toString() + "\nParent: $containingDeclaration"
}

fun IrTypeParameter.toIrBasedDescriptor() = IrBasedTypeParameterDescriptor(this)

Response:
open class IrBasedVariableDescriptor(owner: IrVariable) : VariableDescriptor, IrBasedCallableDescriptor<IrVariable>(owner) {

    override fun getContainingDeclaration() = (owner.parent as IrDeclaration).toIrBasedDescriptor()
    override fun getType() = owner.type.toIrBasedKotlinType()
    override fun getReturnType() = getType()<|endoftext|>


Prompt:
val factory = dispatcher.getDiagnostic(conflictingDeclaration, symbols, context)

            if (factory != null) {
                reporter.reportOn(source, factory, symbols, context)
            }
        }
    }

    private val FirBasedSymbol<*>.isPrimaryConstructor: Boolean

Response:
get() = this is FirConstructorSymbol && isPrimary || origin == FirDeclarationOrigin.Synthetic.TypeAliasConstructor

    private fun checkFile(file: FirFile, inspector: FirDeclarationCollector<FirBasedSymbol<*>>, context: CheckerContext) {<|endoftext|>


Prompt:
// Will be initialized only when we found a branch that compares
        // subject with compile-time known enum entry.
        val subjectOrdinalProvider = lazy {
            context.createIrBuilder(currentScope!!.scope.scopeOwnerSymbol, subject.startOffset, subject.endOffset).run {
                val integer = if (subject.type.isNullable())

Response:
irIfNull(context.irBuiltIns.intType, irGet(subject), irInt(-1), mapRuntimeEnumEntry(this, irGet(subject)))
                else
                    mapRuntimeEnumEntry(this, irGet(subject))
                scope.createTemporaryVariable(integer).also {
                    expression.statements.add(1, it)
                }
            }
        }<|endoftext|>


Prompt:
parent: LexicalScope,
    override val ownerDescriptor: DeclarationDescriptor,
    override val isOwnerDescriptorAccessibleByLabel: Boolean,
    redeclarationChecker: LocalRedeclarationChecker,
    override val kind: LexicalScopeKind
) : LexicalScopeStorage(parent, redeclarationChecker) {

Response:
override val implicitReceiver: ReceiverParameterDescriptor?
        get() = null
    override val contextReceiversGroup: List<ReceiverParameterDescriptor>
        get() = emptyList()

    private var canWrite: Boolean = true
    private var lastSnapshot: Snapshot? = null

    fun freeze() {
        canWrite = false
    }<|endoftext|>


Prompt:
// WITH_STDLIB

@file:JvmName("TestKt")
package test

import kotlinx.parcelize.*
import android.os.Parcel
import android.os.Parcelable
import java.util.Arrays

@Parcelize
data class A(val params: @RawValue Array<*>? = null): Parcelable

fun box() = parcelTest { parcel ->

Response:
val a1 = A(arrayOf<Int>(1,2,3))
    val b1 = A()
    a1.writeToParcel(parcel, 0)
    b1.writeToParcel(parcel, 0)

    val bytes = parcel.marshall()
    parcel.unmarshall(bytes, 0, bytes.size)
    parcel.setDataPosition(0)<|endoftext|>


Prompt:
cases += SwitchBranchData.SwitchDefaultData(branch.result)
                        break@l
                    }
                }
                else -> return null
            }
        }

        val s = varSymbol

        // Seems it is not reasonable to optimize very simple when
        if (caseCount < 3) return null

Response:
if (s?.owner?.type?.isSuitableForSwitch() == true) return SwitchData(s, cases)
        return null
    }

    private fun buildJsSwitch(switch: SwitchData): JsStatement {

        val exprTransformer = IrElementToJsExpressionTransformer()
        val stmtTransformer = IrElementToJsStatementTransformer()<|endoftext|>


Prompt:
val ConeKotlinType.isLong: Boolean get() = isBuiltinType(StandardClassIds.Long, isNullable = false)
val ConeKotlinType.isFloat: Boolean get() = isBuiltinType(StandardClassIds.Float, isNullable = false)

Response:
val ConeKotlinType.isDouble: Boolean get() = isBuiltinType(StandardClassIds.Double, isNullable = false)

val ConeKotlinType.isAny: Boolean get() = isBuiltinType(StandardClassIds.Any, isNullable = false)<|endoftext|>


Prompt:
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.expressions.FirBlock
import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol

Response:
import org.jetbrains.kotlin.fir.symbols.impl.FirAnonymousInitializerSymbol
import org.jetbrains.kotlin.fir.visitors.FirTransformer
import org.jetbrains.kotlin.fir.visitors.FirVisitor
import org.jetbrains.kotlin.fir.visitors.transformInplace<|endoftext|>


Prompt:
private fun isNotLessSpecific(
        sigA: FlatSignature<FirCallableSymbol<*>>,
        sigB: FlatSignature<FirCallableSymbol<*>>,
    ): Boolean = createEmptyConstraintSystem().isSignatureNotLessSpecific(
        sigA,
        sigB,
        OverloadabilitySpecificityCallbacks,

Response:
session.typeSpecificityComparatorProvider?.typeSpecificityComparator ?: TypeSpecificityComparator.NONE,
    )

    private fun createSignature(declaration: FirCallableSymbol<*>): FlatSignature<FirCallableSymbol<*>> {
        val valueParameters = (declaration as? FirFunctionSymbol<*>)?.valueParameterSymbols.orEmpty()<|endoftext|>


Prompt:
configure: KotlinNativeTargetWithHostTests.() -> Unit = { }
    ): KotlinNativeTargetWithHostTests =
        configureOrCreate(
            name,
            @Suppress("DEPRECATION")
            presets.getByName("mingwX64") as KotlinNativeTargetWithHostTestsPreset,
            configure
        )

Response:
fun mingwX64() = mingwX64("mingwX64") { }
    fun mingwX64(name: String) = mingwX64(name) { }
    fun mingwX64(name: String, configure: Action<KotlinNativeTargetWithHostTests>) = mingwX64(name) { configure.execute(this) }<|endoftext|>


Prompt:
val MinUS = UShort.MIN_VALUE
val MaxUL = ULong.MAX_VALUE
val MinUL = ULong.MIN_VALUE

fun box(): String {
    val list1 = ArrayList<UInt>()
    for (i in MaxUI..MinUI step 1) {
        list1.add(i)
        if (list1.size > 23) break
    }

Response:
if (list1 != listOf<UInt>()) {
        return "Wrong elements for MaxUI..MinUI step 1: $list1"
    }

    val list2 = ArrayList<UInt>()
    for (i in MaxUB..MinUB step 1) {
        list2.add(i)
        if (list2.size > 23) break
    }<|endoftext|>


Prompt:
x.addAll(<!ARGUMENT_TYPE_MISMATCH!>mc<Open>()<!>)
    x.addAllMC(<!ARGUMENT_TYPE_MISMATCH!>mc<Open>()<!>)

    x.addAll(<!ARGUMENT_TYPE_MISMATCH!>mc<Derived>()<!>)

Response:
x.addAllMC(<!ARGUMENT_TYPE_MISMATCH!>mc<Derived>()<!>)

    x.addAll(c())
    x.addAll(c<Nothing>())

    x.addAllInv(<!ARGUMENT_TYPE_MISMATCH!>mc<Open>()<!>)<|endoftext|>


Prompt:
expect annotation class B(val a: Array<String>)

@OptionalExpectation
expect annotation class C()

@OptionalExpectation
expect annotation class D()

actual annotation class D actual constructor()

@Suppress("OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE")
@A(42)
@B(["OK", ""])
@C

Response:
@D()
fun ok() {}<|endoftext|>


Prompt:
analysisFlag(AnalysisFlags.muteExpectActualClassesWarning, trueOrNull(LanguageSettingsDirectives.ENABLE_EXPECT_ACTUAL_CLASSES_WARNING in directives) != true),
            analysisFlag(AnalysisFlags.dontWarnOnErrorSuppression, trueOrNull(LanguageSettingsDirectives.DONT_WARN_ON_ERROR_SUPPRESSION in directives)),

Response:
analysisFlag(JvmAnalysisFlags.jvmDefaultMode, directives.singleOrZeroValue(LanguageSettingsDirectives.JVM_DEFAULT_MODE)),
            analysisFlag(JvmAnalysisFlags.inheritMultifileParts, trueOrNull(LanguageSettingsDirectives.INHERIT_MULTIFILE_PARTS in directives)),<|endoftext|>


Prompt:
.withArtifacts(JvmLibrary::class.java, SourcesArtifact::class.java)
            .execute()

        val sourcesArtifacts = resolutionResult.resolvedComponents.flatMap { resolved ->
            resolved.getArtifacts(SourcesArtifact::class.java).filterIsInstance<ResolvedArtifactResult>()
        }

        sourcesArtifacts.forEach { artifact ->

Response:
binaryDependencies[Coordinates(artifact)]?.forEach { dependency ->
                dependency.sourcesClasspath.add(artifact.file)
            }
        }
    }

    private fun selectConfiguration(sourceSet: KotlinSourceSet): Configuration {
        val platformCompilation = sourceSet.internal.compilations.singleOrNull { it.platformType != KotlinPlatformType.common }<|endoftext|>


Prompt:
node.instructions.remove(value.boxingInsn)
        } else {
            val iterator = value.progressionIterator ?: error("iterator should not be null because isFromProgressionIterator returns true")

            //add checkcast to kotlin/<T>Iterator before next() call

Response:
node.instructions.insertBefore(value.boxingInsn, TypeInsnNode(Opcodes.CHECKCAST, iterator.type.internalName))

            //invoke concrete method (kotlin/<T>iterator.next<T>())
            node.instructions.set(
                value.boxingInsn,
                MethodInsnNode(
                    Opcodes.INVOKEVIRTUAL,<|endoftext|>


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

        if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>.funAny()

Response:
if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>.funNullableT()

        if (s != null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>s<!>.funNullableAny()<|endoftext|>


Prompt:
compileSdk = 31
                flavorDimensions += "version"
                productFlavors {
                    create("demo") {
                        it.dimension = "version"
                    }
                    create("full") {
                        it.dimension = "version"
                    }
                }
            }
            val kotlin = multiplatformExtension
            val androidTarget = kotlin.androidTarget()

            evaluate()

Response:
assertEquals(
                listOf(
                    listOf("commonMain"),
                    listOf("androidDebug", "androidFull", "androidFullDebug", "androidMain"),
                ),
                resourceDirectoriesCopyingOrder(androidTarget.compilations.getByName("fullDebug"))
            )
            assertEquals(
                listOf(
                    listOf("commonMain"),<|endoftext|>


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

import org.jetbrains.kotlin.commonizer.CommonizerTarget

fun StatsCollector(type: StatsType, targets: List<CommonizerTarget>): StatsCollector? {
    return when (type) {
        StatsType.RAW -> RawStatsCollector(targets)

Response:
StatsType.AGGREGATED -> AggregatedStatsCollector(targets)
        StatsType.NONE -> null
    }
}

enum class StatsType {
    RAW, AGGREGATED, NONE;
}

interface StatsCollector {
    data class StatsKey(
        val id: String,
        val extensionReceiver: String?,
        val parameterNames: List<String>,<|endoftext|>


Prompt:
override fun check(declaration: FirRegularClass, context: CheckerContext, reporter: DiagnosticReporter) {
        if (context.languageVersionSettings.doesDataClassCopyRespectConstructorVisibility()) {
            return
        }
        if (declaration.classKind != ClassKind.CLASS || !declaration.isData) {
            return
        }

Response:
val primaryConstructor = declaration.primaryConstructorIfAny(context.session) ?: return
        if (primaryConstructor.visibility == Visibilities.Public) {
            return
        }
        val isAlreadyAnnotated = declaration.hasAnnotation(StandardClassIds.Annotations.ConsistentCopyVisibility, context.session) ||<|endoftext|>


Prompt:
package org.jetbrains.kotlin.generators.test.evaluate

import junit.framework.TestCase
import org.jetbrains.kotlin.generators.evaluate.DEST_FILE
import org.jetbrains.kotlin.generators.evaluate.generate
import org.jetbrains.kotlin.test.KotlinTestUtils

Response:
class GenerateOperationsMapTest : TestCase() {
    fun testGeneratedDataIsUpToDate(): Unit {
        val text = generate()
        KotlinTestUtils.assertEqualsToFile(DEST_FILE, text)
    }
}<|endoftext|>


Prompt:
// EXPECTED_REACHABLE_NODES: 1284
// MODULE_KIND: AMD
package foo

@JsModule("lib")
external class A(x: Int = definedExternally) {
    val x: Int

    fun foo(y: Int): Int = definedExternally

    fun bar(vararg arg: String): String = definedExternally
}

class C {

Response:
val e = arrayOf("e")
    val f = arrayOf("f")
    val a = A(1)

    fun qux() = a.bar(*e, *f)
}

fun box(): String {
    val a = A(23)
    assertEquals(23, a.x)
    assertEquals(65, a.foo(42))<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<KtNamedDeclaration>(firDiagnostic, token), KtFirDiagnostic.VariableNeverRead

internal class UselessCallOnNotNullImpl(
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,

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

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


Prompt: if (b != null || <!SENSELESS_COMPARISON!>this.b != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float & kotlin.Float?")!>this.b<!>.propNullableT

Response: if (b != null || <!SENSELESS_COMPARISON!>this.b != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float & kotlin.Float?")!>this.b<!>.propNullableAny<|endoftext|>


Prompt:
package org.jetbrains.kotlin.backend.common.serialization.mangle

import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.model.*

/**
 * A base implementation of the [KotlinMangleComputer] interface containing routines that are common for all frontends and backends.
 *

Response:
* @param Declaration A class representing a Kotlin declaration.
 * @param Type A class representing a Kotlin type.
 * @param TypeParameter A class representing a type parameter of a Kotlin class or function.
 * @param ValueParameter A class representing a value parameter declaration of a Kotlin function.
 * @param TypeParameterContainer A class representing something that can have type parameters, like a Kotlin function or class declaration.<|endoftext|>


Prompt:
// FILE: ClassWithExternalAnnotatedMembers.java
public class ClassWithExternalAnnotatedMembers {
    public String externalNotNullMethod() {
        return "";
    }
}

// FILE: annotations.xml
<root>
    <item name='ClassWithExternalAnnotatedMembers java.lang.String externalNotNullMethod()'>
        <annotation name='org.jetbrains.annotations.NotNull'/>

Response:
</item>
</root>

// FILE: main.kt
import ClassWithExternalAnnotatedMembers

fun test(a: ClassWithExternalAnnotatedMembers) = a.e<caret><caret_onAirContext>xternalNotNullMethod()<|endoftext|>


Prompt:
append("(\"${ktType.render(position = Variance.INVARIANT)}\") ")
                        append(base.text)
                    }
                }
            })
        }
        testServices.assertions.assertEqualsToFile(testDataPath, actualText)
    }

    override fun configureTest(builder: TestConfigurationBuilder) {
        super.configureTest(builder)

Response:
builder.useAdditionalSourceProviders(AbstractIsDenotableTest::TestHelperProvider)
        builder.defaultDirectives {
            +ConfigurationDirectives.WITH_STDLIB
        }
    }

    private class TestHelperProvider(testServices: TestServices) : AdditionalSourceProvider(testServices) {
        override fun produceAdditionalFiles(globalDirectives: RegisteredDirectives, module: TestModule): List<TestFile> {<|endoftext|>


Prompt:
internal lateinit var components: FirRendererComponents
    private val printer get() = components.printer

    fun render(element: FirElementWithResolveState) {
        @OptIn(ResolveStateAccess::class)
        val text = when (element) {
            is FirSyntheticProperty -> "[<synthetic> ${element.resolvePhase}] "

Response:
is FirSyntheticPropertyAccessor -> "[<synthetic> ${element.delegate.resolveState}] "
            else -> "[${element.resolveState}] "
        }

        printer.print(text)
    }

    fun render(element: FirAnnotationCall) {
        printer.print("[${element.annotationResolvePhase}]")
    }
}<|endoftext|>


Prompt:
finallyBlock()
    }
    return res
}

// FILE: 2.kt

import test.*

class Holder {
    var value: String = ""
}

fun test0(h: Holder): Long {
    val localResult = doCall2 (
            {
                h.value += "OK_NONLOCAL"
                if (true) {
                    throw RuntimeException()
                }

Response:
return 1.toLong()
            },
            {
                h.value += ", OK_EXCEPTION"
                return 2.toLong()
            },
            {
                h.value += ", OK_FINALLY"
                "OK_FINALLY"
            }, "FAIL")

    return -1.toLong()
}

fun test1(h: Holder): Long {<|endoftext|>


Prompt:
if (captureThisType != null) {
                        StackValue.field(
                            captureThisType, Type.getObjectType(v.thisName), AsmUtil.CAPTURED_THIS_FIELD,
                            false, StackValue.LOCAL_0
                        ).put(captureThisType, codegen.v)
                    }

Response:
val isInterfaceMethod = DescriptorUtils.isInterface(suspendFunctionJvmView.containingDeclaration)
                    val callableAccessorMethod =
                        typeMapper.mapToCallableMethod(
                            context.accessibleDescriptor(suspendFunctionJvmView.unwrapFrontendVersion(), null),
                            // Obtain default impls method for interfaces
                            isInterfaceMethod
                        )

                    val callableMethod =<|endoftext|>


Prompt:
fun buildVariable(
    parent: IrDeclarationParent?,
    startOffset: Int,
    endOffset: Int,
    origin: IrDeclarationOrigin,
    name: Name,
    type: IrType,
    isVar: Boolean = false,
    isConst: Boolean = false,
    isLateinit: Boolean = false,
): IrVariable {
    return IrVariableImpl(
        startOffset, endOffset, origin,

Response:
IrVariableSymbolImpl(),
        name, type, isVar, isConst, isLateinit
    ).also {
        if (parent != null) {
            it.parent = parent
        }
    }
}<|endoftext|>


Prompt:
packageSegments = arrayOf("foo", "bar", "baz"),
                rawRelativeNameSegments = emptyList()
            ),
            TestRow(
                rawEntityId = "My",
                packageSegments = emptyArray(),
                rawRelativeNameSegments = listOf("My")
            ),
            TestRow(
                rawEntityId = "My.Test",
                packageSegments = emptyArray(),

Response:
rawRelativeNameSegments = listOf("My", "Test")
            ),
            TestRow(
                rawEntityId = "My.Test.Class",
                packageSegments = emptyArray(),
                rawRelativeNameSegments = listOf("My", "Test", "Class")
            ),
            TestRow(
                rawEntityId = "/My",
                packageSegments = emptyArray(),<|endoftext|>


Prompt:
private val bodyResolveComponents = createStubBodyResolveComponents(firSession)
    private val firCallCompleter = FirCallCompleter(
        bodyResolveComponents.transformer,
        bodyResolveComponents,
    )
    private val resolutionStageRunner = ResolutionStageRunner()

    fun resolveSingleCandidate(
        resolutionParameters: ResolutionParameters
    ): FirFunctionCall? {

Response:
val infoProvider = createCandidateInfoProvider(resolutionParameters)
        if (infoProvider.shouldFailBeforeResolve())
            return null

        val callInfo = infoProvider.callInfo()
        val explicitReceiverKind = infoProvider.explicitReceiverKind()
        val dispatchReceiverValue = infoProvider.dispatchReceiverValue()
        val implicitExtensionReceiverValue = infoProvider.implicitExtensionReceiverValue()<|endoftext|>


Prompt: public fun WebGLContextAttributes(alpha: Boolean? = true, depth: Boolean? = true, stencil: Boolean? = false, antialias: Boolean? = true, premultipliedAlpha: Boolean? = true, preserveDrawingBuffer: Boolean? = false, preferLowPowerToHighPerformance: Boolean? = false, failIfMajorPerformanceCaveat: Boolean? = false): WebGLContextAttributes { js("return { alpha, depth,

Response: stencil, antialias, premultipliedAlpha, preserveDrawingBuffer, preferLowPowerToHighPerformance, failIfMajorPerformanceCaveat<|endoftext|>


Prompt:
SpecialNames.UNDERSCORE_FOR_UNUSED_VAR
        } else {
            identifier.nameAsSafeName()
        }

        return DestructuringEntry(
            source = entry.toFirSourceElement(),
            returnTypeRef = firType ?: implicitType,
            name = name,
            annotations = annotations,
        )
    }

    /**

Response:
* @see org.jetbrains.kotlin.parsing.KotlinParsing.parsePropertyComponent
     */
    private fun convertGetterOrSetter(
        getterOrSetter: LighterASTNode,
        propertyTypeRef: FirTypeRef,
        propertyVisibility: Visibility,
        propertySymbol: FirPropertySymbol,
        propertyModifiers: Modifier,<|endoftext|>


Prompt:
0x7ff8000000000000UL,     0x3fac05ed8c8adffeUL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,
            0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,

Response:
0x3fac05ed8c8adffeUL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,
            0x7ff8000000000000UL,     0x7ff8000000000000UL,     0x7ff8000000000000UL,     0xc240237a93013752UL,<|endoftext|>


Prompt:
override fun containsAll(elements: Collection<MyUInt<T>>): Boolean = elements.all { storage.contains(it.x) }
    override fun isEmpty(): Boolean = TODO()
}

fun <T> checkBoxed(c: Collection<T>, element: T): Boolean {
    return c.contains(element) && c.containsAll(listOf(element))
}

Response:
fun box(): String {
    val uints = MyUIntArray<Int>(intArrayOf(0, 1, 42))

    if (MyUInt(42) !in uints) return "Fail 1"

    val ints = listOf(MyUInt(1), MyUInt(0))
    if (!uints.containsAll(ints)) return "Fail 2"<|endoftext|>


Prompt:
LookupSymbol(name = "FineGrainedFirstBuild_CoarseGrainedSecondBuild_Class", scope = "com.example"),
                LookupSymbol(name = "modifiedField", scope = "com.example.FineGrainedFirstBuild_FineGrainedSecondBuild_Class"),
                LookupSymbol(name = "modifiedMethod", scope = "com.example.FineGrainedFirstBuild_FineGrainedSecondBuild_Class"),

Response:
LookupSymbol(name = SAM_LOOKUP_NAME.asString(), scope = "com.example.FineGrainedFirstBuild_FineGrainedSecondBuild_Class")
            ),
            fqNames = setOf(
                "com.example.CoarseGrainedFirstBuild_CoarseGrainedSecondBuild_Class",
                "com.example.CoarseGrainedFirstBuild_FineGrainedSecondBuild_Class",<|endoftext|>


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

import com.github.gundy.hidden.antlr.v4.runtime.tree.TerminalNode
import com.github.gundy.semver4j.generated.grammar.NodeSemverExpressionBaseVisitor

Response:
import com.github.gundy.semver4j.generated.grammar.NodeSemverExpressionParser
import com.github.gundy.semver4j.model.Version
import org.jetbrains.kotlin.gradle.utils.toSetOrEmpty

class NpmRangeVisitor : NodeSemverExpressionBaseVisitor<Set<NpmRange>>() {<|endoftext|>


Prompt:
import org.jetbrains.kotlin.backend.common.serialization.proto.IrBlockBody as ProtoBlockBody
import org.jetbrains.kotlin.backend.common.serialization.proto.IrBranch as ProtoBranch
import org.jetbrains.kotlin.backend.common.serialization.proto.IrBreak as ProtoBreak

Response:
import org.jetbrains.kotlin.backend.common.serialization.proto.IrCall as ProtoCall
import org.jetbrains.kotlin.backend.common.serialization.proto.IrCatch as ProtoCatch
import org.jetbrains.kotlin.backend.common.serialization.proto.IrClass as ProtoClass<|endoftext|>


Prompt:
// FIR_IDENTICAL
// WITH_REFLECT
import kotlin.reflect.KCallable

fun defaultsOnly(x: String = "") = 1

fun regularAndDefaults(x1: String, x2: String = "") = 1

fun varargs(vararg xs: String) = 1

class C(val x: String = "")

Response:
fun useKCallableStar(fn: KCallable<*>) {}

fun testDefaultsOnlyStar() { useKCallableStar(::defaultsOnly) }

fun testRegularAndDefaultsStar() { useKCallableStar(::regularAndDefaults) }

fun testVarargsStar() { useKCallableStar(::varargs) }<|endoftext|>


Prompt: val INAPPLICABLE_OPERATOR_MODIFIER: KtDiagnosticFactory1<String> by error1<PsiElement, String>(SourceElementPositioningStrategies.OPERATOR_MODIFIER)

Response: val NO_EXPLICIT_VISIBILITY_IN_API_MODE: KtDiagnosticFactory0 by error0<KtDeclaration>(SourceElementPositioningStrategies.DECLARATION_START_TO_NAME)<|endoftext|>


Prompt:
spec.summary                  = 'CocoaPods test library'
                spec.vendored_frameworks      = 'cocoapods.xcframework'
                spec.libraries                = 'c++'
                spec.ios.deployment_target    = '13.5'
            end
        """.trimIndent()

    private val publishPodspecCustomContent =
        """

Response:
Pod::Spec.new do |spec|
                spec.name                     = 'CustomPod'
                spec.version                  = '2.0'
                spec.homepage                 = 'https://github.com/JetBrains/kotlin'
                spec.source                   = { :http=> ''}
                spec.authors                  = { 'Kotlin Dev' => 'kotlin.dev@jetbrains.com' }<|endoftext|>


Prompt:
assertEquals(setOf("foo"), Optional.of("foo").toSet())
        assertEquals(emptySet(), Optional.empty<String>().toSet())

        // List element type can be a supertype
        assertEquals(setOf<CharSequence>("foo"), Optional.of("foo").toSet<CharSequence>())
    }

    @Test
    fun optionalAsSequence() {

Response:
assertEquals(listOf("foo"), Optional.of("foo").asSequence().toList())
        assertEquals(emptyList(), Optional.empty<String>().asSequence().toList())

        // List element type can be a supertype
        assertEquals(listOf<CharSequence>("foo"), Optional.of("foo").asSequence<CharSequence>().toList())
    }
}<|endoftext|>


Prompt:
private val assignedNames: SetMultimap<Name, Writer> = LinkedHashMultimap.create()

    open fun writers(variableDescriptor: VariableDescriptor): MutableSet<Writer> = assignedNames[variableDescriptor.name]

    fun hasWriters(variableDescriptor: VariableDescriptor) = writers(variableDescriptor).isNotEmpty()

Response:
private var currentDeclaration: KtDeclaration? = null

    override fun visitDeclaration(declaration: KtDeclaration) {
        val previous = currentDeclaration
        if (declaration is KtDeclarationWithBody || declaration is KtClassOrObject || declaration is KtAnonymousInitializer) {
            currentDeclaration = declaration
        }
        super.visitDeclaration(declaration)<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("case_20.`<no name provided>`.B19.`<no name provided>`.C19.`<no name provided>`.D19.`<no name provided>`"), DEBUG_INFO_SMARTCAST!>a.B19.C19.D19<!>.equals(null)

Response: <!DEBUG_INFO_EXPRESSION_TYPE("case_20.`<no name provided>`.B19.`<no name provided>`.C19.`<no name provided>`.D19.`<no name provided>`"), DEBUG_INFO_SMARTCAST!>a.B19.C19.D19<!>.propT<|endoftext|>


Prompt:
parcelableClass: ClassDescriptor,
            parcelableCreatorClassType: KotlinType,
            creatorClass: ClassDescriptorImpl,
            parcelerObject: ClassDescriptor?
    ) {
        val builtIns = parcelableClass.builtIns
        val parcelableAsmType = codegen.typeMapper.mapType(parcelableClass)

Response:
val overriddenFunction = parcelableCreatorClassType.findFunction(NEW_ARRAY)
            ?: error("Can't resolve 'android.os.Parcelable.Creator.${NEW_ARRAY.methodName}' method")
        createMethod(creatorClass, NEW_ARRAY, Modality.FINAL,
                builtIns.getArrayType(Variance.INVARIANT, parcelableClass.defaultType),<|endoftext|>


Prompt: DEBUG_INFO_SMARTCAST!>a<!>) {

Response:
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>a<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
    <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null)<|endoftext|>


Prompt:
) : KtAbstractFirDiagnostic<KtParameter>(firDiagnostic, token), KtFirDiagnostic.DataClassVarargParameter

internal class DataClassNotPropertyParameterImpl(
    firDiagnostic: KtPsiDiagnostic,
    token: KtLifetimeToken,

Response:
) : KtAbstractFirDiagnostic<KtParameter>(firDiagnostic, token), KtFirDiagnostic.DataClassNotPropertyParameter

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


Prompt:
return callablesGenerator.createIrVariable(variable, irParent, givenOrigin).also {
            localStorage.putVariable(variable, it.symbol)
        }
    }

    fun getIrValueSymbol(firVariableSymbol: FirVariableSymbol<*>): IrSymbol {
        return when (val firDeclaration = firVariableSymbol.fir) {

Response:
is FirEnumEntry -> classifierStorage.getIrEnumEntrySymbol(firDeclaration)

            is FirValueParameter -> localStorage.getParameter(firDeclaration)
                ?: getIrVariableSymbol(firDeclaration) // catch parameter is FirValueParameter in FIR but IrVariable in IR

            else -> getIrVariableSymbol(firDeclaration)
        }
    }<|endoftext|>


Prompt:
scriptCompilationConfiguration: ScriptCompilationConfiguration
    ) {
        data[script to scriptCompilationConfiguration.notTransientData] = compiledScript
        _storedScripts++
    }
}

private class FileBasedScriptCache(val baseDir: File) : ScriptingCacheWithCounters {

    override fun get(script: SourceCode, scriptCompilationConfiguration: ScriptCompilationConfiguration): CompiledScript? {

Response:
val file = File(baseDir, uniqueScriptHash(script, scriptCompilationConfiguration))
        return if (!file.exists()) null else file.readCompiledScript().also { retrievedScripts++ }
    }

    override fun store(
        compiledScript: CompiledScript,
        script: SourceCode,
        scriptCompilationConfiguration: ScriptCompilationConfiguration
    ) {<|endoftext|>


Prompt:
add("Results are not equal for $testName: $r1 vs $r2")
    } else if (r1.isSuccess) {
        if (r1.getOrNull()?.descriptor != r2.getOrNull()?.descriptor)
            add("Not equal descriptors: $r1 vs $r2")
    }
}

fun box(): String {

Response:
val res = buildList {
        // Check that all variations of @Serializable do not change result of lookup
        isIntrinsicEqual<ByDefault>("ByDefault")
        isIntrinsicEqual<@Serializable(NotDefaultSerializer::class) ByDefault>("@Serializable(with) ByDefault")
        isIntrinsicEqual<NotDefault>("typealias NotDefault")<|endoftext|>


Prompt:
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
    }
    return block()
}

fun indefiniteVarReassignment(n: Int) {
    var x: Int
    repeat(n) {
        myRun { x = 42 }
    }
    <!UNINITIALIZED_VARIABLE!>x<!>.inc()
}

Response:
fun nonAnonymousLambdas() {
    // Named lambdas are not inlined, even in theory it could be done for some simple cases as this one
    var x: Int
    val initializer = { x = 42 }
    myRun(initializer)
    <!UNINITIALIZED_VARIABLE!>x<!>.inc()
}

fun branchingIndetermineFlow(a: Any) {<|endoftext|>


Prompt:
internal object MultiplatformLayoutV2AndroidStyleSourceDirUsageChecker : KotlinAndroidSourceSetLayoutChecker {

    override fun checkCreatedSourceSet(
        diagnosticsCollector: KotlinToolingDiagnosticsCollector,
        target: KotlinAndroidTarget,
        layout: KotlinAndroidSourceSetLayout,
        kotlinSourceSet: KotlinSourceSet,

Response:
@Suppress("TYPEALIAS_EXPANSION_DEPRECATION") androidSourceSet: DeprecatedAndroidSourceSet
    ) {
        if (target.project.kotlinPropertiesProvider.ignoreMppAndroidSourceSetLayoutV2AndroidStyleDirs) return
        val projectRoot = target.project.rootDir<|endoftext|>


Prompt:
override fun foo4(d: Array<out String>) { }
}

abstract class D : Java3    //Kotlin ← Java ← Kotlin ← Java

class E : Java3 {   //Kotlin ← Java ← Kotlin ← Java with explicit override
    override fun foo(a: MutableList<Int>?) { }

Response:
override fun bar(): MutableList<Int> {
        return mutableListOf()
    }

    override fun foo2(c: MutableSet<Any>?) { }
    override fun bar2(): MutableSet<Any> {
        return mutableSetOf()
    }

    override fun foo3(d: IntArray?) { }
    override fun bar3(): IntArray {<|endoftext|>


Prompt:
"FirDeclaration.psi (${this::class.simpleName}) should be KtDeclaration but was ${psi::class.simpleName}",
                fir = this,
                psi = psi,
            )
        }
    }

internal val FirDeclaration.containingKtFileIfAny: KtFile?
    get() = psi?.containingFile as? KtFile

Response:
internal fun KtDeclaration.isNonAnonymousClassOrObject() =
    this is KtClassOrObject
            && !this.isObjectLiteral()<|endoftext|>


Prompt: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function3<kotlin.Int, kotlin.String, kotlin.Float, kotlin.Float>")!>select(A2(), id { a, b, c -> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a<!>;

Response: <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>b<!>; <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float")!>c<!><|endoftext|>


Prompt:
const val shortVal = 2.<!EVALUATED("2")!>toShort()<!>
const val intVal = <!EVALUATED("2")!>2<!>
const val longVal = <!EVALUATED("2")!>2L<!>
const val floatVal = <!EVALUATED("2.0")!>2.0f<!>

Response:
const val doubleVal = <!EVALUATED("2.0")!>2.0<!>

const val compareTo1 = oneVal.<!EVALUATED("-1")!>compareTo(twoVal)<!>
const val compareTo2 = twoVal.<!EVALUATED("0")!>compareTo(twoVal)<!><|endoftext|>


Prompt:
hasRequiredFields = true
                true
            }
            else -> {
                println(" = $defaultValue")
                true
            }
        }
        return needNewLine to hasRequiredFields
    }

    private fun SmartPrinter.printDeprecationOnUselessFieldIfNeeded(
        field: AbstractField<*>,
        builder: Builder<BuilderField, Element>,

Response:
fieldIsUseless: Boolean,
    ) {
        if (fieldIsUseless) {
            println(
                "@Deprecated(\"Modification of '",
                field.name,
                "' has no impact for ",
                builder.typeName,
                "\", level = DeprecationLevel.HIDDEN)",
            )
        }
    }

    context(ImportCollector)<|endoftext|>


Prompt: 0x1770, 0x1772, 0x1774, 0x1780, 0x17b4, 0x17b7, 0x17be, 0x17c4, 0x17c9, 0x17d4, 0x17d5, 0x17da, 0x17dd, 0x17e0, 0x17ea, 0x17f0, 0x17fa,

Response: 0x1800, 0x1804, 0x1809,<|endoftext|>


Prompt:
// BODY_RESOLVE
package util

@Target(AnnotationTarget.TYPE)
annotation class Anno(val str: String)

const val prop = "str"
fun bar(): @Anno("bar $prop") List<@Anno("nested bar $prop") Collection<@Anno("nested nested bar $prop") Int>>? = null

fun f<caret>oo() {
    class Local {

Response:
fun doo() = foo()
        fun foo() = bar()
        fun baz() = foo()
    }
}<|endoftext|>


Prompt:
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
        val DOCUMENT_POSITION_CONTAINS: Short

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

/**
 * Exposes the JavaScript [HTMLProgressElement](https://developer.mozilla.org/en/docs/Web/API/HTMLProgressElement) to Kotlin
 */
public external abstract class HTMLProgressElement : HTMLElement, JsAny {<|endoftext|>


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

import org.jetbrains.kotlin.codegen.ExpressionCodegen
import org.jetbrains.kotlin.codegen.generateCallReceiver
import org.jetbrains.kotlin.codegen.generateCallSingleArgument

Response:
import org.jetbrains.kotlin.codegen.range.forLoop.IteratorForLoopGenerator
import org.jetbrains.kotlin.codegen.range.inExpression.InContinuousRangeOfComparableExpressionGenerator
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.psi.KtForExpression<|endoftext|>


Prompt:
if (PREFIX + MAX_LONG != ((PREFIX as String?)::plus)(Long.MAX_VALUE)) return "fail \"$PREFIX\"?::plus"
//    if (PREFIX + MAX_LONG != prefixNPlus(Long.MAX_VALUE)) return "fail prefixNPlus(Long.MAX_VALUE)"

Response:
//    if (PREFIX + MAX_LONG != customToString(Long.MAX_VALUE, (PREFIX as String?)::plus)) return "fail customToString(Long.MAX_VALUE, \"$PREFIX\"?::plus)"

    return "OK"
}<|endoftext|>


Prompt: expectFailure(linkage("Function 'getInterfaceToEnumClassImpl' can not be called: Function uses class 'InterfaceToEnumClassImpl' that inherits from final enum class 'InterfaceToEnumClass'")) { getInterfaceToEnumClassImpl() }

Response: expectFailure(linkage("Constructor 'InterfaceToEnumClassImpl.<init>' can not be called: Class 'InterfaceToEnumClassImpl' inherits from final enum class 'InterfaceToEnumClass'")) { getInterfaceToEnumClassImplAsAny() }<|endoftext|>


Prompt:
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER

// FILE: A.java
import java.util.Comparator;

public class A<E> {
    public A(Comparator<? super E> comparator) {}
}

// FILE: main.kt

fun foo() {

Response:
val result: A<String> = A<String> { x, y -> 1 }
}<|endoftext|>


Prompt:
<!DEBUG_INFO_CALL("fqName: testsCase3.Super_1.values.invoke; typeCall: variable&invoke")!>values()<!>
        }
    }

}

// FILE: TestCase4.kt
// TESTCASE NUMBER: 4
package testsCase4

open class A {
    operator fun invoke(value: String) = print("invoke $value")

Response:
}

interface Super_0 {
    object valueOf : A()

    private fun case() {
        <!DEBUG_INFO_CALL("fqName: testsCase4.Super_0.valueOf.invoke; typeCall: variable&invoke")!>valueOf("")<!>
    }
}

open class Super_1 : Super_0 {
    object valueOf : A() {}<|endoftext|>


Prompt:
import kotlin.test.*

interface I1<T> {
    fun foo(x: T): String
}
interface I2<T> {
    fun foo(x: T): String
}
class C : I1<String>, I2<Int> {
    override fun foo(x: String) = "I1.foo($x)"

Response:
override fun foo(x: Int) = "I2.foo($x)"
}

fun box(): String {
    val c = C()
    val i1: I1<String> = c
    assertEquals("I1.foo(str)", i1.foo("str"))
    val i2: I2<Int> = c<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.name.Name

class Fir2IrLazyTypeAlias(
    c: Fir2IrComponents,
    override val startOffset: Int,
    override val endOffset: Int,
    override var origin: IrDeclarationOrigin,
    override val fir: FirTypeAlias,

Response:
override val symbol: IrTypeAliasSymbol,
    override var parent: IrDeclarationParent
) : IrTypeAlias(), AbstractFir2IrLazyDeclaration<FirTypeAlias>, Fir2IrTypeParametersContainer, Fir2IrComponents by c {
    init {
        symbol.bind(this)
        classifierStorage.preCacheTypeParameters(fir)
    }<|endoftext|>


Prompt:
declarationProvider: PackageMemberDeclarationProvider,
        result: MutableSet<ClassDescriptor>
    ) {
    }

    fun generateSyntheticMethods(
        thisDescriptor: ClassDescriptor,
        name: Name,
        bindingContext: BindingContext,
        fromSupertypes: List<SimpleFunctionDescriptor>,
        result: MutableCollection<SimpleFunctionDescriptor>

Response:
) {
    }

    fun generateSyntheticProperties(
        thisDescriptor: ClassDescriptor,
        name: Name,
        bindingContext: BindingContext,
        fromSupertypes: ArrayList<PropertyDescriptor>,
        result: MutableSet<PropertyDescriptor>
    ) {
    }

    fun generateSyntheticSecondaryConstructors(<|endoftext|>


Prompt:
* - specific extension -> all extension instances: extension accessor on `FirExtensionService`
 * - all declarations matching extension with predicate -> FirPredicateBasedProvider.getSymbolsByPredicate
 * - all specific extensions interested in specific declaration -> TODO with StateMachine
 */
abstract class FirExtension(val session: FirSession) {
    abstract val name: FirExtensionPointName

Response:
abstract val extensionType: KClass<out FirExtension>

    fun interface Factory<out P : FirExtension> {
        fun create(session: FirSession): P
    }

    open fun FirDeclarationPredicateRegistrar.registerPredicates() {}
}

data class FirExtensionPointName(val name: Name) {<|endoftext|>


Prompt:
override fun shouldKeepTypeVariableBasedType(marker: TypeVariableTypeConstructorMarker, isK2: Boolean): Boolean = isK2

        object SaveAnonymousTypes : PublicDeclaration(localTypes = false, anonymous = false)
        object ApproximateAnonymousTypes : PublicDeclaration(localTypes = false, anonymous = true)
    }

Response:
sealed class AbstractCapturedTypesApproximation(val approximatedCapturedStatus: CaptureStatus?) :
        AllFlexibleSameValue() {
        override val allFlexible: Boolean get() = true
        override val errorType: Boolean get() = true

        // i.e. will be approximated only approximatedCapturedStatus captured types<|endoftext|>


Prompt:
boundSymbol = WeakPair(session, symbol)
}

@SymbolInternals
fun ConeClassLikeLookupTag.toFirRegularClass(session: FirSession): FirRegularClass? = toFirRegularClassSymbol(session)?.fir

fun FirSymbolProvider.getSymbolByLookupTag(lookupTag: ConeClassifierLookupTag): FirClassifierSymbol<*>? {

Response:
return lookupTag.toSymbol(session)
}

fun FirSymbolProvider.getSymbolByLookupTag(lookupTag: ConeClassLikeLookupTag): FirClassLikeSymbol<*>? {
    return lookupTag.toSymbol(session)
}<|endoftext|>


Prompt:
private fun IrExpression.unwrapSingleExpressionBlock(): IrExpression =
            (this as? IrBlock)?.statements?.singleOrNull() as? IrExpression ?: this

        override fun visitWhen(expression: IrWhen, data: IrDeclaration?): IrExpression {
            val isCompilerGenerated = expression.origin == null
            expression.transformChildren(this, data)

Response:
// Remove all branches with constant false condition.
            expression.branches.removeIf {
                it.condition.isFalseConst() && isCompilerGenerated
            }
            if (expression.origin == IrStatementOrigin.ANDAND) {
                assert(
                    expression.type.isBoolean()
                            && expression.branches.size == 2
                            && expression.branches[1].condition.isTrueConst()<|endoftext|>


Prompt:
* Returns an average value of elements in the array.
 */
@kotlin.jvm.JvmName("averageOfInt")
public fun Array<out Int>.average(): Double {
    var sum: Double = 0.0
    var count: Int = 0
    for (element in this) {
        sum += element
        ++count
    }
    return if (count == 0) Double.NaN else sum / count

Response:
}

/**
 * Returns an average value of elements in the array.
 */
@kotlin.jvm.JvmName("averageOfLong")
public fun Array<out Long>.average(): Double {
    var sum: Double = 0.0
    var count: Int = 0
    for (element in this) {
        sum += element
        ++count
    }<|endoftext|>


Prompt:
// FILE: Base_ShouldBeOpen.java
import org.jetbrains.kotlin.fir.plugin.AllOpen2;

@AllOpen2
public abstract class Base_ShouldBeOpen {
    public void baseMethod() {}
}

// FILE: Intf.java
import org.jetbrains.kotlin.fir.plugin.AllOpen2;

@AllOpen2
public interface Intf {

Response:
void intfMethod();
}

// FILE: main.kt
open class BaseImpl : Base_ShouldBeOpen() {
    fun baseImplMethod_ShouldBeOpen() {}
}

class BaseImpl2_ShouldBeOpen : BaseImpl() {
    fun baseImpl2Method_ShouldBeOpen() {}
    val baseImpl2Property_ShouldBeOpen = ""
}

open class IntfImpl : Intf {<|endoftext|>


Prompt:
@Another.Foo class ClassMarkedWithBar {
    class NonMarkedClass {
        class NonMarkedClass
        @Foo class ClassMarkedWithFoo
        @Bar class ClassMarkedWithAnotherFoo
        @Another.Foo class ClassMarkedWithBar
        @Another.Bar class ClassMarkedWithAnotherBar
    }
    @Foo class ClassMarkedWithFoo

Response:
@Bar class ClassMarkedWithAnotherFoo
    @Another.Foo class ClassMarkedWithBar
    @Another.Bar class ClassMarkedWithAnotherBar
}
@Another.Bar class ClassMarkedWithAnotherBar {
    class NonMarkedClass {
        class NonMarkedClass
        @Foo class ClassMarkedWithFoo
        @Bar class ClassMarkedWithAnotherFoo<|endoftext|>


Prompt:
val dependencyProfiles = this.propertyList("dependencyProfiles")
    return dependencies.map { dependency ->
        dependency to dependencyProfiles.flatMap { profile ->
            val candidateSpecs = propertyList("$dependency.$profile")
            if (profile == "default" && candidateSpecs.isEmpty()) {
                listOf(DependencySource.Remote.Public)
            } else {

Response:
candidateSpecs.map { candidateSpec ->
                    when (candidateSpec) {
                        "remote:public" -> DependencySource.Remote.Public
                        "remote:internal" -> DependencySource.Remote.Internal
                        else -> DependencySource.Local(File(candidateSpec))
                    }
                }
            }
        }
    }.toMap()
}<|endoftext|>


Prompt:
val fields: MutableList<BuilderField> = mutableListOf()
    var materializedElement: Element? = null

    override val allFields: List<BuilderField> by lazy {
        mutableSetOf<BuilderField>().apply {
            parents.forEach { this += it.allFields }
            this += fields
        }.toList()
    }

Response:
override val uselessFields: List<BuilderField> = emptyList()
}<|endoftext|>


Prompt:
import org.jetbrains.kotlin.gradle.testbase.*
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.io.TempDir
import java.nio.file.Path

Response:
import java.util.zip.ZipFile
import kotlin.io.path.*

@JvmGradlePluginTests
@DisplayName("KGP simple tests")
class SimpleKotlinGradleIT : KGPBaseTest() {

    @GradleTest
    @DisplayName("On second run common tasks should be up-to-date")
    fun testSimpleCompile(gradleVersion: GradleVersion) {<|endoftext|>


Prompt:
Renderers.TO_STRING
        )
        MAP.put(
            ComposeErrors.COMPOSE_APPLIER_PARAMETER_MISMATCH,
            "A {0} composable parameter was provided where a {1} composable was expected",
            Renderers.TO_STRING,
            Renderers.TO_STRING
        )
        MAP.put(

Response:
ComposeErrors.COMPOSE_APPLIER_DECLARATION_MISMATCH,
            "The composition target of an override must match the ancestor target"
        )
        MAP.put(
            ComposeErrors.COMPOSE_INVALID_DELEGATE,
            "Composable setValue operator is not currently supported."
        )
        MAP.put(<|endoftext|>


Prompt:
}

    fun execute(closure: Closure<*>) = executeClosure(closure)
}

open class KaptJavacOptionsDelegate: KaptJavacOption {
    internal val options = LinkedHashMap<String, String>()

    override fun option(name: Any, value: Any) {
        options.put(name.toString(), value.toString())
    }

Response:
override fun option(name: Any) {
        options.put(name.toString(), "")
    }

    fun execute(closure: Closure<*>) = executeClosure(closure)
}

private fun Any?.executeClosure(closure: Closure<*>) {
    closure.resolveStrategy = Closure.DELEGATE_FIRST
    closure.delegate = this
    closure.call()<|endoftext|>


Prompt:
val cl: @Composable () -> Unit = identity { A() }
        """)
    }

    @Test
    fun testGenericComposableInference4() {
        assumeTrue(useFir)
        check("""
        import androidx.compose.runtime.Composable

        fun <T> identity(value: T): T = value

Response:
// We should infer `T` as `Function0<Unit>` from the context and
        // reject the lambda which is explicitly typed as `ComposableFunction...`.
        val cl: () -> Unit = identity(@Composable <!ARGUMENT_TYPE_MISMATCH!>{}<!>)
        """)
    }

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


Prompt:
val source = this@constructFunctionTypeRef.source?.fakeElement(KtFakeSourceElementKind.ImplicitTypeRef)
    return if (diagnostic == null) {
        buildResolvedTypeRef {
            this.source = source
            this.type = type
        }
    } else {
        buildErrorTypeRef {
            this.source = source
            this.type = type
            this.diagnostic = diagnostic

Response:
}
    }
}

fun createFunctionType(
    kind: FunctionTypeKind,
    parameters: List<ConeKotlinType>,
    receiverType: ConeKotlinType?,
    rawReturnType: ConeKotlinType,
    contextReceivers: List<ConeKotlinType> = emptyList(),
): ConeLookupTagBasedType {<|endoftext|>


Prompt: NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!><!BUILDER_INFERENCE_STUB_RECEIVER!>references<!>[<!ARGUMENT_TYPE_MISMATCH!>1<!>]<!> = <!ARGUMENT_TYPE_MISMATCH, CANNOT_INFER_PARAMETER_TYPE,


Prompt:
// TARGET_BACKEND: JS_IR
// TARGET_BACKEND: JS_IR_ES6
// EXPECTED_REACHABLE_NODES: 1238
// FILE: bar.kt
@file:JsQualifier("bar")
package bar

external interface Bar {
    companion object {
        fun ok(): String
    }
}

// FILE: test.kt
import bar.Bar

Response:
fun box(): String {
    return Bar.ok()
}

// FILE: test.js
var bar = function() {
    var Bar = {
        ok() {
            return "OK"
        }
    };
    return {
        Bar: Bar
    }
}();<|endoftext|>


Prompt: $i$a$-f1-LibraryKt$foo$10\96\573\56:int=0:int, $i$f$test\97\563:int=0:int

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


Prompt:
fun test4(): <!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@setparam:Suppress<!> Int = TODO()
fun test5(i: (<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@setparam:Suppress<!> Int) -> Unit) {}

Response:
fun ((<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@setparam:Suppress<!> Int) -> Unit).test6() {}

fun test7(): ((<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@setparam:Suppress<!> Int) -> Unit) = TODO()<|endoftext|>


Prompt:
public inline val RequestDestination.Companion.MEDIA: RequestDestination get() = "media".asDynamic().unsafeCast<RequestDestination>()

public inline val RequestDestination.Companion.OBJECT: RequestDestination get() = "object".asDynamic().unsafeCast<RequestDestination>()

Response:
public inline val RequestDestination.Companion.REPORT: RequestDestination get() = "report".asDynamic().unsafeCast<RequestDestination>()

public inline val RequestDestination.Companion.SCRIPT: RequestDestination get() = "script".asDynamic().unsafeCast<RequestDestination>()<|endoftext|>


Prompt:
tasks.named("testPublicPackageJson") {
                        enabled = false
                    }
                """.trimIndent()
            }

            build("assemble") {
                assertTasksExecuted(":app:packageJson")
                assertTasksExecuted(":base:packageJson")
                assertTasksExecuted(":lib:packageJson")
            }

            build("check") {

Response:
assertTasksUpToDate(":app:packageJson")
                assertTasksUpToDate(":base:packageJson")
                assertTasksUpToDate(":lib:packageJson")

                assertTasksSkipped(":app:testPackageJson")
                assertTasksExecuted(":lib:testPackageJson")
                assertTasksExecuted(":base:testPackageJson")
            }<|endoftext|>


Prompt:
arrayOf(upperBound ?: Any::class.java)

    override fun getLowerBounds(): Array<Type> =
        if (lowerBound == null) emptyArray() else arrayOf(lowerBound)

    override fun getTypeName(): String = when {
        lowerBound != null -> "? super ${typeToString(lowerBound)}"

Response:
upperBound != null && upperBound != Any::class.java -> "? extends ${typeToString(upperBound)}"
        else -> "?"
    }

    override fun equals(other: Any?): Boolean =
        other is WildcardType && upperBounds.contentEquals(other.upperBounds) && lowerBounds.contentEquals(other.lowerBounds)

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


Prompt:
for (o1 in <!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE, NON_PUBLIC_CALL_FROM_PUBLIC_INLINE_DEPRECATION, NON_PUBLIC_CALL_FROM_PUBLIC_INLINE_DEPRECATION!>o<!>) {
    }

Response:
<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>o[1]<!>
    <!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>o[1]<!> = o
    val (<!NON_PUBLIC_CALL_FROM_PUBLIC_INLINE!>o2<!>) = o<|endoftext|>


Prompt:
// Inferring lambda parameter types by other specified lambda parameters; expected type is a functional type with type variables in parameter types
    takeLambdas({ <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>it<!> }, { x: Int -> }, { x: Nothing -> x })

Response:
takeLambdas({ <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>it<!> }, { } as (Int) -> Unit, { x: Nothing -> x })
    takeLambdas({ <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>it<!> }, { } as (Nothing) -> Unit, { x: Int -> x })<|endoftext|>


Prompt: override fun testGood(x: Any) { assertIs(x, x is Function15<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *>) }

Response:
override fun testBad(x: Any) { assertIsNot(x, x !is Function15<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *>) }
}<|endoftext|>


Prompt:
}

    override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?) {
        receiverParameter = newReceiverParameter
    }

    override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider) {
        deprecationsProvider = newDeprecationsProvider
    }

Response:
override fun replaceContextReceivers(newContextReceivers: List<FirContextReceiver>) {
        contextReceivers = newContextReceivers.toMutableOrEmpty()
    }

    override fun replaceDelegate(newDelegate: FirExpression?) {
        delegate = newDelegate
    }

    override fun replaceGetter(newGetter: FirPropertyAccessor?) {<|endoftext|>


Prompt:
}.toMap()

                val substitutor = substitutorByMap(substitution, session)
                val substitutedType = substitutor.substituteOrSelf(originalFirDeclaration.returnTypeRef.coneType)
                callTypeCanBeNullable = Fir2IrImplicitCastInserter.typeCanBeEnhancedOrFlexibleNullable(substitutedType, session)

Response:
substitutedType.toIrType(c, typeOrigin)
            }
            true -> {
                callTypeCanBeNullable = false
                irBuiltIns.unitType
            }
        }

        val irCall = IrCallImpl(
            startOffset,
            endOffset,
            callReturnType,
            originalFunctionSymbol,
            originalFirDeclaration.typeParameters.size,<|endoftext|>


Prompt:
val l1: ICLong by Delegate { ICLong(22) }
    val o1: ICOverIC by Delegate { ICOverIC(ICLong(33)) }

    var i2 by Delegate { ICInt(0) }
    var l2 by Delegate { ICLong(0) }
    var o2 by Delegate { ICOverIC(ICLong(0)) }
}

Response:
fun box(): String {
    if (Demo.i0.i != 1) return "Fail 1"
    if (Demo.l0.l != 2L) return "Fail 2"
    if (Demo.o0.o.l != 3L) return "Fail 3"

    if (Demo.i1.i != 11) return "Fail 2 1"<|endoftext|>


Prompt: at MyTest.foo (/Users/user/repos/check-kotlin-js-test/src/test/kotlin/MyTest.kt:7:8)

Response:
at Context.<anonymous> (/Users/user/repos/check-kotlin-js-test/build/js/packages/check-kotlin-js-test-test/adapter.js:53115:31)""".trimIndent()

        assertEquals(
            expected,
            processKarmaStackTrace(stackTrace)
        )
    }

    @Test<|endoftext|>


Prompt:
<!DEBUG_INFO_CALL("fqName: Case1.InnerClass1.foo; typeCall: function")!>foo()<!>
            this.<!DEBUG_INFO_CALL("fqName: Case1.InnerClass1.foo; typeCall: function")!>foo()<!>

Response:
this@Case1.<!DEBUG_INFO_CALL("fqName: Case1.foo; typeCall: function")!>foo()<!>
        }
    }
}<|endoftext|>


Prompt:
class AndroidExtensionPropertiesComponentContainerContributor : StorageComponentContainerContributor {
    override fun registerModuleComponents(
        container: StorageComponentContainer, platform: TargetPlatform, moduleDescriptor: ModuleDescriptor
    ) {
        if (platform.isJvm()) {
            container.useInstance(AndroidExtensionPropertiesCallChecker())
        }
    }
}

Response:
class ParcelizeDeclarationCheckerComponentContainerContributor : StorageComponentContainerContributor {
    override fun registerModuleComponents(
        container: StorageComponentContainer, platform: TargetPlatform, moduleDescriptor: ModuleDescriptor
    ) {
        if (platform.isJvm()) {
            container.useInstance(ParcelableDeclarationChecker())
            container.useInstance(ParcelableAnnotationChecker())
        }<|endoftext|>


Prompt:
// test.kt:18 invoke: w:int=1:int, x:double=1.0:double, y:char=0:char, a:double=1.0:double, c:char=0:char, _:java.lang.String="":java.lang.String, d:char=0:char
// test.kt:8 getArrayOfA:

Response: // test.kt:18 invoke: w:int=1:int, x:double=1.0:double, y:char=0:char, a:double=1.0:double, c:char=0:char, _:java.lang.String="":java.lang.String, d:char=0:char<|endoftext|>


Prompt:
if (atomicfu_compareAndSet(cur, upd, `atomicfu$getter`, `atomicfu$setter`)) return
    }
}

internal inline fun <T> atomicfu_getAndUpdate(function: (T) -> T, `atomicfu$getter`: () -> T, `atomicfu$setter`: (T) -> Unit): T {
    while (true) {

Response:
val cur = `atomicfu$getter`()
        val upd = function(cur)
        if (atomicfu_compareAndSet(cur, upd, `atomicfu$getter`, `atomicfu$setter`)) return cur
    }
}<|endoftext|>


Prompt:
)
        super.applySpecificArgs(argsBuilder)
    }

    override fun applyDependencies(argsBuilder: ArgsBuilder): Unit = with(argsBuilder) {
        super.applyDependencies(argsBuilder)
        addFlattened(dependencies.libraries) { library -> listOf("-l", library.path) }
    }
}

Response:
internal class GivenLibraryCompilation(givenArtifact: KLIB) : TestCompilation<KLIB>() {
    override val result = TestCompilationResult.Success(givenArtifact, LoggedData.NoopCompilerCall(givenArtifact.klibFile))
}

internal class CInteropCompilation(
    targets: KotlinNativeTargets,
    classLoader: KotlinNativeClassLoader,<|endoftext|>


Prompt:
IdeJvmAndAndroidPlatformBinaryDependencyResolver(project).resolve(kotlin.sourceSets.getByName("jvmAndAndroidMain"))
            .assertMatches(jvmAndAndroidDependencies)

        IdeJvmAndAndroidPlatformBinaryDependencyResolver(project).resolve(kotlin.sourceSets.getByName("jvmAndAndroidTest"))

Response:
.assertMatches(jvmAndAndroidDependencies)
    }

    @Test
    fun `test - project to multiplatform project dependency`() {
        val root = buildProject { setMultiplatformAndroidSourceSetLayoutVersion(2) }
        val producer = buildProject({ withParent(root).withName("producer") }) { configureAndroidAndMultiplatform() }<|endoftext|>


Prompt: if (<!SENSELESS_COMPARISON!>v != null<!> || <!SENSELESS_COMPARISON!>this.v != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int"), DEBUG_INFO_SMARTCAST!>this.v<!>.funAny()

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


Prompt:
if (subType.isMarkedNullable() && !superType.isMarkedNullable()) return false

            return AbstractStrictEqualityTypeChecker.strictEqualTypes(
                this,
                subType.withNullability(false),
                superType.withNullability(false)
            )
        }

Response:
if (subType.isStubTypeForBuilderInference() && superType.isStubTypeForBuilderInference())
            return isStubTypeSubtypeOfAnother(subType, superType) || state.isStubTypeEqualsToAnything

        if (subType.isStubType() || superType.isStubType())
            return state.isStubTypeEqualsToAnything<|endoftext|>


Prompt:
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
import org.jetbrains.kotlin.ir.types.IrTypeSystemContextImpl
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.library.IrLibrary
import org.jetbrains.kotlin.library.KotlinAbiVersion

Response:
import org.jetbrains.kotlin.library.KotlinLibrary
import org.jetbrains.kotlin.library.containsErrorCode
import org.jetbrains.kotlin.utils.memoryOptimizedMap

class JsIrLinker(
    private val currentModule: ModuleDescriptor?, messageLogger: IrMessageLogger, builtIns: IrBuiltIns, symbolTable: SymbolTable,<|endoftext|>


Prompt:
reporter.reportOn(declaration.source, FirJsErrors.EXTERNAL_TYPE_EXTENDS_NON_EXTERNAL_TYPE, context)
            }
        }

        if (!isEffectivelyExternal) {
            val fakeOverriddenMethod = declaration.findFakeMethodOverridingExternalWithOptionalParams(context)

            if (fakeOverriddenMethod != null) {

Response:
reporter.reportOn(
                    declaration.source, FirJsErrors.OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS_WITH_FAKE,
                    fakeOverriddenMethod, context
                )
            }
        }

        if (
            !context.languageVersionSettings.supportsFeature(LanguageFeature.JsAllowImplementingFunctionInterface) &&<|endoftext|>


Prompt:
task.compilerOptions.freeCompilerArgs.zip(task.modeProperty) { freeArgs, mode ->
                freeArgs.toMutableList().apply {
                    commonJsAdditionalCompilerFlags(compilation)

                    when (mode) {
                        KotlinJsBinaryMode.PRODUCTION -> {
                            configureOptions(
                                compilation,
                                ENABLE_DCE,

Response:
MINIMIZED_MEMBER_NAMES
                            )
                        }

                        KotlinJsBinaryMode.DEVELOPMENT -> {
                            configureOptions(
                                compilation
                            )
                        }
                        else -> throw InvalidUserDataException(
                            "Unknown KotlinJsBinaryMode to configure the build: $mode"
                        )
                    }<|endoftext|>


Prompt:
import org.jetbrains.kotlin.codegen.optimization.common.removeAll
import org.jetbrains.kotlin.codegen.optimization.fixStack.peek
import org.jetbrains.kotlin.codegen.optimization.fixStack.top
import org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer

Response:
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.tree.*
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue
import org.jetbrains.org.objectweb.asm.tree.analysis.Frame<|endoftext|>


Prompt:
if (!(element5 !in 1.0..3.0) != range0.contains(element5)) throw AssertionError()
}

fun testR0xE6() {
    // with possible local optimizations
    if (2F in 1.0..3.0 != range0.contains(2F)) throw AssertionError()

Response:
if (2F !in 1.0..3.0 != !range0.contains(2F)) throw AssertionError()
    if (!(2F in 1.0..3.0) != !range0.contains(2F)) throw AssertionError()
    if (!(2F !in 1.0..3.0) != range0.contains(2F)) throw AssertionError()<|endoftext|>


Prompt:
* by substituting format specifiers in the format string with the provided arguments,
 * using the default locale.
 *
 * See [java.util.Formatter] class documentation
 * for the syntax of format specifiers for the format string.
 *
 * @sample samples.text.Strings.formatStatic
 */
@kotlin.internal.InlineOnly

Response:
public inline fun String.Companion.format(format: String, vararg args: Any?): String = java.lang.String.format(format, *args)

/**
 * Uses this string as a format string and returns a string obtained
 * by substituting format specifiers in the format string with the provided arguments,
 * using the specified locale. If [locale] is `null` then no localization is applied.
 *<|endoftext|>


Prompt:
return s;
}

unsigned short unsigned_short_id(unsigned short s) {
    return s;
}

int callbackUser(int (*fn)(int, short)) {
    return fn(5,5);
}

// MODULE: main(cinterop)
// FILE: main.kt

@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)

Response:
import signext_zeroext_interop_input.*
import kotlinx.cinterop.*

// CHECK-DEFAULTABI-CACHE_NO: declare zeroext i1 @Kotlin_Char_isHighSurrogate(i16 zeroext){{.*}}<|endoftext|>


Prompt:
* If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found.
 *
 * @param element the to search for.
 * @param fromIndex the start of the range (inclusive) to search in, 0 by default.
 * @param toIndex the end of the range (exclusive) to search in, size of this array by default.
 *

Response:
* @return the index of the element, if it is contained in the array within the specified range;
 * otherwise, the inverted insertion point `(-insertion point - 1)`.
 * The insertion point is defined as the index at which the element should be inserted,
 * so that the array (or the specified subrange of array) still remains sorted.
 *<|endoftext|>


Prompt:
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.typeUtil.isNothing
import org.jetbrains.kotlin.types.typeUtil.isUnit

@InternalKotlinNativeApi
class ObjCExportMapper(

Response:
internal val deprecationResolver: DeprecationResolver? = null,
    private val local: Boolean = false,
    internal val unitSuspendFunctionExport: UnitSuspendFunctionObjCExport,
) {
    fun getCustomTypeMapper(descriptor: ClassDescriptor): CustomTypeMapper? = CustomTypeMappers.getMapper(descriptor)<|endoftext|>


Prompt:
}
    }

    override fun addManifestAddend(properties: Properties) {
        manifestProperties.putAll(properties)
    }

    override fun commit() {
        manifestProperties.saveToFile(libraryLayout.manifestFile)
        if (!nopack) {
            libraryLayout.unzippedDir.zipDirAs(klibFile)

Response:
libraryLayout.unzippedDir.deleteRecursively()
        }
    }
}

/**
 * Requires non-null [target].
 */
class KotlinLibraryWriterImpl(
    moduleName: String,
    versions: KotlinLibraryVersioning,
    builtInsPlatform: BuiltInsPlatform,
    nativeTargets: List<String>,
    nopack: Boolean = false,<|endoftext|>


Prompt:
val nonFixedToVariablesSubstitutor = createNonFixedTypeToVariableSubstitutor()

            val nonFixedTypesToResult = nonFixedToVariablesSubstitutor.map.mapValues { substitutor.safeSubstitute(it.value) }
            val nonFixedTypesToResultSubstitutor = ComposedSubstitutor(substitutor, nonFixedToVariablesSubstitutor)

Response:
val atomCompleter = createResolvedAtomCompleter(
                nonFixedTypesToResultSubstitutor,
                topLevelCallContext.replaceBindingTrace(findTopLevelTrace()).replaceInferenceSession(this)
            )

            for (expression in commonExpressions) {
                updateExpressionDescriptorAndType(expression, nonFixedTypesToResultSubstitutor)
            }<|endoftext|>


Prompt: if (u != null || <!SENSELESS_COMPARISON!>this.u != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>u<!>.funNullableT()

Response: if (u != null || <!SENSELESS_COMPARISON!>this.u != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>u<!>.funNullableAny()<|endoftext|>


Prompt:
val expression: IrFunctionAccessExpression,
    val signature: JvmMethodSignature,
    val classCodegen: ClassCodegen,
    val argsTypes: List<Type>,
) {
    abstract fun genInvokeInstruction(v: InstructionAdapter)

    open fun invoke(
        v: InstructionAdapter,
        codegen: ExpressionCodegen,
        data: BlockInfo,

Response:
expression: IrFunctionAccessExpression,
    ): StackValue {
        loadArguments(codegen, data)
        with(codegen) { expression.markLineNumber(startOffset = true) }
        genInvokeInstruction(v)
        return StackValue.onStack(signature.returnType)
    }

    private fun loadArguments(codegen: ExpressionCodegen, data: BlockInfo) {<|endoftext|>


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

// TESTCASE NUMBER: 9

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


Prompt:
// WITH_STDLIB

import kotlin.test.*

class Outer(val s: String) {
    inner class Inner {
        constructor(x: Int) {
            this.x = x
        }

        constructor(z: String) {
            x = z.length
        }

        val x: Int

        fun foo() = s
    }

}

Response:
fun box(): String {
    assertEquals("OK", Outer("OK").Inner(42).foo())
    return Outer("OK").Inner("zzz").foo()
}<|endoftext|>


Prompt:
override fun find(startIndex: Int, testString: CharSequence, matchResult: MatchResultImpl): Int {
        var index = startIndex
        while (index < testString.length) {
            index = testString.indexOf(char, index, ignoreCase)
            if (index < 0) {
                return -1
            }
            // Remove params.

Response:
if (!testString.isLowSurrogate(index + 1)
                &&  next.matches(index + charCount, testString, matchResult) >= 0) {
                return index
            }
            index++
        }
        return -1
    }

    override fun findBack(leftLimit: Int, rightLimit: Int, testString: CharSequence, matchResult: MatchResultImpl): Int {<|endoftext|>


Prompt:
class ActualDiagnostic constructor(val diagnostic: Diagnostic, override val platform: String?, withNewInference: Boolean) :
    AbstractTestDiagnostic {
    override var inferenceCompatibility = if (withNewInference)
        TextDiagnostic.InferenceCompatibility.NEW
    else
        TextDiagnostic.InferenceCompatibility.OLD

    override val name: String

Response:
get() = diagnostic.factory.name

    val file: PsiFile
        get() = diagnostic.psiFile

    override fun compareTo(other: AbstractTestDiagnostic): Int {
        return if (this.diagnostic is DiagnosticWithParameters1<*, *> && other is ActualDiagnostic && other.diagnostic is DiagnosticWithParameters1<*, *>) {<|endoftext|>


Prompt:
c: ResolutionContext<*>,
        dataFlowValueForWholeExpression: () -> DataFlowValue
    ): TypeParameterDescriptor? {
        if (c.languageVersionSettings.supportsFeature(LanguageFeature.ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated)) return null
        if (TypeUtils.noExpectedType(c.expectedType)) return null

Response:
var foundSubtypeTypeParameter: TypeParameterDescriptor? = null

        @OptIn(ClassicTypeCheckerStateInternals::class)
        val typeState: TypeCheckerState = object : ClassicTypeCheckerState(isErrorTypeEqualsToAnything = true) {
            private var expectsTypeArgument = false<|endoftext|>


Prompt:
val x = <!OVERLOAD_RESOLUTION_AMBIGUITY!>swapVararg<!>(named = 42, namedVararg = arrayOf("1", "2"),)

fun swap(string: String, int: Int){}
fun swap(int: Int, string: String){}

Response: val y = <!OVERLOAD_RESOLUTION_AMBIGUITY!>swap<!>(int = 42, string = "2")<|endoftext|>


Prompt:
val INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS by warning<KtNamedFunction>(PositioningStrategy.DECLARATION_NAME) {
            parameter<ConeKotlinType>("type")
        }
    }

    val IMPORTS by object : DiagnosticGroup("Imports") {

Response:
val CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON by error<KtImportDirective>(PositioningStrategy.IMPORT_LAST_NAME) {
            parameter<Name>("objectName")
        }

        val PACKAGE_CANNOT_BE_IMPORTED by error<KtImportDirective>(PositioningStrategy.IMPORT_LAST_NAME)<|endoftext|>


Prompt:
//          override fun hasNext() : Boolean = current > 0
//          override fun remove() {throw UnsupportedOperationException()}
//      }
//}

// fun Char.isDigit() = Character.isDigit(this)

fun Reader.forEachChar(body : (Char) -> Unit) {
    do {
        var i = read();
        if (i == -1) break

Response:
body(i.toChar())
    } while(true)
}<|endoftext|>