{"prompt":"private fun getInfoForDeclaration(symbol: FirBasedSymbol<*>): Fork? {\n val root = rootFunction ?: return null\n if (root == symbol) return null\n val cachedMap = buildInfoForRoot(root)\n return cachedMap[symbol]\n }","completion":"private fun buildInfoForRoot(root: FirFunctionSymbol<*>): Map, Fork> {\n assignedLocalVariablesByDeclaration?.let { return it }\n\n val data = MiniCfgBuilder.MiniCfgData()\n MiniCfgBuilder().visitElement(root.fir, data)\n\n assignedLocalVariablesByDeclaration = data.forks<|endoftext|>"} {"prompt":"assertEquals(false, nullToNotNullI(AIE()), \"AIE? is II\")\n assertEquals(false, nullToNotNullI(AIF()), \"AIF? is II\")\n assertEquals(true, nullToNotNullI(AIJ()), \"AIJ? is II\")\n assertEquals(false, nullToNotNullI(BAIA()), \"BAIA? is II\")","completion":"assertEquals(false, nullToNotNullI(BAIAIF()), \"BAIAIF? is II\")\n assertEquals(true, nullToNotNullI(BAIAIJ()), \"BAIAIJ? is II\")\n assertEquals(false, nullToNotNullI(C()), \"C? is II\")<|endoftext|>"} {"prompt":"for (e in other) min = minOf(min, e)\n return min\n}\n\n\/**\n * Returns the smaller of the given values.\n *\/\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Byte, vararg other: Byte): Byte {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n\/**","completion":"* Returns the smaller of the given values.\n *\/\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Short, vararg other: Short): Short {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n\/**\n * Returns the smaller of the given values.\n *\/\n@SinceKotlin(\"1.4\")<|endoftext|>"} {"prompt":"@kotlin.jvm.JvmName(name = \"sumOfFloat\")\npublic fun kotlin.sequences.Sequence.sum(): kotlin.Float\n\n@kotlin.jvm.JvmName(name = \"sumOfInt\")\npublic fun kotlin.sequences.Sequence.sum(): kotlin.Int","completion":"@kotlin.jvm.JvmName(name = \"sumOfLong\")\npublic fun kotlin.sequences.Sequence.sum(): kotlin.Long\n\n@kotlin.jvm.JvmName(name = \"sumOfShort\")\npublic fun kotlin.sequences.Sequence.sum(): kotlin.Int<|endoftext|>"} {"prompt":"DEBUG_INFO_SMARTCAST!>b)","completion":" kotlin.Unit) -> kotlin.Unit)? & (() -> kotlin.Unit) -> kotlin.Unit\"), DEBUG_INFO_SMARTCAST!>a.equals(null)<|endoftext|>"} {"prompt":"if (resultingSize < 0) throw OutOfMemoryError(\"File $this is too big to fit in memory.\")\n\n return@use extra.buffer.copyInto(\n destination = result.copyOf(resultingSize),\n destinationOffset = result.size,\n startIndex = 0, endIndex = extra.size()\n )\n}","completion":"private class ExposingBufferByteArrayOutputStream(size: Int) : ByteArrayOutputStream(size) {\n val buffer: ByteArray get() = buf\n}\n\n\/**\n * Sets the content of this file as an [array] of bytes.\n * If this file already exists, it becomes overwritten.\n *\n * @param array byte array to write into this file.\n *\/<|endoftext|>"} {"prompt":"environment: KotlinCoreProjectEnvironment,\n modules: List,\n sourceFiles: List,\n languageVersionSettings: LanguageVersionSettings,\n jdkHome: Path?,\n ) {\n val project = environment.project\n val javaFileManager = project.getService(JavaFileManager::class.java) as KotlinCliJavaFileManagerImpl","completion":"val javaModuleFinder = CliJavaModuleFinder(jdkHome?.toFile(), null, javaFileManager, project, null)\n val javaModuleGraph = JavaModuleGraph(javaModuleFinder)\n\n val allSourceFileRoots = sourceFiles.map { JavaRoot(it.virtualFile, JavaRoot.RootType.SOURCE) }<|endoftext|>"} {"prompt":"\/\/ Do not create clone for arrays deserialized from metadata in the old (1.0) runtime, because clone is declared there anyway\n if (classDescriptor.classProto.functionList.any { functionProto ->\n classDescriptor.c.nameResolver.getName(functionProto.name) == CloneableClassScope.CLONE_NAME\n }) {\n return emptyList()\n }","completion":"return listOf(\n createCloneForArray(\n classDescriptor, cloneableType.memberScope.getContributedFunctions(name, NoLookupLocation.FROM_BUILTINS).single()\n )\n )\n }\n\n if (!settings.isAdditionalBuiltInsFeatureSupported) return emptyList()\n\n return getAdditionalFunctions(classDescriptor) {<|endoftext|>"} {"prompt":"object Constants {\n const val A = 30\n const val B = 40\n}\n\nclass ClassConstants {\n companion object {\n const val C = 50\n }\n}\nfun foo(state: Int) {\n when (state) {\n Constants.A -> return\n Constants.B -> return\n ClassConstants.C -> return\n else -> return\n }\n}","completion":"\/\/ 1 LOOKUPSWITCH<|endoftext|>"} {"prompt":"val typeConstructorDeclaration = lhs.type.constructor.declarationDescriptor\n val typeClass = typeConstructorDeclaration\n ?: throw AssertionError(\"Unexpected type constructor for ${lhs.type}: $typeConstructorDeclaration\")\n IrClassReferenceImpl(\n ktClassLiteral.startOffsetSkippingComments, ktClassLiteral.endOffset, resultType,","completion":"context.symbolTable.referenceClassifier(typeClass), lhs.type.toIrType()\n )\n }\n }\n\n fun generateCallableReference(ktCallableReference: KtCallableReferenceExpression): IrExpression {\n val resolvedCall = getResolvedCall(ktCallableReference.callableReference)!!\n val resolvedDescriptor = resolvedCall.resultingDescriptor<|endoftext|>"} {"prompt":"private fun expectMinMax(min: Short, max: Short, elements: ShortArray) {\n assertEquals(min, elements.minOrNull())\n assertEquals(max, elements.maxOrNull())\n assertEquals(min, elements.min())\n assertEquals(max, elements.max())\n }\n\n @Test\n fun minMax() {","completion":"expectMinMax(1, 1, shortArrayOf(1))\n expectMinMax(1, 2, shortArrayOf(1, 2))\n expectMinMax(1, Short.MAX_VALUE, shortArrayOf(1, 2, Short.MAX_VALUE))\n \n }\n\n @Test\n fun minMaxEmpty() {\n val empty = shortArrayOf()<|endoftext|>"} {"prompt":"if (w != null || this.w != null) this.w.funT()","completion":"if (w != null || this.w != null) this.w.funAny()<|endoftext|>"} {"prompt":"if (cache !is CachedLibraries.Cache.PerFile) {\n require(library.isInteropLibrary())\n continue\n }\n\n val libraryCacheRootDir = File(cache.path)\n val cachedFiles = libraryCacheRootDir.listFiles.map { it.name }\n\n val actualFilesWithFqNames = library.getFilesWithFqNames()","completion":"libraryFilesWithFqNames[library] = actualFilesWithFqNames\n val actualFiles = actualFilesWithFqNames.withIndex()\n .associate { CacheSupport.cacheFileId(it.value.fqName, it.value.filePath) to it.index }\n .toMutableMap()\n\n for (cachedFile in cachedFiles) {<|endoftext|>"} {"prompt":"open fun testScripting(gradleVersion: GradleVersion) {\n project(\"scripting\", gradleVersion) {\n val appSubProject = subProject(\"app\")\n val scriptTemplateSubProject = subProject(\"script-template\")\n appSubProject.disableLightTreeIfNeeded()\n scriptTemplateSubProject.disableLightTreeIfNeeded()","completion":"build(\"assemble\", buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.DEBUG)) {\n assertCompiledKotlinSources(\n listOf(\n appSubProject.kotlinSourcesDir().resolve(\"world.greet.kts\").relativeTo(projectPath),\n scriptTemplateSubProject.kotlinSourcesDir().resolve(\"GreetScriptTemplate.kt\").relativeTo(projectPath)<|endoftext|>"} {"prompt":"override fun visitFunctionReference(expression: IrFunctionReference) {\n visitAnonymousDeclaration(expression)\n }\n\n override fun visitGetValue(expression: IrGetValue) {\n super.visitGetValue(expression)\n if (\n expression.symbol.owner in inlinableParameters ||","completion":"expression.type.getClass()?.let { classesToRegenerate.contains(it) } == true\n ) {\n saveDeclarationsFromStackIntoRegenerationPool()\n }\n }\n\n override fun visitCall(expression: IrCall) {\n if (expression.symbol == context.ir.symbols.singleArgumentInlineFunction) {<|endoftext|>"} {"prompt":"resultTypeResolver: ResultTypeResolver\n ): TypeConstructorMarker {\n val expectedType = argument.expectedType\n ?: throw IllegalStateException(\"Postponed argument's expected type must not be null\")\n\n val expectedTypeConstructor = expectedType.typeConstructor()\n\n return when (argument) {\n is LambdaWithTypeVariableAsExpectedTypeMarker ->","completion":"getNonReflectFunctionTypeConstructor(parametersNumber, functionTypeKind)\n is PostponedCallableReferenceMarker -> {\n val computedResultType = resultTypeResolver.findResultType(\n this@computeResultingFunctionalConstructor,\n notFixedTypeVariables.getValue(expectedTypeConstructor),\n TypeVariableDirectionCalculator.ResolveDirection.TO_SUPERTYPE\n )<|endoftext|>"} {"prompt":"}\n }\n true\n }\n\n Assert.assertTrue(\n \"Too few (<= 10) pom.xml files found. Something must be wrong in the test or in the project structure\",\n poms.size > 10\n )\n\n if (!poms.map(Pom::version).areEqual()) {\n Assert.fail(","completion":"\"Some versions in pom.xml files are different. Please change the versions so that they are equal:\\n\\n\" +\n poms.joinToString(separator = \"\\n\") { (path, version) -> \"$version $path\" }\n )\n }\n }\n\n private fun loadValueFromPomXml(filePath: String, query: List): String? {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.utils.printer.PrettyPrinter\nimport org.jetbrains.kotlin.lexer.KtKeywordToken\n\npublic interface KtCallableSignatureRenderer {\n public fun renderCallableSignature(\n analysisSession: KtAnalysisSession,\n symbol: KtCallableSymbol,\n keyword: KtKeywordToken?,","completion":"declarationRenderer: KtDeclarationRenderer,\n printer: PrettyPrinter,\n )\n\n public object FOR_SOURCE : KtCallableSignatureRenderer {\n override fun renderCallableSignature(\n analysisSession: KtAnalysisSession,\n symbol: KtCallableSymbol,\n keyword: KtKeywordToken?,<|endoftext|>"} {"prompt":"\/\/ MEMBER_NAME_FILTER: property\npackage properties\n\n@Target(\n AnnotationTarget.TYPE,\n AnnotationTarget.PROPERTY,\n AnnotationTarget.VALUE_PARAMETER,\n AnnotationTarget.FIELD,\n AnnotationTarget.PROPERTY_SETTER,\n AnnotationTarget.PROPERTY_GETTER,\n)\nannotation class Anno(val position: String)","completion":"const val constant = 0\n\nclass MyClass(\n @property:Anno(\"property $constant\")\n @get:Anno(\"get $constant\")\n @set:Anno(\"set $constant\")\n @setparam:Anno(\"set $constant\")\n @field:Anno(\"field $constant\")\n @param:Anno(\"param $constant\")<|endoftext|>"} {"prompt":"\/\/ Always filter resources configuration because it resolves klibs for dependency graph inheritance\n explicitlyEnabled || project.kotlinPropertiesProvider.mppResourcesResolutionStrategy == KotlinTargetResourcesResolutionStrategy.ResourcesConfiguration\n }\n )\n it.archivesFromDependencies.from(\n project.kotlinPropertiesProvider.mppResourcesResolutionStrategy.resourceArchives(compilation)\n )","completion":"it.outputDirectory.set(\n project.layout.buildDirectory.dir(\"$MULTIPLATFORM_RESOURCES_DIRECTORY\/resources-from-dependencies\/${targetName}\")\n )\n }\n }\n\n private fun resolveResourcesFromSelf(\n compilation: KotlinCompilation<*>,\n target: KotlinTarget,<|endoftext|>"} {"prompt":"NodeJsStackTraceElement(className=AssertionError, methodName=init, fileName=\/Users\/jetbrains\/IdeaProjects\/mpplib2\/build\/tmp\/expandedArchives\/kotlin-stdlib-js-1.3-SNAPSHOT.jar_730a1b227513cf16a9b639e009a985fc\/kotlin\/exceptions.kt,","completion":"lineNumber=102, colNumber=37)<|endoftext|>"} {"prompt":"\/\/ (ICONST or other integers creating instruction)\n \/\/ (ACONST_NULL or ALOAD)\n \/\/ ICONST_0\n \/\/ INVOKESTATIC InlineMarker.mark\n \/\/ INVOKE* suspendingFunction$default(..., Continuation;ILjava\/lang\/Object)Ljava\/lang\/Object;\n assert(paramTypes.size >= 3) {","completion":"\"${suspensionPoint.name}${suspensionPoint.desc} shall have 3+ parameters\"\n }\n } else {\n \/\/ Expected pattern here:\n \/\/ ALOAD 0\n \/\/ ICONST_0\n \/\/ INVOKESTATIC InlineMarker.mark\n \/\/ INVOKE* suspendingFunction(..., Continuation;)Ljava\/lang\/Object;<|endoftext|>"} {"prompt":"private fun Class<*>.getMethodOrNull(name: String, vararg parameterTypes: Class<*>): Method? =\n try {\n getMethod(name, *parameterTypes)\n } catch (e: NoSuchMethodException) {\n null\n }\n\nprivate fun getGeneratedClass(classLoader: ClassLoader, className: String): Class<*> =","completion":"classLoader.loadClassOrNull(className) ?: error(\"No class file was generated for: $className\")\n\nobject TestProcessServer {\n\n const val DEBUG_TEST = \"--debugTest\"\n\n private val executor = Executors.newFixedThreadPool(1)!!\n\n @Volatile\n private var isProcessingTask = true\n\n @Volatile<|endoftext|>"} {"prompt":"import org.gradle.api.provider.Provider\nimport org.gradle.api.services.BuildService\nimport org.gradle.api.services.BuildServiceParameters\nimport org.gradle.api.tasks.Internal\nimport org.gradle.tooling.events.FinishEvent\nimport org.gradle.tooling.events.OperationCompletionListener","completion":"import org.gradle.tooling.events.task.TaskExecutionResult\nimport org.gradle.tooling.events.task.TaskFailureResult\nimport org.gradle.tooling.events.task.TaskFinishEvent\nimport org.gradle.tooling.events.task.TaskSkippedResult\nimport org.gradle.util.GradleVersion<|endoftext|>"} {"prompt":"assertEquals(\"something\", String(Files.readAllBytes(file)))\n }\n\n @Test\n fun testDeletingNotExistingFileOnFailure() {\n val file = workingDir.resolve(\"1.txt\")\n useTransaction {\n deleteFile(file)\n }\n assertFalse(Files.exists(file))\n }\n\n @Test","completion":"fun testChangesAreRevertedOnExecutionException() {\n val file1 = workingDir.resolve(\"1.txt\")\n val file2 = workingDir.resolve(\"2.txt\")\n Files.write(file1, \"something\".toByteArray())\n assertThrows {\n useTransaction {\n registerAddedOrChangedFile(file1)<|endoftext|>"} {"prompt":"\/\/ library.kt:8 box: $i$f$foo\\56\\65:int=0:int, array\\56:java.lang.Integer[]=java.lang.Integer[], myClass\\56:MyClass=MyClass, this_\\67:MyClass=MyClass, $i$f$f1\\67\\515:int=0:int","completion":"\/\/ library.kt:28 box: $i$f$foo\\56\\65:int=0:int, array\\56:java.lang.Integer[]=java.lang.Integer[], myClass\\56:MyClass=MyClass, this_\\67:MyClass=MyClass, $i$f$f1\\67\\515:int=0:int,<|endoftext|>"} {"prompt":"private const val INLINE_MARKER_AFTER_INLINE_SUSPEND_ID = 7\nprivate const val INLINE_MARKER_BEFORE_UNBOX_INLINE_CLASS = 8\nprivate const val INLINE_MARKER_AFTER_UNBOX_INLINE_CLASS = 9","completion":"internal inline fun getMethodNode(classData: ByteArray, classType: Type, crossinline match: (Method) -> Boolean): SMAPAndMethodNode? {\n var node: MethodNode? = null\n var sourceFile: String? = null\n var sourceMap: String? = null\n ClassReader(classData).accept(object : ClassVisitor(Opcodes.API_VERSION) {<|endoftext|>"} {"prompt":"val arguments = qualifiedAccess.orderedArguments(callee) ?: return\n val argumentVariables = Array(arguments.size) { i ->\n arguments[i]?.let { argument ->\n getOrCreateVariableIfRealAndStable(flow, argument)\n \/\/ Only apply contract information to argument if it has not been reassigned in a lambda.","completion":".takeIf { callArgsExit == null || isSameValueIn(callArgsExit, argument, flow) }\n }\n }\n if (argumentVariables.all { it == null }) return\n\n val typeParameters = callee.typeParameters\n val typeArgumentsSubstitutor = if (typeParameters.isNotEmpty() && qualifiedAccess is FirQualifiedAccessExpression) {<|endoftext|>"} {"prompt":"parameterObjectOption: (ParameterObjectOption, K) -> CreatorLike, V, A, C>,\n assertionCreator: C.(M) -> Unit\n) {}\n\nprivate fun createGetParameterObject(\n plant: AssertionPlant>,\n key: K","completion":") = null as ParameterObject, V>\n\nprivate fun containsNullable(\n plant: AssertionPlant>,\n pairs: List>,\n assertionCreator: AssertionPlantNullable.(M) -> Unit\n) = contains(<|endoftext|>"} {"prompt":"\/\/ so `fun remember` wasn't transformed yet, then we have to transform it now.\n val createDecoysTransformer = CreateDecoysTransformer(\n context, symbolRemapper, signatureBuilder, stabilityInferencer, metrics\n )\n with(createDecoysTransformer) {\n if (!it.isDecoy()) {\n visitSimpleFunction(it) as IrSimpleFunction\n updateParents()","completion":"composerParamTransformer.visitSimpleFunction(\n it.getComposableForDecoy().owner as IrSimpleFunction\n ) as IrSimpleFunction\n } else {\n it.getComposableForDecoy().owner as IrSimpleFunction\n }\n }\n }\n }.symbol\n }\n\n override fun lower(module: IrModuleFragment) {<|endoftext|>"} {"prompt":"* NOTE: for-loop operators\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-36898, KT-62356\n *\/\npackage testPackCase8\n\nfun case8 () {\n val iterable: Iterable = Iterable()\n for (i in iterable) {\n println(i)\n }\n}","completion":"class Iterable() {\n \/\/ operator fun iterator() : CharIterator = TODO()\n}\nval Iterable.iterator: Inv\n get() = Inv('c')\n\nclass Inv(val c: Char) {\n operator fun invoke(): CharIterator = object : CharIterator() {\n private var index = 0\n\n override fun nextChar(): Char {\n index++; return c\n }<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WITH_COROUTINES\nimport helpers.*\nimport kotlin.coroutines.*\nimport kotlin.coroutines.intrinsics.*\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\n@Suppress(\"UNSUPPORTED_FEATURE\")\ninline class IC(val s: String)","completion":"var c: Continuation? = null\n\nsuspend fun suspendMe(): T = suspendCoroutine {\n @Suppress(\"UNCHECKED_CAST\")\n c = it as Continuation\n}\n\ninterface I {\n suspend fun foo(s: String): IC\n}\n\nclass D: I {\n override suspend fun foo(s: String): IC = suspendMe()\n}<|endoftext|>"} {"prompt":"*\/\n fun put(key: K, value: D, oldValue: D?): S {\n @Suppress(\"UNCHECKED_CAST\")\n \/\/ Avoid a copy instance creation if new value is the same\n if (value == oldValue) return this as S\n return copy(map.put(key, value))\n }","completion":"override fun getOrNull(key: K): D? = this[key].getOrElse(null as D?)\n override fun asMap() = this\n\n fun retainAll(predicate: (K) -> Boolean): S = copy(map.removeAll(map.keySet().filterNot(predicate)))<|endoftext|>"} {"prompt":"@nativeGetter\n fun get(): Any? = null","completion":"@nativeGetter\n fun get(a: A): Any? = null<|endoftext|>"} {"prompt":"suspend fun AsyncSequence.toList(): List {\n val out = arrayListOf()\n for (e in this@toList) out += e \/\/ fails at this line\n return out\n}\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\nfun box(): String {","completion":"val seq = asyncGenerate {\n yield(\"O\")\n yield(\"K\")\n }\n\n var res = listOf()\n\n builder {\n res = seq.toList()\n }\n\n if (res.size > 2) return \"fail 1: ${res.size}\"\n\n return res[0] + res[1]\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.ir.util\n\nimport org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kotlin.descriptors.DeclarationDescriptor\nimport org.jetbrains.kotlin.descriptors.PropertyDescriptor\nimport org.jetbrains.kotlin.ir.symbols.IrFileSymbol","completion":"import org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.ir.util.render as newRender\n\n\/**\n * [IdSignature] is a unique key that corresponds to each Kotlin Declaration. It is used to reference declarations in klib.\n * It has to be stable and unique. It\u2019s a bit similar to JVM signature but more Kotlin-specific.\n *<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.konan.test.blackbox.support.settings\n\nimport org.jetbrains.kotlin.konan.test.blackbox.AbstractNativeSimpleTest\n\n\/**\n * All instances of test classes.\n *\n * [allInstances] - all test class instances ordered from innermost to outermost\n * [enclosingTestInstance] - the outermost test instance\n *\/","completion":"internal class SimpleTestInstances(val allInstances: List) {\n val enclosingTestInstance: AbstractNativeSimpleTest\n get() = allInstances.firstOrNull() as AbstractNativeSimpleTest\n}<|endoftext|>"} {"prompt":"* \n * @sample samples.collections.Collections.Aggregates.runningFold\n *\/\n@SinceKotlin(\"1.4\")\npublic inline fun CharSequence.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List {\n if (isEmpty()) return listOf(initial)","completion":"val result = ArrayList(length + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n\/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right<|endoftext|>"} {"prompt":"val platformNN = J.staticNN\n \/\/ @Nullable platform type\n val platformN = J.staticN\n \/\/ platform type with no annotation\n val platformJ = J.staticJ\n\n if (platformNN) {}\n if (platformN) {}\n if (platformJ) {}\n\n while (platformNN) {}","completion":"while (platformN) {}\n while (platformJ) {}\n\n do {} while (platformNN)\n do {} while (platformN)\n do {} while (platformJ)\n\n platformNN && false<|endoftext|>"} {"prompt":"lateinit var result1: String\nlateinit var result2: String\n\nclass Test(val x: String) {\n fun test(a: String) {\n if (result1 != a) throw AssertionError(\"result1: $result1\")\n result2 = a\n }\n\n init {\n fun test() {\n fun test1() {\n result1 = x\n }\n test1()","completion":"}\n test()\n }\n}\n\nfun box(): String {\n val t = Test(\"OK\")\n t.test(\"OK\")\n\n return result2\n}<|endoftext|>"} {"prompt":"C","completion":"@JsPlainObject\nexternal interface E\n\n@JsPlainObject\nexternal interface F\n\n@JsPlainObject\nexternal interface DEF: D, E, F\n\nexternal interface G: A, C, E<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: -SuspendConversion\n\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\nfun foo1(f: suspend () -> String) {}\nfun foo2(f: suspend (Int) -> String) {}\nfun foo3(f: suspend () -> Unit) {}\n\nfun bar(): String = \"\"\n\nfun test(\n f0: suspend () -> String,","completion":"f1: () -> String,\n f2: (Int) -> String,\n f3: () -> Unit,\n) {\n foo1 { \"str\" }\n foo1(f0)\n\n foo1(f1)\n foo2(f2)\n foo3(f3)\n\n foo1(::bar)<|endoftext|>"} {"prompt":"diagnosticReporter: DiagnosticReporter,\n compatibilityMode: CompatibilityMode,\n cleanFiles: List,\n dependencies: List,\n createModuleSerializer: (\n irDiagnosticReporter: IrDiagnosticReporter,\n irBuiltins: IrBuiltIns,\n compatibilityMode: CompatibilityMode,","completion":"normalizeAbsolutePaths: Boolean,\n sourceBaseDirs: Collection,\n languageVersionSettings: LanguageVersionSettings,\n shouldCheckSignaturesOnUniqueness: Boolean,\n ) -> IrModuleSerializer<*>,\n metadataSerializer: KlibSingleFileMetadataSerializer,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.declarations.impl.FirPropertyAccessorImpl\nimport org.jetbrains.kotlin.fir.expressions.FirAnnotation\nimport org.jetbrains.kotlin.fir.expressions.FirBlock\nimport org.jetbrains.kotlin.fir.symbols.impl.FirPropertyAccessorSymbol","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol\nimport org.jetbrains.kotlin.fir.types.ConeSimpleKotlinType\nimport org.jetbrains.kotlin.fir.types.FirTypeRef\nimport org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource<|endoftext|>"} {"prompt":"val TEXTURE29: Int\n val TEXTURE30: Int\n val TEXTURE31: Int\n val ACTIVE_TEXTURE: Int\n val REPEAT: Int\n val CLAMP_TO_EDGE: Int\n val MIRRORED_REPEAT: Int\n val FLOAT_VEC2: Int\n val FLOAT_VEC3: Int","completion":"val FLOAT_VEC4: Int\n val INT_VEC2: Int\n val INT_VEC3: Int\n val INT_VEC4: Int\n val BOOL: Int\n val BOOL_VEC2: Int\n val BOOL_VEC3: Int\n val BOOL_VEC4: Int\n val FLOAT_MAT2: Int<|endoftext|>"} {"prompt":"foo({1}, {1})\n foo({1}, {1})\n }\n}\n\n\/\/ TESTCASE NUMBER: 3\nclass Case3() {","completion":"fun foo(x: ()->CharSequence, x1: String = \"\"): Unit = TODO() \/\/ (3)\n fun foo(x: ()->String, z: Any = \"\"): String = TODO() \/\/ (4)\n\n fun boo() = \"\"\n\n val boo = 1\n\n fun case() {<|endoftext|>"} {"prompt":"propagateLambdaAnalysisDiagnostics(diagnosticHolderForLambda, candidate)\n }\n\n val errorCandidates = mutableSetOf()\n val successfulCandidates = mutableSetOf()\n\n for (candidate in candidates) {\n if (candidate.isSuccessful) {\n successfulCandidates += candidate\n } else {","completion":"errorCandidates += candidate\n }\n }\n return when {\n successfulCandidates.isNotEmpty() -> successfulCandidates\n else -> errorCandidates\n }\n }\n\n private fun propagateLambdaAnalysisDiagnostics(\n diagnosticHolder: KotlinDiagnosticsHolder.SimpleHolder,\n candidate: SimpleResolutionCandidate\n ) {<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.serialization.deserialization\n\nimport org.jetbrains.kotlin.descriptors.*\nimport org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor\nimport org.jetbrains.kotlin.descriptors.deserialization.AdditionalClassPartsProvider","completion":"import org.jetbrains.kotlin.descriptors.deserialization.ClassDescriptorFactory\nimport org.jetbrains.kotlin.descriptors.deserialization.PlatformDependentDeclarationFilter\nimport org.jetbrains.kotlin.incremental.components.LookupTracker\nimport org.jetbrains.kotlin.metadata.ProtoBuf<|endoftext|>"} {"prompt":"var a = \"\"\n var b = 0\n val r = object: Runnable {\n override fun run() {\n b += 2\n a += \"b\"\n }\n }\n r.run()\n c()\n r.run()\n Result.a += a\n Result.b += b\n}\nsuspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {","completion":"var a = \"\"\n var b = 0\n val r = object: Runnable {\n override fun run() {\n b += 3\n a += \"c\"\n }\n }\n r.run()\n c()\n r.run()\n Result.a += a\n Result.b += b\n}\n\n\/\/ FILE: inlineSite.kt\nimport kotlin.coroutines.*<|endoftext|>"} {"prompt":"fun mangledInternal() = NameAndStability(getInternalMangledName(baseName, encodeSignature(descriptor)), true)\n fun mangledPrivate() = NameAndStability(getPrivateMangledName(baseName, descriptor), false)\n\n val effectiveVisibility = descriptor.ownEffectiveVisibility\n\n val containingDeclaration = descriptor.containingDeclaration\n return when (containingDeclaration) {","completion":"is PackageFragmentDescriptor -> when {\n effectiveVisibility.isPublicAPI -> mangledAndStable()\n\n effectiveVisibility == DescriptorVisibilities.INTERNAL -> mangledInternal()\n\n else -> regularAndUnstable()\n }\n is ClassDescriptor -> when {\n \/\/ valueOf() is created in the library with a mangled name for every enum class<|endoftext|>"} {"prompt":"fun HandlersStepBuilder.inlineHandlers() {\n useHandlers(\n ::BytecodeInliningHandler,\n ::SMAPDumpHandler\n )\n}\n\nfun TestConfigurationBuilder.configureModernJavaTest(jdkKind: TestJdkKind, jvmTarget: JvmTarget) {\n defaultDirectives {","completion":"JvmEnvironmentConfigurationDirectives.JDK_KIND with jdkKind\n JvmEnvironmentConfigurationDirectives.JVM_TARGET with jvmTarget\n +ConfigurationDirectives.WITH_STDLIB\n +CodegenTestDirectives.USE_JAVAC_BASED_ON_JVM_TARGET\n +CodegenTestDirectives.IGNORE_DEXING\n }\n}<|endoftext|>"} {"prompt":"\/**\n * The most precise time source available in the platform.\n *\n * This time source returns its readings from a source of monotonic time when it is available in a target platform,\n * and resorts to a non-monotonic time source otherwise.\n *\n * The function [markNow] of this time source returns the specialized [ValueTimeMark] that is an inline value class","completion":"* wrapping a platform-dependent time reading value.\n *\/\n public object Monotonic : TimeSource.WithComparableMarks {\n override fun markNow(): ValueTimeMark = MonotonicTimeSource.markNow()\n override fun toString(): String = MonotonicTimeSource.toString()\n\n \/**<|endoftext|>"} {"prompt":"fun case3(case: T): T where T : A3, T : B3 = case\n\n\/\/ TESTCASE NUMBER: 4\nfun case4() {\n fun case4(case: T): T where T : A4, T : B4 = case\n\n val x = case4(C4())\n checkSubtype(x)","completion":"checkSubtype(x)\n}\n\nclass C4: A4, B4\n\ninterface A4 {\n fun fooA() = \"A\"\n}\n\ninterface B4 {\n fun fooB() = \"B\"\n}\n\n\n\n\/\/ TESTCASE NUMBER: 5\nfun case5() {\n val x = \"\" case5 object : A5, B5 {}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.impl.IrClassReferenceImpl\nimport org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol\nimport org.jetbrains.kotlin.ir.types.*\nimport org.jetbrains.kotlin.ir.util.*\nimport org.jetbrains.kotlin.name.FqName","completion":"import org.jetbrains.kotlin.types.Variance\n\n\/\/ true if the class should be processed by the parcelize plugin\nval IrClass.isParcelize: Boolean\n get() = kind in ParcelableExtensionBase.ALLOWED_CLASS_KINDS && hasAnnotation(PARCELIZE_CLASS_FQNAME)<|endoftext|>"} {"prompt":"checkExactType>(; Buildee\"), TYPE_MISMATCH(\"Buildee; Buildee\")!>buildee)\n}\n\n\n\n\nclass TargetType\nclass DifferentType\n\nfun consumeDifferentType(value: DifferentType) {}\n\nclass Buildee {","completion":"fun setTypeVariable(value: TV) { storage = value }\n fun getTypeVariable(): TV = storage\n private var storage: TV = null!!\n}\n\nfun parallelBuild(\n instructionsA: Buildee.(PTV) -> Unit,\n instructionsB: Buildee.(PTV) -> Unit\n): Buildee {<|endoftext|>"} {"prompt":"val WASM_IMPORT_EXPORT_VARARG_PARAMETER: KtDiagnosticFactory0 by error0()","completion":"val WASM_IMPORT_EXPORT_UNSUPPORTED_PARAMETER_TYPE: KtDiagnosticFactory1 by error1(SourceElementPositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT)<|endoftext|>"} {"prompt":"assertHasDiagnostic(KotlinToolingDiagnostics.InconsistentTargetCompatibilityForKotlinAndJavaTasks)\n }\n\n javaSourcesDir().resolve(\"demo\").run {\n createDirectories()\n resolve(\"HelloWorld.java\").writeText(\n \/\/language=Java\n \"\"\"\n package demo;\n\n public class HelloWorld {","completion":"public static void main(String[] args) {\n System.out.println(\"Hello world!\");\n }\n }\n \"\"\".trimIndent()\n )\n }\n\n build(\":compileKotlin\") {\n assertHasDiagnostic(KotlinToolingDiagnostics.InconsistentTargetCompatibilityForKotlinAndJavaTasks)\n }\n }\n }<|endoftext|>"} {"prompt":"\/\/ jspecify_nullness_mismatch, jspecify_nullness_mismatch\n a.foo(null, x).foo()","completion":"\/\/ jspecify_nullness_mismatch\n a.field.foo()\n\n \/\/ jspecify_nullness_mismatch<|endoftext|>"} {"prompt":"open class A(val value: String) {\n fun component1() = value\n}\n\ninterface B {\n fun component1(): Any\n}\n\nclass C(value: String) : A(value), B\n\nfun box(): String {\n val c = C(\"OK\")\n val b: B = c\n val a: A = c\n if (b.component1() != \"OK\") return \"Fail 1\"","completion":"if (a.component1() != \"OK\") return \"Fail 2\"\n return c.component1()\n}<|endoftext|>"} {"prompt":"OPTIONAL_JVM_INLINE_ANNOTATION\nvalue class IcInt(val x: T)\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class IcLong(val x: T)\n\nfun id(x: T) = x\n\nfun box(): String {","completion":"if (IcInt(42) == id(IcInt(24))) return \"Error 1\"\n if (IcInt(42) != id(IcInt(42))) return \"Error 2\"\n if (id(IcInt(42)) == IcInt(24)) return \"Error 3\"\n if (id(IcInt(42)) != IcInt(42)) return \"Error 4\"<|endoftext|>"} {"prompt":"@Target(AnnotationTarget.EXPRESSION, AnnotationTarget.LOCAL_VARIABLE)\n@Retention(AnnotationRetention.SOURCE)\nannotation class Ann\n\nfun foo(arg: Int): Int {\n if (@Ann arg == 0) {\n @Ann return 1\n }\n @Ann if (arg == 1) {\n return (@Ann 1)\n }\n return 42\n}","completion":"data class Two(val x: Int, val y: Int)\n\nfun bar(two: Two) {\n val (@Ann x, @Ann y) = two\n}<|endoftext|>"} {"prompt":"override fun visitStringConcatenation(expression: IrStringConcatenation, data: IrDeclaration) {\n super.visitStringConcatenation(expression, data)\n toStringMethod.enqueue(data, \"string concatenation\")\n }\n }\n\n private fun addReachabilityInfoIfNeeded(\n from: IrDeclaration,\n to: IrDeclaration,","completion":"description: String,\n isContagiousOverridableDeclaration: Boolean,\n ) {\n reachabilityInfos?.add(ReachabilityInfo(from, to, description, isContagiousOverridableDeclaration))\n }\n\n protected fun IrDeclaration.enqueue(\n from: IrDeclaration,\n description: String,\n isContagious: Boolean = true,\n ) {<|endoftext|>"} {"prompt":"arr[break]\n }\n\n while (true) {\n arr[1] = break\n }\n\n while (true) {\n break\n foo(1)","completion":"}\n\n while (true) {\n var x = 1\n break\n x = 2\n }\n\n while (true) {\n var x = 1<|endoftext|>"} {"prompt":"repository.getLibraries(target).toList().ifNotEmpty { NativeLibrariesToCommonize(target, this) }\n }\n\n libraries.forEachWithTarget { target, librariesOrNull ->\n if (librariesOrNull == null)\n logger.warning(\n \"No libraries found for target ${target}. This target will be excluded from commonization.\"\n )\n }\n libraries","completion":"}\n }\n\n private fun commonizeAndSaveResults(libraries: TargetDependent) {\n runCommonization(\n CommonizerParameters(\n outputTargets = outputTargets,\n targetProviders = libraries.map { target, targetLibraries -> createTargetProvider(target, targetLibraries) },\n manifestProvider = createManifestProvider(libraries),<|endoftext|>"} {"prompt":"firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }\n add(FirErrors.CONST_VAL_WITH_NON_CONST_INITIALIZER) { firDiagnostic ->\n ConstValWithNonConstInitializerImpl(\n firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }","completion":"add(FirErrors.WRONG_SETTER_PARAMETER_TYPE) { firDiagnostic ->\n WrongSetterParameterTypeImpl(\n firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),\n firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b),<|endoftext|>"} {"prompt":"@Deprecated(\"Use inline extension function with body using dynamic\")\npublic annotation class nativeInvoke\n\n@Target(CLASS, FUNCTION, PROPERTY)\ninternal annotation class library(public val name: String = \"\")\n\n@Target(CLASS)\ninternal annotation class marker\n\n\/**\n * Gives a declaration (a function, a property or a class) specific name in JavaScript.\n *\n * This may be useful in the following cases:","completion":"*\n * * There are two functions for which the compiler gives same name in JavaScript, you can\n * mark one with `@JsName(...)` to prevent the compiler from reporting error.\n * * You are writing a JavaScript library in Kotlin. The compiler produces mangled names\n * for functions with parameters, which is unnatural for usual JavaScript developer.<|endoftext|>"} {"prompt":"\/\/ library.kt:26 box: m:int=2:int, m1:int=2:int, xg$iv:int=0:int, $i$f$g:int=0:int, $i$f$bar\\2\\8:int=0:int","completion":"\/\/ library.kt:27 box: m:int=2:int, m1:int=2:int, xg$iv:int=0:int, $i$f$g:int=0:int, $i$f$bar\\2\\8:int=0:int, wbar\\2$iv:int=2:int<|endoftext|>"} {"prompt":".failures.withClosure { listOfNotNull(it.cause) }\n assertFalse(executedAfterLifecycleFinished.getAndSet(true))\n if (thrownException !in exceptions) fail(\"Expected 'thrownException' in lifecycle.finished\")\n }\n\n\n \/* Provoking an exception during project.evaluate() *\/\n val exceptionWasProvoked = AtomicBoolean()","completion":"project.tasks.whenObjectAdded {\n assertFalse(exceptionWasProvoked.getAndSet(true))\n throw thrownException\n }\n runCatching { project.evaluate() }\n assertTrue(exceptionWasProvoked.get(), \"Exception during '.evaluate()' was not provoked\")<|endoftext|>"} {"prompt":"if (this.e != null) e.propNullableT\n if (this.e != null) e.propNullableAny","completion":"if (this.e != null) e.funT()\n if (this.e != null) e.funAny()<|endoftext|>"} {"prompt":"buildScriptContent.replace(PLUGIN_MARKER_VERSION_PLACEHOLDER, KOTLIN_VERSION)","completion":"\/** Copies the logic of Gradle [`mavenLocal()`](https:\/\/docs.gradle.org\/3.4.1\/dsl\/org.gradle.api.artifacts.dsl.RepositoryHandler.html#org.gradle.api.artifacts.dsl.RepositoryHandler:mavenLocal())\n *\/\nprivate object MavenLocalUrlProvider {<|endoftext|>"} {"prompt":"fun Long.id() = this\n\nfun String.drop2() = if (length >= 2) subSequence(2, length) else null\n\nfun String.anyLength(): Any = length\n\n\nfun doSimple(s: String?) = s?.length == 3\n\nfun doLongReceiver(x: Long) = x?.id() == 3L","completion":"fun doChain(s: String?) = s?.drop2()?.length == 1\n\nfun doIf(s: String?) =\n if (s?.length == 1) \"A\" else \"B\"\n\nfun doCmpWithAny(s: String?) =\n s?.anyLength() == 3\n\nfun doIfNot(s: String?) =<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.light.classes.symbol.isLateInit\nimport org.jetbrains.kotlin.light.classes.symbol.methods.SymbolLightMethodBase\nimport org.jetbrains.kotlin.light.classes.symbol.modifierLists.SymbolLightClassModifierList","completion":"import org.jetbrains.kotlin.light.classes.symbol.withSymbol\nimport org.jetbrains.kotlin.name.SpecialNames\n\ninternal class SymbolLightSetterParameter(\n ktAnalysisSession: KtAnalysisSession,\n private val containingPropertySymbolPointer: KtSymbolPointer,\n parameterSymbol: KtValueParameterSymbol,<|endoftext|>"} {"prompt":"return \"new(${parameters.generateTypeScriptString(indent)}): ${returnType.toTypeScript(indent)};\"\n }\n\n private fun ExportedProperty.generateTypeScriptString(indent: String, prefix: String, esModules: Boolean = false): String {\n val extraIndent = \"$indent \"\n val optional = if (isOptional) \"?\" else \"\"","completion":"val containsUnresolvedChar = !name.isValidES5Identifier()\n val memberName = if (containsUnresolvedChar) \"\\\"$name\\\"\" else name\n val isObjectGetter = irGetter?.origin == JsLoweredDeclarationOrigin.OBJECT_GET_INSTANCE_FUNCTION<|endoftext|>"} {"prompt":"private fun MappedByteBuffer.parseZip64CentralDirectoryRecordsNumberAndOffset(): Pair {\n var endOfCentralDirectoryOffset = capacity() - END_OF_CENTRAL_DIR_ZIP64_SIZE\n while (endOfCentralDirectoryOffset >= 0) {","completion":"\/\/ header of \"End of central directory\" (see https:\/\/pkware.cachefly.net\/webdocs\/casestudies\/APPNOTE.TXT)\n if (getInt(endOfCentralDirectoryOffset) == 0x06064b50) break\n endOfCentralDirectoryOffset--\n }\n\n val entriesNumber = getLong(endOfCentralDirectoryOffset + 32)<|endoftext|>"} {"prompt":"origin = when {\n origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB -> origin\n fir.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR\n origin == IrDeclarationOrigin.FAKE_OVERRIDE -> origin\n origin == IrDeclarationOrigin.DELEGATED_MEMBER -> origin","completion":"fir.getter is FirDefaultPropertyGetter -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR\n else -> origin\n },\n firAccessor = fir.getter,\n isSetter = false,\n firParentProperty = fir,\n firParentClass = containingClass,\n symbol = it,\n parent = this@Fir2IrLazyProperty.parent,<|endoftext|>"} {"prompt":"false,\n false\n )\n scopeKind = LexicalScopeKind.PROPERTY_HEADER\n }\n else -> TODO(\"${declaration::class}\")\n }\n\n val result = LexicalWritableScope(\n parent,\n descriptor,\n false,\n LocalRedeclarationChecker.DO_NOTHING,\n scopeKind\n )","completion":"val typeParameters = descriptorResolver.resolveTypeParametersForDescriptor(\n descriptor,\n result,\n result,\n declaration.typeParameters,\n trace\n )\n\n descriptorResolver.resolveGenericBounds(declaration, descriptor, result, typeParameters, trace)\n\n return result\n }\n\n private class LazyObjCProtocolImpl(<|endoftext|>"} {"prompt":"val lastLineImports = lexicalScopeAfterLastLine.parentsWithSelf.first { it is ImportingScope } as ImportingScope\n val scopesForThisLine = fileScopeFactory.createScopesForFile(linePsi, lastLineImports, false)\n val combinedLexicalScopes = if (hasImports)","completion":"lexicalScopeAfterLastLine.replaceImportingScopes(scopesForThisLine.importingScope)\n else\n lexicalScopeAfterLastLine\n\n return FileScopes(combinedLexicalScopes, scopesForThisLine.importingScope, scopesForThisLine.importForceResolver)\n }\n }\n}<|endoftext|>"} {"prompt":"ensure(1)\n data[size++] = value\n }\n\n fun addChainable(value: Int): IntArrayList {\n add(value)\n return this\n }\n\n operator fun get(index: Int): Int = data[index]\n operator fun set(index: Int, value: Int) {\n data[index] = value\n }\n }","completion":"val size = BENCHMARK_SIZE * 100\n\n \/\/Benchmark\n fun testChainable() {\n val list = IntArrayList()\n for (i in 0..size) {\n list.addChainable(i)\n }\n for (i in 0..size) {\n list[i] = i * 2\n }\n var sum = 0<|endoftext|>"} {"prompt":"for (i in 0 until size) {\n if (i != 0 && i % Integer.SIZE == 0) {\n masks.add(mask)\n mask = 0\n }\n mask = mask or if (bits.get(i)) 1 shl (i % Integer.SIZE) else 0\n }\n masks.add(mask)\n\n return masks\n }","completion":"fun generateOnStackIfNeeded(callGenerator: CallGenerator, isConstructor: Boolean): Boolean {\n val toInts = toInts()\n if (!toInts.isEmpty()) {\n for (mask in toInts) {\n callGenerator.putValueIfNeeded(<|endoftext|>"} {"prompt":"fun takeWithNullableReference(a: WithNullableReference) {}\n\n\/\/ FILE: test.kt\n\nfun foo(a: WithPrimitive?, b: WithPrimitive) {\n takeWithPrimitive(a!!) \/\/ unbox\n takeWithPrimitive(a) \/\/ unbox\n takeWithPrimitive(b!!)\n}\n\nfun bar(a: WithReference?, b: WithReference) {","completion":"takeWithReference(a!!)\n takeWithReference(a)\n takeWithReference(b!!)\n}\n\nfun baz(a: WithNullableReference?, b: WithNullableReference) {\n takeWithNullableReference(a!!) \/\/ unbox\n takeWithNullableReference(a) \/\/ unbox\n takeWithNullableReference(a!!) \/\/ unbox<|endoftext|>"} {"prompt":"\/\/ Here we're dividing the build process onto two phases:\n \/\/ 1. build bag of edges and direct edges array;\n \/\/ 2. build reversed edges array from the direct edges array.\n \/\/ This is to lower memory usage (all of these edges structures are more or less equal by size),\n \/\/ and by that we're only holding references to two out of three of them.","completion":"private fun buildConstraintGraph(nodesMap: MutableMap,\n functions: Map,\n typeHierarchy: TypeHierarchyImpl,\n rootSet: List\n ): ConstraintGraphBuildResult {<|endoftext|>"} {"prompt":"assertFalse(eqFloatChar(1.toFloat(), 1.toChar()))\n assertFalse(eqFloatCharQ(0.toFloat(), 0.toChar()))\n assertFalse(eqFloatCharQ(0.toFloat(), 1.toChar()))\n assertFalse(eqFloatCharQ(0.toFloat(), null))\n assertFalse(eqFloatCharQ(0.toFloat(), undefined))","completion":"assertFalse(eqFloatCharQ(1.toFloat(), 0.toChar()))\n assertFalse(eqFloatCharQ(1.toFloat(), 1.toChar()))\n assertFalse(eqFloatCharQ(1.toFloat(), null))\n assertFalse(eqFloatCharQ(1.toFloat(), undefined))\n assertFalse(eqFloatQChar(0.toFloat(), 0.toChar()))<|endoftext|>"} {"prompt":"\/\/ \"Ţ\" to 354,\n\/\/ \"ţ\" to 355,\n\/\/ \"Т\" to 1058,\n\/\/ \"т\" to 1090,\n\/\/ \"⃛\" to 8411,\n\/\/ \"⌕\" to 8981,\n\/\/ \"𝔗\" to 120087,\n\/\/ \"𝔱\" to 120113,","completion":"\/\/ \"∴\" to 8756,\n\/\/ \"∴\" to 8756,\n\/\/ \"∴\" to 8756,\n\/\/ \"Θ\" to 920,\n\/\/ \"θ\" to 952,\n\/\/ \"ϑ\" to 977,\n\/\/ \"ϑ\" to 977,\n\/\/ \"≈\" to 8776,<|endoftext|>"} {"prompt":"load(descriptorVar, descType)\n iconst(index)\n\n val sti = getSerialTypeInfo(property, propertyType)\n val useSerializer = stackValueSerializerInstanceFromSerializer(expressionCodegen, codegen, sti, this@SerializerCodegenImpl)\n val unknownSer = (!useSerializer && sti.elementMethodPrefix.isEmpty())\n if (unknownSer) {","completion":"aconst(codegen.typeMapper.mapType(property.type))\n AsmUtil.wrapJavaClassIntoKClass(this)\n }\n\n fun produceCall(isUpdatable: Boolean) {\n invokeinterface(\n kInputType.internalName,<|endoftext|>"} {"prompt":"private fun HEAD.commonHead() {\n meta { charset = \"utf-8\" }\n script(src = \"https:\/\/code.jquery.com\/jquery-3.4.0.slim.min.js\") {","completion":"integrity = \"sha256-ZaXnYkHGqIhqTbJ6MB4l9Frs\/r7U4jlx7ir8PJYBqbI=\"\n @Suppress(\"SpellCheckingInspection\")\n attributes[\"crossorigin\"] = \"anonymous\"\n }\n}<|endoftext|>"} {"prompt":"* Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.any(): Boolean {\n return storage.any()\n}\n\n\/**","completion":"* Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.any(predicate: (UInt) -> Boolean): Boolean {<|endoftext|>"} {"prompt":"* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)\n *\n * SPEC VERSION: 0.1-313\n * MAIN LINK: expressions, when-expression -> paragraph 4 -> sentence 1\n * NUMBER: 1\n * DESCRIPTION: it is possible to replace the else condition with an always-true condition\n *\/\n\n\/\/ FILE: JavaEnum.java\n\nenum JavaEnum {\n Val_1,","completion":"Val_2,\n}\n\n\/\/ FILE: KotlinClass.kt\n\n\/\/ TESTCASE NUMBER: 1\nfun case1() {\n val z = JavaEnum.Val_1\n val when2 = when (z) {\n JavaEnum.Val_1 -> { }<|endoftext|>"} {"prompt":"\"removeAll(listOf(present))\" to { removeAll(listOf(present)) },\n \"removeAll(emptyList())\" to { removeAll(emptyList()) },\n \"removeAll(this.toList())\" to { removeAll(this.toList()) },\n\n \"retainAll(listOf(present))\" to { retainAll(listOf(present)) },","completion":"\"retainAll(emptyList())\" to { retainAll(emptyList()) },\n \"retainAll(this.toList())\" to { retainAll(this.toList()) },\n\n \"clear()\" to { clear() },\n\n \"iterator().apply { next() }.remove()\" to { iterator().apply { next() }.remove() }\n )<|endoftext|>"} {"prompt":"interface WrongExportedDeclaration : KtFirDiagnostic {\n override val diagnosticClass get() = WrongExportedDeclaration::class\n val kind: String\n }\n\n interface NonExportableType : KtFirDiagnostic {\n override val diagnosticClass get() = NonExportableType::class\n val kind: String\n val type: KtType","completion":"}\n\n interface NonConsumableExportedIdentifier : KtFirDiagnostic {\n override val diagnosticClass get() = NonConsumableExportedIdentifier::class\n val name: String\n }\n\n interface NamedCompanionInExportedInterface : KtFirDiagnostic {<|endoftext|>"} {"prompt":"p:foo.bar.D1(getValue) p:foo.bar.D1(provideDelegate) p:foo.bar.D1(setValue) p:java.lang(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate)","completion":"p:kotlin.comparisons(provideDelegate) p:kotlin.io(provideDelegate) p:kotlin.jvm(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate)*\/D1()<|endoftext|>"} {"prompt":"@Synchronized\n override operator fun set(key: FqName, value: Set) {\n if (value.isNotEmpty()) {\n super.set(key, value)\n } else {\n remove(key)\n }\n }\n\n @Synchronized\n fun removeValues(key: FqName, removed: Set) {","completion":"this[key] = this[key].orEmpty() - removed\n }\n\n}\n\ninternal class SubtypesMap(\n storageFile: File,\n icContext: IncrementalCompilationContext,\n) : ClassOneToManyMap(storageFile, icContext)\n\ninternal class SupertypesMap(\n storageFile: File,\n icContext: IncrementalCompilationContext,<|endoftext|>"} {"prompt":"fun fn5(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any) {}\nfun fn6(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any, x5: Any) {}","completion":"fun fn7(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any) {}\nfun fn8(x0: Any, x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any) {}<|endoftext|>"} {"prompt":"val correspondingDeclaredSuperType = superTypeRefs.firstOrNull {\n it.coneType.fullyExpandedType(session).classId == classId\n }?.coneTypeSafe()?.fullyExpandedType(session) ?: return@let null\n\n if (superType.typeArguments.isEmpty() && correspondingDeclaredSuperType.typeArguments.isNotEmpty() ||","completion":"superType == correspondingDeclaredSuperType\n ) {\n correspondingDeclaredSuperType\n } else {\n null\n }\n }\n \/*\n * See tests:\n * DiagnosticsTestGenerated$Tests$ThisAndSuper.testGenericQualifiedSuperOverridden\n * DiagnosticsTestGenerated$Tests$ThisAndSuper.testQualifiedSuperOverridden\n *\/<|endoftext|>"} {"prompt":"val (typeQualifierResolver, aClass) = buildTypeQualifierResolverAndFindClass(\"A\")\n\n assertMethodHasUnwrappedAnnotation(\n aClass, typeQualifierResolver,\n \"nullable\",\n \"@javax.annotation.Nonnull(when = When.UNKNOWN)\"\n )\n\n assertMethodHasUnwrappedAnnotation(","completion":"aClass, typeQualifierResolver,\n \"checkForNull\",\n \"@javax.annotation.CheckForNull()\"\n )\n\n assertMethodHasUnwrappedAnnotation(\n aClass, typeQualifierResolver,\n \"nonNull\",\n \"@javax.annotation.Nonnull()\"\n )\n\n assertMethodHasUnwrappedAnnotation(<|endoftext|>"} {"prompt":"return if (type1.ordinal > type2.ordinal) type1 else type2\n }\n\n fun getOperatorReturnType(kind1: PrimitiveType, kind2: PrimitiveType): PrimitiveType {\n require(kind1 != PrimitiveType.BOOLEAN) { \"kind1 must not be BOOLEAN\" }","completion":"require(kind2 != PrimitiveType.BOOLEAN) { \"kind2 must not be BOOLEAN\" }\n return maxByDomainCapacity(maxByDomainCapacity(kind1, kind2), PrimitiveType.INT)\n }\n }\n\n private val typeDescriptions: Map = mapOf(<|endoftext|>"} {"prompt":"@Test\nfun `nothing new collected`() {\n GC.collect()\n GC.collect()\n val stat = GC.lastGCInfo\n assertNotNull(stat)\n for (key in stat.sweepStatistics.keys) {\n assertEquals(stat.sweepStatistics[key]!!.sweptCount, 0L)\n }\n}\n\nobject Global {","completion":"val x = listOf(1, 2, 3)\n}\n\n@Test\nfun `stable refs in root set`() {\n GC.collect()\n val stat0 = GC.lastGCInfo\n assertNotNull(stat0)\n val rootSet0 = stat0.rootSet\n assertNotNull(rootSet0)\n val x = listOf(1, 2, 3)<|endoftext|>"} {"prompt":"@ExperimentalWasmDsl\n fun wasmJs(name: String, configure: Action) = wasmJs(name) { configure.execute(this) }\n\n @ExperimentalWasmDsl\n fun wasmJs(configure: Action) = wasmJs { configure.execute(this) }","completion":"@ExperimentalWasmDsl\n fun wasmWasi(\n name: String = \"wasmWasi\",\n configure: KotlinWasmWasiTargetDsl.() -> Unit = { },\n ): KotlinWasmWasiTargetDsl =\n configureOrCreate(\n name,\n @Suppress(\"DEPRECATION\")<|endoftext|>"} {"prompt":"override suspend fun resolve(\n artifactCoordinates: String,\n options: ExternalDependenciesResolver.Options,\n sourceCodeLocation: SourceCode.LocationWithId?\n ): ResultWithDiagnostics> {\n if (!acceptsArtifact(artifactCoordinates)) throw Exception(\"Path is invalid\")\n val file = doResolve(artifactCoordinates)","completion":"?: return makeResolveFailureResult(\"Failed to resolve '$artifactCoordinates'\", sourceCodeLocation)\n return ResultWithDiagnostics.Success(listOf(file))\n }\n\n override fun addRepository(\n repositoryCoordinates: RepositoryCoordinates,\n options: ExternalDependenciesResolver.Options,\n sourceCodeLocation: SourceCode.LocationWithId?<|endoftext|>"} {"prompt":"original.name.identifier.startsWith(StandardNames.DATA_CLASS_COMPONENT_PREFIX)\n }\n\n private fun IrDeclaration.isExportedSyntheticEnumEntriesProperty(): Boolean {\n return this is IrSimpleFunction &&\n parentEnumClassOrNull?.isExported(context) == true &&","completion":"(body as? IrSyntheticBody)?.kind == IrSyntheticBodyKind.ENUM_ENTRIES\n }\n\n private fun IrDeclaration.excludeFromJsExport() {\n annotations += generateJsExportIgnoreCall()\n }\n\n private fun generateJsExportIgnoreCall(): IrConstructorCall {<|endoftext|>"} {"prompt":"assertEquals(16.0F, listOf(1, 2, 3, 4, 5).maxOf { (-2.0F).pow(it) })\n\n assertIsPositiveZero(listOf(1.0, -1.0).shuffled().maxOf { it * 0.0 })","completion":"assertIsPositiveZero(listOf(1.0F, -1.0F).shuffled().maxOf { it * 0.0F }.toDouble())\n }\n\n @Test fun maxOfWith() {\n val data = listOf(\"abca\", \"bcaa\", \"cabb\")<|endoftext|>"} {"prompt":"KtSimpleVariableAccess.Read\n )\n } else {\n KtCompoundVariableAccessCall(\n variablePartiallyAppliedSymbol,\n fir.unwrapLValue()?.toTypeArgumentsMapping(variablePartiallyAppliedSymbol) ?: emptyMap(),","completion":"KtCompoundAccess.IncOrDecOperation(operationPartiallyAppliedSymbol, incOrDecOperationKind, incDecPrecedence),\n )\n }\n }\n }\n return null\n }\n\n private data class CompoundArrayAccessPartiallyAppliedSymbols(\n val operationPartiallyAppliedSymbol: KtPartiallyAppliedFunctionSymbol,<|endoftext|>"} {"prompt":"\/\/ \"Ш\" to 1064,\n\/\/ \"ш\" to 1096,\n\/\/ \"↓\" to 8595,\n\/\/ \"←\" to 8592,\n\/\/ \"∣\" to 8739,\n\/\/ \"∥\" to 8741,\n\/\/ \"→\" to 8594,","completion":"\/\/ \"↑\" to 8593,\n\/\/ \"­\" to 173,\n\/\/ \"­\" to 173,\n\/\/ \"Σ\" to 931,\n\/\/ \"σ\" to 963,\n\/\/ \"ς\" to 962,\n\/\/ \"ς\" to 962,\n\/\/ \"∼\" to 8764,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.library.metadata.resolver.KotlinLibraryResolveResult\nimport org.jetbrains.kotlin.storage.StorageManager\n\ninterface KlibResolvedModuleDescriptorsFactory {\n\n val moduleDescriptorFactory: KlibMetadataModuleDescriptorFactory\n\n \/**","completion":"* Given the [resolvedLibraries] creates the list of [ModuleDescriptorImpl]s with properly installed\n * inter-dependencies. The result of this method is returned in a form of [KlibResolvedModuleDescriptors] instance.\n *\n * Please use this method with care: Unless this method accepts `null` for [builtIns], it is not recommended to<|endoftext|>"} {"prompt":"val nameParts = parts.dropLast(deps.size)\n\n val platformIndex = when (nameParts.size) {\n 1 -> 0\n else -> if (nameParts.last() == TEST_SOURCE_ROOT_SUFFIX) 0 else 1\n }\n\n val additionalDependencies = mutableListOf().apply {","completion":"if (nameParts[platformIndex] != COMMON_SOURCE_ROOT_NAME)\n add(partsToQualifiedName(nameParts.take(platformIndex) + COMMON_SOURCE_ROOT_NAME + nameParts.drop(platformIndex + 1)))\n if (nameParts.last() == TEST_SOURCE_ROOT_SUFFIX)\n add(partsToQualifiedName(nameParts.dropLast(1)))<|endoftext|>"} {"prompt":"val cachedInfo = headerToCachedInfo[header] ?: notFoundIcError(\"artifact for module ${header.moduleName}\")\n val actualCrossModuleHash = references.crossModuleReferencesHashForIC()\n if (header.associatedModule == null && cachedInfo.crossModuleReferencesHash != actualCrossModuleHash) {\n header.associatedModule = cachedInfo.artifact.loadJsIrModule()\n }","completion":"header.associatedModule?.let {\n cachedInfo.crossModuleReferencesHash = actualCrossModuleHash\n cachedInfo.commitModuleInfo()\n }\n }\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.config.Services\nimport org.jetbrains.kotlin.utils.PathUtil\nimport java.io.PrintStream\nimport java.net.URL\nimport java.net.URLConnection\nimport java.util.function.Predicate\nimport kotlin.system.exitProcess\n\nabstract class CLITool {","completion":"fun exec(errStream: PrintStream, vararg args: String): ExitCode =\n exec(errStream, Services.EMPTY, defaultMessageRenderer(), args)\n\n fun exec(errStream: PrintStream, messageRenderer: MessageRenderer, vararg args: String): ExitCode =\n exec(errStream, Services.EMPTY, messageRenderer, args)\n\n protected fun exec(<|endoftext|>"} {"prompt":"*\/\n@SinceKotlin(\"1.4\")\npublic inline fun IntArray.reduceOrNull(operation: (acc: Int, Int) -> Int): Int? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}","completion":"\/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n *<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind\nimport org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext\nimport org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker","completion":"import org.jetbrains.kotlin.fir.analysis.checkers.isTopLevel\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors\nimport org.jetbrains.kotlin.fir.declarations.FirClass\nimport org.jetbrains.kotlin.fir.declarations.FirDeclaration<|endoftext|>"} {"prompt":") {\n private val isJavaSamConversionWithEqualsHashCode =\n context.config.languageVersionSettings.supportsFeature(LanguageFeature.JavaSamConversionEqualsHashCode)\n\n \/**\n * @see java.lang.invoke.LambdaMetafactory\n *\/\n fun getLambdaMetafactoryArguments(\n reference: IrFunctionReference,\n samType: IrType,","completion":"plainLambda: Boolean\n ): MetafactoryArgumentsResult {\n val samClass = samType.getClass()\n ?: throw AssertionError(\"SAM type is not a class: ${samType.render()}\")\n\n var semanticsHazard = false\n var abiHazard = false\n var inliningHazard = false\n var shouldBeSerializable = false\n var functionHazard = false<|endoftext|>"} {"prompt":") : CodeMetaInfo {\n override var renderConfiguration: FirDiagnosticCodeMetaRenderConfiguration = renderConfiguration\n private set\n\n override val start: Int\n get() = range.startOffset\n\n override val end: Int\n get() = range.endOffset\n\n override val tag: String\n get() = renderConfiguration.getTag(this)","completion":"override val attributes: MutableList = mutableListOf()\n\n override fun asString(): String = renderConfiguration.asString(this)\n\n fun replaceRenderConfiguration(renderConfiguration: FirDiagnosticCodeMetaRenderConfiguration) {\n this.renderConfiguration = renderConfiguration\n }\n}\n\nclass FirDiagnosticCodeMetaRenderConfiguration(\n val renderSeverity: Boolean = false,<|endoftext|>"} {"prompt":"else InlineClassAbi.mangledNameFor(context, function, mangleReturnTypes = false, useOldMangleRules = false)\n }\n\n private fun makeAndAddGroupedValueParametersFrom(\n sourceFunction: IrFunction,\n includeDispatcherReceiver: Boolean,\n substitutionMap: Map,\n targetFunction: IrFunction,","completion":"): List {\n val newFlattenedParameters = mutableListOf()\n if (sourceFunction.dispatchReceiverParameter != null && includeDispatcherReceiver) {\n newFlattenedParameters.add(\n sourceFunction.parentAsClass.thisReceiver!!.grouped(\n \"\\$dispatchReceiver\",\n substitutionMap,<|endoftext|>"} {"prompt":"override var nonFatalDiagnostics: MutableOrEmptyList,\n override var argumentList: FirArgumentList,\n override var explicitReceiver: FirExpression,\n override val componentIndex: Int,\n) : FirComponentCall() {\n override var calleeReference: FirNamedReference = FirSimpleNamedReference(source, Name.identifier(\"component$componentIndex\"))","completion":"override val origin: FirFunctionCallOrigin = FirFunctionCallOrigin.Operator\n\n override fun acceptChildren(visitor: FirVisitor, data: D) {\n annotations.forEach { it.accept(visitor, data) }\n contextReceiverArguments.forEach { it.accept(visitor, data) }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.symbols.IrSymbol\nimport org.jetbrains.kotlin.ir.types.*\nimport org.jetbrains.kotlin.ir.util.*\nimport org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.name.Name","completion":"import org.jetbrains.kotlin.util.OperatorNameConventions\n\n\/** Builds a [HeaderInfo] for iteration over iterables using the `get \/ []` operator and an index. *\/\nabstract class IndexedGetIterationHandler(\n protected val context: CommonBackendContext,\n private val canCacheLast: Boolean\n) : HeaderInfoHandler {<|endoftext|>"} {"prompt":"* not in partial as before the inroducing new posponed arguments analysis.\n *\n * It happens due to the lack of rerun stages after fixation variables\n * (stage 5 \u2013 see `fixVariablesOrReportNotEnoughInformation` in `KotlinConstraintSystemCompleter.kt`).\n * Rerun is need as fixation of variables can be make lambda available for analysis.\n *","completion":"* TODO: add tests with lambdas, which can't be analyzed in partial mode, but if can, the code will be successfully resolved.\n *\/\n ArrayList().foo(y.unwrap { it })\n }\n}<|endoftext|>"} {"prompt":"* ```\n *\/\n private fun modifyFunctionAccessExpression(\n oldExpression: IrFunctionAccessExpression,\n accessorSymbol: IrFunctionSymbol\n ): IrFunctionAccessExpression {\n val newExpression = when (oldExpression) {\n is IrCall -> IrCallImpl.fromSymbolOwner(\n oldExpression.startOffset, oldExpression.endOffset,","completion":"oldExpression.type,\n accessorSymbol as IrSimpleFunctionSymbol, oldExpression.typeArgumentsCount,\n origin = oldExpression.origin\n )\n is IrDelegatingConstructorCall -> IrDelegatingConstructorCallImpl.fromSymbolOwner(\n oldExpression.startOffset, oldExpression.endOffset,\n context.irBuiltIns.unitType,<|endoftext|>"} {"prompt":"\"kobjcclassinfo:$internalName\"\n }\n val classInfoGlobal = staticData.createGlobal(\n runtime.kotlinObjCClassInfo,\n classInfoSymbolName,\n isExported = isExported\n ).apply {\n setConstant(true)\n }","completion":"val bodyOffsetGlobal = staticData.createGlobal(llvm.int32Type, \"kobjcbodyoffs:$internalName\")\n\n return KotlinObjCClassLlvmDeclarations(classInfoGlobal, bodyOffsetGlobal)\n }\n\n override fun visitValueParameter(declaration: IrValueParameter) {\n \/\/ In some cases because of inconsistencies of previous lowerings, default values can be not removed.<|endoftext|>"} {"prompt":"external interface ExternRef\n\nfun notNullExternRef(): ExternRef = js(\"'abc'\")\n\nfun notNull2ExternRef(): ExternRef = js(\"null\")\n\nfun nullExternRef(): ExternRef? = js(\"'abc'\")\n\nfun null2ExternRef(): ExternRef? = js(\"null\")\n\n\nfun testExterRef() {","completion":"check(notNullExternRef() != null)\n checkNPE { notNull2ExternRef() }\n check(nullExternRef() != null)\n check(null2ExternRef() == null)\n}\n\nclass StructRefImpl\ntypealias StructRef = JsReference\n\nfun notNullStructRef(x: StructRef): StructRef = js(\"x\")<|endoftext|>"} {"prompt":"dataClassMembersGenerator.generateBodiesForMultiFieldValueClassMembers(klass, irClass)\n }\n if (irClass.isData) {\n dataClassMembersGenerator.generateBodiesForDataClassMembers(klass, irClass)\n }\n }\n\n annotationGenerator.generate(irClass, klass)\n if (irPrimaryConstructor != null) {","completion":"declarationStorage.leaveScope(irPrimaryConstructor.symbol)\n }\n }\n declarationStorage.leaveScope(irClass.symbol)\n }\n\n fun convertFunctionContent(irFunction: T, firFunction: FirFunction?, containingClass: FirClass?): T {\n conversionScope.withParent(irFunction) {\n if (firFunction != null) {<|endoftext|>"} {"prompt":"private fun isOuterForLoopRangeVariable(\n expression: KtExpression,\n variableDescriptor: CallableDescriptor,\n c: ResolutionContext<*>\n ): Boolean {\n for (parent in expression.parents) {\n if (parent is KtForExpression) {\n val rangeExpression = parent.loopRange as? KtSimpleNameExpression ?: continue","completion":"val rangeResolvedCall = rangeExpression.getResolvedCall(c.trace.bindingContext) ?: continue\n if (rangeResolvedCall.resultingDescriptor == variableDescriptor) {\n return true\n }\n }\n }\n return false\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor\nimport org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutorByConstructorMap\nimport org.jetbrains.kotlin.resolve.calls.model.*","completion":"import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults\nimport org.jetbrains.kotlin.resolve.calls.tower.*\nimport org.jetbrains.kotlin.resolve.calls.util.BuilderLambdaLabelingInfo\nimport org.jetbrains.kotlin.resolve.calls.util.replaceArguments<|endoftext|>"} {"prompt":"if (!funWithReturnsFalseAndInvertCondition(value_1 !is String)) println(value_1.length)\n if (funWithReturnsNotNull(value_1 is String) != null) println(value_1.length)\n if (!(funWithReturnsNotNull(value_1 is String) == null)) println(value_1.length)\n}\n\n\/\/ TESTCASE NUMBER: 9","completion":"fun case_9(value_1: String?) {\n if (funWithReturnsTrue(value_1 != null)) println(value_1.length)\n if (funWithReturnsTrueAndInvertCondition(value_1 == null)) println(value_1.length)\n if (!funWithReturnsFalse(value_1 != null)) println(value_1.length)<|endoftext|>"} {"prompt":"val companionObjectSymbol: FirRegularClassSymbol?\n get() = fir.companionObjectSymbol\n\n val resolvedContextReceivers: List\n get() {\n if (fir.contextReceivers.isEmpty()) return emptyList()\n lazyResolveToPhase(FirResolvePhase.TYPES)\n return fir.contextReceivers\n }","completion":"}\n\nclass FirAnonymousObjectSymbol(packageFqName: FqName) : FirClassSymbol(\n ClassId(packageFqName, SpecialNames.ANONYMOUS_FQ_NAME, isLocal = true)\n)\n\nclass FirTypeAliasSymbol(classId: ClassId) : FirClassLikeSymbol(classId), TypeAliasSymbolMarker {<|endoftext|>"} {"prompt":"): DeprecationsProvider = getDeprecationsAnnotationInfoByUseSiteFromAccessors(\n session = session,\n getter = getter,\n setter = setter,\n).toDeprecationsProvider(session.firCachesFactory)\n\nfun getDeprecationsAnnotationInfoByUseSiteFromAccessors(\n session: FirSession,\n getter: FirFunction?,","completion":"getterAnnotations: List? = getter?.annotations,\n setter: FirFunction?,\n setterAnnotations: List? = setter?.annotations,\n): DeprecationAnnotationInfoPerUseSiteStorage = buildDeprecationAnnotationInfoPerUseSiteStorage {<|endoftext|>"} {"prompt":"lookupSuperTypes(firJavaClass.symbol, lookupInterfaces = true, deep = true, session).mapTo(this) { superType ->\n val originalClassId = superType.lookupTag.classId\n JavaToKotlinClassMap.mapKotlinToJava(originalClassId.asSingleFqName().toUnsafe()) ?: originalClassId\n }\n }\n }","completion":"private val isList: Boolean = firKotlinClass.classId == StandardClassIds.List\n\n \/\/ It's ok to have a super set of actually available member names\n private val myCallableNames: Set by lazy {\n if (firKotlinClass.isFinal) {\n \/\/ For final classes we don't need to load HIDDEN members at all because they might not be overridden<|endoftext|>"} {"prompt":"private fun rewriteNonLabelInstructions() {\n var thisNode = instructions.first\n while (thisNode != null) {\n thisNode = when (thisNode) {\n is JumpInsnNode ->\n rewriteJumpInsn(thisNode)\n is LineNumberNode ->\n rewriteLineNumberNode(thisNode)\n is LookupSwitchInsnNode ->","completion":"rewriteLookupSwitchInsn(thisNode)\n is TableSwitchInsnNode ->\n rewriteTableSwitchInsn(thisNode)\n is FrameNode ->\n rewriteFrameNode(thisNode)\n else ->\n thisNode.next\n }\n }\n }\n\n private fun rewriteLineNumberNode(oldLineNode: LineNumberNode): AbstractInsnNode? =<|endoftext|>"} {"prompt":"internal class JvmArgumentNullabilityAssertionsLowering(context: JvmBackendContext) : FileLoweringPass,\n IrElementTransformer {\n\n enum class AssertionScope {\n Enabled, Disabled\n }\n\n private val isWithUnifiedNullChecks = context.config.unifiedNullChecks","completion":"private val isCallAssertionsDisabled = context.config.isCallAssertionsDisabled\n private val isReceiverAssertionsDisabled = context.config.isReceiverAssertionsDisabled\n\n private val specialBridgeMethods = SpecialBridgeMethods(context)\n\n override fun lower(irFile: IrFile) = irFile.transformChildren(this, AssertionScope.Enabled)<|endoftext|>"} {"prompt":"0 -> break\n 1 -> foo { break }","completion":"2 -> foo(@SomeAnnotation { break })\n 3 -> foo(fun () { break })<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +EnumEntries +PrioritizedEnumEntries\n\/\/ WITH_STDLIB\n\/\/ FIR_DUMP\n\npackage pckg\n\nenum class A {\n ;\n\n companion object\n}\n\nval A.Companion.entries: Int get() = 0\n\nfun test() {\n A.entries\n A.Companion.entries\n\n with(A) {","completion":"this.entries\n entries\n }\n\n with(A.Companion) {\n entries\n }\n\n val aCompanion = A.Companion\n aCompanion.entries\n}<|endoftext|>"} {"prompt":"testDecode(Base64.Mime, \"Zm[@]9vYg==\", \"foob\".encodeToByteArray())\n testDecode(Base64.Mime, \"Zm9v-Yg==\", \"foob\".encodeToByteArray())\n testDecode(Base64.Mime, \"Zm9vYg=(%^)=\", \"foob\".encodeToByteArray())","completion":"testDecode(Base64.Mime, \"Zm\\u00FF9vYg==\", \"foob\".encodeToByteArray())\n testDecode(Base64.Mime, \"\\uFFFFZm9vYg==\", \"foob\".encodeToByteArray())<|endoftext|>"} {"prompt":"internal val deprecatedMppProperties: List = listOf(\n KOTLIN_MPP_ENABLE_COMPATIBILITY_METADATA_VARIANT,\n KOTLIN_MPP_ENABLE_GRANULAR_SOURCE_SETS_METADATA,\n KOTLIN_MPP_HIERARCHICAL_STRUCTURE_BY_DEFAULT,","completion":"KOTLIN_MPP_HIERARCHICAL_STRUCTURE_SUPPORT,\n KOTLIN_NATIVE_DEPENDENCY_PROPAGATION,\n)\n\nprivate val propertiesSetByPlugin: Set = setOf(\n KOTLIN_MPP_ENABLE_GRANULAR_SOURCE_SETS_METADATA,\n)<|endoftext|>"} {"prompt":"fun hashCode(param: String): Int {\n return 1\n }\n\n override fun hashCode(x: Int) = x + 1\n}\n\nopen class Super {\n override fun equals(other: Any?): Boolean {\n return super.equals(other)\n }\n\n override fun hashCode(): Int {\n return 1\n }\n}","completion":"data object OverridenInSuper: Super() {\n override fun equals(other: Any?): Boolean {\n return super.equals(other)\n }\n}<|endoftext|>"} {"prompt":"\/\/ TESTCASE NUMBER: 13\nfun case_13(value_1: Int, value_2: List, value_3: List>>>) {\n when (value_1) {\n value_2[0], value_3[0][-4][1][-1] -> {}\n }\n}\n\n\/\/ TESTCASE NUMBER: 14","completion":"fun case_14(value_1: Any, value_2: Class, value_3: Class?, value_4: Int) {\n fun __fun_1(): () -> Unit { return fun() { } }\n\n when (value_1) {\n funWithoutArgs(), __fun_1()(), value_2.fun_2(value_4) -> {}<|endoftext|>"} {"prompt":"Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n or a positive number if it's greater than other.\n \"\"\".trimIndent()\n method {\n appendDoc(doc)\n annotations += intrinsicConstEvaluationAnnotation\n signature {\n isOverride = true\n methodName = \"compareTo\"\n parameter {","completion":"name = \"other\"\n type = PrimitiveType.CHAR.capitalized\n }\n returnType = PrimitiveType.INT.capitalized\n }\n }.modifyGeneratedCompareTo()\n }\n\n private fun ClassBuilder.generatePlus() {\n method {\n appendDoc(\"Adds the other Int value to this value resulting a Char.\")\n annotations += intrinsicConstEvaluationAnnotation<|endoftext|>"} {"prompt":"@Composable fun Wrap(content: @Composable (x: Int) -> Unit) {\n content(123)\n }\n @Composable fun App(x: Int) {\n print(x)\n Wrap { a ->\n print(a)\n print(x)\n Wrap { b ->\n print(x)\n print(a)\n print(b)\n }","completion":"}\n }\n \"\"\",\n \"\"\"\n public final class TestKt {\n public final static Wrap(Lkotlin\/jvm\/functions\/Function3;Landroidx\/compose\/runtime\/Composer;I)V\n public final static App(ILandroidx\/compose\/runtime\/Composer;I)V\n final static INNERCLASS TestKt%App%1 null null<|endoftext|>"} {"prompt":"extensionReceiverParameter.substituteTopLevelType(approximatedExtensionReceiver)\n )\n approximated = true\n }\n }\n\n var valueParameterApproximated = false\n val newParameters = descriptor.valueParameters.map {\n val approximatedType = approximate(it.type.unwrap(), toSuper = false)\n if (approximatedType != null) {","completion":"valueParameterApproximated = true\n \/\/ invoking constructor explicitly as substitution on value parameters is not supported\n ValueParameterDescriptorImpl(\n it.containingDeclaration, it.original, it.index, it.annotations,\n it.name, outType = approximatedType, it.declaresDefaultValue(),\n it.isCrossinline, it.isNoinline, it.varargElementType, it.source\n )<|endoftext|>"} {"prompt":"baz1LambdaVar\\4$iv:int=1:int, baz1Param\\5$iv:int=2:int, $i$f$baz1\\5\\60:int=0:int, baz1Var\\5$iv:int=3:int","completion":"\/\/ library.kt:21 box: mainVar:int=1:int, fooParam$iv:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=1:int, bazParam\\1$iv:int=1:int, $i$f$baz\\1\\7:int=0:int, bazVar\\1$iv:int=3:int,<|endoftext|>"} {"prompt":"0x10a05..0x10a06,\n 0x10a0c..0x10a0f,\n 0x10a38..0x10a3a,\n 0x10a3f..0x10a3f,\n 0x10ae5..0x10ae6,\n 0x10d24..0x10d27,","completion":"0x10eab..0x10eac,\n 0x10f46..0x10f50,\n 0x11001..0x11001,\n 0x11038..0x11046,\n 0x1107f..0x11081,\n 0x110b3..0x110b6,\n 0x110b9..0x110ba,<|endoftext|>"} {"prompt":"}\n\n\/\/ FILE: main.kt\nfun main(x2: Runnable) {\n val x1 = {}\n val x3 = arrayOf()\n\n Test.foo1({}, arrayOf())\n Test.foo1({}, *arrayOf())","completion":"Test.foo1({}, x3)\n Test.foo1({}, *arrayOf(\"\"))\n\n Test.foo1(x1, arrayOf())<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE\nannotation class Ann(vararg val i: Boolean)\nfun foo() {\n val a1 = 1 > 2\n val a2 = 1 == 2\n val a3 = a1 == a2\n val a4 = a1 > a2\n\n @Ann(","completion":"a1,\n a2,\n a3,<|endoftext|>"} {"prompt":"private fun > expectMinMax(min: T, max: T, elements: Iterable) {\n assertEquals(min, elements.minOrNull())\n assertEquals(max, elements.maxOrNull())\n assertEquals(min, elements.min())\n assertEquals(max, elements.max())\n }\n\n @Test\n fun minMax() {","completion":"expectMinMax(\"a\", \"a\", listOf(\"a\"))\n expectMinMax(\"a\", \"bcd\", listOf(\"a\", \"bcd\"))\n expectMinMax(\"a\", \"e\", listOf(\"a\", \"bcd\", \"e\"))\n expectMinMax(1, Int.MAX_VALUE, listOf(1, 2, Int.MAX_VALUE))<|endoftext|>"} {"prompt":"fun test31(i: Int, j: Int) {\n var x: Any? = materialize()\n require(x is String)\n do {\n x.length\n do {\n x.length\n } while (i < 10)\n x = \"\"","completion":"}while (j < 10)\n}\n\nfun test32(i: Int, j: Int) {\n var x: Any? = materialize()\n require(x is String)\n do {\n x.length\n do {\n x.length\n } while (i < 10)\n x += \"\"\n } while (j < 10)\n}<|endoftext|>"} {"prompt":"KotlinBuiltIns.isULong(targetType) -> invokeUnsignedIntegerCoercionFunction(targetType, \"toULong\")\n else -> throw AssertionError(\"Unexpected target type for integer coercion: $targetType\")\n }\n }\n }\n\n \/\/ In JVM, we don't convert values resulted from calling built-in operators on integer literals to another integer type.","completion":"\/\/ The reason is that doing so would change behavior, which we want to avoid, see KT-42321.\n \/\/ At the same time, such structure seems possible to achieve only via the magical integer value type, but inferring the result of\n \/\/ the operator call based on an expected type is deprecated behavior which is going to be removed in the future, see KT-38895.<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.backend.jvm.lower\n\nimport org.jetbrains.kotlin.backend.common.FileLoweringPass\nimport org.jetbrains.kotlin.backend.common.phaser.PhaseDescription\nimport org.jetbrains.kotlin.backend.jvm.JvmBackendContext","completion":"import org.jetbrains.kotlin.backend.jvm.functionByName\nimport org.jetbrains.kotlin.ir.IrElement\nimport org.jetbrains.kotlin.ir.declarations.IrFile\nimport org.jetbrains.kotlin.ir.expressions.IrCall\nimport org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl<|endoftext|>"} {"prompt":"private val packageCache = session.firCachesFactory.createCache(::computePackage)\n\n override val symbolNamesProvider: FirSymbolNamesProvider = object : FirCompositeCachedSymbolNamesProvider(\n session,\n providers.map { it.symbolNamesProvider },\n ) {","completion":"override fun computeTopLevelClassifierNames(packageFqName: FqName): Set? =\n super.computeTopLevelClassifierNames(packageFqName).also {\n ensureNotNull(it) { \"classifier names in package $packageFqName\" }\n }\n\n override val hasSpecificCallablePackageNamesComputation: Boolean get() = true<|endoftext|>"} {"prompt":"\"\u0430\u0432\u0442\u043e\u043b\u0430\u0432\u043a\u0430\",\n\"\u0430\u0432\u0442\u043e\u043b\u0438\u0437\",\n\"\u0430\u0432\u0442\u043e\u043b\u0438\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f\",\n\"\u0430\u0432\u0442\u043e\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\",\n\"\u0430\u0432\u0442\u043e\u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0433\u0438\u0441\u0442\u0440\u0430\u043b\u044c\",","completion":"\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f\",<|endoftext|>"} {"prompt":"internal fun > T.chainedDisallowChanges(): T =\n apply {\n disallowChanges()\n }\n\ninternal fun > T.chainedDisallowChanges(): T =\n apply {\n disallowChanges()\n }\n\n\n\/\/ Before 5.0 fileProperty is created via ProjectLayout","completion":"\/\/ https:\/\/docs.gradle.org\/current\/javadoc\/org\/gradle\/api\/model\/ObjectFactory.html#fileProperty--\ninternal fun Project.newFileProperty(initialize: (() -> File)? = null): RegularFileProperty {\n val regularFileProperty = project.objects.fileProperty()\n\n return regularFileProperty.apply {\n if (initialize != null) {<|endoftext|>"} {"prompt":"return if (apiVersion >= versionArgument) builder.irTrue() else builder.irFalse()\n }\n\n private fun isInInlineFunInKotlinRuntime(currentFunction: IrFunction?): Boolean {\n return currentFunction != null && currentFunction.isInline\n && currentFunction.getPackageFragment().packageFqName.startsWith(StandardNames.BUILT_INS_PACKAGE_NAME)","completion":"}\n\n private val IrFunction.isApiVersionIsAtLeast: Boolean\n get() {\n return isTopLevelInPackage(\"apiVersionIsAtLeast\", StandardNames.KOTLIN_INTERNAL_FQ_NAME)\n && valueParameters.size == 3\n && valueParameters[0].type.isInt()\n && valueParameters[1].type.isInt()<|endoftext|>"} {"prompt":"val catchParameter = buildVariable(\n builder.parent, startOffset, endOffset,\n IrDeclarationOrigin.CATCH_PARAMETER,\n Name.identifier(\"e\"),\n context.irBuiltIns.throwableType\n )\n catches += irCatch(\n catchParameter,\n result = irBlock {","completion":"+irCall(context.ir.symbols.processUnhandledException).apply {\n putValueArgument(0, irGet(catchParameter))\n }\n +irCall(context.ir.symbols.terminateWithUnhandledException).apply {\n putValueArgument(0, irGet(catchParameter))\n }\n }\n )\n }\n }\n\n return entryPoint\n}<|endoftext|>"} {"prompt":"\/\/ IGNORE_BACKEND_K2: NATIVE\n\/\/ IGNORE_BACKEND_K2: WASM\n\/\/ IGNORE_BACKEND_K2: JS, JS_IR, JS_IR_ES6\n\/\/ IGNORE_LIGHT_ANALYSIS\n\n\/\/ CHECK_TYPE_WITH_EXACT\n\n\/\/ IGNORE_BACKEND_K1: ANY\n\/\/ ISSUE: KT-60274","completion":"import kotlin.reflect.KProperty\n\nclass Buildee {\n fun materialize(): CT = UserKlass() as CT\n}\n\nfun build(\n instructions: Buildee.() -> Unit\n): Buildee {\n return Buildee().apply(instructions)\n}\n\nclass UserKlass<|endoftext|>"} {"prompt":"val enumEntryStub: EnumEntryStub,\n override val annotations: List = emptyList()\n ) : Getter()\n }\n\n sealed class Setter : PropertyAccessor() {\n\n override val parameters: List = emptyList()\n\n class SimpleSetter(","completion":"override val annotations: List = emptyList()\n ) : Setter()\n\n class ExternalSetter(\n override val annotations: List = emptyList()\n ) : Setter()\n\n class MemberAt(\n val offset: Long,\n override val annotations: List = emptyList(),<|endoftext|>"} {"prompt":"fun foo(e: E): String = when (e) {\n E.A -> \"A\"\n E.B -> \"B\"\n else -> \"\"\n}\n\nfun bar(e: E?): String = when (e) {\n E.A -> \"A\"\n E.B -> \"B\"\n else -> \"\" \/\/ no warning\n}\n\nfun foo(b: Boolean) = when (b) {","completion":"true -> 1\n false -> 0\n else -> -1\n}\n\nfun useJava(): String {\n val me = MyEnum.getInstance()\n return when (me) {\n MyEnum.SINGLE -> \"OK\"\n else -> \"FAIL\" \/\/ no warning\n }\n}<|endoftext|>"} {"prompt":"project.configurations.maybeCreate(EmbeddedComponents.CONFIGURATION_NAME)\n project.extensions.create(\"pill\", PillExtension::class.java)\n\n \/\/ 'jpsTest' does not require the 'tests-jar' artifact\n project.configurations.create(\"jpsTest\")\n\n if (project == project.rootProject) {\n project.tasks.register(\"pill\") {","completion":"dependsOn(\":pill:pill-importer:pill\")\n\n if (System.getProperty(\"pill.android.tests\", \"false\") == \"true\") {\n TaskUtils.useAndroidSdk(this)\n TaskUtils.useAndroidJar(this)\n }\n }\n\n project.tasks.register(\"unpill\") {<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class Foo(val a: String) {\n fun test(): String {\n return a + inlineFun()\n }\n}\n\ninline fun inlineFun(): String = \"K\"\n\nfun box(): String {","completion":"val f = Foo(\"O\")\n return f.test()\n}<|endoftext|>"} {"prompt":"val nativeCompilerOptionsHelperFqName = FqName(\n \"${nativeInterfaceFqName.asString()}$IMPLEMENTATION_HELPERS_SUFFIX\"\n )\n withPrinterToFile(fileFromFqName(srcDir, nativeCompilerOptionsHelperFqName)) {\n generateCompilerOptionsHelper(\n nativeInterfaceFqName,","completion":"nativeCompilerOptionsHelperFqName,\n commonCompilerHelper,\n k2NativeCompilerArgumentsFqName,\n nativeOptions\n )\n }\n}\n\n\nprivate fun generateJsDceOptions(\n apiSrcDir: File,\n commonToolOptions: GeneratedOptions,\n withPrinterToFile: (targetFile: File, Printer.() -> Unit) -> Unit<|endoftext|>"} {"prompt":"Outer().Inner(\"\", y, 1) checkType { _.Inner>() }\n Outer().Inner(\"\", y, 1) checkType { _.Inner>() }","completion":"Outer().Inner(\"\", x, 1) checkType { _.Inner>() }\n Outer().Inner(\"\", x, 1)\n}<|endoftext|>"} {"prompt":"materialized: Boolean,\n ): Type {\n if (type.isError()) {\n val name = type.getNameForErrorType() ?: NON_EXISTENT_CLASS_NAME\n val jvmType = Type.getObjectType(name)\n with(context) { sw?.writeGenericType(type, jvmType, mode) }\n return jvmType\n }","completion":"val typeConstructor = type.typeConstructor()\n\n if (type is SimpleTypeMarker) {\n val builtInType = mapBuiltInType(type, AsmTypeFactory, mode)\n if (builtInType != null) {\n val asmType = boxTypeIfNeeded(builtInType, mode.needPrimitiveBoxing)<|endoftext|>"} {"prompt":"import kotlin.script.experimental.api.asSuccess\nimport kotlin.script.experimental.dependencies.impl.makeResolveFailureResult\n\n@ExperimentalContracts\nclass ResolversTest : ResolversTestBase() {\n\n private fun withTempFile(body: (file: File) -> T): T {\n val file = Files.createTempFile(null, null).toFile()","completion":"file.deleteOnExit()\n try {\n return body(file)\n } finally {\n file.delete()\n }\n }\n\n private fun getNonExistingFile() = withTempFile { it }.also { assertFalse(it.exists()) }\n\n fun testFileSystemResolver() {\n withTempFile { file ->\n\n val resolver = FileSystemDependenciesResolver()<|endoftext|>"} {"prompt":"\/\/ Number after an exponent were validated already.\n s.forEach {\n if (it < '0' || it > '9') {\n throw NumberFormatException()\n }\n }\n\n length = s.length\n if (length == 0)\n throw NumberFormatException()\n\n end = length\n while (end > 1 && s[end - 1] == '0')\n --end","completion":"start = 0\n while (start < end - 1 && s[start] == '0')\n start++\n\n if (end != length || start != 0) {\n shift = length - end\n if (e <= 0 || Int.MAX_VALUE - e > shift) {\n e += shift\n }\n s = s.substring(start, end)\n }<|endoftext|>"} {"prompt":"ExpectedData(0x9c9e5be0943d4b05UL, 0xc738a77a9a55f0e2UL, 0x705221addedd81dfUL, 0xfd9bd8d397abcfa3UL, 0x8ccf0004aa86b795UL),","completion":"ExpectedData(0x3898bca4dfd6638dUL, 0x9b82567ab6560796UL, 0x891b69462b41c224UL, 0x8eccc7e4f3af3b51UL, 0x381e54c3c8f1c7d0UL),<|endoftext|>"} {"prompt":"* Returns a view with the [JsReadonlyMap] methods to consume it in JavaScript as a regular readonly Map.\n * Structural changes in the base map are synchronized with the view.\n *\/\n @ExperimentalJsExport\n @ExperimentalJsCollectionsApi\n @SinceKotlin(\"2.0\")","completion":"public fun asJsReadonlyMapView(): JsReadonlyMap = createJsReadonlyMapViewFrom(this)\n}\n\n\/**\n * A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving\n * the value corresponding to each key. Map keys are unique; the map holds only one value for each key.<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.psi.KtAnonymousInitializer\nimport org.jetbrains.kotlin.psi.KtParameter\nimport org.jetbrains.kotlin.psi.KtProperty\nimport org.jetbrains.kotlin.psi.KtPureClassOrObject","completion":"import org.jetbrains.kotlin.resolve.BindingContext\nimport org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe\nimport org.jetbrains.kotlin.types.KotlinType\nimport org.jetbrains.kotlin.types.typeUtil.*<|endoftext|>"} {"prompt":"val mset = MS()\n val hashSet = HashSet()\n\n safeAsReturnsNull(\"set as? MutableIterable\") { set as? MutableIterable<*> }\n safeAsReturnsNull(\"set as? MutableCollection\") { set as? MutableCollection<*> }\n safeAsReturnsNull(\"set as? MutableSet\") { set as? MutableSet<*> }","completion":"safeAsReturnsNonNull(\"mset as? MutableIterable\") { mset as? MutableIterable<*> }\n safeAsReturnsNonNull(\"mset as? MutableCollection\") { mset as? MutableCollection<*> }\n safeAsReturnsNonNull(\"mset as? MutableSet\") { mset as? MutableSet<*> }<|endoftext|>"} {"prompt":"\/\/ MODULE: context\n\n\/\/ FILE: context.kt\nfun test() {\n 1.ext\n}\n\nval Int.ext: String\n get() {\n return \"foo\"\n }\n\n\n\/\/ MODULE: main\n\/\/ MODULE_KIND: CodeFragment\n\/\/ CONTEXT_MODULE: context\n\n\/\/ FILE: fragment.kt\n\/\/ CODE_FRAGMENT_KIND: EXPRESSION","completion":"this@ext.dec()<|endoftext|>"} {"prompt":"x\n y\n z","completion":"y.inv()\n z.inv()\n }\n}<|endoftext|>"} {"prompt":"override fun getContributedDescriptors(\n kindFilter: DescriptorKindFilter,\n nameFilter: (Name) -> Boolean,\n changeNamesForAliased: Boolean\n ): Collection = emptyList()\n}\n\nclass CompositePrioritizedImportingScope(\n private val primaryScope: ImportingScope,\n private val secondaryScope: ImportingScope,\n) : ImportingScope {","completion":"override val parent: ImportingScope?\n get() = primaryScope.parent ?: secondaryScope.parent\n\n override fun getContributedPackage(name: Name): PackageViewDescriptor? {\n return primaryScope.getContributedPackage(name) ?: secondaryScope.getContributedPackage(name)\n }\n\n override fun getContributedDescriptors(\n kindFilter: DescriptorKindFilter,<|endoftext|>"} {"prompt":"setOf(CommonizerTarget(LINUX_X64, MACOS_X64)),\n setOf(linuxInterop, macosInterop)\n )\n\n assertEquals(\n group, findCInteropCommonizerGroup(expectCInteropCommonizerDependent(nativeMain))\n )\n\n assertEquals(","completion":"group, findCInteropCommonizerGroup(expectCInteropCommonizerDependent(expectSharedNativeCompilation(nativeMain)))\n )\n\n assertNull(\n findCInteropCommonizerDependent(nativeTest),\n \"Expected 'nativeTest' to not be CInteropCommonizer dependent\"\n )\n }\n\n @Test<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ FILE: A.java\n\npublic class A extends B {\n public int getFoo() { return 0; }\n}\n\n\/\/ FILE: F.java\n\npublic class F extends B {\n public final int getFoo() { return 0; }\n}\n\n\/\/ FILE: main.kt\n\nopen class B {\n open val foo: Int = 1\n}","completion":"class C1 : A() {\n override val foo: Int = 2\n}\n\nclass C2 : F() {\n override val foo: Int = 3\n}<|endoftext|>"} {"prompt":"fun `test - simple resolved binary dependency`() {\n val dependency = TestIdeaKotlinInstances.simpleResolvedBinaryDependency\n val binary = TestIdeaKotlinDependencySerializer().serialize(dependency)\n val deserialized = deserializeIdeaKotlinDependencyWithBackwardsCompatibleClasses(binary)","completion":"val deserializedCopied = deserialized.copy()\n\n assertEquals(dependency.coordinates, deserializedCopied.coordinates)\n assertEquals(dependency.binaryType, deserializedCopied.binaryType)\n assertEquals(dependency.classpath, deserializedCopied.classpath)<|endoftext|>"} {"prompt":"operator fun UserKlassB.unaryMinus() {}\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun UserKlassB.unaryMinus() {}","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) tailrec fun testIdenticalPresenceOfTailrecModifier() {}\n tailrec fun testIdenticalPresenceOfTailrecModifier() {}<|endoftext|>"} {"prompt":"override fun accept(contractDescriptionVisitor: ContractDescriptionVisitor, data: D): R =\n contractDescriptionVisitor.visitLogicalAnd(this, data)\n}\n\nclass LogicalNot(val arg: BooleanExpression) : BooleanExpression {","completion":"override fun accept(contractDescriptionVisitor: ContractDescriptionVisitor, data: D): R =\n contractDescriptionVisitor.visitLogicalNot(this, data)\n}<|endoftext|>"} {"prompt":"\/\/If a receiver type is not null, then this safe expression is useless, and we don't need to make the result type nullable.\n val expressionType = trace.getType(expression.receiverExpression)\n return expressionType != null && TypeUtils.isNullableType(expressionType)\n }\n\n internal fun bind(trace: BindingTrace, resolvedCall: ResolvedCall<*>) {","completion":"(resolvedCall as? NewAbstractResolvedCall<*>)?.let { bind(trace, it) }\n (resolvedCall as? NewVariableAsFunctionResolvedCallImpl)?.let { bind(trace, it) }\n }\n\n fun reportDiagnostics(\n context: BasicCallResolutionContext,\n trace: BindingTrace,\n resolvedCall: NewAbstractResolvedCall<*>,<|endoftext|>"} {"prompt":"private val currentTransformerPhase = ThreadLocal.withInitial { null }\n\n inline fun lazyResolveToPhaseInside(phase: FirResolvePhase, resolve: () -> Unit) {\n checkIfCanLazyResolveToPhase(phase)\n\n val previousPhase = currentTransformerPhase.get()\n currentTransformerPhase.set(phase)\n try {\n resolve()","completion":"} finally {\n currentTransformerPhase.set(previousPhase)\n }\n }\n\n private fun checkIfCanLazyResolveToPhase(requestedPhase: FirResolvePhase) {\n val currentPhase = currentTransformerPhase.get() ?: return\n\n if (!currentPhase.isItAllowedToCallLazyResolveTo(requestedPhase)) {<|endoftext|>"} {"prompt":"* * cleaners that are referenced from globals will not be garbage collected at all,\n * * cleaners that become unreferenced just before exiting main() might not be garbage collected,\n because the GC might not get a chance to run.\n *\n * @param resource an object for which to perform [cleanupAction]\n * @param cleanupAction a cleanup to perform on [resource]. Must not capture anything.\n *\/","completion":"\/\/ TODO: Consider just annotating the lambda argument rather than hardcoding checking\n\/\/ by function name in the compiler.\n@ExperimentalNativeApi\n@SinceKotlin(\"1.9\")\n@ExportForCompiler\npublic fun createCleaner(resource: T, cleanupAction: (resource: T) -> Unit): Cleaner =\n createCleanerImpl(resource, cleanupAction)\n\n@ExperimentalNativeApi<|endoftext|>"} {"prompt":"3996, 4023, 4001, 4023, 4006, 4023, 4011, 4023, 3984, 4021, 4133, 4142, 65, 805, 97, 805,\n 66, 775, 98, 775, 66, 803, 98, 803, 66, 817, 98, 817, 67, 807, 769, 99,","completion":"807, 769, 68, 775, 100, 775, 68, 803, 100, 803, 68, 817, 100, 817, 68, 807,\n 100, 807, 68, 813, 100, 813, 69, 772, 768, 101, 772, 768, 69, 772, 769, 101,<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER\n\/\/ MODULE: m1\n\/\/ FILE: a.kt\n\npackage p\n\npublic class A\npublic class M1 {\n public val a: A = A()\n}","completion":"\/\/ MODULE: m2\n\/\/ FILE: b.kt\n\npackage p\n\npublic class A\n\npublic fun foo(a: A) {\n}\n\n\/\/ MODULE: m3(m1, m2)\n\/\/ FILE: b.kt\n\nimport p.*\n\nfun test() {<|endoftext|>"} {"prompt":"BuildFinishMetrics.collectMetrics(log, buildFailed, buildStartTime, projectEvaluatedTime, fusMetricsConsumer)\n parameters.configurationMetrics.orElse(emptyList()).get().forEach { it.addToConsumer(fusMetricsConsumer) }\n parameters.buildStatisticsConfiguration.orNull?.also {\n val loggerService = KotlinBuildStatsLoggerService(it)","completion":"loggerService.initSessionLogger(buildId)\n loggerService.reportBuildFinished(fusMetricsConsumer)\n }\n }\n}\n\nclass MetricContainer : Serializable {\n private val numericalMetrics = HashMap()\n private val booleanMetrics = HashMap()<|endoftext|>"} {"prompt":"public inline fun kotlin.LongArray.maxOf(selector: (kotlin.Long) -> kotlin.Double): kotlin.Double\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.LongArray.maxOf(selector: (kotlin.Long) -> kotlin.Float): kotlin.Float\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ ISSUE: KT-41013\n\nfun Iterable.map(transform: (V) -> R): List {\n return this.mapIndexed { i, v -> transform(v) }\n}\nfun Iterable.map(transform: (V, Int) -> R): List {","completion":"return this.mapIndexed { i, v -> transform(v, i) }\n}\n\nfun main() {\n val list = listOf(1, 2, 3)\n println(list.map { v -> v })\n println(list.map { it })\n}<|endoftext|>"} {"prompt":"fun box(): String {\n val capture = \"O\"\n\n class Local {\n val captured = capture\n\n open inner class Inner(val d: Double = -1.0, val s: String, vararg val y: Int) {\n open fun result() = \"Fail\"\n }\n\n val obj = object : Inner(s = \"K\") {\n override fun result() = capture + s\n }","completion":"}\n\n return Local().obj.result()\n}<|endoftext|>"} {"prompt":"override val lightMemberOrigin: LightMemberOrigin? get() = null\n override val kotlinOrigin: KtDeclaration? get() = null\n\n override fun getText(): String = \"\"\n override fun getTextRange(): TextRange = TextRange.EMPTY_RANGE\n\n private companion object {\n private fun makeNotNullAnnotation(context: PsiClass): PsiAnnotation {","completion":"return PsiElementFactory.getInstance(context.project).createAnnotationFromText(\n ClassInnerStuffCache.NOT_NULL_ANNOTATION_QUALIFIER,\n context,\n )\n }\n }\n}\n\nprivate val PsiClass.isAnonymous: Boolean\n get() = name == null || this is PsiAnonymousClass<|endoftext|>"} {"prompt":"private fun createAccessorBodyForGetter(\n targetField: IrField,\n accessor: IrSimpleFunction,\n superQualifierSymbol: IrClassSymbol?\n ): IrBody {\n val maybeDispatchReceiver =\n if (targetField.isStatic) null\n else IrGetValueImpl(accessor.startOffset, accessor.endOffset, accessor.valueParameters[0].symbol)","completion":"return context.irFactory.createExpressionBody(\n accessor.startOffset, accessor.endOffset,\n IrGetFieldImpl(\n accessor.startOffset, accessor.endOffset,\n targetField.symbol,\n targetField.type,\n maybeDispatchReceiver,\n superQualifierSymbol = superQualifierSymbol\n )\n )\n }<|endoftext|>"} {"prompt":"val result = runProcess(command, File(\".\"), options = BaseGradleIT.BuildOptions(forceOutputToStdout = true))\n\n assertProcessRunResult(result) {\n assertTrue(\n result.isSuccessful,\n \"Process 'gem ${args.joinToString(separator = \" \")}' exited with error code ${result.exitCode}. See log for details.\"\n )\n }","completion":"return result.output\n}\n\nprivate fun Path.appendLine(s: String) = appendText(\"\\n$s\")\n\nprivate const val podfileImportDirectivePlaceholder = \"\"<|endoftext|>"} {"prompt":"ExpectedData(0x7fb19eb1a496e8f5UL, 0x1a57313a32f22ddeUL, 0x30af46e49850bf8bUL, 0xaa0fe8d12f808f83UL, 0x443e31d70873bb6bUL),","completion":"ExpectedData(0x5dba5b0dadccdbaaUL, 0xe9029e6364286587UL, 0xae69f49ecb46726cUL, 0x18e002679217c405UL, 0xbd6d66e85332ae9fUL),<|endoftext|>"} {"prompt":"is SealedChild2 -> 2\n is SealedChild3 -> 3\n }\n }\n return 0\n}\n\n\/\/ TESTCASE NUMBER: 31\nfun case_31(x: Any) {\n x as SealedClassWithObjects\n val y = when(x) {\n SealedWithObjectsChild1 -> 1\n SealedWithObjectsChild2 -> 2","completion":"SealedWithObjectsChild3 -> 3\n }\n}\n\n\/\/ TESTCASE NUMBER: 32\nfun case_32(x: Any) {\n if (x is SealedClassWithObjects?) {\n val y = when(x) {\n SealedWithObjectsChild1 -> 1\n SealedWithObjectsChild2 -> 2\n SealedWithObjectsChild3 -> 3<|endoftext|>"} {"prompt":"platformSpecificCastChecker: PlatformSpecificCastChecker\n ): Boolean {\n val typeConstructor = lhsType.constructor\n if (typeConstructor is IntersectionTypeConstructor) {\n return typeConstructor.supertypes.any { isCastPossible(it, rhsType, platformToKotlinClassMapper, platformSpecificCastChecker) }\n }","completion":"val rhsNullable = TypeUtils.isNullableType(rhsType)\n val lhsNullable = TypeUtils.isNullableType(lhsType)\n if (KotlinBuiltIns.isNothing(lhsType)) return true\n if (KotlinBuiltIns.isNullableNothing(lhsType) && !rhsNullable) return false<|endoftext|>"} {"prompt":"token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.BuilderInferenceStubReceiver\n\ninternal class BuilderInferenceMultiLambdaRestrictionImpl(\n override val typeParameterName: Name,\n override val containingDeclarationName: Name,","completion":"firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.BuilderInferenceMultiLambdaRestriction\n\ninternal class OverrideCannotBeStaticImpl(\n firDiagnostic: KtPsiDiagnostic,<|endoftext|>"} {"prompt":"}\n\n override fun hashCode(): Int {\n var result = typeParameter.hashCode()\n result += 31 * result + typeAttr.hashCode()\n return result\n }\n }\n\n private val getErasedUpperBound = storage.createMemoizedFunction {","completion":"with(it) { getErasedUpperBoundInternal(typeParameter, typeAttr) }\n }\n\n fun getErasedUpperBound(\n typeParameter: TypeParameterDescriptor,\n typeAttr: ErasureTypeAttributes\n ): KotlinType = getErasedUpperBound(DataToEraseUpperBound(typeParameter, typeAttr))<|endoftext|>"} {"prompt":"containingClass: FirClass?,\n ): List {\n if (containingClass == null) {\n return emptyList()\n }\n\n val scope = containingClass.unsubstitutedScope(session, scopeSession, withForcedTypeCalculator = false, memberRequiredPhase = null)\n\n return buildList {\n scope.processPropertiesByName(property.name) {}","completion":"scope.processDirectOverriddenPropertiesWithBaseScope(property.symbol) { overriddenSymbol, _ ->\n if (session.visibilityChecker.isVisibleForOverriding(\n candidateInDerivedClass = property, candidateInBaseClass = overriddenSymbol.fir\n )\n ) {\n this += overriddenSymbol.fir\n }\n ProcessorAction.NEXT<|endoftext|>"} {"prompt":"arrayOf(\"1.0.0-beta.11+sha.0nsfgkjkjsdf\", \"1-beta.11+sha.0nsfgkjkjsdf\"),","completion":"arrayOf(\"1.2.3-beta.1-1.ab-c+sha.0nsfgkjkjs-df\", \"1.2.3-beta.1-1.ab-c+sha.0nsfgkjkjs-df\"),\n arrayOf(\"1.0.0-alpha.1\", \"1.0.0-alpha.1\"),<|endoftext|>"} {"prompt":"public inline val UShortArray.lastIndex: Int\n get() = storage.lastIndex\n\n\/**\n * Returns an array containing all elements of the original array and then the given [element].\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.plus(element: UInt): UIntArray {","completion":"return UIntArray(storage + element.toInt())\n}\n\n\/**\n * Returns an array containing all elements of the original array and then the given [element].\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.plus(element: ULong): ULongArray {<|endoftext|>"} {"prompt":"it.extensionValue()\n}\n\nfun dispatch(a: IC): T = bar(a) {\n it.dispatchValue()\n}\n\nfun normal(a: IC): T = bar(a) {\n normalValue(it)\n}\n\nfun bar(value: T, f: (T) -> R): R {","completion":"return f(value)\n}\n\nfun IC.extensionValue(): T = value\n\nfun normalValue(ic: IC): T = ic.value\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class IC(val value: T) {\n fun dispatchValue(): T = value\n}\n\nfun box(): String {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.ktNullability\nimport org.jetbrains.kotlin.analysis.api.descriptors.types.base.KtFe10Type\nimport org.jetbrains.kotlin.analysis.api.descriptors.types.base.asStringForDebugging","completion":"import org.jetbrains.kotlin.analysis.api.symbols.KtTypeParameterSymbol\nimport org.jetbrains.kotlin.analysis.api.types.KtTypeNullability\nimport org.jetbrains.kotlin.analysis.api.types.KtTypeParameterType\nimport org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion<|endoftext|>"} {"prompt":"className == List::class.java.canonicalName\n || className == ArrayList::class.java.canonicalName\n || className == LinkedList::class.java.canonicalName\n || className == Set::class.java.canonicalName\n || className == SortedSet::class.java.canonicalName\n || className == NavigableSet::class.java.canonicalName","completion":"|| className == HashSet::class.java.canonicalName\n || className == LinkedHashSet::class.java.canonicalName\n || className == TreeSet::class.java.canonicalName\n -> {\n val elementType = type.arguments.single().type\n val elementAsmType = typeMapper.mapTypeSafe(elementType, forceBoxed = true)<|endoftext|>"} {"prompt":"printlnWelcomeMessage(\"Warning: REPL is not yet compatible with the Kotlin version ${KotlinCompilerVersion.VERSION}, using '-language-version 1.9'.\")\n }\n printlnWelcomeMessage(\"Type :help for help, :quit for quit\")\n }\n\n \/\/ Display compiler messages related to configuration and CLI arguments, quit if there are errors\n val hasErrors = messageCollector.hasErrors()","completion":"(messageCollector as? GroupingMessageCollector)?.flush()\n if (hasErrors) return\n\n var next = WhatNextAfterOneLine.READ_LINE\n while (true) {\n next = one(next)\n if (next == WhatNextAfterOneLine.QUIT) {\n break\n }\n }\n } catch (e: Exception) {<|endoftext|>"} {"prompt":"val rootScope = computeScopes().liftUsedNames()\n val replacements = hashMapOf()\n fun traverse(scope: Scope) {\n \/\/ Don't clash with non-temporary names declared in current scope. It's for rare cases like `_` or `Kotlin` names,\n \/\/ since most of local declarations are temporary.","completion":"val occupiedNames = scope.declaredNames.asSequence().filter { !it.isTemporary }.map { it.ident }.toMutableSet()\n\n \/\/ Don't clash with non-temporary names used in current scope. It's ok to clash with unused names.\n \/\/ Don't clash with used temporary names from outer scopes that get their resolved names. For example,<|endoftext|>"} {"prompt":"internal val Project.compilerArgs: List\n get() = (findProperty(\"compilerArgs\") as String?)?.split(\"\\\\s\".toRegex()).orEmpty()\n\ninternal val Project.kotlinVersion: String\n get() = property(\"kotlinVersion\") as String\n\ninternal val Project.konanVersion: String\n get() = property(\"konanVersion\") as String","completion":"internal val Project.nativeJson: String\n get() = project.property(\"nativeJson\") as String\n\ninternal val Project.jvmJson: String\n get() = project.property(\"jvmJson\") as String\n\ninternal val Project.buildType: NativeBuildType<|endoftext|>"} {"prompt":"true -> 42\n else ->\n when {\n true -> 42\n else -> println()\n }\n }\n }\n\nfun testUsage1() =\n when {","completion":"true -> 42\n else -> println()\n }\n\nfun testUsage2() =\n foo(when {\n true -> 42\n else -> println()\n })\n\nfun testUsage2Generic() =\n fooGeneric(when {\n true -> 42<|endoftext|>"} {"prompt":"x.itest2()\n }\n }\n}\n\n\/*\n * TESTCASE NUMBER: 2\n * ISSUES: KT-28362\n *\/\nfun case_2(x: Any) {\n if (x is Interface2) {","completion":"if (x is Interface1) {\n x\n x.itest0()\n }\n }\n}\n\n\/*<|endoftext|>"} {"prompt":"if (f != null || this.f != null) f.funNullableAny()","completion":"if (f != null || this.f != null) f<|endoftext|>"} {"prompt":"val DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE: KtDiagnosticFactory2, FirCallableSymbol<*>> by warning2, FirCallableSymbol<*>>(SourceElementPositioningStrategies.DECLARATION_NAME)","completion":"val RETURN_TYPE_MISMATCH_ON_OVERRIDE: KtDiagnosticFactory2, FirCallableSymbol<*>> by error2, FirCallableSymbol<*>>(SourceElementPositioningStrategies.DECLARATION_RETURN_TYPE)<|endoftext|>"} {"prompt":"LLVMSetLinkage(global, LLVMLinkage.LLVMInternalLinkage)\n LLVMSetInitializer(global, LLVMConstNull(int8PtrType))\n global\n }\n\n private val personalityFunctionName = when (target) {\n KonanTarget.MINGW_X64 -> \"__gxx_personality_seh0\"","completion":"else -> \"__gxx_personality_v0\"\n }\n\n val cxxStdTerminate = externalNativeRuntimeFunction(\n \"_ZSt9terminatev\", \/\/ mangled C++ 'std::terminate'\n returnType = LlvmRetType(voidType),\n functionAttributes = listOf(LlvmFunctionAttribute.NoUnwind)\n )<|endoftext|>"} {"prompt":"fun call(ic: T): R\n}\n\nfun bar(value: T, f: IFace): R {\n return f.call(value)\n}\n\nfun IC.extensionValue(): T = value\n\nfun normalValue(ic: IC): T = ic.value","completion":"OPTIONAL_JVM_INLINE_ANNOTATION\nvalue class IC(val value: T) {\n fun dispatchValue(): T = value\n}\n\nfun box(): String {\n var res = underlying(IC(\"O\")) + \"K\"\n if (res != \"OK\") return \"FAIL 1: $res\"\n\n res = extension(IC(\"O\")) + \"K\"<|endoftext|>"} {"prompt":"forceFoxedReturnTypeOnOverride(function) ||\n forceBoxedReturnTypeOnDefaultImplFun(function) ||\n function.isFromJava() && function.returnType.isInlineClassType()\n\n private fun forceFoxedReturnTypeOnOverride(function: IrFunction) =\n function is IrSimpleFunction &&\n function.returnType.isPrimitiveType() &&","completion":"function.allOverridden().any { !it.returnType.isPrimitiveType() }\n\n private fun forceBoxedReturnTypeOnDefaultImplFun(function: IrFunction): Boolean {\n if (function !is IrSimpleFunction) return false\n val originalFun = context.cachedDeclarations.getOriginalFunctionForDefaultImpl(function) ?: return false\n return forceFoxedReturnTypeOnOverride(originalFun)\n }<|endoftext|>"} {"prompt":"fun clang_getCursorExtent(arg0: CValue): CValue {\n memScoped {\n val kniRetVal = nativeHeap.alloc()\n try {\n kniBridge127(arg0.getPointer(memScope).rawValue, kniRetVal.rawPtr)","completion":"return kniRetVal.readValue()\n } finally { nativeHeap.free(kniRetVal) }\n }\n}\n\nfun clang_getCursorType(C: CValue): CValue {\n memScoped {\n val kniRetVal = nativeHeap.alloc()\n try {<|endoftext|>"} {"prompt":"classId(\"com.example\", \"TopLevelClass$1LocalClass$1LocalClassWithinLocalClass\", local = true),\n classId(\"com.example\", \"TopLevelClass$1LocalClass.InnerClassWithinLocalClass\", local = true),\n classId(\"com.example\", \"TopLevelClass$2\", local = true),\n classId(\"com.example\", \"TopLevelClass.InnerClass\", local = false),","completion":"classId(\"com.example\", \"TopLevelClass\\$InnerClass\\$1LocalClassWithinInnerClass\", local = true),\n classId(\"com.example\", \"TopLevelClass.InnerClass.InnerClassWithinInnerClass\", local = false),\n classId(\"com.example\", \"TopLevelClass.InnerClassWith\\$Sign\", local = false),<|endoftext|>"} {"prompt":"\"Type ''{1}'' is non-nullable and therefore can not be serialized with serializer for nullable type ''{0}''\",\n FirDiagnosticRenderers.RENDER_TYPE,\n FirDiagnosticRenderers.RENDER_TYPE\n )\n put(\n FirSerializationErrors.SERIALIZER_TYPE_INCOMPATIBLE,","completion":"\"Class ''{1}'', which is serializer for type ''{2}'', is applied here to type ''{0}''. This may lead to errors or incorrect behavior.\",\n FirDiagnosticRenderers.RENDER_TYPE,\n FirDiagnosticRenderers.RENDER_TYPE,\n FirDiagnosticRenderers.RENDER_TYPE\n )\n put(<|endoftext|>"} {"prompt":"if (element3 !in 1.0..<3.0 != !range0.contains(element3)) throw AssertionError()\n if (!(element3 in 1.0..<3.0) != !range0.contains(element3)) throw AssertionError()","completion":"if (!(element3 !in 1.0..<3.0) != range0.contains(element3)) throw AssertionError()\n}\n\nfun testR0xE4() {\n \/\/ with possible local optimizations\n if (1F in 1.0..<3.0 != range0.contains(1F)) throw AssertionError()<|endoftext|>"} {"prompt":"@Deprecated(\"Use 'Long.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"this.hours\", \"kotlin.time.Duration.Companion.hours\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\", errorSince = \"1.8\", hiddenSince = \"1.9\")\npublic val Long.hours: Duration get() = toDuration(DurationUnit.HOURS)\n\n\/**","completion":"* Returns a [Duration] equal to this [Double] number of hours.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"this.hours\", \"kotlin.time.Duration.Companion.hours\"))<|endoftext|>"} {"prompt":"x.funAny()\n x.funNullableT()","completion":"x.funNullableAny()\n x.test1()<|endoftext|>"} {"prompt":"clazz.allInheritedAnnotations.forEach { annotation ->\n when (annotation) {\n is DisabledTests -> contributeSourceLocations(annotation.sourceLocations)\n is DisabledTestsIfProperty -> if (System.getProperty(annotation.property.propertyName) == annotation.propertyValue) {\n contributeSourceLocations(annotation.sourceLocations)\n }\n }\n }","completion":"clazz.declaredClasses.forEach(::recurse)\n }\n\n recurse(enclosingTestClass)\n }\n\n return DisabledTestDataFiles(filesAndDirectories)\n }\n\n private fun computeTestRoots(enclosingTestClass: Class<*>): TestRoots {\n fun TestMetadata.testRoot() = getAbsoluteFile(localPath = value)<|endoftext|>"} {"prompt":"fun methodName(): Promise\n}\n\n\/**\n * Exposes the JavaScript [ServiceWorkerContainer](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/ServiceWorkerContainer) to Kotlin\n *\/\npublic external abstract class ServiceWorkerContainer : EventTarget {\n open val controller: ServiceWorker?\n open val ready: Promise","completion":"open var oncontrollerchange: ((Event) -> dynamic)?\n open var onmessage: ((MessageEvent) -> dynamic)?\n fun register(scriptURL: String, options: RegistrationOptions = definedExternally): Promise\n fun getRegistration(clientURL: String = definedExternally): Promise\n fun getRegistrations(): Promise>\n fun startMessages()\n}<|endoftext|>"} {"prompt":"freeCompilerArgs,\n sourceModules = emptyList(),\n dependencies = emptyList(),\n expectedArtifact\n ).result\n }\n}\n\n@Suppress(\"JUnitTestCaseWithNoTests\")\n@TestDataPath(\"\\$PROJECT_ROOT\")\n@EnforcedProperty(ClassLevelProperty.COMPILER_OUTPUT_INTERCEPTOR, \"NONE\")","completion":"class ClassicCompilerOutputTest : CompilerOutputTestBase()\n\n@Suppress(\"JUnitTestCaseWithNoTests\")\n@FirPipeline\n@Tag(\"frontend-fir\")\n@TestDataPath(\"\\$PROJECT_ROOT\")\n@EnforcedProperty(ClassLevelProperty.COMPILER_OUTPUT_INTERCEPTOR, \"NONE\")\nclass FirCompilerOutputTest : CompilerOutputTestBase()<|endoftext|>"} {"prompt":"fieldUpdater.compareAndSet(this, null, memberValues)\n return getOrCompareArguments()\n }\n\n override fun getParent(): PsiElement = lightParent\n override fun isPhysical(): Boolean = false\n\n override fun getText(): String = \"{\" + getOrCompareArguments().joinToString { it.text } + \"}\"\n\n companion object {","completion":"private val fieldUpdater = AtomicReferenceFieldUpdater.newUpdater(\n \/* tclass = *\/ SymbolPsiArrayInitializerMemberValue::class.java,\n \/* vclass = *\/ List::class.java,\n \/* fieldName = *\/ \"cachedArguments\",\n )\n }\n}\n\ninternal abstract class SymbolPsiAnnotationMemberValue(<|endoftext|>"} {"prompt":"if (childrenArray.isEmpty()) return node\n for (child in childrenArray) {\n val childTokenType = child.tokenType ?: return null\n if (childTokenType in KtTokens.WHITE_SPACE_OR_COMMENT_BIT_SET || childTokenType == KtNodeTypes.ANNOTATION_ENTRY) {\n continue\n }","completion":"return firstNonCommentNonAnnotationLeaf(child) ?: continue\n }\n return null\n }\n\n override fun mark(\n node: LighterASTNode,\n startOffset: Int,\n endOffset: Int,\n tree: FlyweightCapableTreeStructure\n ): List {<|endoftext|>"} {"prompt":"val parameterAnnotations = C::class.constructors.single().parameters.map { it.name to it.annotations.map { it.annotationClass.simpleName ?: \"\" }.toSet() }.toMap()\n assertEquals(setOf(\"ParameterAnnotation\", \"UniversalAnnotation\", \"AnotherUniversalAnnotation\"), parameterAnnotations[\"x1\"])","completion":"assertEquals(setOf(), parameterAnnotations[\"x2\"])\n assertEquals(setOf(\"PropertyOrParameterAnnotation\"), parameterAnnotations[\"x3\"])\n assertEquals(setOf(\"ParameterOrFieldAnnotation\"), parameterAnnotations[\"x4\"])\n assertEquals(setOf(), parameterAnnotations[\"x5\"])<|endoftext|>"} {"prompt":"val followingNodes = delegatedConstructorCall.followingNodes.toList()\n CFGNode.removeAllOutgoingEdges(delegatedConstructorCall)\n addEdge(delegatedConstructorCall, delegatedEnter, preferredKind = EdgeKind.CfgForward, propagateDeadness = false)\n for (node in followingNodes) {\n addEdgeToSubGraph(delegatedExit, node)","completion":"addEdge(delegatedConstructorCall, node, preferredKind = EdgeKind.DfgForward)\n }\n } else if (lastInPlaceExit !== enterNode || !isLocalClass) {\n \/\/ (init blocks if any, else class entry) -> non-delegating or super-delegating constructor.\n \/\/ For local classes, if there are no init blocks, the CFG edge from the class entry already exists,<|endoftext|>"} {"prompt":"val blankObjCNameB: Int = 0\n\n@ObjCName(swiftName = \"SwiftMissingExactName\", exact = true)\nclass MissingExactName\n\ninterface KotlinInterfaceA {\n @ObjCName(\"objCPropertyA\", \"swiftPropertyA\")\n var kotlinPropertyA: Int","completion":"@ObjCName(\"objCPropertyB\", \"swiftPropertyB\")\n var kotlinPropertyB: Int\n @ObjCName(\"objCPropertyB\")\n var kotlinPropertyC: Int\n @ObjCName(swiftName =\"swiftPropertyB\")\n var kotlinPropertyD: Int\n var kotlinPropertyE: Int\n var kotlinPropertyF: Int<|endoftext|>"} {"prompt":"val sharedModuleByCommonizer: SerializedMetadata = results.modulesByTargets.getValue(sharedTarget).single().metadata\n\n assertModulesAreEqual(sharedModuleAsExpected, sharedModuleByCommonizer, sharedTarget)\n }\n}\n\nprivate data class SourceModuleRoot(\n val targetName: String,\n val location: File\n) {\n init {\n assertIsDirectory(location)","completion":"}\n\n companion object {\n fun load(directory: File): SourceModuleRoot = SourceModuleRoot(\n targetName = directory.name,\n location = directory\n )\n\n const val SHARED_TARGET_NAME = \"common\"\n }\n}\n\nprivate class SourceModuleRoots(\n val originalRoots: Map,<|endoftext|>"} {"prompt":"\/\/ @sample samples.contracts.returnsFalseContract\n \/\/ @sample samples.contracts.returnsNullContract\n @ContractsDsl public fun returns(value: Any?): Returns\n\n \/**\n * Describes a situation when a function returns normally with any value that is not `null`.\n *\n * Use [SimpleEffect.implies] function to describe a conditional effect that happens in such case.\n *","completion":"*\/\n \/\/ @sample samples.contracts.returnsNotNullContract\n @ContractsDsl public fun returnsNotNull(): ReturnsNotNull\n\n \/**\n * Specifies that the function parameter [lambda] is invoked in place.\n *\n * This contract specifies that:\n * 1. the function [lambda] can only be invoked during the call of the owner function,<|endoftext|>"} {"prompt":"var found = false\n for (element in this) {\n if (predicate(element)) {\n last = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Sequence contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return last as T\n}\n\n\/**","completion":"* Returns last index of [element], or -1 if the sequence does not contain element.\n *\n * The operation is _terminal_.\n *\/\npublic fun <@kotlin.internal.OnlyInputTypes T> Sequence.lastIndexOf(element: T): Int {\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)<|endoftext|>"} {"prompt":"fun foo4(e1: E1, i: MyInterface, c: MyOpenClass) {\n e1 == i\n i == e1\n\n e1 == c","completion":"c == e1\n\n when (e1) {\n i -> {}\n c -> {}\n else -> {}\n }\n}<|endoftext|>"} {"prompt":"if (regularClass.isEffectivelyExpect(containingClass, context) ||\n regularClass.isEffectivelyExternal(containingClass, context)\n ) {\n return\n }\n val delegatedCallSource = delegatedConstructorCall.source ?: return\n if (delegatedCallSource.kind !is KtFakeSourceElementKind) return\n val supertypesToSkip = context.session.primaryConstructorSuperTypePlatformSupport","completion":".supertypesThatDontNeedInitializationInSubtypesConstructors\n if (superClassSymbol.classId in supertypesToSkip) return\n if (delegatedCallSource.elementType != KtNodeTypes.SUPER_TYPE_CALL_ENTRY) {\n reporter.reportOn(constructedTypeRef.source, FirErrors.SUPERTYPE_NOT_INITIALIZED, context)<|endoftext|>"} {"prompt":"val IrModuleFragment.safeName: String\n get() = name.asString().safeModuleName\n\nfun generateProxyIrModuleWith(\n safeName: String,\n externalName: String,\n mainFunctionTag: String?,\n suiteFunctionTag: String? = null,\n cachedTestFunctionsWithTheirPackage: CachedTestFunctionsWithTheirPackage = emptyMap(),","completion":"importedWithEffectInModuleWithName: String? = null\n): JsIrModule {\n val programFragment = JsIrProgramFragment(safeName, \"\").apply {\n mainFunctionTag?.let {\n this.mainFunctionTag = it\n nameBindings[it] = ReservedJsNames.makeMainFunctionName()\n }<|endoftext|>"} {"prompt":"PathUtil.kotlinPathsForDistDirectoryForTests.stdlibPath,\n File(PathUtil.kotlinPathsForDistDirectoryForTests.libPath, \"annotations-13.0.jar\"),\n )\n }\n ),\n\n JvmTest(\n \"kotlin-test\",","completion":"{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.kotlinTestPath) },\n ),\n\n JsStdLib(\n \"KotlinJavaScript\",\n { arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibKlibPath) }\n ),\n JsTest(\n \"KotlinJavaScriptTest\",<|endoftext|>"} {"prompt":"COROUTINE_SUSPENDED\n }\n\n operator suspend fun minusAssign(y: String): Unit = suspendCoroutineUninterceptedOrReturn { x ->\n if (y != \"56\") return@suspendCoroutineUninterceptedOrReturn Unit\n isMinusAssignCalled = true\n x.resume(Unit)\n COROUTINE_SUSPENDED\n }","completion":"\/\/ See KT-16221\n\/\/ operator suspend fun contains(y: String): Boolean = suspendCoroutineUninterceptedOrReturn { x ->\n\/\/ x.resume(y == \"56\")\n\/\/ COROUTINE_SUSPENDED\n\/\/ }\n\n operator suspend fun compareTo(y: String): Int = suspendCoroutineUninterceptedOrReturn { x -><|endoftext|>"} {"prompt":"private fun produceBinaryFromBitcode(engine: PhaseEngine, config: KonanConfig, bitcodeFilePath: String) {\n val llvmContext = LLVMContextCreate()!!\n var llvmModule: CPointer? = null\n try {\n llvmModule = parseBitcodeFile(llvmContext, bitcodeFilePath)","completion":"val context = BitcodePostProcessingContextImpl(config, llvmModule, llvmContext)\n val depsPath = config.readSerializedDependencies\n val dependencies = if (depsPath.isNullOrEmpty()) DependenciesTrackingResult(emptyList(), emptyList(), emptyList()).also {\n config.configuration.report(CompilerMessageSeverity.WARNING, \"No backend dependencies provided.\")<|endoftext|>"} {"prompt":"public open class UninitializedPropertyAccessException : kotlin.RuntimeException {\n public constructor UninitializedPropertyAccessException()\n\n public constructor UninitializedPropertyAccessException(message: kotlin.String?)\n\n public constructor UninitializedPropertyAccessException(message: kotlin.String?, cause: kotlin.Throwable?)\n\n public constructor UninitializedPropertyAccessException(cause: kotlin.Throwable?)\n}","completion":"public object Unit {\n public open override fun toString(): kotlin.String\n}\n\n@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE})\n@kotlin.annotation.Retention(value = AnnotationRetention.SOURCE)\n@kotlin.annotation.MustBeDocumented\npublic final annotation class UnsafeVariance : kotlin.Annotation {<|endoftext|>"} {"prompt":"fun foo1(x: _) {}\nfun foo2(x: Foo<_>) {}\nfun foo21(x: Foo_>>) {}","completion":"fun foo3(): _ {}<|endoftext|>"} {"prompt":"override val defaultProjectName: String = \"incrementalMultiproject\"\n\n @DisplayName(\"'inspectClassesForKotlinIC' task is added to execution plan\")\n open fun testInspectClassesForKotlinICTask(gradleVersion: GradleVersion) {\n defaultProject(gradleVersion) {\n build(\"assemble\") {\n assertTasksSkipped(","completion":"\":lib:inspectClassesForKotlinIC\",\n \":app:inspectClassesForKotlinIC\"\n )\n }\n }\n }\n\n \/\/ todo: do the same for js backend\n @DisplayName(\"Duplicated class\")\n @GradleTest\n fun testDuplicatedClass(gradleVersion: GradleVersion) {<|endoftext|>"} {"prompt":"fun foo3(r1: KRunnable, r2: KRunnable, r3: KRunnable)\n}\n\nfun interface KRunnable {\n fun run()\n}\n\n\/\/ FILE: 1.kt\nfun test(j: J, r: KRunnable) {\n j.foo1(r)\n j.foo1({})","completion":"j.foo2(r, r)\n j.foo2({}, {})\n j.foo2(r, {})\n j.foo2({}, r)\n\n j.foo3(r, r, r)\n j.foo3(r, r, {})\n j.foo3(r, {}, r)\n j.foo3(r, {}, {})<|endoftext|>"} {"prompt":"is PropertyDescriptor -> {\n TypeOfCall.PROPERTY_GETTER.nameToRender\n }\n is FunctionDescriptor -> buildString {\n if (functionDescriptor.isInline) append(\"inline \")\n if (functionDescriptor.isInfix) append(\"infix \")\n if (functionDescriptor.isOperator) append(\"operator \")","completion":"if (functionDescriptor.isExtension) append(\"extension \")\n append(TypeOfCall.FUNCTION.nameToRender)\n }\n else -> TypeOfCall.OTHER.nameToRender\n }\n }\n}\n\nenum class TypeOfCall(val nameToRender: String) {\n VARIABLE_THROUGH_INVOKE(\"variable&invoke\"),<|endoftext|>"} {"prompt":"ConeClassLikeLookupTagImpl(DataFrameLikeCallsRefinementExtension.DATAFRAME),\n arrayOf(\n ConeClassLikeTypeImpl(\n ConeClassLookupTagWithFixedSymbol(tokenSymbol.classId, tokenSymbol),\n emptyArray(),\n isNullable = false\n )\n ),\n isNullable = false\n )\n }\n }","completion":"}\n\n private fun buildTokenProperty(\n tokenSymbol: FirClassSymbol<*>,\n propName: Name,\n ): FirProperty {\n return createMemberProperty(\n tokenSymbol,\n DataFrameLikeCallsRefinementExtension.Companion.KEY,\n propName,\n session.builtinTypes.intType.type\n ) {\n visibility = Visibilities.Local<|endoftext|>"} {"prompt":"import a.bar.foo\n\nimport a.B.foo\nimport a.B.foo.bar\nimport a.B.bar","completion":"import a.B.bar.foo\n\nimport a.C.foo\nimport a.C.foo.bar\nimport a.C.bar\nimport a.C.bar.foo\nimport a.C.Nested<|endoftext|>"} {"prompt":"if (intScale.toDouble() == scale && intScale != 0) {\n return div(intScale)\n }\n\n val unit = storageUnit\n val result = toDouble(unit) \/ scale\n return result.toDuration(unit)\n }\n\n \/** Returns a number that is the ratio of this and [other] duration values. *\/\n public operator fun div(other: Duration): Double {","completion":"val coarserUnit = maxOf(this.storageUnit, other.storageUnit)\n return this.toDouble(coarserUnit) \/ other.toDouble(coarserUnit)\n }\n\n \/**\n * Returns a duration whose value is this duration value truncated to the specified duration [unit].\n *\/\n internal fun truncateTo(unit: DurationUnit): Duration {\n val storageUnit = storageUnit<|endoftext|>"} {"prompt":"with(firstParceler) { this@write.first.write(parcel, 0) }\n with(secondParceler) { this@write.second.write(parcel, 0) }\n }\n}\n\nobject IntParceler: Parceler {\n \/**\n * Reads the [T] instance state from the [parcel], constructs the new [T] instance and returns it.\n *\/","completion":"override fun create(parcel: Parcel): Int = parcel.readInt()\n\n \/**\n * Writes the [T] instance state to the [parcel].\n *\/\n override fun Int.write(parcel: Parcel, flags: Int) {\n parcel.writeInt(this)\n }\n}\n\n\/**\n * [Int] to [Int] pair parceler\n *\/<|endoftext|>"} {"prompt":"\/\/ !OPT_IN: kotlin.contracts.ExperimentalContracts\n\n\/*\n * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE)\n *\n * SECTIONS: contracts, declarations, contractBuilder, effects, returns\n * NUMBER: 2\n * DESCRIPTION: Using equality with not labeled 'this' in implies.\n *\/\n\nimport kotlin.contracts.*","completion":"\/\/ TESTCASE NUMBER: 1\nfun Any?.case_1(): Boolean {\n contract {\n returns(true) implies (this != null)\n }\n return this != null\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun Any?.case_2(): Boolean {<|endoftext|>"} {"prompt":"private val kFunctionNMap = mutableMapOf()\n private val suspendFunctionNMap = mutableMapOf()\n private val kSuspendFunctionNMap = mutableMapOf()\n\n private val irFactory: IrFactory get() = symbolTable.irFactory\n\n val functionClass =","completion":"symbolTable.descriptorExtension.referenceClass(irBuiltIns.builtIns.getBuiltInClassByFqName(FqName(\"kotlin.Function\")))\n val kFunctionClass =\n symbolTable.descriptorExtension.referenceClass(irBuiltIns.builtIns.getBuiltInClassByFqName(FqName(\"kotlin.reflect.KFunction\")))<|endoftext|>"} {"prompt":"}\n\ninline fun default1_0(lambda: () -> String, dlambda: () -> String = { lambda() }) {\n lambda() + dlambda()\n}","completion":"inline fun default1_1(lambda: () -> String, noinline dlambda: () -> String = { lambda() }) {\n lambda() + dlambda()\n}\n\ninline fun default1_1crossinline(crossinline lambda: () -> String, noinline dlambda: () -> String = { lambda() }) {\n lambda() + dlambda()<|endoftext|>"} {"prompt":"override fun getFinishTime(): Long = finishTime\n\n override fun getCompilerArguments(): List = compilerArguments\n\n override fun getNonIncrementalAttributes(): Set = nonIncrementalAttributes\n\n override fun getBuildTimesMetrics(): Map = buildTimesMetrics","completion":"override fun getPerformanceMetrics(): Map = performanceMetrics\n\n override fun getGcTimeMetrics(): Map? = gcTimeMetrics\n\n override fun getGcCountMetrics(): Map? = gcCountMetrics\n\n override fun getFromKotlinPlugin(): Boolean? = fromKotlinPlugin<|endoftext|>"} {"prompt":"val constructor = expression.symbol.owner\n if (constructor.constructedClass.isAnnotationClass)\n return expression\n return super.visitConstructorCall(expression)\n }\n\n override fun visitFunctionAccess(expression: IrFunctionAccessExpression): IrExpression {\n expression.transformChildrenVoid()\n val function = expression.symbol\n\n \/\/ Replace empty varargs with empty arrays","completion":"for (i in 0 until expression.valueArgumentsCount) {\n if (expression.getValueArgument(i) != null)\n continue\n\n val parameter = function.owner.valueParameters[i]\n if (parameter.varargElementType != null && !parameter.hasDefaultValue()) {\n \/\/ Compute the correct type for the array argument.<|endoftext|>"} {"prompt":"(a.x)()\n if (a.x != null) {\n a.x() \/\/ todo","completion":"(a.x)()\n }\n }\n}<|endoftext|>"} {"prompt":"\"I\" -> if (kType.isInt()) PrimitiveBuiltins.intSerializer else null\n \"J\" -> if (kType.isLong()) PrimitiveBuiltins.longSerializer else null\n \"F\" -> if (kType.isFloat()) PrimitiveBuiltins.floatSerializer else null\n \"D\" -> if (kType.isDouble()) PrimitiveBuiltins.doubleSerializer else null","completion":"\"C\" -> if (kType.isChar()) PrimitiveBuiltins.charSerializer else null\n else -> findStandardKotlinTypeSerializerName(typeName)\n } ?: return null\n val identifier = Name.identifier(name)\n return module.findClassAcrossModuleDependencies(ClassId(internalPackageFqName, identifier))<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.kapt3.test.handlers\n\nimport com.intellij.openapi.util.text.StringUtil\nimport com.sun.tools.javac.comp.CompileStates\nimport com.sun.tools.javac.util.JCDiagnostic\nimport com.sun.tools.javac.util.Log","completion":"import org.jetbrains.kotlin.kapt3.base.javac.KaptJavaLogBase\nimport org.jetbrains.kotlin.kapt3.util.prettyPrint\nimport org.jetbrains.kotlin.kapt3.test.KaptContextBinaryArtifact<|endoftext|>"} {"prompt":"package kotlin.reflect.jvm.internal\n\nimport org.jetbrains.kotlin.descriptors.CallableMemberDescriptor\nimport org.jetbrains.kotlin.descriptors.Modality\nimport org.jetbrains.kotlin.load.java.descriptors.JavaCallableMemberDescriptor\nimport org.jetbrains.kotlin.types.asSimpleType","completion":"import java.lang.reflect.ParameterizedType\nimport java.lang.reflect.Type\nimport java.lang.reflect.WildcardType\nimport kotlin.coroutines.Continuation\nimport kotlin.reflect.*\nimport kotlin.reflect.jvm.internal.calls.Caller\nimport kotlin.reflect.jvm.internal.calls.getMfvcUnboxMethods<|endoftext|>"} {"prompt":"where C: Context,\n A: InterfaceA,\n B: InterfaceA\n = null!!\n\nobject ContextImpl : Context\nobject RootA : InterfaceA\n\nclass AImpl> : InterfaceA

{\n fun foo(): Int = null!!\n}","completion":"val , A: InterfaceA> A.impl get() = ABuilder>()\n\nfun test_1() {\n RootA.apply {\n (impl) {\n foo()\n }\n }\n}\n\nfun test_2() {\n RootA.apply {\n impl {<|endoftext|>"} {"prompt":"* Defines the fully-qualified path of functions which should be transformed by the Power-Assert compiler plugin.\n * If nothing is defined, defaults to [`kotlin.assert`][assert].\n *\/\n val functions: SetProperty = objectFactory.setProperty(String::class.java).convention(setOf(\"kotlin.assert\"))\n\n \/**","completion":"* Defines the Kotlin SourceSets by name which will be transformed by the Power-Assert compiler plugin.\n * When the provider returns `null` - which is the default - all test SourceSets will be transformed.\n *\/\n val includedSourceSets: SetProperty = objectFactory.setProperty(String::class.java).convention(emptySet())\n}<|endoftext|>"} {"prompt":"val i: Int? = null\n instance.method(i)\n\n val s: String? = null\n instance.method(s)\n\n val b: Boolean? = null","completion":"instance.method(b)\n\n instance.method(null)\n}\n\n\/\/ FILE: annotations.xml\n\n <|endoftext|>"} {"prompt":"if (upperBounds.size < 2) {\n return true\n }\n\n val typeArgumentMapping = collectTypeArgumentMapping(upperBounds)\n for ((typeParameter, boundTypeArguments) in typeArgumentMapping) {\n if (!boundTypeArguments.isCompatible) {\n return false\n }\n\n checkedTypeParameters.add(typeParameter)","completion":"if (!areBoundsCompatible(boundTypeArguments.upper, boundTypeArguments.lower, checkedTypeParameters)) {\n return false\n }\n }\n\n return true\n }\n\n private fun collectTypeArgumentMapping(upperBounds: Set): Map {<|endoftext|>"} {"prompt":"final override fun iterator(): Iterator = ULongProgressionIterator(first, last, step)\n\n \/** \n * Checks if the progression is empty.\n \n * Progression with a positive step is empty if its first element is greater than the last element.\n * Progression with a negative step is empty if its first element is less than the last element.\n *\/","completion":"public open fun isEmpty(): Boolean = if (step > 0) first > last else first < last\n\n override fun equals(other: Any?): Boolean =\n other is ULongProgression && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last && step == other.step)\n\n override fun hashCode(): Int =<|endoftext|>"} {"prompt":".use { output ->\n javaClass.classLoader.getResourceAsStream(\"StringFactory.class\")!!\n .use { it.copyTo(output) }\n }\n }\n\n for (element in roundEnv.getElementsAnnotatedWith(SomeAnnotation::class.java)) {\n val packageName = processingEnv.elementUtils.getPackageOf(element).qualifiedName","completion":"val name = \"Generated${element.simpleName}\"\n val file = processingEnv.filer.createResource(\n StandardLocation.SOURCE_OUTPUT,\n packageName,\n \"$name.kt\",\n element\n )\n processingEnv.messager.printMessage(Diagnostic.Kind.NOTE, \"Writing $name\")\n file.openWriter().use { writer -><|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.types.FirTypeRef\nimport org.jetbrains.kotlin.lexer.KtKeywordToken\nimport org.jetbrains.kotlin.lexer.KtModifierKeywordToken\nimport org.jetbrains.kotlin.metadata.deserialization.VersionRequirement","completion":"import org.jetbrains.kotlin.name.CallableId\nimport org.jetbrains.kotlin.name.ClassId\nimport org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.psi.KtExpression<|endoftext|>"} {"prompt":"val psiFiles = ktTestModule.files\n for (psiFile in psiFiles) {\n val targetOffset = testServices.expressionMarkerProvider.getCaretPositionOrNull(psiFile)\n if (targetOffset != null) {\n if (psiDeclaration != null) error(\"Only one target method is expected\")","completion":"psiDeclaration = psiFile.findElementAt(targetOffset)?.parentsWithSelf?.find { it is PsiMethod || it is PsiVariable }\n }\n\n val useSiteOffset = testServices.expressionMarkerProvider.getCaretPositionOrNull(psiFile, caretTag = \"useSite\")\n if (useSiteOffset != null) {<|endoftext|>"} {"prompt":"if (false || false || a == z && b === z) {\n kotlin.Unit) -> kotlin.Unit)?\")!>a","completion":" kotlin.Unit)?\")!>b\n kotlin.Unit) -> kotlin.Unit)?\")!>a.equals(null)<|endoftext|>"} {"prompt":"public inline fun Array.map(transform: (T) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n\/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n *\/","completion":"public inline fun ByteArray.map(transform: (Byte) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n\/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n *\/<|endoftext|>"} {"prompt":"package org.jetbrains.kotlinx.serialization.compiler.fir.checkers\n\nimport com.intellij.psi.PsiElement\nimport org.jetbrains.kotlin.diagnostics.*\nimport org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.types.ConeKotlinType\nimport org.jetbrains.kotlin.psi.KtAnnotationEntry<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.backend.jvm.ir.isWithFlexibleNullability\nimport org.jetbrains.kotlin.ir.IrBuiltIns\nimport org.jetbrains.kotlin.ir.types.IrSimpleType\nimport org.jetbrains.kotlin.ir.types.IrType","completion":"import org.jetbrains.kotlin.ir.types.IrTypeSystemContext\nimport org.jetbrains.kotlin.types.model.FlexibleTypeMarker\nimport org.jetbrains.kotlin.types.model.KotlinTypeMarker\nimport org.jetbrains.kotlin.types.model.SimpleTypeMarker<|endoftext|>"} {"prompt":"val memoizedFunctionLambda = createMemoizedFunction","completion":"{ it.foo()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.psi.psiUtil.visibilityModifier\nimport org.jetbrains.kotlin.resolve.BindingContext.*\nimport org.jetbrains.kotlin.resolve.DescriptorUtils.classCanHaveAbstractDeclaration\nimport org.jetbrains.kotlin.resolve.DescriptorUtils.classCanHaveOpenMembers","completion":"import org.jetbrains.kotlin.resolve.calls.results.TypeSpecificityComparator\nimport org.jetbrains.kotlin.resolve.checkers.PlatformDiagnosticSuppressor\nimport org.jetbrains.kotlin.resolve.descriptorUtil.builtIns\nimport org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal<|endoftext|>"} {"prompt":"if (!(element0 !in 1uL until 3uL) != range0.contains(element0)) throw AssertionError()\n}\n\nfun testR0xE1() {\n \/\/ with possible local optimizations\n if (1uL in 1uL until 3uL != range0.contains(1uL)) throw AssertionError()","completion":"if (1uL !in 1uL until 3uL != !range0.contains(1uL)) throw AssertionError()\n if (!(1uL in 1uL until 3uL) != !range0.contains(1uL)) throw AssertionError()<|endoftext|>"} {"prompt":"public public fun z(): Int = 1\n }\n}\n\npublic public val bar: Int = 1\n\npublic public fun foo(): Int = 1\n\nfun test() {","completion":"public public class B(public public val z: Int = 1) {\n public public val y: Int = 2\n\n public val x: Int<|endoftext|>"} {"prompt":"cHeaderBridges = exportResultsPath.resolve(\"result.h\"),\n )\n val swiftExportConfig = SwiftExportConfig(\n settings = mapOf(\n SwiftExportConfig.BRIDGE_MODULE_NAME to SwiftExportConfig.DEFAULT_BRIDGE_MODULE_NAME,\n SwiftExportConfig.STABLE_DECLARATIONS_ORDER to \"true\",\n ),","completion":"logger = createDummyLogger()\n )\n runSwiftExport(swiftExportInput, swiftExportConfig, swiftExportOutput)\n return swiftExportOutput\n }\n\n private fun compileSwiftModule(\n swiftModuleName: String,\n sources: List,\n moduleMap: File,\n binaryLibrary: TestCompilationArtifact.BinaryLibrary,<|endoftext|>"} {"prompt":"\/\/ test.kt:10 box: $completion:kotlin.coroutines.Continuation=Generated_Box_MainKt$main$1, $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$baz\\1\\30:int=0:int,","completion":"$i$f$foo\\2\\115:int=0:int<|endoftext|>"} {"prompt":"if (this.b != null) this.b.propNullableAny\n if (this.b != null) this.b.funT()","completion":"if (this.b != null) this.b.funAny()\n if (this.b != null) this.b.funNullableT()<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\n\/\/ WITH_REFLECT\n\/\/ FILE: test.kt\n\nfun test2() {\n}\n\n\/\/ FILE: main.kt\n\/\/ See KT-10690 Exception in kotlin.reflect when trying to get kotlinFunction from javaMethod\n\nimport kotlin.reflect.jvm.javaMethod\nimport kotlin.reflect.jvm.kotlinFunction","completion":"fun box(): String {\n if (::box.javaMethod?.kotlinFunction == null)\n return \"Fail box\"\n if (::test1.javaMethod?.kotlinFunction == null)\n return \"Fail test1\"\n if (::test2.javaMethod?.kotlinFunction == null)\n return \"Fail test2\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"checkAnswers(::expm1, arguments, answers, true)\n }\n \n @Test\n fun testLog() {\n val answers = arrayOf(\n 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL,","completion":"0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, \n 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL,<|endoftext|>"} {"prompt":"suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c ->\n computesNext = false\n computeContinuation = c\n nextStep!!.resume(Unit)\n COROUTINE_SUSPENDED\n }\n\n suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c ->\n computesNext = true\n computeContinuation = c","completion":"nextStep!!.resume(Unit)\n COROUTINE_SUSPENDED\n }\n\n @Suppress(\"UNCHECKED_CAST\")\n fun resumeIterator(exception: Throwable?) {\n if (exception != null) {\n done()\n computeContinuation!!.resumeWithException(exception)\n return\n }\n if (computesNext) {<|endoftext|>"} {"prompt":"firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.CannotWeakenAccessPrivilegeWarning\n\ninternal class CannotChangeAccessPrivilegeImpl(\n override val overridingVisibility: Visibility,","completion":"override val overridden: KtCallableSymbol,\n override val containingClassName: Name,\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.CannotChangeAccessPrivilege<|endoftext|>"} {"prompt":"b[3] = 4\n +b\n}\n\n\/\/ FILE: TestCase4.kt\n\/*\n * TESTCASE NUMBER: 4\n * NOTE: Operator-form assignments\n *\/\npackage testPackCase4\nclass Assign() {\n operator fun invoke(i: Int) {}","completion":"}\n\nclass B(val minusAssign: Assign = Assign()) {\n val plusAssign = Assign()\n}\n\nfun case3() {\n var b = B()\n b += 2\n b -= 3\n}<|endoftext|>"} {"prompt":"block(x, y)\n }\n }\n }\n}\n\nclass Color(r: Int, g: Int, b: Int) : ColorLike {\n override val red: Int = r\n override val green: Int = g\n override val blue: Int = b\n}\n\ninterface ColorLike {\n val red: Int;\n val green: Int;\n val blue: Int;","completion":"}\n\nfun box(): String {\n val d = Data(Array(4) { 0 }, 1, 1)\n if (d[0, 0].red != 0) {\n return \"fail1\"\n }\n if (d[0, 0].green != 0) {\n return \"fail2\"\n }\n if (d[0, 0].blue != 0) {\n return \"fail3\"<|endoftext|>"} {"prompt":"constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Int32Array, offset: Int = definedExternally)","completion":"fun set(array: JsArray, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Int32Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"UNUSED_PARAMETER\")<|endoftext|>"} {"prompt":"override fun visitBlock(x: JsBlock) {\n if (blockStack.isNotEmpty()) {\n blockParents[x] = currentBlock\n }\n blockStack += x\n super.visitBlock(x)\n blockStack.removeLast()\n }\n\n override fun visit(x: JsVars.JsVar) {","completion":"if (x.initExpression == null && x.synthetic) {\n varWithoutInitDeclarations += x.name\n }\n super.visit(x)\n }\n\n override fun visitVars(x: JsVars) {\n if (x.synthetic) {\n for (variable in x) {\n if (variable.initExpression == null) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.services.TestServices\nimport org.jetbrains.kotlin.test.services.assertions\n\nabstract class AbstractIsSubclassOfTest : AbstractAnalysisApiBasedTest() {\n override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {","completion":"val subClass = testServices.expressionMarkerProvider.getElementOfTypeAtCaret(mainFile, \"sub\")\n val superClass = testServices.expressionMarkerProvider.getElementOfTypeAtCaret(mainFile, \"super\")\n\n val actual = executeOnPooledThreadInReadAction {\n analyseForTest(subClass) {<|endoftext|>"} {"prompt":"var i = when(d) {\n 3 -> null\n 4 -> { val z = 23 }\n else -> z = 20\n }\n\n var u = when(d) {\n 3 -> { z = 34 }","completion":"else -> z--\n }\n\n var iff = if (true) {\n z = 34\n }\n val g = if (true) 4<|endoftext|>"} {"prompt":"if (isCollection)\n \/\/ (Mutable)Collection!\n if (lowerBound.isMarkedNullable != upperBound.isMarkedNullable)\n lowerBound.makeNullableAsSpecified(!preferNotNull)\n else\n lowerBound\n else\n if (this is RawType && preferStarForRaw) upperBound.makeNullableAsSpecified(!preferNotNull)","completion":"else\n if (preferNotNull) lowerBound else upperBound\n\n approximation = approximation.approximateNonDynamicFlexibleTypes()\n\n approximation = if (nullability() == TypeNullability.NOT_NULL) approximation.makeNullableAsSpecified(false) else approximation\n\n if (approximation.isMarkedNullable && !lowerBound<|endoftext|>"} {"prompt":"g.funNullableAny()\n }\n }\n }\n }\n }\n }\n }\n}\n\n\/\/ TESTCASE NUMBER: 3\nfun case_3(a: Inv?) {\n if (a != null) {","completion":"val b = a\n if (a == null)\n ? & kotlin.Nothing\")!>b<|endoftext|>"} {"prompt":", kotlin.Unit>? & kotlin.Function1, kotlin.Unit>\")!>a.funT()","completion":", kotlin.Unit>? & kotlin.Function1, kotlin.Unit>\")!>a.funAny()<|endoftext|>"} {"prompt":"val x1 = C(A(Test.id(x0)), B(), B())\n val x2 = C(Test.id(A(1)), B(), B())\n , B, B>\")!>x1","completion":"..A?), B, B>\")!>x2\n\n val result_5 = select(x1, x2)<|endoftext|>"} {"prompt":"diagnosticHolder.report(ErrorsParcelize.PARCELABLE_CONSTRUCTOR_PARAMETER_SHOULD_BE_VAL_OR_VAR.on(reportElement))\n }\n\n val descriptor = typeMapper.bindingContext[BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, parameter] ?: return\n\n \/\/ Don't check parameters which won't be serialized","completion":"if (descriptor.annotations.any { it.fqName in IGNORED_ON_PARCEL_FQ_NAMES }) {\n return\n }\n\n val type = descriptor.type\n if (!type.isError) {\n val customParcelerTypes =<|endoftext|>"} {"prompt":"override fun first(): Any {\n return 1\n }\n override fun remove(element: Any): Boolean {\n return true\n }\n}\n\nabstract class C : SortedSet, ArrayList() {\n override fun spliterator(): Spliterator {\n TODO(\"Not yet implemented\")\n }\n}","completion":"fun test(a: A, b: B, c: C) {\n a.size\n a.first()\n a.last()\n a.add(1)\n a.add(null)\n a.remove(1)\n a.remove(null)\n a.spliterator()\n\n b.size\n b.first()\n b.last()\n b.add(1)<|endoftext|>"} {"prompt":"override fun record(slice: WritableSlice, key: K, value: V) {\n storageManager.compute { trace.record(slice, key, value) }\n }\n\n override fun record(slice: WritableSlice, key: K) {","completion":"storageManager.compute { trace.record(slice, key) }\n }\n\n override fun get(slice: ReadOnlySlice, key: K): V? = storageManager.compute { trace.get(slice, key) }<|endoftext|>"} {"prompt":"val value_3 = \"$ 10\"\n val value_4 = \"${}\"\n val value_5 = + \" 11...\" + + \"1\"\n val value_6 = ","completion":"if (value_1 != 10) return null\n if (value_2 != 9) return null\n if (value_3 != \". 10\") return null\n if (value_4 != \".\") return null\n if (value_5 != \". 11....1\") return null\n if (value_6 != 10) return null\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"val propertyType = codegen.typeMapper.mapType(property.type)\n callReadProperty(expressionCodegen, property, propertyType, index, inputVar, descVar, propVar)\n propVar += propertyType.size\n }\n \/\/ set all bit masks to true\n for (maskVar in bitMaskBase until propsStartVar) {\n iconst(Int.MAX_VALUE)","completion":"store(maskVar, OPT_MASK_TYPE)\n }\n \/\/ go to end\n goTo(readEndLabel)\n \/\/ branch with decodeSequentially = false\n \/\/ readElement: int index = input.readElement(classDesc)\n visitLabel(readElementLabel)\n load(inputVar, kInputType)\n load(descVar, descType)\n invokeinterface(<|endoftext|>"} {"prompt":"fun toImmutableModifiers() = CirFunctionModifiers.createInterned(\n isOperator = isOperator,\n isInfix = isInfix,\n isInline = isInline,\n isSuspend = isSuspend,\n )\n }\n\n private lateinit var modifiers: MutableModifiers\n\n override fun commonizationResult() = modifiers.toImmutableModifiers()","completion":"override fun initialize(first: CirFunctionModifiers) {\n modifiers = MutableModifiers(first)\n }\n\n override fun doCommonizeWith(next: CirFunctionModifiers): Boolean {\n if (modifiers.isSuspend != next.isSuspend)\n return false\n\n modifiers.isOperator = modifiers.isOperator && next.isOperator<|endoftext|>"} {"prompt":"table.forEachDeclarationSymbol(block)\n\n scriptSlice.forEachSymbol { block(it) }\n classSlice.forEachSymbol { block(it) }\n constructorSlice.forEachSymbol { block(it) }\n enumEntrySlice.forEachSymbol { block(it) }\n fieldSlice.forEachSymbol { block(it) }","completion":"functionSlice.forEachSymbol { block(it) }\n propertySlice.forEachSymbol { block(it) }\n typeAliasSlice.forEachSymbol { block(it) }\n globalTypeParameterSlice.forEachSymbol { block(it) }\n }\n\n @OptIn(DelicateSymbolTableApi::class)<|endoftext|>"} {"prompt":"private abstract class PlatformDependentTypeWithSingleArgumentCommonizer(\n classifiers: CirKnownClassifiers,\n private val typeArgumentListCommonizer: TypeArgumentListCommonizer,\n intPlatformId: CirEntityId,\n longPlatformId: CirEntityId,\n private val mixedPlatformId: CirEntityId,","completion":") : PlatformDependentTypeCommonizer(classifiers, intPlatformId, longPlatformId, mixedPlatformId) {\n\n override fun doCommonize(values: List): CirClassOrTypeAliasType? {\n val commonTypeArgument = typeArgumentListCommonizer.commonize(values.map { it.arguments })?.singleOrNull()\n ?: return null<|endoftext|>"} {"prompt":"import java.io.File\n\ninterface TargetableExternalStorage {\n fun targetString(key: String): String?\n fun targetList(key: String): List\n fun hostString(key: String): String?\n fun hostList(key: String): List\n fun hostTargetString(key: String): String?\n fun hostTargetList(key: String): List","completion":"fun absolute(value: String?): String\n fun downloadDependencies()\n}\n\nabstract class KonanPropertiesLoader(\n override val target: KonanTarget,\n val properties: Properties,\n private val dependenciesRoot: String?,\n private val host: KonanTarget = HostManager.host,\n private val progressCallback: ProgressCallback,\n) : Configurables {<|endoftext|>"} {"prompt":"\/\/ We need to defer the construction of the create method, since it may refer to the [Parcelable.Creator]\n \/\/ instances in other @Parcelize classes in the current module, which may not exist yet.\n defer {\n body = androidSymbols.createBuilder(symbol).run {\n irExprBody(\n when {\n parcelerObject != null ->","completion":"parcelerCreate(parcelerObject, parcelParameter)\n\n parcelableProperties.isNotEmpty() ->\n irCall(declaration.primaryConstructor!!).apply {\n for ((index, property) in parcelableProperties.withIndex()) {\n putValueArgument(index, readParcelWith(property.parceler, parcelParameter))\n }\n }<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1289\npackage foo\n\nopen class A(val a: Int = 1, val b: Int = 2)\n\nclass B : A(b = 3)\n\nfun box(): String {\n val b = B()\n if (b.a != 1) return \"b.a != 1, it: ${b.a}\"","completion":"if (b.b != 3) return \"b.a != 3, it: ${b.b}\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"private fun getActualSortedDiagnosticDescriptors(diagnostics: Collection) =\n getSortedDiagnosticDescriptors(diagnostics, emptyList()).filterIsInstance(ActualDiagnosticDescriptor::class.java)\n\n private fun getSortedDiagnosticDescriptors(\n diagnostics: Collection,","completion":"uncheckedDiagnostics: Collection\n ): List {\n val validDiagnostics = diagnostics.filter { actualDiagnostic -> actualDiagnostic.diagnostic.isValid }\n val diagnosticDescriptors = groupDiagnosticsByTextRange(validDiagnostics, uncheckedDiagnostics)<|endoftext|>"} {"prompt":"fun factoryForVariable(stripExplicitReceiver: Boolean): CandidateFactory\n\n \/\/ foo() -> ReceiverValue(foo), context for invoke\n \/\/ null means that there is no invoke on variable\n fun factoryForInvoke(variable: C, useExplicitReceiver: Boolean): Pair>?\n}\n\nsealed class TowerData {","completion":"object Empty : TowerData()\n class OnlyImplicitReceiver(val implicitReceiver: ReceiverValueWithSmartCastInfo) : TowerData()\n class TowerLevel(val level: ScopeTowerLevel) : TowerData()\n class BothTowerLevelAndImplicitReceiver(val level: ScopeTowerLevel, val implicitReceiver: ReceiverValueWithSmartCastInfo) : TowerData()<|endoftext|>"} {"prompt":"fun main3() = if (true) { Foo::minus } else { Foo::times }","completion":"fun main4() = try { Foo::minus } finally { Foo::times }\n\nfun main5() = Foo::minus ?: Foo::times<|endoftext|>"} {"prompt":"val initialEdges = edges(this)\n\n val resolveDequeue = if (initialEdges is Collection && initialEdges.isEmpty()) return emptySequence()\n else createDequeue()\n\n return sequence {\n val results = HashSet()\n results.add(this@closureSequence)\n\n initialEdges.forEach { initialEdge ->","completion":"if (results.add(initialEdge)) {\n yield(initialEdge)\n resolveDequeue.add(initialEdge)\n }\n }\n\n while (resolveDequeue.isNotEmpty()) {\n edges(resolveDequeue.removeAt(0)).forEach { edge ->\n if (results.add(edge)) {\n yield(edge)<|endoftext|>"} {"prompt":"\/\/ ISSUE: KT-58013\n\/\/ WITH_REFLECT\n\/\/ FIR_DUMP\n\nimport kotlin.reflect.KProperty\n\ndata class Ref(val t: D)\n\nclass GenericDelegate(val value: G)","completion":"operator fun Ref.provideDelegate(a: Any?, p: KProperty<*>): GenericDelegate = GenericDelegate(this.t)\n\noperator fun GenericDelegate.getValue(a: Any?, p: KProperty<*>): W = this.value<|endoftext|>"} {"prompt":"@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray {\n System.arraycopy(this, startIndex, destination, destinationOffset, endIndex - startIndex)\n return destination\n}\n\n\/**","completion":"* Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.<|endoftext|>"} {"prompt":"val argument = when (type) {\n is CirProvided.TypeParameterType -> expansion.arguments[type.index]\n is CirProvided.TypeAliasType -> {\n val substitutedType = expandTypeAliasType(expansion, type)\n CirRegularTypeProjection(projection.variance, substitutedType)\n }\n is CirProvided.ClassType -> {","completion":"val substitutedType = expandClassType(expansion, type)\n CirRegularTypeProjection(projection.variance, substitutedType)\n }\n }\n\n return when (argument) {\n is CirStarTypeProjection -> CirStarTypeProjection\n is CirRegularTypeProjection -> {\n val argumentType = argument.type as CirSimpleType\n\n val resultingVariance = run {<|endoftext|>"} {"prompt":"override fun containsAll(elements: Collection): Boolean {\n for (element in elements) {\n if (!contains(element)) return false\n }\n return true\n }\n\n override fun isEmpty() = size == 0\n\n override fun iterator(): Iterator = array.iterator()\n}\n\n\/**","completion":"* A simple polyfill. We don't need fancy hashmaps, since we don't deal with many values in the helpers.\n *\/\nprivate class ArrayMap(private val array: Array>): Map {\n\n private class Entry(override val key: Key, override val value: Value) : Map.Entry<|endoftext|>"} {"prompt":"val res = context.evaluationConfiguration.with {\n providedProperties.put(mapOf(scriptFileLocationVariable to scriptFileLocation))\n }\n return res.asSuccess()\n}\n\nfun configureScriptFileLocationPathVariablesForCompilation(context: ScriptConfigurationRefinementContext): ResultWithDiagnostics {","completion":"val scriptFile = (context.script as? FileBasedScriptSource)?.file ?: return context.compilationConfiguration.asSuccess()\n val scriptFileLocationVariableName = context.compilationConfiguration[ScriptCompilationConfiguration.scriptFileLocationVariable]\n ?: SCRIPT_FILE_LOCATION_DEFAULT_VARIABLE_NAME\n\n return ScriptCompilationConfiguration(context.compilationConfiguration) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.KCLASS_WITH_NULLABLE_TYPE_PARAMETER_IN_SIGNATURE\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.LATEINIT_FIELD_IN_VAL_PROPERTY","completion":"import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.LATEINIT_INTRINSIC_CALL_IN_INLINE_FUNCTION\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.LATEINIT_INTRINSIC_CALL_ON_NON_ACCESSIBLE_PROPERTY<|endoftext|>"} {"prompt":"implicitReceiverStack.replaceReceiverType(receiverIndex, smartCastedType)\n }\n }\n }\n }\n\n val towerDataContextSnapshot = context.towerDataContext.createSnapshot(keepMutable = true)\n\n for ((index, oldType) in oldReceiverTypes) {\n implicitReceiverStack.replaceReceiverType(index, oldType)\n }","completion":"return Context(towerDataContextSnapshot, smartCasts)\n }\n\n private fun getClosestControlFlowNode(fir: FirElement): CFGNode<*>? {\n val selfNode = getControlFlowNode(fir)\n if (selfNode != null) {\n return selfNode\n }<|endoftext|>"} {"prompt":"assertFalse(eqDoubleQDoubleQ(null, 0.toDouble()))\n assertFalse(eqDoubleQDoubleQ(null, 1.toDouble()))\n assertTrue(eqDoubleQDoubleQ(null, null))\n assertTrue(eqDoubleQDoubleQ(null, undefined))\n assertFalse(eqDoubleQDoubleQ(undefined, 0.toDouble()))","completion":"assertFalse(eqDoubleQDoubleQ(undefined, 1.toDouble()))\n assertTrue(eqDoubleQDoubleQ(undefined, null))\n assertTrue(eqDoubleQDoubleQ(undefined, undefined))\n assertTrue(eqDoubleLong(0.toDouble(), 0.toLong()))\n assertFalse(eqDoubleLong(0.toDouble(), 1.toLong()))<|endoftext|>"} {"prompt":"abstract class AbstractAnalysisApiSpecificAnnotationOnDeclarationTest : AbstractAnalysisApiBasedTest() {\n override fun configureTest(builder: TestConfigurationBuilder) {\n super.configureTest(builder)\n builder.useDirectives(Directives)\n }\n\n override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {","completion":"val ktDeclaration = testServices.expressionMarkerProvider.getElementOfTypeAtCaret(mainFile)\n val classIdString = mainModule.testModule.directives.singleValue(Directives.CLASS_ID)\n\n val actual = analyseForTest(ktDeclaration) {\n val declarationSymbol = ktDeclaration.getSymbol() as KtAnnotatedSymbol<|endoftext|>"} {"prompt":"@file:Suppress(\"PackageDirectoryMismatch\")\n\npackage org.jetbrains.kotlin.util.capitalizeDecapitalize\n\n\/**\n * \"FooBar\" -> \"fooBar\"\n * \"FOOBar\" -> \"fooBar\"\n * \"FOO\" -> \"foo\"\n * \"FOO_BAR\" -> \"foO_BAR\"\n *\/","completion":"fun String.decapitalizeSmartForCompiler(asciiOnly: Boolean = false): String {\n if (isEmpty() || !isUpperCaseCharAt(0, asciiOnly)) return this\n\n if (length == 1 || !isUpperCaseCharAt(1, asciiOnly)) {<|endoftext|>"} {"prompt":"* Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n *","completion":"* @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n *\/\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\nimport kotlin.collections.AbstractIterator\n\nclass MyIterator : AbstractIterator() {\n var i = 0\n public override fun computeNext() {\n if(i < 5)\n setNext((i++).toString())\n }\n\n}\n\nfun box() : String {\n var k = \"\"\n for (x in MyIterator()) {\n k+=x","completion":"}\n return if(k==\"01234\") \"OK\" else k\n}<|endoftext|>"} {"prompt":"\/\/ 4. Generate nested classes at the end, to ensure that when the companion's metadata is serialized\n \/\/ everything moved to the outer class has already been recorded in `globalSerializationBindings`.\n for (declaration in irClass.declarations) {\n if (declaration is IrClass) {\n getOrCreate(declaration, context).generate()\n }\n }","completion":"object : AnnotationCodegen(this@ClassCodegen) {\n override fun visitAnnotation(descr: String, visible: Boolean): AnnotationVisitor {\n return visitor.visitor.visitAnnotation(descr, visible)\n }\n }.genAnnotations(irClass, null, null)\n\n AnnotationCodegen.genAnnotationsOnTypeParametersAndBounds(\n context,<|endoftext|>"} {"prompt":"x.propT\n x.propAny","completion":"x.propNullableT\n x.propNullableAny<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH","completion":"import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.DELEGATE_USES_EXTENSION_PROPERTY_TYPE_PARAMETER\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.DELEGATION_IN_INTERFACE<|endoftext|>"} {"prompt":"report: MultiFileClassPartMetadataReport,\n ) {\n val value1 = getProperty(metadata1)\n val value2 = getProperty(metadata2)\n if (!areEqual(value1, value2)) {\n report.addPropertyDiff(NamedDiffEntry(name, value1, value2))\n }\n }\n}","completion":"fun multiFileClassPartMetadataPropertyChecker(name: String, propertyGetter: (KotlinClassMetadata.MultiFileClassPart) -> String) =\n object : MultiFileClassPartMetadataPropertyChecker(name) {\n override fun getProperty(node: KotlinClassMetadata.MultiFileClassPart) = propertyGetter(node)\n }<|endoftext|>"} {"prompt":"* Exposes the JavaScript [Uint16Array](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/Uint16Array) to Kotlin\n *\/\npublic external open class Uint16Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Uint16Array)\n constructor(array: Array)","completion":"constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Uint16Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)<|endoftext|>"} {"prompt":"}\n\nopen class ClashnameClass(val str: String)\ninterface ClashnameProtocol {\n val str: String\n}\ndata class ClashnameParam(val str: String)\n\nclass GenExClash(val myT:ValuesGenericsSomeData):GenBase(SomeData(55))\n\nclass SelfRef : GenBasic()","completion":"open class GenBasic()\n\n\/\/Extensions\nfun GenNonNull.foo(): T = arg\n\nclass StarProjectionInfiniteRecursion>\n\nfun testStarProjectionInfiniteRecursion(x: StarProjectionInfiniteRecursion<*>) {}<|endoftext|>"} {"prompt":"for (x in xs) {\n println(x)\n updateXs()\n }\n}\n\nfun testArrayCapturedInLabmda() {\n var xs = arrayOf(\"a\", \"b\", \"c\")\n\n val updateXs = { xs = arrayOf(\"d\", \"e\", \"f\") }\n\n for (x in xs) {\n println(x)","completion":"updateXs()\n }\n}\n\nfun testArrayCapturedInInlineLambda() {\n var xs = arrayOf(\"a\", \"b\", \"c\")\n\n for (x in xs) {\n println(x)\n run {\n xs = arrayOf(\"d\", \"e\", \"f\")\n }\n }\n}\n\nfun testArrayCapturedInLocalObject() {<|endoftext|>"} {"prompt":"findFileInDirectory(descriptor.dataManager.dataPaths.dataStorageRoot, \"jvm-build-meta-info.txt\")!!.also { kotlinDataPaths.add(it) }\n\n dirToCopyKotlinCaches.deleteRecursively()\n val originalStorageRoot = descriptor.dataManager.dataPaths.dataStorageRoot","completion":"for (kotlinCacheRoot in kotlinDataPaths) {\n val relativePath = kotlinCacheRoot.relativeTo(originalStorageRoot).path\n val targetDir = dirToCopyKotlinCaches.resolve(relativePath)\n targetDir.parentFile.mkdirs()\n kotlinCacheRoot.copyRecursively(targetDir)\n }\n }<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1292\npackage foo\n\n\/\/ CHECK_CONTAINS_NO_CALLS: capturedInLambda except=Unit_getInstance\n\/\/ CHECK_CONTAINS_NO_CALLS: declaredInLambda except=Unit_getInstance\n\ninternal data class State(var count: Int = 0)","completion":"internal inline fun repeatAction(times: Int, action: () -> Unit) {\n for (i in 1..times) {\n action()\n }\n}\n\n\/\/ CHECK_BREAKS_COUNT: function=capturedInLambda count=0 TARGET_BACKENDS=JS_IR<|endoftext|>"} {"prompt":"list2.add(i)\n if (list2.size > 23) break\n }\n if (list2 != listOf()) {\n return \"Wrong elements for 1u.toUShort()..MinUS step 3: $list2\"\n }\n\n val list3 = ArrayList()\n val range3 = 1u..MinUI step 3","completion":"for (i in range3) {\n list3.add(i)\n if (list3.size > 23) break\n }\n if (list3 != listOf()) {\n return \"Wrong elements for 1u..MinUI step 3: $list3\"\n }\n\n val list4 = ArrayList()\n val range4 = 1uL..MinUL step 3<|endoftext|>"} {"prompt":"private const val specNameKey = \"name\"\n private const val specVersionKey = \"version\"\n private const val vendoredLibrary = \"vendored_library\"\n private const val vendoredLibraries = \"vendored_libraries\"\n private const val vendoredFrameworks = \"vendored_frameworks\"\n private const val podspecValueIndent = 24","completion":"private val vendoredKeys = listOf(vendoredLibrary, vendoredLibraries, vendoredFrameworks)\n }\n}<|endoftext|>"} {"prompt":"override fun render(builder: StringBuilder, indent: String) {\n builder.append(\"$indent$text\\n\")\n }\n}\n\nabstract class Tag(val name: String) : Element() {\n val children = ArrayList()\n val attributes = HashMap()","completion":"protected fun initTag(tag: T, init: T.() -> Unit): T {\n tag.init()\n children.add(tag)\n return tag\n }\n\n override fun render(builder: StringBuilder, indent: String) {\n builder.append(\"$indent<$name${renderAttributes()}>\\n\")\n for (c in children) {<|endoftext|>"} {"prompt":"}\n }\n\n val f_sortedArray = fn(\"sortedArray()\") {\n include(InvariantArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned)\n exclude(PrimitiveType.Boolean)\n } builder {\n doc {\n \"Returns an array with all elements of this array sorted according to their natural sort order.\"\n }","completion":"specialFor(InvariantArraysOfObjects) {\n appendStableSortNote()\n }\n typeParam(\"T : Comparable\")\n returns(\"SELF\")\n body {\n \"\"\"\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n \"\"\"\n }\n }<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1285\npackage foo\n\nfun box(): String {\n\n assertEquals('A', 'A'.toChar(), \"toChar\")\n assertEquals(65, 'A'.toInt(), \"toInt\")\n assertEquals(65.toShort(), 'A'.toShort(), \"toShort\")","completion":"assertEquals(65.toByte(), 'A'.toByte(), \"toByte\")\n assertEquals(65.0, 'A'.toDouble(), \"toDouble\")\n assertEquals(65.0f, 'A'.toFloat(), \"toFloat\")\n assertEquals(65L, 'A'.toLong(), \"toLong\")\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"assertEquals(listOf(1u, 3u, 5u, 7u, 9u), uintList)\n\n val ulongList = mutableListOf()\n for (i in 1uL..10uL step 3L step 2L) {\n ulongList += i\n }","completion":"assertEquals(listOf(1uL, 3uL, 5uL, 7uL, 9uL), ulongList)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"}\n visitor.accept(root)\n}\n\n\/\/ Get KType from expression or from staticRef of referenced name.\n\/\/ kType metadata is set on jsClass expressions.\n\/\/ There can be a chain of local variables from jsClass to its usage.\n\/\/ This methods uses staticRef to find the original expression with kType metadata.\nprivate fun getTransitiveKType(e: JsExpression): JsExpression? {","completion":"return when {\n e.kType != null ->\n e.kType\n\n e is JsNameRef -> {\n val staticRef = e.name?.staticRef as? JsExpression ?: return null\n getTransitiveKType(staticRef)\n }\n\n else -> null\n }\n}\n\nprivate fun JsExpression.checkNoInvocationsWithRecursiveKType() {<|endoftext|>"} {"prompt":"\/\/ CHECK_BREAKS_COUNT: function=test2 count=1 TARGET_BACKENDS=JS\n\/\/ CHECK_BREAKS_COUNT: function=test2 count=0 IGNORED_BACKENDS=JS\n\/\/ CHECK_IF_COUNT: function=test2 count=0\n\nfun test1(v: Int) {\n when (v) {\n 1, 2 -> Unit\n }","completion":"}\n\nfun test2(v: Int) {\n loop@ while(true) {\n when (v) {\n 1, 2 -> break@loop\n }\n }\n}\n\nfun box(): String {\n test1(1)\n test2(1)\n return \"OK\"\n}<|endoftext|>"} {"prompt":"fun neOk11(i: InvI>)\n fun neOk12(i: InvO>)","completion":"fun neOk30(i: Pair, >)\n fun neOk31(i: Pair<O, Inv>)<|endoftext|>"} {"prompt":"): Collection = mutableListOf().apply {\n getConstructorsTo(\n this,\n unsubstitutedScope(\n session,\n scopeSession,\n withForcedTypeCalculator = false,\n memberRequiredPhase = FirResolvePhase.STATUS,\n )\n )\n }","completion":"private fun getConstructorsTo(destination: MutableList, scope: FirTypeScope) {\n scope.getDeclaredConstructors().mapTo(destination) { it }\n }\n\n private fun FirTypeScope.getMembersTo(destination: MutableList>, name: Name) {<|endoftext|>"} {"prompt":"* HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses\n *\/\n\n\/*\n * TESTCASE NUMBER: 1\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-22379\n *\/\nfun case_1() {\n var x: String? = \"...\"\n while (x!!.length > 1) {\n x = null\n break","completion":"}\n x\n x.length\n}\n\n\/*\n * TESTCASE NUMBER: 3<|endoftext|>"} {"prompt":"if (!s.equals(TestKt.expected)) throw new IllegalStateException(s);\n return mock;\n }\n}\n\n\/\/ FILE: test.kt\n\ninline fun mock(s: String = \"\"): T = MOCK as T\n\nval MOCK = {}\n\ninline fun inOrder(\n vararg mocks: Any,\n evaluation: InOrder.() -> Unit","completion":") {\n inOrder.evaluation()\n InOrder().evaluation()\n}\n\nval inOrder = object : InOrder() {\n override fun verify(mock: T): T {\n val s = mock!!.javaClass.toString()\n if (s != expected) throw IllegalStateException(s)\n return mock\n }\n}\n\nlateinit var expected: String<|endoftext|>"} {"prompt":"type.isError || !sizeIsEqual\n }\n\n return psiTypeArguments.indices.map { index: Int ->\n \/\/ todo fix for List<*>\n val typeReference = psiTypeArguments[index]\n val typeElement = typeReference?.typeElement ?: return@map null\n val isArgumentFromQualifier = index >= qualifierArgumentStartIndex","completion":"if (isErrorBinding) {\n val nextType = trace[BindingContext.TYPE, typeReference] ?: return@map null\n\n return@map TypeArgumentBindingImpl(\n TypeProjectionImpl(nextType),\n null,\n createTypeBindingFromPsi(trace, typeElement, nextType, isArgumentFromQualifier)\n )\n }<|endoftext|>"} {"prompt":"A.Marker.Companion.bar()\n}","completion":"fun f11(m: A.Marker.NestedClass.NestedClass2) {}\n\n\n\/\/ FILE: usage-from-other-file.kt<|endoftext|>"} {"prompt":"val inlineX = InlineDouble(1000.0)\n return inlineX.fooRes({ z: Double -> z})\n}\n\nfun test2Params() : Double {\n val inlineX = InlineDouble(1000.0)\n return inlineX.fooRes2({ y: Double, z: Double -> 2.0 * y + 3.0 * z})\n}","completion":"fun test2ParamsWithCaptured() : Double {\n val inlineX = InlineDouble(1000.0)\n val s = 9.0\n var t = 1.0\n return inlineX.fooRes2({ y: Double, z: Double -> 2.0 * s + t})\n}\n\nfun box(): String {\n if (test0Param() != 1.0) return \"test0Param\"<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.parcelize.fir.diagnostics.KtErrorsParcelize.CLASS_SHOULD_BE_PARCELIZE\nimport org.jetbrains.kotlin.parcelize.fir.diagnostics.KtErrorsParcelize.CREATOR_DEFINITION_IS_NOT_ALLOWED","completion":"import org.jetbrains.kotlin.parcelize.fir.diagnostics.KtErrorsParcelize.DEPRECATED_ANNOTATION\nimport org.jetbrains.kotlin.parcelize.fir.diagnostics.KtErrorsParcelize.DEPRECATED_PARCELER<|endoftext|>"} {"prompt":"public inline fun kotlin.FloatArray.lastOrNull(predicate: (kotlin.Float) -> kotlin.Boolean): kotlin.Float?\n\npublic fun kotlin.IntArray.lastOrNull(): kotlin.Int?\n\npublic inline fun kotlin.IntArray.lastOrNull(predicate: (kotlin.Int) -> kotlin.Boolean): kotlin.Int?","completion":"public fun kotlin.LongArray.lastOrNull(): kotlin.Long?\n\npublic inline fun kotlin.LongArray.lastOrNull(predicate: (kotlin.Long) -> kotlin.Boolean): kotlin.Long?\n\npublic fun kotlin.ShortArray.lastOrNull(): kotlin.Short?<|endoftext|>"} {"prompt":"return super.createKotlinVariant(componentName, compilation, usageContexts).apply {\n artifactTargetName = wasmDecamelizedDefaultNameOrNull() ?: componentName\n }\n }\n\n override fun createUsageContexts(producingCompilation: KotlinCompilation<*>): Set {","completion":"val usageContexts = super.createUsageContexts(producingCompilation)\n\n if (isMpp!!) return usageContexts\n\n return usageContexts +\n DefaultKotlinUsageContext(\n compilation = compilations.getByName(MAIN_COMPILATION_NAME),\n mavenScope = KotlinUsageContext.MavenScope.COMPILE,<|endoftext|>"} {"prompt":"protected fun runTest(@TestDataFile path: String) {\n testDataPath = configurator.computeTestDataPath(Paths.get(path))\n val testConfiguration = createTestConfiguration()\n testServices = testConfiguration.testServices\n createAndRegisterTestModuleStructure(testConfiguration)\n\n if (configurator.analyseInDependentSession && isDependentModeDisabledForTheTest()) {","completion":"return\n }\n\n if (configurator.frontendKind == FrontendKind.Fe10 && isFe10DisabledForTheTest() ||\n configurator.frontendKind == FrontendKind.Fir && isFirDisabledForTheTest()\n ) {\n return\n }\n\n try {\n prepareToTheAnalysis(testConfiguration)\n } catch (_: SkipTestException) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.expressions.FirBlock\nimport org.jetbrains.kotlin.fir.symbols.impl.FirCodeFragmentSymbol\n\n@FirBuilderDsl\nclass FirCodeFragmentBuilder : FirAnnotationContainerBuilder {\n override var source: KtSourceElement? = null","completion":"var resolvePhase: FirResolvePhase = FirResolvePhase.RAW_FIR\n override val annotations: MutableList = mutableListOf()\n lateinit var moduleData: FirModuleData\n lateinit var origin: FirDeclarationOrigin\n var attributes: FirDeclarationAttributes = FirDeclarationAttributes()\n lateinit var symbol: FirCodeFragmentSymbol\n lateinit var block: FirBlock<|endoftext|>"} {"prompt":"private fun isSuspendFunctionWithFakeConstructorCall(node: MethodNode): Boolean = findFakeContinuationConstructorClassName(node) != null\n\n private fun newStateMachineForLambda(node: MethodNode): DeferredMethodVisitor {\n val name = node.name.removeSuffix(FOR_INLINE_SUFFIX)\n return DeferredMethodVisitor(\n MethodNode(","completion":"node.access, name, node.desc, node.signature,\n ArrayUtil.toStringArray(node.exceptions)\n )\n ) {\n val sourceCompilerForInline = inliningContext.root.sourceCompilerForInline\n val stateMachineBuilder = CoroutineTransformerMethodVisitor(<|endoftext|>"} {"prompt":"0.toUInt() to listOf(\"2\"),\n 1.toUInt() to listOf(\"1\", \"3\")\n ),\n uintArrayOf(1u, 2u, 3u).groupBy({ k -> k % 2u }, { v -> v.toString() })\n )\n assertEquals(\n mapOf(\n 0 to listOf(0, 0, 0)\n ),","completion":"ulongArrayOf(1u, 2u, 3u).groupBy({ 0 }, { 0 })\n )\n }\n\n @Test\n fun flatMap() {\n assertEquals(listOf(), ubyteArrayOf().flatMap { listOf(it) })<|endoftext|>"} {"prompt":"fun clang_getDefinitionSpellingAndExtent(arg0: CValue, startBuf: CValuesRef>?, endBuf: CValuesRef>?, startLine: CValuesRef?, startColumn: CValuesRef?, endLine: CValuesRef?, endColumn:","completion":"CValuesRef?): Unit {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.types.AbstractTypeRefiner\nimport org.jetbrains.kotlin.types.KotlinType\nimport org.jetbrains.kotlin.types.TypeConstructor\nimport org.jetbrains.kotlin.types.model.KotlinTypeMarker\nimport org.jetbrains.kotlin.types.TypeRefinement","completion":"@DefaultImplementation(impl = KotlinTypeRefiner.Default::class)\nabstract class KotlinTypeRefiner : AbstractTypeRefiner() {\n @TypeRefinement\n abstract override fun refineType(type: KotlinTypeMarker): KotlinType\n\n @TypeRefinement\n abstract fun refineSupertypes(classDescriptor: ClassDescriptor): Collection<|endoftext|>"} {"prompt":"if (!(element4 !in 3L..<1L) != range1.contains(element4)) throw AssertionError()\n}\n\nfun testR1xE5() {\n \/\/ with possible local optimizations\n if (0.toShort() in 3L..<1L != range1.contains(0.toShort())) throw AssertionError()","completion":"if (0.toShort() !in 3L..<1L != !range1.contains(0.toShort())) throw AssertionError()\n if (!(0.toShort() in 3L..<1L) != !range1.contains(0.toShort())) throw AssertionError()<|endoftext|>"} {"prompt":"is ResolutionMode.ContextDependent,\n is ResolutionMode.ContextIndependent,\n is ResolutionMode.ReceiverResolution,\n -> {\n \/\/ Regular cases, just continue execution.\n \/\/ Enumerating all the cases just to make sure we don't forget to handle some mode.\n }\n }\n\n val callSite = callInfo.callSite\n \/\/ Annotation calls and collection literals (allowed only inside annotations)","completion":"\/\/ should be completed independently since that can't somehow affect PCLA\n if (callSite is FirAnnotationCall || callSite is FirArrayLiteral) return true\n\n \/\/ I'd say that this might be an assertion, but let's do an early return\n if (callSite !is FirResolvable && callSite !is FirVariableAssignment) return false\n\n \/\/ We can't analyze independently the calls which have postponed receivers<|endoftext|>"} {"prompt":"x\n }\n}\n\n\/\/ TESTCASE NUMBER: 7\nfun case_7() {","completion":"if (nullableStringProperty == null || nullableStringProperty == null) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.resolve.getContainingDeclaration\nimport org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.types.FirTypeRef\nimport org.jetbrains.kotlin.fir.types.classId\nimport org.jetbrains.kotlin.fir.types.coneType<|endoftext|>"} {"prompt":"ENTRY2() { override fun abstractFunc() { TODO(\"Not yet implemented\") } };\n constructor(arg: UserKlass = UserKlass())\n abstract fun abstractFunc()\n}\n\nenum class EnumerationCCA {\n ENTRY;\n constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())\n}","completion":"enum class EnumerationCCB {\n ENTRY1,\n ENTRY2;\n constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())\n}\n\nenum class EnumerationCCC {\n ENTRY1,\n ENTRY2();\n constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())\n}<|endoftext|>"} {"prompt":"@Suppress(\"UNCHECKED_CAST\")\n override fun getAttribute(key: Attribute): T? = lazyAttributesMap[key]?.get() as T?\n ?: attributesMap[key] as T?\n ?: getFilteredParentAttribute(key) as T?\n\n override fun isEmpty(): Boolean = lazyAttributesMap.isEmpty() &&","completion":"attributesMap.isEmpty() &&\n (parent?.keySet().orEmpty().toSet().none(filterParentAttributes))\n\n override fun keySet(): Set> = lazyAttributesMap.keys +\n attributesMap.keys +\n parent?.keySet().orEmpty().toSet().filter(filterParentAttributes)<|endoftext|>"} {"prompt":"assertFailsWith { HexFormat { number.prefix = \"\\r\" } }\n }\n\n @Test\n fun suffixWithNewLine() {\n assertFailsWith { HexFormat { number.suffix = \"ab\\ncd\" } }","completion":"assertFailsWith { HexFormat { number.suffix = \"ab\\rcd\" } }\n }\n}<|endoftext|>"} {"prompt":"this.outputs.clear()\n }\n\n private fun clearInputs() {\n this.inputs.forEach { nativeHeap.free(it) }\n this.inputs.clear()\n }\n\n operator fun invoke(outputs: List, inputsWithValues: List> = listOf()): List {","completion":"setInputsWithValues(inputsWithValues)\n setOutputs(outputs)\n\n return invoke()\n }\n\n operator fun invoke(output: Operation, inputsWithValues: List> = listOf()) =\n invoke(listOf(output), inputsWithValues).single()!!\n\n operator fun invoke(): List {<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\n\/\/ MODULE: m1-common\n\/\/ FILE: common.kt\nexpect annotation class Measurement(val iterations: Int = -1)\nexpect value class Inline(val value: String = \"\")\n\n\n\/\/ MODULE: m2-jvm()()(m1-common)\n\/\/ FILE: jvm.kt\nactual annotation class Measurement(actual val iterations: Int)","completion":"@JvmInline actual value class Inline(val value: String)\n\n@Measurement()\nfun test() {\n Inline() \/\/ KT-60476 Fixed in K2\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.resolve.konan.platform\n\nimport org.jetbrains.kotlin.container.StorageComponentContainer\nimport org.jetbrains.kotlin.container.useImpl\nimport org.jetbrains.kotlin.container.useInstance\nimport org.jetbrains.kotlin.descriptors.CallableMemberDescriptor","completion":"import org.jetbrains.kotlin.psi.KtCallableDeclaration\nimport org.jetbrains.kotlin.resolve.BindingContext\nimport org.jetbrains.kotlin.resolve.PlatformConfiguratorBase\nimport org.jetbrains.kotlin.resolve.calls.checkers.LateinitIntrinsicApplicabilityChecker<|endoftext|>"} {"prompt":"?: error(\"Atomic property accessor ${this.render()} expected to have non-null correspondingPropertySymbol\" + CONSTRAINTS_MESSAGE)\n\n protected fun IrExpression.isThisReceiver() =\n this is IrGetValue && symbol.owner.name.asString() == \"\"\n\n protected val IrDeclaration.parentDeclarationContainer: IrDeclarationContainer","completion":"get() = parents.filterIsInstance().firstOrNull()\n ?: error(\"In the sequence of parents for ${this.render()} no IrDeclarationContainer was found\" + CONSTRAINTS_MESSAGE)\n\n protected val IrFunction.containingFunction: IrFunction\n get() {<|endoftext|>"} {"prompt":"return mapNotNullTo(ArrayList(), transform).compactIfPossible()\n}\n\n\/**\n * A memory-optimized version of [Iterable.flatMap].\n * @see Iterable.flatMap\n *\/\ninline fun Collection.memoryOptimizedFlatMap(transform: (T) -> Iterable): List {","completion":"return flatMapTo(ArrayList(), transform).compactIfPossible()\n}\n\n\/**\n * A memory-optimized version of [Iterable.filter].\n * @see Iterable.filter\n *\/\ninline fun Collection.memoryOptimizedFilter(predicate: (T) -> Boolean): List {\n return filterTo(ArrayList(), predicate).compactIfPossible()\n}<|endoftext|>"} {"prompt":"add(\"-cp\")\n add(compilationClasspath.joinToString(File.pathSeparator) { it.absolutePath })\n }\n }\n val process = processBuilder.start()\n data class ExceptionContainer(\n var value: Throwable? = null\n )\n\n fun InputStream.captureStream(): Triple> {","completion":"val out = ArrayList()\n val exceptionContainer = ExceptionContainer()\n val thread = thread {\n val promptRegex = Regex(\"(?:\\\\u001B\\\\p{Graph}+)*(?:>>> ?|\\\\.\\\\.\\\\.)\")\n try {\n reader().forEachLine { rawLine ->\n promptRegex.split(rawLine).forEach { line -><|endoftext|>"} {"prompt":"val irBuiltIns: IrBuiltIns,\n val extensions: StubGeneratorExtensions = StubGeneratorExtensions.EMPTY,\n) : IrProvider {\n protected val lazyTable = symbolTable.lazyWrapper\n\n val lock: IrLock\n get() = symbolTable.lock\n\n var unboundSymbolGeneration: Boolean\n get() = lazyTable.stubGenerator != null","completion":"set(value) {\n lazyTable.stubGenerator = if (value) this else null\n }\n\n abstract val typeTranslator: TypeTranslator\n abstract val descriptorFinder: DescriptorByIdSignatureFinder\n\n private val facadeClassMap = mutableMapOf()<|endoftext|>"} {"prompt":"elements.mapIndexed { index, element -> 2 * index + 1 to element }.toMap()\n private val elementsToVar: Map = elements.mapIndexed { index, element -> element.origin to index }.toMap()\n\n operator fun get(element: Node): Int = elementsToVar.getValue(element)","completion":"operator fun get(index: Int): Node = varToElements.getValue(index)\n\n val size: Int = elements.size\n}\n\nprivate fun processRequirementsFromConfig(\n solution: MutableList,\n elementMapping: ElementMapping,\n requiredInterfaces: Collection,\n requiredClasses: Collection,\n) {<|endoftext|>"} {"prompt":"@Language(\"JSON\") val json =\n \"\"\"\n {\n \"schemaVersion\": ${SchemaVersion.current},\n \"buildSystem\": \"Gradle\",\n \"buildSystemVersion\": \"6.7\",\n \"buildPlugin\": \"org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper\",\n \"projectSettings\": {","completion":"\"isHmppEnabled\": false,\n \"isCompatibilityMetadataVariantEnabled\": true\n },\n \"projectTargets\": []\n }\n \"\"\".trimIndent()\n\n val result = KotlinToolingMetadata.parseJson(json)\n assertTrue(\n result is KotlinToolingMetadataParsingResult.Failure,<|endoftext|>"} {"prompt":") : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.ValueClassNotFinal\n\ninternal class AbsenceOfPrimaryConstructorForValueClassImpl(\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,","completion":") : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.AbsenceOfPrimaryConstructorForValueClass\n\ninternal class InlineClassConstructorWrongParametersSizeImpl(\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,<|endoftext|>"} {"prompt":"\"Attempt to rebind an IR symbol or to re-create its owner: old owner ${symbol.owner.render()}, new owner ${owner.render()}\"\n }\n return owner\n }\n\n class Flat(lock: IrLock, val symbolFilter: (Symbol) -> Boolean = { true }) : SymbolTableSlice(lock)","completion":"where SymbolOwner : IrSymbolOwner, Symbol : IrBindableSymbol<*, SymbolOwner> {\n private val signatureToSymbol = hashMapOf()\n\n override fun get(key: Key): Symbol? {\n return signatureToSymbol[key]\n }\n\n override fun set(key: Key, symbol: Symbol) {\n if (symbolFilter(symbol)) {<|endoftext|>"} {"prompt":"b -> { ::foo }","completion":"else -> { ::bar }\n }\n a\n }\n\n private val test_4 by lazy {<|endoftext|>"} {"prompt":"buildGradleKts.addCocoapodsBlock(\"osx.deploymentTarget = \\\"10.15\\\"\")\n testImport()\n\n val tasks = listOf(\n podspecTaskName,\n defaultPodGenTaskName,\n defaultSetupBuildTaskName,\n defaultBuildTaskName,\n defaultCinteropTaskName\n )\n val anotherTarget = \"MacosX64\"","completion":"val anotherSdk = \"macosx\"\n val anotherFamily = \"macos\"\n buildGradleKts.addKotlinBlock(anotherTarget.replaceFirstChar { it.lowercase(Locale.getDefault()) } + \"()\")\n\n testImport {\n assertTasksExecuted(\n podGenFullTaskName(anotherFamily),<|endoftext|>"} {"prompt":"\"Configuring JVM toolchain in the Kotlin target level DSL is prohibited. \" +\n \"JVM toolchain feature should be configured in the extension scope as it affects all JVM targets (JVM, Android).\"\n\ninternal val KotlinTarget.internal: InternalKotlinTarget\n get() = (this as? InternalKotlinTarget) ?: throw IllegalArgumentException(","completion":"\"KotlinTarget($name) ${this::class} does not implement ${InternalKotlinTarget::class}\"\n )\n\ninternal val InternalKotlinTarget.isSourcesPublishableFuture by extrasStoredFuture {\n KotlinPluginLifecycle.Stage.AfterFinaliseDsl.await()\n isSourcesPublishable\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.references\n\nimport org.jetbrains.kotlin.fir.diagnostics.FirDiagnosticHolder\nimport org.jetbrains.kotlin.fir.symbols.FirBasedSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.*","completion":"import kotlin.contracts.ExperimentalContracts\nimport kotlin.contracts.contract\n\nval FirReference.symbol: FirBasedSymbol<*>?\n get() = when (this) {\n is FirThisReference -> boundSymbol\n is FirResolvedNamedReference -> resolvedSymbol\n is FirNamedReferenceWithCandidateBase -> candidateSymbol\n else -> null\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.symbols.IrReturnTargetSymbol\nimport org.jetbrains.kotlin.ir.symbols.IrReturnableBlockSymbol\nimport org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol\nimport org.jetbrains.kotlin.ir.types.*","completion":"import org.jetbrains.kotlin.ir.util.isPrimitiveArray\nimport org.jetbrains.kotlin.ir.util.patchDeclarationParents\nimport org.jetbrains.kotlin.ir.util.render\n\n\n\/\/ Copied and adapted from Kotlin\/Native\n\nabstract class AbstractValueUsageLowering(\n val context: JsCommonBackendContext,<|endoftext|>"} {"prompt":"private val FirClassifierSymbol<*>.classIdIfExists: ClassId?\n get() = (this as? FirClassLikeSymbol<*>)?.classId\n\n private val FirConstructorSymbol.classIdIfExists: ClassId?\n get() = this.containingClassLookupTag()?.classId\n\n \/**","completion":"* Returns true if the class symbol has a type parameter that is supposed to be provided for its parent class.\n *\n * Example:\n * class Outer {\n * inner class Inner \/\/ Inner has an implicit type parameter `T`.\n * }\n *\/\n private fun FirClassLikeSymbol<*>.hasTypeParameterFromParent(): Boolean = typeParameterSymbols.orEmpty().any {<|endoftext|>"} {"prompt":"val (supportModuleFiles, nonSupportModuleFiles) = generatedFiles.partition { it.module.isSupport }\n val parsedFiles = nonSupportModuleFiles.associateWith { psiFactory.createFile(it.name, it.text) }\n val nonParsedFiles = supportModuleFiles.toMutableList()\n\n \/\/ Explicitly add support module to other modules' dependencies (as it is not listed there by default).","completion":"val supportModule = modules[SUPPORT_MODULE_NAME]\n if (supportModule != null) {\n modules.forEach { (moduleName, module) ->\n if (moduleName != SUPPORT_MODULE_NAME && supportModule !in module.dependencies) {\n module.dependencies += supportModule\n }\n }\n }\n\n Triple(modules, parsedFiles, nonParsedFiles)<|endoftext|>"} {"prompt":"fun testTypeParameterWithTypeAliasedUpperBoundsB(arg: T) {}\n\nfun testTypeParameterWithTypeAliasedUpperBoundsBReverse(arg: T) {}","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun testTypeParameterWithTypeAliasedUpperBoundsBReverse(arg: T) {}<|endoftext|>"} {"prompt":"a?.bar()\n }\n if (!(a is B)) {\n return;\n }\n a.bar()\n a.foo()\n}\n\nfun f10(init : A?) {\n val a : A? = init\n if (!(a is B)) {\n return;\n }","completion":"if (!(a is B)) {\n return;\n }\n}\n\nclass C() : A() {\n fun bar() {\n\n }\n}\n\nfun f101(a : A?) {\n if (a is C) {\n a.bar();\n }\n}\n\nfun f11(a : A?) {<|endoftext|>"} {"prompt":"}\n\nfun KonanTarget.toTargetMachine(objectFactory: ObjectFactory): TargetMachine = object : TargetMachine {\n override fun getOperatingSystemFamily(): OperatingSystemFamily =\n getGradleOSFamily(objectFactory)\n\n override fun getArchitecture(): MachineArchitecture =\n objectFactory.named(MachineArchitecture::class.java, this@toTargetMachine.architecture.visibleName)\n}","completion":"class DefaultKotlinNativePlatform(name: String, override val target: KonanTarget) :\n DefaultNativePlatform(name, target.getGradleOS(), target.getGradleCPU()),\n KotlinNativePlatform {\n constructor(target: KonanTarget) : this(target.visibleName, target)<|endoftext|>"} {"prompt":"internal val Project.shouldCompileIntermediateSourceSetsToMetadata: Boolean\n get() = with(PropertiesProvider(this)) {\n when {\n !hierarchicalStructureSupport && mppHierarchicalStructureByDefault -> false\n else -> true\n }\n }\n\ninternal val Project.isCompatibilityMetadataVariantEnabled: Boolean","completion":"get() = PropertiesProvider(this).enableCompatibilityMetadataVariant == true\n\nclass KotlinMetadataTargetConfigurator :\n KotlinOnlyTargetConfigurator, KotlinMetadataTarget>(createTestCompilation = false) {\n companion object {\n internal const val ALL_METADATA_JAR_NAME = \"allMetadataJar\"\n }<|endoftext|>"} {"prompt":"* \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n *\/\npublic inline fun >> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M {\n for (element in this) {","completion":"val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n\/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.utils.addToStdlib.shouldNotBeCalled\n\nobject DisabledDescriptorMangler : KotlinMangler.DescriptorMangler {\n override val String.hashMangle: Long\n get() = shouldNotBeCalled()\n\n override fun DeclarationDescriptor.isExported(compatibleMode: Boolean): Boolean = shouldNotBeCalled()","completion":"override fun DeclarationDescriptor.signatureString(compatibleMode: Boolean): String = shouldNotBeCalled()\n}\n\nobject DisabledIdSignatureDescriptor : IdSignatureDescriptor(DisabledDescriptorMangler) {\n override fun composeSignature(descriptor: DeclarationDescriptor): IdSignature? = null<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactoryImpl\nimport org.jetbrains.kotlin.test.directives.AdditionalFilesDirectives\nimport org.jetbrains.kotlin.test.directives.DiagnosticsDirectives","completion":"import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.MARK_DYNAMIC_CALLS\nimport org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives\nimport org.jetbrains.kotlin.test.directives.model.DirectivesContainer<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.analysis.checkers.expression\n\nimport org.jetbrains.kotlin.KtSourceElement\nimport org.jetbrains.kotlin.config.AnalysisFlags\nimport org.jetbrains.kotlin.descriptors.ClassKind\nimport org.jetbrains.kotlin.diagnostics.DiagnosticReporter","completion":"import org.jetbrains.kotlin.diagnostics.reportOn\nimport org.jetbrains.kotlin.fir.*\nimport org.jetbrains.kotlin.fir.analysis.checkers.*\nimport org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext<|endoftext|>"} {"prompt":"if (lookupTag.classId != SpecialJvmAnnotations.JAVA_LANG_ANNOTATION_REPEATABLE) return false\n\n val getClassCall = argumentMap[StandardClassIds.Annotations.ParameterNames.value] as? FirGetClassCall ?: return false\n val classReference = getClassCall.argument as? FirClassReferenceExpression ?: return false","completion":"val containerType = classReference.classTypeRef.coneType as? ConeClassLikeType ?: return false\n val classId = containerType.lookupTag.classId\n if (classId.outerClassId == null || classId.shortClassName.asString() != JvmAbi.REPEATABLE_ANNOTATION_CONTAINER_NAME\n ) return false<|endoftext|>"} {"prompt":"}\n }\n\n fun generateUnboundSymbolsAsDependencies(irProviders: List) {\n ExternalDependenciesGenerator(context.symbolTable, irProviders).generateUnboundSymbolsAsDependencies()\n }","completion":"fun generateSingleFile(irDeclarationGenerator: DeclarationGenerator, ktFile: KtFile, module: IrModuleFragment): IrFileImpl {\n val irFile = createEmptyIrFile(ktFile, module)\n\n val constantValueGenerator = irDeclarationGenerator.context.constantValueGenerator\n for (ktAnnotationEntry in ktFile.annotationEntries) {<|endoftext|>"} {"prompt":"val localLabels = argInsns.filterTo(HashSet()) { it is LabelNode }\n return argInsns.any { insn ->\n insn.isStoreOperation() ||\n insn in methodContext.suspensionJumpLabels ||\n insn.opcode == Opcodes.GOTO && (insn as JumpInsnNode).label !in localLabels\n }\n }","completion":"private fun moveInplaceArgumentsFromStoresToLoads(methodContext: MethodContext, callContext: CallContext) {\n \/\/ Transform call\n val insnList = methodContext.methodNode.instructions\n val args = callContext.args.associateBy { it.varIndex }\n var argsProcessed = 0\n\n var insn: AbstractInsnNode = callContext.callStartMarker<|endoftext|>"} {"prompt":"fun lower(irModule: IrModuleFragment)\n}\n\ninterface FileLoweringPass : ModuleLoweringPass {\n fun lower(irFile: IrFile)\n\n override fun lower(irModule: IrModuleFragment) {\n for (file in irModule.files) {\n try {\n lower(file)\n } catch (e: CompilationException) {","completion":"e.initializeFileDetails(file)\n throw e\n } catch (e: KotlinExceptionWithAttachments) {\n throw e\n } catch (e: Throwable) {\n throw e.wrapWithCompilationException(\"Internal error in file lowering\", file, null)\n }\n }\n }\n}\n\ninterface ClassLoweringPass : FileLoweringPass {<|endoftext|>"} {"prompt":"flow.addAllConditionally(expressionVariable notEq null, previousFlow)\n\n \/*\n * If we have some implication about rhs of safe call in the previous flow, then we can expand them to the whole\n * safe call variable\n *\n * a?.foo() \/\/ original call\n * subj.foo() \/\/ rhs of safe call\n *\n * previousFlow:","completion":"* - subj.foo() == True -> X_1\n * - subj.foo() == False -> X_2\n * - subj.foo() != Null -> X_3\n * - subj.foo() == Null -> X_4\n *\n * flow:\n * - a?.foo() == True -> X_1<|endoftext|>"} {"prompt":"\"-ProhibitAssigningSingleElementsToVarargsInNamedForm\", \/\/ Prohibit these assignments\n \"-ProhibitDataClassesOverridingCopy\", \/\/ Prohibit as no longer supported\n \"-ProhibitOperatorMod\", \/\/ Prohibit as no longer supported\n \"-ProhibitIllegalValueParameterUsageInDefaultArguments\", \/\/ Allow only legal values","completion":"\"-UseBuilderInferenceOnlyIfNeeded\", \/\/ Run only default one\n \"-UseCorrectExecutionOrderForVarargArguments\" \/\/ Run only correct one\n )\n\n private const val USE_EXPERIMENTAL_DIRECTIVE = \"USE_EXPERIMENTAL\"\n\n private const val NATIVE_STANDALONE_DIRECTIVE = \"NATIVE_STANDALONE\"<|endoftext|>"} {"prompt":"get() = CompilerSystemProperties.OS_NAME.value!!.lowercase().startsWith(\"windows\")\n\nfun String?.toBooleanLenient(): Boolean? = when (this?.lowercase()) {\n null -> false\n in listOf(\"\", \"yes\", \"true\", \"on\", \"y\") -> true\n in listOf(\"no\", \"false\", \"off\", \"n\") -> false","completion":"else -> null\n}<|endoftext|>"} {"prompt":"private val IrDeclarationWithName.exportedName: String\n get() = getAnnotation(JsStandardClassIds.Annotations.JsName.asSingleFqName())?.getSingleConstStringArgument() ?: name.toString()\n\n@Suppress(\"UNCHECKED_CAST\")\nprivate fun IrConstructorCall.getSingleConstStringArgument() =","completion":"(getValueArgument(0) as IrConst).value\n\nfun IrModuleFragment.collectExportedNames(): Map> {\n return files.associateWith { irFile ->\n val isFileExported = irFile.annotations.hasAnnotation(JsStandardClassIds.Annotations.JsExport.asSingleFqName())<|endoftext|>"} {"prompt":"fun staticLib(\n namePrefix: String,\n buildTypes: Collection = NativeBuildType.DEFAULT_BUILD_TYPES,\n configure: StaticLibrary.() -> Unit = {}\n ) = createBinaries(namePrefix, namePrefix, NativeOutputKind.STATIC, buildTypes, ::StaticLibrary, configure)","completion":"\/** Creates a static library with the empty name prefix for each build type and configures it. *\/\n @JvmOverloads\n fun staticLib(\n buildTypes: Collection = NativeBuildType.DEFAULT_BUILD_TYPES,\n configure: StaticLibrary.() -> Unit = {}<|endoftext|>"} {"prompt":"\"Expected KotlinSourceSet: ${kotlinSourceSet.name} to dependsOn commonTest\"\n )\n }\n }\n\n android.testVariants.all { libraryVariant ->\n libraryVariant.sourceSets.forEach { androidSourceSet ->\n val kotlinSourceSet = project.getKotlinSourceSetOrFail(androidSourceSet)\n assertEquals(","completion":"emptySet(), kotlinSourceSet.dependsOn.map { it.name }.toSet(),\n \"Expected KotlinSourceSet: ${kotlinSourceSet.name} to have no dependsOn edges\"\n )\n }\n }\n }\n\n @Test\n fun `test - kotlin source directories - are in sync between KotlinSourceSet and AndroidSourceSet`() {<|endoftext|>"} {"prompt":"return java.util.Arrays.copyOfRange(this, fromIndex, toIndex)\n}\n\n@SinceKotlin(\"1.3\")\n@PublishedApi\n@JvmName(\"copyOfRange\")\ninternal fun IntArray.copyOfRangeImpl(fromIndex: Int, toIndex: Int): IntArray {\n copyOfRangeToIndexCheck(toIndex, size)","completion":"return java.util.Arrays.copyOfRange(this, fromIndex, toIndex)\n}\n\n@SinceKotlin(\"1.3\")\n@PublishedApi\n@JvmName(\"copyOfRange\")\ninternal fun LongArray.copyOfRangeImpl(fromIndex: Int, toIndex: Int): LongArray {\n copyOfRangeToIndexCheck(toIndex, size)<|endoftext|>"} {"prompt":"\/\/ test1.kt:12 box\n\/\/ test.kt:6 box\n\/\/ test.kt:7 box\n\/\/ test1.kt:12 invoke\n\/\/ test.kt:7 box\n\/\/ test.kt:8 box\n\n\/\/ EXPECTATIONS JS_IR\n\/\/ test1.kt:11 box\n\/\/ test.kt:7 box\n\/\/ test1.kt:9 box$lambda\n\/\/ test.kt:8 box","completion":"\/\/ EXPECTATIONS WASM\n\/\/ test.kt:6 $box\n\/\/ test1.kt:12 $box\n\/\/ test.kt:7 $box\n\/\/ test.kt:9 $box$lambda.invoke\n\/\/ test.kt:8 $box<|endoftext|>"} {"prompt":"endIndex: Int,\n bytesFormat: HexFormat.BytesHexFormat\n): ByteArray? {\n val byteSeparatorLength = bytesFormat.byteSeparator.length\n require(byteSeparatorLength <= 1)\n\n val numberOfChars = endIndex - startIndex\n var charIndex = 0\n\n if (byteSeparatorLength == 0) {","completion":"if (numberOfChars and 1 != 0) return null\n val numberOfBytes = numberOfChars shr 1\n val byteArray = ByteArray(numberOfBytes)\n for (byteIndex in 0 until numberOfBytes) {\n byteArray[byteIndex] = parseByteAt(charIndex)\n charIndex += 2\n }\n return byteArray\n } else {<|endoftext|>"} {"prompt":"@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})\npublic fun kotlin.Array.sum(): kotlin.UInt\n\n@kotlin.jvm.JvmName(name = \"sumOfUInt\")\n@kotlin.SinceKotlin(version = \"1.5\")","completion":"@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})\npublic fun kotlin.Array.sum(): kotlin.UInt\n\n@kotlin.jvm.JvmName(name = \"sumOfULong\")\n@kotlin.SinceKotlin(version = \"1.5\")<|endoftext|>"} {"prompt":"override fun findClass(name: String): Class<*> = try {\n super.findClass(name)\n } catch (e: ClassNotFoundException) {\n fallbackClassLoader?.loadClass(name) ?: throw e\n }\n\n override fun getResourceAsStream(name: String): InputStream? =","completion":"super.getResourceAsStream(name) ?: fallbackClassLoader?.getResourceAsStream(name)\n\n override fun findResources(name: String): Enumeration =\n if (fallbackClassLoader == null) super.findResources(name)\n else Collections.enumeration(super.findResources(name).toList() + fallbackClassLoader.openFindResources(name).asSequence())<|endoftext|>"} {"prompt":"val a3 = A()\n if (a3.x != \"23\") return \"fail3: ${a3.x}\"\n\n val b = B(\"q\")\n if (b.x != \"q\") return \"fail4: ${b.x}\"\n\n val c = C(\"w\")\n if (c.x != \"w\") return \"fail5: ${c.x}\"\n\n return \"OK\"","completion":"}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.symbols.markers.KtNamedSymbol\nimport org.jetbrains.kotlin.backend.konan.KonanFqNames\nimport org.jetbrains.kotlin.backend.konan.objcexport.*\nimport org.jetbrains.kotlin.name.Name","completion":"import org.jetbrains.kotlin.objcexport.Predefined.anyMethodSelectors\nimport org.jetbrains.kotlin.objcexport.Predefined.anyMethodSwiftNames\nimport org.jetbrains.kotlin.objcexport.analysisApiUtils.*\nimport org.jetbrains.kotlin.objcexport.extras.objCExportStubExtras<|endoftext|>"} {"prompt":"override fun replaceBoundSymbol(newBoundSymbol: FirBasedSymbol<*>?) {\n boundSymbol = newBoundSymbol\n }\n\n override fun replaceContextReceiverNumber(newContextReceiverNumber: Int) {\n contextReceiverNumber = newContextReceiverNumber\n }\n\n override fun replaceDiagnostic(newDiagnostic: ConeDiagnostic?) {","completion":"diagnostic = newDiagnostic\n }\n}<|endoftext|>"} {"prompt":"package androidx.compose.compiler.plugins.kotlin.lower\n\nimport org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI\nimport org.jetbrains.kotlin.ir.declarations.IrClass\n\n\/**\n * Used with K1 only.\n *\/","completion":"class ClassStabilityInferredCollection {\n\n private val classesToValues = mutableMapOf()\n\n @OptIn(ObsoleteDescriptorBasedAPI::class)\n fun addClass(c: IrClass, stabilityInferredParametersValue: Int) {\n classesToValues[c.descriptor] = stabilityInferredParametersValue\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.project.structure.builder.buildProjectStructureProvider\nimport org.jetbrains.kotlin.analysis.project.structure.impl.KtSourceModuleImpl\nimport org.jetbrains.kotlin.analysis.project.structure.impl.buildKtModuleProviderByCompilerConfiguration","completion":"import org.jetbrains.kotlin.analysis.project.structure.impl.getPsiFilesFromPaths\nimport org.jetbrains.kotlin.analysis.project.structure.impl.getSourceFilePaths\nimport org.jetbrains.kotlin.analysis.providers.*\nimport org.jetbrains.kotlin.analysis.providers.impl.*<|endoftext|>"} {"prompt":"override fun check(declaration: FirFile, context: CheckerContext, reporter: DiagnosticReporter) {\n val topLevelProperties = declaration.declarations.filterIsInstance()\n checkFileLikeDeclaration(declaration, topLevelProperties, context, reporter)\n }\n}\n\nobject FirScriptPropertiesChecker : FirScriptChecker(MppCheckerKind.Common) {","completion":"override fun check(declaration: FirScript, context: CheckerContext, reporter: DiagnosticReporter) {\n val topLevelProperties = declaration.declarations.filterIsInstance()\n checkFileLikeDeclaration(declaration, topLevelProperties, context, reporter)\n }\n}\n\nprivate fun checkFileLikeDeclaration(\n declaration: FirDeclaration,<|endoftext|>"} {"prompt":"diagnostic: Diagnostic,\n module: TestModule,\n file: TestFile,\n configuration: DiagnosticsRenderingConfiguration,\n withNewInferenceModeEnabled: Boolean\n ) {\n globalMetadataInfoHandler.addMetadataInfosForFile(\n file,\n diagnostic.toMetaInfo(\n module,\n file,\n configuration.withNewInference,","completion":"withNewInferenceModeEnabled\n )\n )\n }\n\n private fun Diagnostic.toMetaInfo(\n module: TestModule,\n file: TestFile,\n newInferenceEnabled: Boolean,\n withNewInferenceModeEnabled: Boolean\n ): List = textRanges.map { range -><|endoftext|>"} {"prompt":"return originalTypeParameter.isReified\n }\n\n @OptIn(TypeRefinement::class)\n override fun KotlinTypeMarker.refineType(): KotlinTypeMarker {\n require(this is KotlinType)\n return kotlinTypeRefiner.refineType(this)\n }","completion":"override fun createArgumentConstraintPosition(argument: PostponedAtomWithRevisableExpectedType): ArgumentConstraintPosition<*> {\n require(argument is ResolvedAtom)\n return ArgumentConstraintPositionImpl(argument.atom as KotlinCallArgument)\n }<|endoftext|>"} {"prompt":"val f: Array = arrayOf(mutable),\n val g: Array = arrayOf(mutableWithGetter),","completion":"val h: Array> = arrayOf(WithLateinit.kClass)\n)\n\nconst val ONE = 1\n\nval twoWithGetter\n get() = 2\n\nval readOnly = \"\"\n\nval withGetter\n get() = \"\"\n\nfun func() = \"\"<|endoftext|>"} {"prompt":"package aa\n\nfun foo(block: (T)-> R) = block\n\nfun test1() {\n foo {\n x -> \/\/ here we have 'cannot infer parameter type' error\n 43\n }","completion":"}\n\nfun bar(f: (A)->Unit) {}\n\nfun test2() {\n bar { a -> } \/\/ here we don't have 'cannot infer parameter type' error\n}<|endoftext|>"} {"prompt":"package kotlin.js\n\n\/**\n * Exports top-level declaration on JS platform.\n *\n * Can only be applied to top-level functions.\n *\/\n@ExperimentalJsExport\n@Retention(AnnotationRetention.BINARY)\n@Target(AnnotationTarget.FUNCTION)\n\/\/ All targets from expect can't be set because for K\/Wasm so far you can export only functions","completion":"@Suppress(\"ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT\")\npublic actual annotation class JsExport {\n @ExperimentalJsExport\n @Retention(AnnotationRetention.BINARY)\n @Target(\n AnnotationTarget.CLASS,\n AnnotationTarget.FUNCTION,\n AnnotationTarget.PROPERTY,\n AnnotationTarget.CONSTRUCTOR,\n )<|endoftext|>"} {"prompt":"return expression.value.maybeOptimizeIntoSwitch(context) { jsAssignment(dest, it()).withSource(expression, context).makeStmt() }\n }\n\n override fun visitSetValue(expression: IrSetValue, context: JsGenerationContext): JsStatement {\n val owner = expression.symbol.owner","completion":"val ref = JsNameRef(context.getNameForValueDeclaration(owner))\n return expression.value.maybeOptimizeIntoSwitch(context) { jsAssignment(ref, it()).withSource(expression, context).makeStmt() }\n }\n\n override fun visitReturn(expression: IrReturn, context: JsGenerationContext): JsStatement {<|endoftext|>"} {"prompt":"x.x.funNullableT()\n x.x.funNullableAny()\n }\n if (x.y != null) {","completion":"x.y\n x.y.equals(null)<|endoftext|>"} {"prompt":"operator fun mod(x: String) = ModAndRemAssign()\n operator fun modAssign(x: String) {}\n operator fun remAssign(x: Int) {}\n}","completion":"operator fun ModAndRemAssign.mod(x: String) = ModAndRemAssign()\noperator fun ModAndRemAssign.modAssign(x: String) {}\n\nfun test() {\n val modAndRemAssign = ModAndRemAssign()<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.scopes.impl\n\nimport org.jetbrains.kotlin.descriptors.Modality\nimport org.jetbrains.kotlin.fir.FirSession\nimport org.jetbrains.kotlin.fir.declarations.*\nimport org.jetbrains.kotlin.fir.declarations.utils.modality","completion":"import org.jetbrains.kotlin.fir.scopes.FirOverrideChecker\nimport org.jetbrains.kotlin.fir.scopes.FirTypeScope\nimport org.jetbrains.kotlin.fir.symbols.FirBasedSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol<|endoftext|>"} {"prompt":"* DESCRIPTION: Check for lack of unreachable code report when in complex control flow of contract function lambda not all branches are doing non-local return\n * HELPERS: contractFunctions\n *\/\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1(b: Boolean?, c: Boolean) {\n funWithExactlyOnceCallsInPlace {\n if (b == null) return\n\n try {","completion":"when (b) {\n true -> {\n println(1)\n return\n }\n false -> {\n println(2)\n throw Exception()\n }\n }\n } catch (e: Exception) {\n if (c) {<|endoftext|>"} {"prompt":"\/\/ Error(ish): file package does not match file path.\n \/\/ This could happen if, e.g., src\/my\/pkg\/MyTest.java has package `test.pkg`.\n \/\/ It is just best practice, not enforced by language spec.\n \/\/ So, here, we just stop iterating upward the folder structure.\n break\n }\n }\n javaDir?.let { result += it }\n }","completion":"return result.toList()\n }\n\n fun getAllBinaryRoots(\n modules: List,\n environment: KotlinCoreProjectEnvironment,\n ): List = withAllTransitiveDependencies(modules)\n .filterIsInstance()\n .flatMap { it.getJavaRoots(environment) }<|endoftext|>"} {"prompt":"): OverloadResolutionResults {\n val propertyHasReceiver = propertyDescriptor.dispatchReceiverParameter != null\n val arguments = KtPsiFactory(delegateExpression.project, markGenerated = false).run {\n listOf(\n createExpression(if (propertyHasReceiver) \"this\" else \"null\"),\n createExpressionForProperty()\n )\n }","completion":"val functionName = OperatorNameConventions.PROVIDE_DELEGATE\n val receiver = ExpressionReceiver.create(delegateExpression, delegateExpressionType, context.trace.bindingContext)\n\n val (provideDelegateCall, provideDelegateResults) =\n fakeCallResolver.makeAndResolveFakeCallInContext(receiver, context, arguments, functionName, delegateExpression)<|endoftext|>"} {"prompt":"public class PublicClassPrivateMembers private constructor(private val property: String) {\n private fun function(): String = \"\"\n private class NestedClass\n}\ninternal class InternalClass(val property: String) {\n fun function(): String = \"\"\n class NestedClass\n}\n@PublishedApi internal class InternalPAClass(val property: String) {\n fun function(): String = \"\"\n class NestedClass\n}","completion":"@PublishedApi internal class InternalPAClassInternalMembers internal constructor(internal val property: String) {\n internal fun function(): String = \"\"\n internal class NestedClass\n}\n@PublishedApi internal class InternalPAClassInternalPAMembers @PublishedApi internal constructor(@PublishedApi internal val property: String) {\n @PublishedApi internal fun function(): String = \"\"\n @PublishedApi internal class NestedClass\n}<|endoftext|>"} {"prompt":"* This list has size of `groupCount + 1` where `groupCount` is the count of groups in the regular expression.\n * Groups are indexed from 1 to `groupCount` and group with the index 0 corresponds to the entire match.\n *\n * If the group in the regular expression is optional and there were no match captured by that group,\n * corresponding item in [groupValues] is an empty string.\n *","completion":"* @sample samples.text.Regexps.matchDestructuringToGroupValues\n *\/\n public val groupValues: List\n\n \/**\n * An instance of [MatchResult.Destructured] wrapper providing components for destructuring assignment of group values.\n *\n * component1 corresponds to the value of the first group, component2 \u2014 of the second, and so on.\n *<|endoftext|>"} {"prompt":"val NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN: KtDiagnosticFactory1 by error1(SourceElementPositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT)","completion":"val NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER: KtDiagnosticFactory1 by error1(SourceElementPositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT)<|endoftext|>"} {"prompt":"fun testReceiverLambda2() {\n codegen(\n \"\"\"\n class DensityScope(val density: Density)\n\n class Density\n\n val LocalDensity = compositionLocalOf { TODO() }\n\n @Composable\n fun compositionLocalDensity() = LocalDensity.current\n\n @Composable","completion":"fun WithDensity(block: @Composable DensityScope.() -> Unit) {\n DensityScope(compositionLocalDensity()).block()\n }\n \"\"\"\n )\n }\n\n @Test\n fun testInlineChildren() {\n codegen(\n \"\"\"\n import androidx.compose.runtime.*\n\n @Composable\n inline fun PointerInputWrapper(<|endoftext|>"} {"prompt":"}\n }\n }\n\n private fun checkDelegation(declaration: KtDeclaration, descriptor: DeclarationDescriptor, diagnosticHolder: DiagnosticSink) {\n if (descriptor !is MemberDescriptor || !descriptor.isEffectivelyExternal()) return\n\n if (declaration is KtClassOrObject) {","completion":"for (superTypeEntry in declaration.superTypeListEntries) {\n when (superTypeEntry) {\n is KtSuperTypeCallEntry -> {\n diagnosticHolder.report(ErrorsJs.EXTERNAL_DELEGATED_CONSTRUCTOR_CALL.on(superTypeEntry.valueArgumentList!!))\n }\n is KtDelegatedSuperTypeEntry -> {<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.asJava.classes\n\nimport com.intellij.psi.PsiModifierListOwner\nimport com.intellij.psi.PsiPrimitiveType\nimport com.intellij.psi.PsiType\nimport org.jetbrains.kotlin.load.java.JvmAnnotationNames","completion":"import org.jetbrains.kotlin.psi.KtDeclaration\nimport org.jetbrains.kotlin.types.KotlinType\nimport org.jetbrains.kotlin.types.TypeUtils\nimport org.jetbrains.kotlin.types.isError\nimport org.jetbrains.kotlin.types.typeUtil.TypeNullability<|endoftext|>"} {"prompt":"if (check(1, { it as Byte }) != \"OK\") return \"fail 2\"\n if (check(1, { it as Short }) != \"OK\") return \"fail 3\"\n if (check(1, { it as Long }) != \"OK\") return \"fail 4\"\n if (check(1, { it as Char }) != \"OK\") return \"fail 5\"","completion":"if (check(1, { it as Double }) != \"OK\") return \"fail 6\"\n if (check(1, { it as Float }) != \"OK\") return \"fail 7\"\n\n if (check(1.0, { it as Int }) != \"OK\") return \"fail 11\"\n if (check(1.0, { it as Byte }) != \"OK\") return \"fail 12\"<|endoftext|>"} {"prompt":"val info = Project3.serializer().descriptor.annotations.filterIsInstance().first()\n assertEquals(123, info.value)\n assertEquals(String::class, info.kclass)\n}\n\nfun testCustomSerializerAndMetaAnnotation() {\n val string = Json.encodeToString(Project4.serializer(), Project4(\"name\", \"lang\"))","completion":"assertEquals(\"\"\"name:lang\"\"\", string)\n\n val reconstructed = Json.decodeFromString(Project4.serializer(), string)\n assertEquals(\"name\", reconstructed.name)\n assertEquals(\"lang\", reconstructed.language)\n}\n\nfun testSealed() {\n val serializerA = TestSealed.A.serializer()<|endoftext|>"} {"prompt":"lastSuspension = x\n COROUTINE_SUSPENDED\n }\n\n fun hasNext() = lastSuspension != null\n fun next() {\n val x = lastSuspension!!\n lastSuspension = null\n x.resume(\"56\")\n }\n}\n\nfun builder(c: suspend Controller.() -> Unit) {\n val controller1 = Controller()","completion":"val controller2 = Controller()\n\n c.startCoroutine(controller1, EmptyContinuation)\n c.startCoroutine(controller2, EmptyContinuation)\n\n runControllers(controller1, controller2)\n}\n\n\/\/ TODO: additional parameters are not supported yet\n\/\/fun builder2(coroutine c: Controller.(Long, String) -> Continuation) {\n\/\/ val controller1 = Controller()<|endoftext|>"} {"prompt":"var onerror: ((Event) -> dynamic)?\n open val title: String\n open val dir: NotificationDirection\n open val lang: String\n open val body: String\n open val tag: String\n open val image: String\n open val icon: String\n open val badge: String\n open val sound: String\n open val vibrate: Array\n open val timestamp: Number","completion":"open val renotify: Boolean\n open val silent: Boolean\n open val noscreen: Boolean\n open val requireInteraction: Boolean\n open val sticky: Boolean\n open val data: Any?\n open val actions: Array\n fun close()\n\n companion object {\n val permission: NotificationPermission\n val maxActions: Int<|endoftext|>"} {"prompt":"|| lock.write { cacheCursor < cache.size || sequenceIterator.hasNext() }\n\n override fun next(): T {\n lock.read {\n if (cacheCursor < cache.size) return cache[cacheCursor++]\n }\n \/\/ lock.write is not an upgrade but retake, therefore - one more check needed\n lock.write {","completion":"return if (cacheCursor < cache.size) cache[cacheCursor++]\n else sequenceIterator.next().also { cache.add(it) }\n }\n }\n }\n\n override fun iterator(): Iterator = CachingIterator()\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ DIAGNOSTICS: -DEBUG_INFO_SMARTCAST\n\nfun materialize(): R = null!!\n\nfun test1(i : Int, x: Any) {\n require(x is String)\n do {\n x.length\n } while (i < 10)\n}\n\n\/\/Assignment after smartcast\n\nfun test2(i : Int) {","completion":"var x: Any? = materialize()\n require(x is String)\n do {\n x.length\n x = 10\n } while (i < 10)\n}\n\nfun test3(i : Int) {\n var x: Any? = materialize()\n require(x is String)\n do {<|endoftext|>"} {"prompt":"CirRegularTypeProjection(resultingVariance, substitutedType)\n }\n }\n }\n\n private fun expandTypeAliasType(\n expansion: CirTypeAliasExpansion,\n type: CirProvided.TypeAliasType\n ): CirTypeAliasType {\n val typeAlias: CirProvided.TypeAlias = expansion.typeResolver.resolveClassifier(type.classifierId)","completion":"checkArgumentsCount(typeAlias, type.classifierId, type.arguments)\n\n val expandedArguments = type.arguments.compactMapIndexed { index, argument ->\n val projection = expandTypeProjection(expansion, argument, typeAlias.typeParameters[index].variance)\n makeNullableTypeIfNecessary(projection, argument)\n }<|endoftext|>"} {"prompt":"assertEquals(3, bar.foos[1].value)\n\n bar.one = \"Bar\"\n bar.foos[0].value = 100\n bar.foos[1].value = 200\n\n assertEquals(\"Bar\", bar.one)\n assertEquals(100, bar.foos[0].value)\n assertEquals(200, bar.foos[1].value)","completion":"}\n\n assertEquals(\"Foo\", bar.one)\n assertEquals(1, bar.foos[0].value)\n assertEquals(2, bar.foos[1].value)\n assert(bar.foos[0] === foo0)\n assert(bar.foos[1] === foo1)\n }\n\n @Test\n fun testPostProcess() {<|endoftext|>"} {"prompt":"val librarySrc = FileUtil.findFilesByMask(JAVA_FILES, File(testDataDirectory, \"library\"))\n val libraryOut = File(tmpdir, \"out\")\n KotlinTestUtils.compileJavaFilesExternallyWithJava11(librarySrc, listOf(\"-d\", libraryOut.path))\n\n val libraryOut11 = File(tmpdir, \"out11\")","completion":"libraryOut11.mkdirs()\n File(libraryOut, \"module-info.class\").renameTo(File(libraryOut11, \"module-info.class\"))\n\n for (version in listOf(9, 10, 11)) {\n try {\n \/\/ Use the name other from 'library' to prevent it from being loaded as an automatic module if module-info.class is not found.<|endoftext|>"} {"prompt":"}) { source, target ->\n source.copyToIgnoringExistingDirectory(target, followLinks = false)\n if (source.name == \"3\" || source.name == \"9.txt\") throw IllegalArgumentException()\n CopyActionResult.CONTINUE\n }\n\n \/\/ either \"3\" or \"9.txt\" is not copied","completion":"val copied3 = dst.resolve(\"1\/3\").exists()\n val copied9 = dst.resolve(\"8\/9.txt\").exists()\n assertTrue(copied3 || copied9)\n assertFalse(copied3 && copied9)\n }\n\n @Test\n fun copyIntoSourceDirectory() {\n val source = createTestFiles().cleanupRecursively()<|endoftext|>"} {"prompt":"return providers.flatMapToNullableSet { it.getTopLevelCallableNamesInPackage(packageFqName) }\n }\n\n override val mayHaveSyntheticFunctionTypes: Boolean = providers.any { it.mayHaveSyntheticFunctionTypes }","completion":"override fun mayHaveSyntheticFunctionType(classId: ClassId): Boolean = providers.any { it.mayHaveSyntheticFunctionType(classId) }\n\n companion object {\n fun create(providers: List): FirSymbolNamesProvider = when (providers.size) {\n 0 -> FirEmptySymbolNamesProvider\n 1 -> providers.single()<|endoftext|>"} {"prompt":"override fun getContainingDeclaration(): PackageViewDescriptor? = null\n override fun getOriginal() = throw UnsupportedOperationException()\n override fun acceptVoid(visitor: DeclarationDescriptorVisitor?) = throw UnsupportedOperationException()\n override fun getName() = throw UnsupportedOperationException()\n override val annotations: Annotations\n get() = throw UnsupportedOperationException()","completion":"}\n\n private class ScopeWithClassifiers(classifiers: List) : MemberScopeImpl() {\n private val classifierMap = HashMap()\n\n init {\n for (classifier in classifiers) {\n classifierMap.put(classifier.name, classifier)?.let {\n throw IllegalStateException(\n String.format(<|endoftext|>"} {"prompt":"String\")!>get(0), 0f, get(0))","completion":"}\n\n val list17 = buildList l1@ {\n add(\"one\")\n\n with (get(0)) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlinx.serialization.compiler.resolve.SerialEntityNames.SINGLE_MASK_FIELD_MISSING_FUNC_NAME\nimport org.jetbrains.org.objectweb.asm.Label\nimport org.jetbrains.org.objectweb.asm.Opcodes\nimport org.jetbrains.org.objectweb.asm.Type","completion":"import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter\n\nclass SerializableCodegenImpl(\n private val classCodegen: ImplementationBodyCodegen\n) : SerializableCodegen(classCodegen.descriptor, classCodegen.bindingContext) {\n\n private val thisAsmType = classCodegen.typeMapper.mapClass(serializableDescriptor)<|endoftext|>"} {"prompt":"override fun updateComplementaryFiles(dirtyFiles: Collection, expectActualTracker: ExpectActualTrackerImpl) {\n dirtyFiles.forEach {\n complementaryFilesMap.remove(it)\n }\n\n val actualToExpect = hashMapOf>()\n for ((expect, actuals) in expectActualTracker.expectToActualMap) {","completion":"for (actual in actuals) {\n actualToExpect.getOrPut(actual) { hashSetOf() }.add(expect)\n }\n complementaryFilesMap[expect] = actuals.union(complementaryFilesMap[expect].orEmpty())\n }\n\n for ((actual, expects) in actualToExpect) {<|endoftext|>"} {"prompt":"\n\npackage org.jetbrains.\n\nopen class A {\n companion object {\n\n }\n}\n\nclass B {\n companion object : A() {\n\n }\n}\n\nfun box(): String? {","completion":"if (!checkCompanionObjectName(A::class, \"org.jetbrains..A.\")) return null\n if (!checkCompanionObjectName(B::class, \"org.jetbrains..B.\")) return null<|endoftext|>"} {"prompt":"x.propNullableAny\n x.funT()","completion":"x.funAny()\n x.funNullableT()<|endoftext|>"} {"prompt":"val file = declaration.getPackageFragment() as? IrFile ?: return null\n return createCompilerMessageLocation(file, startOffset, endOffset)\n}\n\nprivate fun createCompilerMessageLocation(containingFile: IrFile, startOffset: Int, endOffset: Int): CompilerMessageLocation? {\n val sourceRangeInfo = containingFile.fileEntry.getSourceRangeInfo(startOffset, endOffset)","completion":"return CompilerMessageLocation.create(\n path = sourceRangeInfo.filePath,\n line = sourceRangeInfo.startLineNumber + 1,\n column = sourceRangeInfo.startColumnNumber + 1,\n lineContent = null \/\/ TODO: retrieve the line content.\n )\n}<|endoftext|>"} {"prompt":"constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())\n }\n\n enum class EnumerationCCC {\n ENTRY1,\n ENTRY2();\n\n constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())\n }\n\n enum class EnumerationCCD {\n ENTRY1 {","completion":"override fun abstractFunc() {\n TODO(\"Not yet implemented\")\n }\n },\n ENTRY2() {\n override fun abstractFunc() {\n TODO(\"Not yet implemented\")\n }\n };\n\n constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())\n\n abstract fun abstractFunc()\n }<|endoftext|>"} {"prompt":"}\n if (member.name in failedToResolveUnionTypes) {\n failedToResolveUnionTypes += unionType.name\n return\n }\n newDependenciesToAdd.putIfAbsent(member.name, mutableSetOf())\n newDependenciesToAdd[member.name]!!.add(IDLSingleTypeDeclaration(\n name = unionType.name,","completion":"typeParameter = null,\n nullable = false\n ))\n }\n is IDLSingleTypeDeclaration -> {\n if (member.typeParameter != null || !sourceSet.containsType(member.name)) {\n failedToResolveUnionTypes += unionType.name\n return\n }\n newDependenciesToAdd.putIfAbsent(member.name, mutableSetOf())<|endoftext|>"} {"prompt":"\/\/ JVM_ABI_K1_K2_DIFF: KT-63864\n\/\/ WITH_STDLIB\n\/\/ MODULE: lib\n\/\/ FILE: lib.kt\n\npackage a\n\nimport kotlin.reflect.KProperty\n\npublic val sb = StringBuilder()\n\nopen class A {\n open val x = 42\n}\n\nclass Delegate {\n val f = 117","completion":"operator fun getValue(receiver: Any?, p: KProperty<*>): Int {\n sb.appendLine(p.name)\n return f\n }\n}\n\nopen class B: A() {\n override val x: Int by Delegate()\n\n fun bar() {\n sb.appendLine(super.x)\n }\n}\n\n\/\/ MODULE: main(lib)<|endoftext|>"} {"prompt":"fun myRun(f: () -> V): V = f()\n\nfun test1(a: ParameterizedChild?, b: Child): Base = myRun {\n elvis(a, b)\n}\n\nfun test2(a: S?, b: S): S = myRun {","completion":"select(a, b)\n}<|endoftext|>"} {"prompt":"\/\/ `org.jetbrains.kotlin.idea.highlighting.highlighters.ExpressionsSmartcastHighlighter#highlightExpression`\n \/\/ function in intellij.git\n private fun KtSourceElement.isSourceForSmartCasts(fir: FirElement) =","completion":"(kind is KtFakeSourceElementKind.SmartCastExpression) && fir is FirSmartCastExpression && !fir.originalExpression.isImplicitThisReceiver\n\n private val FirExpression.isImplicitThisReceiver get() = this is FirThisReceiverExpression && this.isImplicit\n\n private fun FirElement.isReadInCompoundCall(): Boolean {<|endoftext|>"} {"prompt":"import com.intellij.psi.PsiElementFinder\nimport com.intellij.psi.PsiFileFactory\nimport com.intellij.psi.PsiPackageStatement\nimport com.intellij.psi.impl.PsiFileFactoryImpl\nimport com.intellij.psi.search.GlobalSearchScope\nimport com.intellij.testFramework.LightVirtualFile","completion":"import org.jetbrains.kotlin.ObsoleteTestInfrastructure\nimport org.jetbrains.kotlin.asJava.finder.JavaElementFinder\nimport org.jetbrains.kotlin.cli.jvm.compiler.*\nimport org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl\nimport org.jetbrains.kotlin.fir.expressions.builder.buildEmptyExpressionBlock\nimport org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirValueParameterSymbol\nimport org.jetbrains.kotlin.fir.types.ConeTypeProjection\nimport org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef<|endoftext|>"} {"prompt":"const val a = 100\n const val b = concat(\"Value in a: \", a)\n\n val nonConst = { \"Not const field in compile time object\" }()\n\n fun concat(first: String, second: Any) = \"$first$second\"\n}","completion":"const val numStatic = A.static\nconst val numStaticFromFun = A.getStaticNumber()\nconst val valFromObject = ObjectWithConst.b<|endoftext|>"} {"prompt":"package kotlin.script.experimental.jvmhost.repl\n\nimport org.jetbrains.kotlin.cli.common.repl.*\nimport org.jetbrains.kotlin.cli.common.repl.ReplEvaluator\nimport java.util.concurrent.locks.ReentrantReadWriteLock\nimport kotlin.concurrent.write\nimport kotlin.reflect.KClass","completion":"import kotlin.script.experimental.api.*\nimport kotlin.script.experimental.impl.internalScriptingRunSuspend\nimport kotlin.script.experimental.jvm.BasicJvmScriptEvaluator\nimport kotlin.script.experimental.jvm.baseClassLoader\nimport kotlin.script.experimental.jvm.impl.KJvmCompiledScript<|endoftext|>"} {"prompt":"final var z: Int = 42\n internal set\n}\nabstract class WithVarProtectedSet {\n abstract var x: Int\n protected set\n open var y: Int = 42\n protected set\n final var z: Int = 42\n protected set\n}\nabstract class WithVarPrivateSet {\n abstract var x: Int","completion":"private set\n open var y: Int = 42\n private set\n final var z: Int = 42\n private set\n}\n\ninterface IVal {\n val x: Int\n val y: Int<|endoftext|>"} {"prompt":"if (target is KotlinNativeTarget) {\n attributes.setAttribute(KotlinNativeTarget.konanTargetAttribute, target.konanTarget.name)\n }\n return this\n}\n\nprivate fun HasAttributes.setJavaTargetEnvironmentAttributeIfSupported(project: Project, value: String) {\n if (GradleVersion.current() >= GradleVersion.version(\"7.0\")) {","completion":"attributes.setAttribute(\n TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,\n project.objects.named(value)\n )\n }\n}\n\ninternal val Project.commonKotlinPluginClasspath get() = configurations.getByName(PLUGIN_CLASSPATH_CONFIGURATION_NAME)<|endoftext|>"} {"prompt":"interface StringList : List\n\nfun box(): String {\n assertEquals(\n listOf(String::class, Int::class),\n D::class.allSupertypes.single { it.classifier == A::class }.arguments.map { it.type!!.classifier }\n )","completion":"val collectionType = StringList::class.allSupertypes.single { it.classifier == Collection::class }\n val arg = collectionType.arguments.single().type!!\n \/\/ TODO: this does not work currently because for some reason two different instances of TypeParameterDescriptor are created for List\n \/\/ assertEquals(String::class, arg.classifier)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun CSSRuleList.get(index: Int): CSSRule? = asDynamic()[index]\n\n\/**\n * Exposes the JavaScript [CSSRule](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/CSSRule) to Kotlin\n *\/","completion":"public external abstract class CSSRule {\n open val type: Short\n open var cssText: String\n open val parentRule: CSSRule?\n open val parentStyleSheet: CSSStyleSheet?\n\n companion object {\n val STYLE_RULE: Short\n val CHARSET_RULE: Short\n val IMPORT_RULE: Short\n val MEDIA_RULE: Short<|endoftext|>"} {"prompt":"expectFailure(linkage(\"Constructor 'InterfaceToAbstractClassAndAbstractClassImpl.' can not be called: Class 'InterfaceToAbstractClassAndAbstractClassImpl' simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'\")) { getInterfaceToAbstractClassAndAbstractClassImplAsAny() }","completion":"expectFailure(linkage(\"Constructor 'InterfaceToAbstractClassAndAbstractClassImpl.' can not be called: Class 'InterfaceToAbstractClassAndAbstractClassImpl' simultaneously inherits from 2 classes: 'AbstractClass', 'InterfaceToAbstractClass1'\")) { getInterfaceToAbstractClassAndAbstractClassImplAsAnyInline() }<|endoftext|>"} {"prompt":"subType: SimpleTypeMarker,\n superType: SimpleTypeMarker\n ): Boolean? = with(state.typeSystemContext) {\n if (!subType.isIntegerLiteralType() && !superType.isIntegerLiteralType()) return null","completion":"fun isTypeInIntegerLiteralType(integerLiteralType: SimpleTypeMarker, type: SimpleTypeMarker, checkSupertypes: Boolean): Boolean =\n integerLiteralType.possibleIntegerTypes().any { possibleType ->\n (possibleType.typeConstructor() == type.typeConstructor()) || (checkSupertypes && isSubtypeOf(state, type, possibleType))\n }<|endoftext|>"} {"prompt":"assertEquals(listOf(1, 2, 3, 4, 5), intList)\n\n val longList = mutableListOf()\n val longProgression = 1L..6L\n for (i in longProgression step 2L step 1L) {\n longList += i\n }","completion":"assertEquals(listOf(1L, 2L, 3L, 4L, 5L), longList)\n\n val charList = mutableListOf()\n val charProgression = 'a'..'f'\n for (i in charProgression step 2 step 1) {\n charList += i\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.psi.KtWhenEntry\nimport org.jetbrains.kotlin.resolve.DescriptorUtils\nimport org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe\nimport org.jetbrains.kotlin.types.KotlinType\nimport org.jetbrains.kotlin.types.isError","completion":"import org.jetbrains.kotlin.types.typeUtil.isUnit\n\nfun LookupTracker.record(expression: KtExpression, type: KotlinType) {\n if (type.isError || type.isUnit()) return\n\n val typeDescriptor = type.constructor.declarationDescriptor ?: return\n val scopeDescriptor = typeDescriptor.containingDeclaration<|endoftext|>"} {"prompt":"val element0 = '0'\nval element1 = '1'\nval element2 = '2'\nval element3 = '3'\nval element4 = '4'\n\nfun box(): String {\n testR0xE0()\n testR0xE1()\n testR0xE2()\n testR0xE3()\n testR0xE4()","completion":"testR1xE0()\n testR1xE1()\n testR1xE2()\n testR1xE3()\n testR1xE4()\n return \"OK\"\n}\n\nfun testR0xE0() {\n \/\/ with possible local optimizations<|endoftext|>"} {"prompt":"val artifactsView = metadataDependenciesConfiguration.incoming.artifactView { view ->\n view.componentFilter { id -> id in keptOriginalDependencyResolutionIds }\n view.isLenient = true\n }\n\n return artifactsView.artifacts.mapNotNull { artifact ->\n val moduleId = artifact.id.componentIdentifier as? ModuleComponentIdentifier ?: return@mapNotNull null","completion":"IdeaKotlinResolvedBinaryDependency(\n binaryType = IdeaKotlinBinaryDependency.KOTLIN_COMPILE_BINARY_TYPE,\n classpath = IdeaKotlinClasspath(artifact.file),\n coordinates = IdeaKotlinBinaryCoordinates(moduleId, artifact.variant.capabilities, artifact.variant.attributes)\n )<|endoftext|>"} {"prompt":"fun vertexAttribPointer(index: Int, size: Int, type: Int, normalized: Boolean, stride: Int, offset: Int)\n fun viewport(x: Int, y: Int, width: Int, height: Int)\n\n companion object {\n val DEPTH_BUFFER_BIT: Int\n val STENCIL_BUFFER_BIT: Int\n val COLOR_BUFFER_BIT: Int","completion":"val POINTS: Int\n val LINES: Int\n val LINE_LOOP: Int\n val LINE_STRIP: Int\n val TRIANGLES: Int\n val TRIANGLE_STRIP: Int\n val TRIANGLE_FAN: Int\n val ZERO: Int\n val ONE: Int\n val SRC_COLOR: Int\n val ONE_MINUS_SRC_COLOR: Int<|endoftext|>"} {"prompt":"\/\/ \"⥴\" to 10612,\n\/\/ \"⤖\" to 10518,\n\/\/ \"↣\" to 8611,\n\/\/ \"↝\" to 8605,\n\/\/ \"⤚\" to 10522,\n\/\/ \"⤜\" to 10524,\n\/\/ \"∶\" to 8758,","completion":"\/\/ \"ℚ\" to 8474,\n\/\/ \"⤍\" to 10509,\n\/\/ \"⤏\" to 10511,\n\/\/ \"⤐\" to 10512,\n\/\/ \"❳\" to 10099,\n\/\/ \"}\" to 125,\n\/\/ \"]\" to 93,\n\/\/ \"⦌\" to 10636,<|endoftext|>"} {"prompt":"* Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n *\/\npublic infix fun Short.downTo(to: Long): LongProgression {","completion":"return LongProgression.fromClosedRange(this.toLong(), to, -1L)\n}\n\n\/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n *\/<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +StrictJavaNullabilityAssertions\n\/\/ TARGET_BACKEND: JVM\n\/\/ WITH_STDLIB\n\/\/ JVM_TARGET: 1.8\n\n\/\/ FILE: box.kt\nimport kotlin.test.*\n\nfun box(): String {\n val actualValues = mutableListOf()\n for (i in J.iteratorOfNotNull()) {","completion":"actualValues += i\n }\n assertEquals(listOf(42, -42), actualValues)\n return \"OK\"\n}\n\n\/\/ FILE: J.java\nimport java.util.*;\nimport org.jetbrains.annotations.*;\n\npublic class J {\n public static Iterator<@NotNull Integer> iteratorOfNotNull() {\n List list = new ArrayList<>();<|endoftext|>"} {"prompt":"private var functionReport: MetadataPropertyReport? = null\n\n override fun isEmpty() = propertyDiffs.isEmpty() && functionReport.isNullOrEmpty()\n\n override fun writeAsHtml(output: PrintWriter) {\n if (isEmpty()) return\n output.tag(\"h2\", \"SYNTHETIC CLASS METADATA $classInternalName\")","completion":"functionReport?.run { writeAsHtml(output) }\n }\n\n fun functionReport() = MetadataPropertyReport(\"function\", header1, header2).also { functionReport = it }\n\n fun addPropertyDiff(diff: NamedDiffEntry) {\n propertyDiffs.add(diff)\n }\n\n fun TextTreeBuilderContext.appendSyntheticClassMetadataReport() {<|endoftext|>"} {"prompt":"fun notOverwriteCustomResDirs(gradleVersion: GradleVersion) {\n project(\"simpleProject\", gradleVersion) {\n val mainResDir = projectPath.resolve(\"src\/main\/resources\").apply { createDirectories() }\n val mainResFile = mainResDir.resolve(\"main.txt\").apply { writeText(\"Yay, Kotlin!\") }","completion":"val additionalResDir = projectPath.resolve(\"src\/main\/extra-resources\").apply { createDirectory() }\n val additionalResFile = additionalResDir.resolve(\"test.txt\").apply { writeText(\"Kotlin!\") }\n\n buildGradle.writeText(\n \"\"\"\n |plugins {\n\t | id 'java'<|endoftext|>"} {"prompt":"return \"Wrong elements for MaxL..MinL: $list4\"\n }\n\n val list5 = ArrayList()\n for (i in MaxC..MinC) {\n list5.add(i)\n if (list5.size > 23) break\n }\n if (list5 != listOf()) {","completion":"return \"Wrong elements for MaxC..MinC: $list5\"\n }\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"+ (node?.let { \"n${ids[it]!!}\" } ?: \"t${tempIds[this]}\")) +\n \"[d=$depth,${if (this in escapeOrigins) \"eo\" else if (escapes(this)) \"e\" else \"\"}]\"\n\n for (from in allNodes) {\n if (!nodeFilter(from)) continue","completion":"for (it in from.edges) {\n val to = it.node\n if (!nodeFilter(to)) continue\n when (it) {\n is PointsToGraphEdge.Assignment ->\n +\" \\\"${from.format()}\\\" -> \\\"${to.format()}\\\";\"\n is PointsToGraphEdge.Field -><|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.resolve.calls.inference\n\nimport org.jetbrains.kotlin.builtins.*\nimport org.jetbrains.kotlin.descriptors.TypeParameterDescriptor\nimport org.jetbrains.kotlin.descriptors.annotations.Annotations","completion":"import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderImpl.ConstraintKind.EQUAL\nimport org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderImpl.ConstraintKind.SUB_TYPE\nimport org.jetbrains.kotlin.resolve.calls.inference.TypeBounds.Bound<|endoftext|>"} {"prompt":"} finally {\n finallyBlock()\n }\n return res\n}\n\npublic inline fun doCall2(block: ()-> R, exception: (e: Exception)-> Unit, finallyBlock: ()-> R, res: R) : R {\n try {\n return block()\n } catch (e: Exception) {\n exception(e)\n } finally {\n finallyBlock()","completion":"}\n return res\n}\n\n\/\/ FILE: 2.kt\n\nimport test.*\n\nclass Holder {\n var value: String = \"\"\n}\n\nfun test0(h: Holder): Int {\n val localResult = doCall2 (\n {\n h.value += \"OK_NONLOCAL\"\n if (true) {\n throw RuntimeException()\n }\n return 1\n },<|endoftext|>"} {"prompt":"val leftVal = if (left is IrGetValue) left.symbol.owner else irTemporary(left)\n val rightVal = if (right is IrGetValue) right.symbol.owner else irTemporary(right)\n\n val equalsCall = equals(\n if (leftNullCheck) irImplicitCast(irGet(leftVal), left.type.makeNotNull()) else irGet(leftVal),","completion":"if (rightNullCheck) irImplicitCast(irGet(rightVal), right.type.makeNotNull()) else irGet(rightVal)\n )\n\n val equalsRight = if (rightNullCheck) {\n irIfNull(context.irBuiltIns.booleanType, irGet(rightVal), irFalse(), equalsCall)\n } else {\n equalsCall\n }<|endoftext|>"} {"prompt":"* @throws JsonElementTypeMismatchException is current element is not a [JsonObject]\n *\/\n open val jsonObject: JsonObject\n get() = error(\"JsonObject\")\n\n \/**\n * Convenience method to get current element as [JsonArray]\n * @throws JsonElementTypeMismatchException is current element is not a [JsonArray]\n *\/","completion":"open val jsonArray: JsonArray\n get() = error(\"JsonArray\")\n\n \/**\n * Convenience method to get current element as [JsonNull]\n * @throws JsonElementTypeMismatchException is current element is not a [JsonNull]\n *\/\n open val jsonNull: JsonNull\n get() = error(\"JsonPrimitive\")\n\n \/**<|endoftext|>"} {"prompt":"val builtInsFragments = module.getPackage(packageFqName).fragments.filterIsInstance()\n\n \/\/ JS IR backend uses separate FunctionInterfacePackageFragment for function interfaces\n val containingPackageFragment =\n builtInsFragments.filterIsInstance().firstOrNull() ?: builtInsFragments.first()","completion":"return FunctionClassDescriptor(storageManager, containingPackageFragment, kind, arity)\n }\n\n override fun getAllContributedClassesIfPossible(packageFqName: FqName): Collection {\n \/\/ We don't want to return 256 classes here since it would cause them to appear in every import list of every file\n \/\/ and likely slow down compilation very much\n return emptySet()<|endoftext|>"} {"prompt":"@kotlin.internal.IntrinsicConstEvaluation public final operator fun plus(other: kotlin.Long): kotlin.Long { \/* compiled code *\/ }\n\n @kotlin.internal.IntrinsicConstEvaluation public final operator fun plus(other: kotlin.Short): kotlin.Int { \/* compiled code *\/ }","completion":"public final operator fun rangeTo(other: kotlin.Byte): kotlin.ranges.IntRange { \/* compiled code *\/ }\n\n public final operator fun rangeTo(other: kotlin.Int): kotlin.ranges.IntRange { \/* compiled code *\/ }\n\n public final operator fun rangeTo(other: kotlin.Long): kotlin.ranges.LongRange { \/* compiled code *\/ }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.config.LanguageFeature\nimport org.jetbrains.kotlin.fir.FirElementWithResolveState\nimport org.jetbrains.kotlin.fir.declarations.*\nimport org.jetbrains.kotlin.fir.expressions.FirStatement\nimport org.jetbrains.kotlin.fir.isCopyCreatedInScope","completion":"import org.jetbrains.kotlin.fir.languageVersionSettings\nimport org.jetbrains.kotlin.fir.resolve.transformers.mpp.FirExpectActualMatcherTransformer\nimport org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.incremental.parsing\n\nimport com.intellij.openapi.Disposable\nimport com.intellij.openapi.util.Disposer\nimport com.intellij.openapi.vfs.StandardFileSystems\nimport com.intellij.openapi.vfs.VirtualFileManager","completion":"import com.intellij.openapi.vfs.local.CoreLocalFileSystem\nimport com.intellij.psi.PsiManager\nimport com.intellij.psi.SingleRootFileViewProvider\nimport org.jetbrains.kotlin.cli.common.CLIConfigurationKeys\nimport org.jetbrains.kotlin.cli.common.messages.MessageCollector<|endoftext|>"} {"prompt":"return commonSystem.fixedTypeVariables as Map \/\/ TODO: SUB\n }\n\n private fun getNestedBuilderInferenceSessions() = buildList {\n for (nestedSession in nestedInferenceSessions) {\n when (nestedSession) {\n is BuilderInferenceSession -> add(nestedSession)","completion":"is DelegateInferenceSession -> addAll(nestedSession.getNestedBuilderInferenceSessions())\n }\n }\n }\n\n \/*\n * We update calls in top-down way:\n * - updating calls within top-level builder inference call\n * - ...\n * - updating calls within the deepest builder inference call\n *\/<|endoftext|>"} {"prompt":"ExitNodeMarker {\n override fun accept(visitor: ControlFlowGraphVisitor, data: D): R {\n return visitor.visitTryMainBlockExitNode(this, data)\n }\n}\nclass CatchClauseEnterNode(owner: ControlFlowGraph, override val fir: FirCatch, level: Int) : CFGNode(owner, level),","completion":"EnterNodeMarker {\n override fun accept(visitor: ControlFlowGraphVisitor, data: D): R {\n return visitor.visitCatchClauseEnterNode(this, data)\n }\n}<|endoftext|>"} {"prompt":"\/\/ !CHECK_TYPE\n\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER\ndata class A(val x: Int, val y: String)\ndata class B(val u: Double, val w: Short)\n\nfun foo(block: (A, B) -> Unit) { }\n\nfun bar() {","completion":"foo { (a, a), b ->\n a checkType { _() }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.diagnostics\n\nimport com.intellij.psi.PsiElement\nimport org.jetbrains.kotlin.config.LanguageFeature\nimport org.jetbrains.kotlin.config.LanguageVersionSettings","completion":"sealed class DiagnosticFactoryForDeprecation>(\n val deprecatingFeature: LanguageFeature,\n val warningFactory: F,\n val errorFactory: F\n) {\n fun LanguageVersionSettings.chooseFactory(): F {\n return if (supportsFeature(deprecatingFeature)) errorFactory else warningFactory<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmFlags as JF\n\n\/**\n * Applicable to a property declared in an interface's companion object.\n * Indicates that its backing field is declared as a static\n * field in the interface. In Kotlin code, this usually happens if the property is annotated with [JvmField].\n *","completion":"* Returns `false` if the property is not declared in a companion object of some interface.\n *\/\npublic var KmProperty.isMovedFromInterfaceCompanion: Boolean by BooleanFlagDelegate(\n KmProperty::jvmFlags,\n booleanFlag(JF.IS_MOVED_FROM_INTERFACE_COMPANION)\n)\n\n\/**<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef\nimport org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef\nimport org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl\nimport org.jetbrains.kotlin.fir.visitors.transformSingle","completion":"import org.jetbrains.kotlin.resolve.calls.inference.addEqualityConstraintIfCompatible\nimport org.jetbrains.kotlin.resolve.calls.inference.addSubtypeConstraintIfCompatible\nimport org.jetbrains.kotlin.resolve.calls.inference.buildAbstractResultingSubstitutor<|endoftext|>"} {"prompt":".unsubstitutedMemberScope\n .getDescriptorsFiltered()\n .filter(DescriptorUtils::isEnumEntry)\n }\n\n override val CallableSymbolMarker.dispatchReceiverType: KotlinTypeMarker?\n get() = asDescriptor().dispatchReceiverParameter?.type","completion":"override val CallableSymbolMarker.extensionReceiverType: KotlinTypeMarker?\n get() = asDescriptor().extensionReceiverParameter?.type\n override val CallableSymbolMarker.returnType: KotlinTypeMarker\n get() = asDescriptor().returnType!!\n override val CallableSymbolMarker.typeParameters: List<|endoftext|>"} {"prompt":"}\n else -> {\n @OptIn(UnsafeExpressionUtility::class)\n argument.toResolvedCallableSymbolUnsafe()?.takeIf { it.fir is FirEnumEntry }\n }\n } ?: return\n processBranch(symbol, isNegated, data)\n }","completion":"override fun visitTypeOperatorCall(typeOperatorCall: FirTypeOperatorCall, data: Flags) {\n val isNegated = when (typeOperatorCall.operation) {\n FirOperation.IS -> false\n FirOperation.NOT_IS -> true\n else -> return\n }<|endoftext|>"} {"prompt":"\/\/ when this member is referenced in subclass.\n if (isStatic)\n JavaDescriptorVisibilities.PROTECTED_STATIC_VISIBILITY\n else\n DescriptorVisibilities.PROTECTED\n }\n else ->\n target.visibility\n }\n isSuspend = target.isSuspend\n }.apply proxy@{\n parent = this@makeProxy","completion":"copyAttributes(target)\n copyTypeParametersFrom(target)\n copyAnnotationsFrom(target)\n if (!isStatic) {\n dispatchReceiverParameter = thisReceiver?.copyTo(this, type = defaultType)\n }\n extensionReceiverParameter = target.extensionReceiverParameter?.copyTo(this)<|endoftext|>"} {"prompt":"override fun readWriteAccessWithFullExpressionByResolve(assignment: KtBinaryExpression): Pair {\n val resolvedCall = analyze(assignment) {\n with((this as KtFe10AnalysisSession).analysisContext.analyze(assignment, Fe10AnalysisFacade.AnalysisMode.PARTIAL)) {","completion":"assignment.getCall(this)?.getResolvedCall(this) ?: return ReferenceAccess.READ_WRITE to assignment\n }\n }\n return if (resolvedCall.resultingDescriptor.name in OperatorConventions.ASSIGNMENT_OPERATIONS.values)\n ReferenceAccess.READ to assignment\n else\n ReferenceAccess.READ_WRITE to assignment\n }\n}<|endoftext|>"} {"prompt":"\/\/ Auto-generated by GenerateSteppedRangesCodegenTestData. Do not edit!\n\/\/ WITH_STDLIB\nimport kotlin.test.*\n\nfun box(): String {\n val uintList = mutableListOf()\n val uintProgression = UInt.MIN_VALUE until UInt.MAX_VALUE\n for (i in uintProgression step Int.MAX_VALUE) {\n uintList += i","completion":"}\n assertEquals(listOf(UInt.MIN_VALUE, 2147483647u, UInt.MAX_VALUE - 1u), uintList)\n\n val ulongList = mutableListOf()\n val ulongProgression = ULong.MIN_VALUE until ULong.MAX_VALUE\n for (i in ulongProgression step Long.MAX_VALUE) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.dsl.HasConfigurableKotlinCompilerOptions\nimport org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions\nimport org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension","completion":"import org.jetbrains.kotlin.gradle.plugin.mpp.external.DecoratedExternalKotlinTarget\n\ndata class PrototypeAndroidDsl(\n var compileSdk: Int\n)\n\n@OptIn(ExperimentalKotlinGradlePluginApi::class)\nclass PrototypeAndroidTarget(\n delegate: Delegate,\n val androidDsl: PrototypeAndroidDsl<|endoftext|>"} {"prompt":"\"\"\".trimIndent()\n )\n\n analyze(file) {\n val foo = file\n .getClassOrFail(\"PublicA\").getMemberScope()\n .getClassOrFail(\"PrivateB\").getMemberScope()\n .getClassOrFail(\"PublicC\")\n .getFunctionOrFail(\"foo\")\n assertFalse(foo.isVisibleInObjC())\n }\n }","completion":"@Test\n fun `test - invisible symbol inside public class marked with @HidesFromObjC`() {\n val file = inlineSourceCodeAnalysis.createKtFile(\n \"\"\"\n @kotlin.native.HidesFromObjC\n annotation class HideIt \n\n @HideIt\n class PublicClass {\n fun foo()\n }\n \"\"\".trimIndent()\n )<|endoftext|>"} {"prompt":"The Default Kotlin Hierarchy Template was not applied to '${project.displayName}':\n Explicit .dependsOn() edges were configured for the following source sets:\n ${sourceSetsWithDependsOnEdges.toSet().map { it.name }}\n \n Consider removing dependsOn-calls or disabling the default template by adding","completion":"'$KOTLIN_MPP_APPLY_DEFAULT_HIERARCHY_TEMPLATE=false'\n to your gradle.properties\n \n Learn more about hierarchy templates: https:\/\/kotl.in\/hierarchy-template\n \"\"\".trimIndent()\n )\n }<|endoftext|>"} {"prompt":"@JvmField\n var myFloatFieldFromConst: Float = constFloat\n @JvmField\n var myBooleanFieldFromConst: Boolean = constBoolean\n @JvmField\n var myCharFieldFromConst: Char = constChar\n\n @JvmField\n var myIntField: Int = 0\n @JvmField\n var myByteField: Byte = 0\n @JvmField","completion":"var myLongField: Long = 0L\n @JvmField\n var myShortField: Short = 0\n @JvmField\n var myDoubleField: Double = 0.0\n @JvmField\n var myFloatField: Float = 0.0f\n @JvmField\n var myBooleanField: Boolean = false\n @JvmField<|endoftext|>"} {"prompt":"}\n}\n\ninternal object CheckCallModifiers : CheckerStage() {\n override suspend fun check(candidate: Candidate, callInfo: CallInfo, sink: CheckerSink, context: ResolutionContext) {\n if (callInfo.callSite is FirFunctionCall) {\n when (val functionSymbol = candidate.symbol) {\n is FirNamedFunctionSymbol -> when {","completion":"callInfo.callSite.origin == FirFunctionCallOrigin.Infix && !functionSymbol.fir.isInfix ->\n sink.reportDiagnostic(InfixCallOfNonInfixFunction(functionSymbol))\n callInfo.callSite.origin == FirFunctionCallOrigin.Operator && !functionSymbol.fir.isOperator -><|endoftext|>"} {"prompt":"computeDescriptors(kindFilter, nameFilter, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS) +\n c.components.fictitiousClassDescriptorFactories.flatMap { it.getAllContributedClassesIfPossible(packageFqName) }\n\n override fun hasClass(name: Name) =","completion":"super.hasClass(name) || c.components.fictitiousClassDescriptorFactories.any { it.shouldCreateClass(packageFqName, name) }\n\n override fun createClassId(name: Name) = ClassId(packageFqName, name)\n\n override fun getContributedClassifier(name: Name, location: LookupLocation): ClassifierDescriptor? {<|endoftext|>"} {"prompt":"lastValueAsULong > (constLimitAsULong - stepValueAsLong.toULong())\n }\n else -> error(\"Unexpected progression direction\")\n }\n } else {\n val lastValueAsLong = last.constLongValue ?: return@lazy true \/\/ If \"last\" is not a const Number or Char.\n when (direction) {\n ProgressionDirection.DECREASING -> {","completion":"val constLimitAsLong = progressionType.minValueAsLong\n lastValueAsLong < (constLimitAsLong - stepValueAsLong)\n }\n ProgressionDirection.INCREASING -> {\n val constLimitAsLong = progressionType.maxValueAsLong\n lastValueAsLong > (constLimitAsLong - stepValueAsLong)\n }\n else -> error(\"Unexpected progression direction\")\n }<|endoftext|>"} {"prompt":"binaryOperation(INT, BYTE, \"plus\", { a, b -> a.plus(b) }, { a, b -> a.add(b) }),\n binaryOperation(INT, DOUBLE, \"plus\", { a, b -> a.plus(b) }, emptyBinaryFun),\n binaryOperation(INT, FLOAT, \"plus\", { a, b -> a.plus(b) }, emptyBinaryFun),","completion":"binaryOperation(INT, INT, \"plus\", { a, b -> a.plus(b) }, { a, b -> a.add(b) }),\n binaryOperation(INT, LONG, \"plus\", { a, b -> a.plus(b) }, { a, b -> a.add(b) }),<|endoftext|>"} {"prompt":"contract { returns() implies (this@case_3 is Number && this@case_3 is Int && this@case_3 != null) }\n if (!(this@case_3 is Number && this@case_3 is Int && this@case_3 != null)) throw Exception()\n}","completion":"\/\/ TESTCASE NUMBER: 4\nfun T?.case_4_1(): Boolean {\n contract { returns(true) implies (this@case_4_1 != null && this@case_4_1 is String) }\n return this@case_4_1 != null && this@case_4_1 is String\n}\nfun T?.case_4_2(): Boolean {<|endoftext|>"} {"prompt":"if (overwriteOnlyOlderFiles && targetFile.exists() && resource.lastModified() < targetFile.lastModified()) return\n\n targetFile.parentFile.mkdirs()\n resource.reader().use { input ->\n FileOutputStream(targetFile).use { output ->\n input.copyTo(output)\n }\n }\n }","completion":"private fun mapSourcePaths(inputFile: File, targetFile: File): Boolean {\n val jsonOut = StringWriter()\n val pathCalculator = RelativePathCalculator(targetFile.parentFile)\n val sourceMapChanged = try {\n SourceMap.mapSources(inputFile.readText(), jsonOut) {<|endoftext|>"} {"prompt":"fun interface NestedSimple\n\n fun interface GoodFun {\n fun invoke()\n }\n\n fun interface NestedFun {\n fun inovke(element: K)\n }\n}\n\nfun local() {","completion":"fun interface LocalFun {\n fun invoke(element: T)\n }\n}\n\nfun interface WithDefaultValue {\n fun invoke(s: String = \"\")\n}\n\ninterface BaseWithDefaultValue {<|endoftext|>"} {"prompt":"\/\/ val anyValues: List = values.filterIsInstance()\n\/\/ assertEquals(values.toList(), anyValues)\n\n val charValues: List = values.filterIsInstance()\n assertEquals(0, charValues.size)\n }\n\n @Test fun filterIsInstanceArray() {","completion":"val src: Array = arrayOf(1, 2, 3.0, \"abc\", \"cde\")\n\n val numberValues: List = src.filterIsInstance()\n assertEquals(listOf(1, 2, 3.0), numberValues)\n\n \/\/ doesn't distinguish double from int in JS<|endoftext|>"} {"prompt":"public constructor SubclassOptInRequired(markerClass: kotlin.reflect.KClass)\n\n public final val markerClass: kotlin.reflect.KClass { get; }\n}","completion":"@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION,<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.decompiled.light.classes.origin\n\nimport com.intellij.openapi.application.ApplicationManager\nimport com.intellij.psi.PsiArrayType\nimport com.intellij.psi.PsiField\nimport com.intellij.psi.PsiMember\nimport com.intellij.psi.PsiMethod","completion":"import com.intellij.psi.PsiParameterList\nimport com.intellij.psi.PsiPrimitiveType\nimport com.intellij.psi.PsiType\nimport org.jetbrains.kotlin.analysis.decompiler.psi.file.KtClsFile<|endoftext|>"} {"prompt":"return this@AbstractCharClass.contains(ch) && !containslHS\n }\n }\n result.alt = this.alt\n result.altSurrogates = this.altSurrogates\n result.mayContainSupplCodepoints = this.mayContainSupplCodepoints\n return result\n }\n\n \/**","completion":"* Sets this CharClass to negative form, i.e. if they will add some characters and after that set this\n * class to negative it will accept all the characters except previously set ones.\n *\n * Although this method will not alternate all the already set characters,\n * just overall meaning of the class.\n *\/\n fun setNegative(value: Boolean): AbstractCharClass {\n if (alt xor value) {<|endoftext|>"} {"prompt":"if (++count == n)\n break\n }\n return list\n}\n\n\/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n *\/\npublic fun LongArray.take(n: Int): List {","completion":"require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)<|endoftext|>"} {"prompt":"assertCommandLineArgumentsContain(escapedQuotedPath)\n }\n }\n }\n }\n\n @DisplayName(\"Checks binary options dsl\")\n @GradleTest\n fun testBinaryOptionsDSL(gradleVersion: GradleVersion) {\n nativeProject(\"native-binaries\/executables\", gradleVersion) {\n buildGradleKts.appendText(\n \"\"\"","completion":"kotlin.targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget::class.java) {\n binaries.all { binaryOptions[\"memoryModel\"] = \"experimental\" }\n }\n \"\"\".trimIndent()\n )\n build(\":linkDebugExecutableHost\") {<|endoftext|>"} {"prompt":"}\n\n return builder.build()\n }\n\n private fun processAnnotation(builder: ImmutableSet.Builder, annotationDescriptor: AnnotationDescriptor) {\n if (annotationDescriptor.fqName != StandardNames.FqNames.suppress) return\n\n \/\/ We only add strings and skip other values to facilitate recovery in presence of erroneous code","completion":"for (arrayValue in annotationDescriptor.allValueArguments.values) {\n if (arrayValue is ArrayValue) {\n for (value in arrayValue.value) {\n if (value is StringValue) {\n builder.add(value.value.lowercase())\n }\n }\n }\n }\n }<|endoftext|>"} {"prompt":"val classifierName = when {\n kClass == null -> classifier.toString()\n kClass.simpleName != null -> kClass.simpleName\n else -> \"(non-denotable type)\"\n }\n\n val args =\n if (arguments.isEmpty()) \"\"\n else arguments.joinToString(\", \", \"<\", \">\")","completion":"val nullable = if (isMarkedNullable) \"?\" else \"\"\n\n return classifierName + args + nullable\n }\n}<|endoftext|>"} {"prompt":"return CompilerMessageLocationWithRange.create(sourceFile.path, startLine, startColumn, endLine, endColumn, text?.toString())\n}\n\nprivate fun FirFile.getLineAndColumnStartingWithOnesAt(offset: Int?): Pair? {\n return offset?.let { sourceFileLinesMapping?.getLineAndColumnByOffsetStartingWithOnes(it) }\n}","completion":"private fun KtSourceFileLinesMapping.getLineAndColumnByOffsetStartingWithOnes(startOffset: Int): Pair {\n val (line, column) = getLineAndColumnByOffset(startOffset)\n return line + 1 to column + 1\n}\n\nfun getLibraryFromHome(\n paths: PathProvider?,\n getLibrary: (PathProvider) -> File,<|endoftext|>"} {"prompt":"case313 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 314\nfun case314(){\n val case314 = '\\u9cff'\n case314\n case314 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 315\nfun case315(){","completion":"val case315 = '\\u9d00'\n case315\n case315 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 316\nfun case316(){\n val case316 = '\\u9dff'<|endoftext|>"} {"prompt":".filter { it !is IdeaKotlinBinaryDependency }\n .assertMatches(\n dependsOnDependency(\":consumer\/commonMain\"),\n projectArtifactDependency(IdeaKotlinSourceDependency.Type.Regular, \":producer\", FilePathRegex(\".*producer.jar\"))\n )\n }\n\n @Test","completion":"fun `test - project to jvm (java only) project dependency`() {\n val root = buildProject()\n\n val producer = buildProject({ withParent(root).withName(\"producer\") }) { plugins.apply(JavaLibraryPlugin::class.java) }\n val consumer = buildProject({ withParent(root).withName(\"consumer\") }) { configureAndroidAndMultiplatform() }<|endoftext|>"} {"prompt":"println(value_1?.toByte())\n funWithReturns(value_1 is Number)\n println(value_1.toByte())\n if (funWithReturnsNull(value_1 is Int) == null) println(value_1.inv())\n }\n}\n\n\/\/ TESTCASE NUMBER: 3\nfun case_3(value_1: Int?, value_2: Any?) {","completion":"if (!value_1.case_3(value_1, value_2 is Number?)) {\n println(value_2?.toByte())\n println(value_1.inv())\n } else if (value_1.case_3(value_1, value_2 is Number?)) {\n println(value_1)\n } else {\n println(value_1.inv())\n }\n}<|endoftext|>"} {"prompt":"tmpdir, testRootDisposable, jdkKind, ConfigurationKind.ALL, true, false, false, false, null\n ).first\n\n RecursiveDescriptorComparatorAdaptor.validateAndCompareDescriptors(expected, actual, comparatorConfiguration, null)\n }\n\n private fun DeclarationDescriptor.isJavaAnnotationConstructor() =\n this is ClassConstructorDescriptor &&","completion":"containingDeclaration is JavaClassDescriptor &&\n containingDeclaration.kind == ClassKind.ANNOTATION_CLASS\n\n @OptIn(ObsoleteTestInfrastructure::class)\n private fun compileFile(file: File, text: String, jdkKind: TestJdkKind) {\n val fileName = file.name\n when {\n fileName.endsWith(\".java\") -> {<|endoftext|>"} {"prompt":"if (a.v != null) a.v.propNullableAny\n if (a.v != null) a.v.funT()","completion":"if (a.v != null) a.v.funAny()\n if (a.v != null) a.v.funNullableT()<|endoftext|>"} {"prompt":"buildConcatenationCall(plusImplFunction, buildNullableArgToString(extensionReceiver!!), buildNullableArgToString(getValueArgument(0)!!))\n\n else -> expression\n }\n }\n }\n\n private fun buildConcatenationCall(function: IrSimpleFunction, receiver: IrExpression, argument: IrExpression): IrExpression =","completion":"builder.irCall(function.symbol, function.returnType, valueArgumentsCount = 1, typeArgumentsCount = 0)\n .apply {\n putValueArgument(0, argument)\n dispatchReceiver = receiver\n }\n\n \/** Builds snippet of type String<|endoftext|>"} {"prompt":"fun compare(v: String) = areEqualNumbers(v)\n\n val zero = when (kind) {\n LONG -> \"0L\"\n else -> \"0\"\n }\n val checkZero = \"\"\"if (step == $zero) throw kotlin.IllegalArgumentException(\"Step must be non-zero.\")\"\"\"\n\n val stepMinValue = \"$incrementType.MIN_VALUE\"","completion":"val checkMin = \"\"\"if (step == $stepMinValue) throw kotlin.IllegalArgumentException(\"Step must be greater than $stepMinValue to avoid overflow on negation.\")\"\"\"\n\n val hashCode = \"=\\n\" + when (kind) {\n CHAR ->\n \" if (isEmpty()) -1 else (31 * (31 * first.code + last.code) + step)\"\n INT -><|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.daemon.client\n\nimport org.jetbrains.kotlin.daemon.common.*\nimport org.jetbrains.kotlin.incremental.components.*\nimport org.jetbrains.kotlin.incremental.js.IncrementalDataProvider\nimport org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer","completion":"import org.jetbrains.kotlin.incremental.js.JsInlineFunctionHash\nimport org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents\nimport org.jetbrains.kotlin.load.kotlin.incremental.components.JvmPackagePartProto\nimport org.jetbrains.kotlin.modules.TargetId<|endoftext|>"} {"prompt":"fun clang_Cursor_isMacroBuiltin(C: CValue): Int {\n memScoped {\n return kniBridge146(C.getPointer(memScope).rawValue)\n }\n}\n\nfun clang_Cursor_isFunctionInlined(C: CValue): Int {\n memScoped {","completion":"return kniBridge147(C.getPointer(memScope).rawValue)\n }\n}\n\nfun clang_isVolatileQualifiedType(T: CValue): Int {\n memScoped {\n return kniBridge148(T.getPointer(memScope).rawValue)\n }\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\nimport Host.x\n\nobject A {\n var xx = intArrayOf(0)\n}\n\nobject Host {\n val A.x get() = A.xx\n}\n\nfun box(): String {\n A.x[0] += 1\n if (A.x[0] != 1) return \"Fail 1: ${A.x[0]}\"","completion":"A.x[0]++\n if (A.x[0] != 2) return \"Fail 2: ${A.x[0]}\"\n\n ++A.x[0]\n if (A.x[0] != 3) return \"Fail 3: ${A.x[0]}\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses, +GenericInlineClassParameter\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class X(val x: T)\n\ninterface IFoo {\n fun foo(): Any\n fun bar(): X\n}\n\nclass TestX : IFoo {","completion":"override fun foo(): X = X(\"O\")\n override fun bar(): X = X(\"K\")\n}\n\nfun box(): String {\n val t: IFoo = TestX()\n val tFoo = t.foo()\n if (tFoo !is X<*>) {\n throw AssertionError(\"X expected: $tFoo\")\n }<|endoftext|>"} {"prompt":"super.resolve(scriptContents, environment)\n}\n\n@Target(AnnotationTarget.FILE)\nannotation class TestAnno1\n\n@Target(AnnotationTarget.FILE)\nannotation class TestAnno2\n\n@Target(AnnotationTarget.FILE)\nannotation class TestAnno3","completion":"private val annotationFqNames = listOf(TestAnno1::class, TestAnno2::class, TestAnno3::class).map { it.qualifiedName!! }\n\ninterface AcceptedAnnotationsCheck {\n fun checkHasAnno1Annotation(scriptContents: ScriptContents): ResolveResult.Success {\n val actualAnnotations = scriptContents.annotations\n Assert.assertTrue(<|endoftext|>"} {"prompt":"public inline fun Array.associateBy(keySelector: (T) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n\/**\n * Returns a [Map] containing the elements from the given array indexed by the key","completion":"* returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n *\/<|endoftext|>"} {"prompt":"generateSerializerForType(type, this, intrinsicType)\n }\n descriptor.append(kSerializerArrayType.descriptor)\n }\n descriptor.append(\")${kSerializerType.descriptor}\")\n invokestatic(\n serializersKtInternalName,\n noCompiledSerializerMethodName,\n descriptor.toString(),\n false","completion":")\n return false\n }\n\n private fun InstructionAdapter.moduleOverPolymorphic(serializer: IrClassSymbol, kType: IrType, intrinsicType: IntrinsicType, argSerializers: List>): Boolean {<|endoftext|>"} {"prompt":"val receiverExpression = expressionReceiverValue.expression\n val c = context.resolutionContext\n\n val assertionInfo = RuntimeAssertionInfo.create(\n receiverParameter.type,\n receiverValue.type,\n RuntimeAssertionsDataFlowExtras(c, receiverValue.type, receiverExpression)\n )\n\n if (assertionInfo != null) {","completion":"c.trace.record(JvmBindingContextSlices.RECEIVER_RUNTIME_ASSERTION_INFO, expressionReceiverValue, assertionInfo)\n }\n }\n}\n\nobject RuntimeAssertionsOnDeclarationBodyChecker {\n @JvmStatic\n fun check(\n declaration: KtDeclaration,\n descriptor: DeclarationDescriptor,<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1283\npackage foo\n\nfun factorial(n: Int): Int = js(\"\"\"\n var result = 1;\n var i = 1;\n\n while(i <= n) {\n result *= i++;\n }\n\n return result;\n\"\"\")\n\nfun box(): String {\n assertEquals(24, factorial(4))","completion":"assertEquals(120, factorial(5))\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short","completion":"val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n\/**\n * Exposes the JavaScript [SVGRectElement](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/SVGRectElement) to Kotlin<|endoftext|>"} {"prompt":"\/\/ FILE: Constants.java\n\npublic class Constants {\n public static final String FIRST = \"1st\";\n public static final String SECOND = \"2nd\";\n}\n\n\/\/ FILE: const.kt\nconst val a = \"something\"\nconst val b","completion":"const val c = null\nconst val d = ForConst\nconst val e = ForConst.one()<|endoftext|>"} {"prompt":"* Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.takeWhile(predicate: (UInt) -> Boolean): List {","completion":"val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n\/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n *\/\n@SinceKotlin(\"1.3\")<|endoftext|>"} {"prompt":"val filesWithReposFirst = runBlocking {\n MavenDependenciesResolver().resolveFromAnnotations(annotationsWithReposFirst)\n }.valueOrThrow()\n\n val filesWithDependsOnFirst = runBlocking {\n MavenDependenciesResolver().resolveFromAnnotations(annotationsWithDependsOnFirst)\n }.valueOrThrow()\n\n \/\/ Tests that the jar was resolved","completion":"assert(\n filesWithReposFirst.any { it.name.startsWith(\"kotlin-shell-core-\") && it.extension == \"jar\" }\n )\n assert(\n filesWithDependsOnFirst.any { it.name.startsWith(\"kotlin-shell-core-\") && it.extension == \"jar\" }\n )<|endoftext|>"} {"prompt":"val typeParameters = getTypeConstructor().parameters\n val typeParameterCount = typeParameters.size\n\n val parametersAsTypeProjections = when {\n typeParameterCount == supertypeParameterCount ->\n typeParameters.map { parameter ->\n TypeProjectionImpl(Variance.INVARIANT, parameter.defaultType)\n }","completion":"typeParameterCount == 1 && supertypeParameterCount > 1 && annotatedPurelyImplementedFqName == null -> {\n val parameter = TypeProjectionImpl(Variance.INVARIANT, typeParameters.single().defaultType)\n (1..supertypeParameterCount).map { parameter } \/\/ TODO: List(supertypeParameterCount) { parameter }\n }\n else -> return null\n }<|endoftext|>"} {"prompt":"\"commonMain\" to null,\n ),\n listOf(\n listOf(\n absolutePath(\"commonMain\")\n ),\n )\n ),\n )\n }\n\n private fun absolutePath(first: String, vararg next: String): Path {\n return Paths.get(\"\").toAbsolutePath().root.resolve(Paths.get(first, *next))\n }","completion":"private fun directoriesToCopy(\n fileSystem: HashMap,\n resourcesSplitByLevel: List>,\n ): AssembleHierarchicalResourcesTask.SourceSetWalk.Result> {\n val fakeFs = buildFakeFileSystem(contents = fileSystem)\n return AssembleHierarchicalResourcesTask.SourceSetWalk(<|endoftext|>"} {"prompt":"override suspend fun sharedSourceSetName(compilation: KotlinCompilation<*>): String? {\n val sourceSetTree = KotlinSourceSetTree.orNull(compilation)?.name ?: return null\n return lowerCamelCaseName(name, sourceSetTree)\n }\n }\n\n final override fun toString(): String = when (this) {\n is Group -> name","completion":"is Root -> \"\"\n }\n }\n\n override fun toString(): String {\n if (children.isEmpty()) return node.toString()\n return node.toString() + \"\\n\" + children.joinToString(\"\\n\").prependIndent(\"----\")\n }\n}<|endoftext|>"} {"prompt":"superTypeUpdater(resultedTypeRefs)\n }\n }\n\n private fun FirClassLikeDeclaration.asResolveTarget(): LLFirSingleResolveTarget? = tryCollectDesignation()?.asResolveTarget()\n\n private fun resolveToSupertypePhase(target: LLFirSingleResolveTarget) {\n LLFirSuperTypeTargetResolver(\n target = target,","completion":"supertypeComputationSession = supertypeComputationSession,\n visitedElements = visitedElements,\n ).resolveDesignation()\n\n LLFirSupertypeLazyResolver.checkIsResolved(target.target)\n }\n\n \/**\n * We want to apply resolved supertypes to as many designations as possible.<|endoftext|>"} {"prompt":"\"This class has been moved from package org.jetbrains.kotlin.descriptors.konan to package org.jetbrains.kotlin.library.metadata\",\n ReplaceWith(\"org.jetbrains.kotlin.library.metadata.KlibModuleOrigin\")\n)\ntypealias KlibModuleOrigin = org.jetbrains.kotlin.library.metadata.KlibModuleOrigin","completion":"@Deprecated(\n \"This class has been moved from package org.jetbrains.kotlin.descriptors.konan to package org.jetbrains.kotlin.library.metadata\",\n ReplaceWith(\"org.jetbrains.kotlin.library.metadata.CompiledKlibModuleOrigin\")\n)<|endoftext|>"} {"prompt":"assertEquals(listOf(listOf(\"s\"), listOf(\"a\")), result, \"should be list + element\")\n\n val listOfAny = listOf(\"a\") + listOf(\"b\")\n assertEquals(listOf(\"a\", \"b\"), listOfAny, \"should be list + list\")","completion":"val listOfAnyAndList = listOf(\"a\") + listOf(\"b\") as Any\n assertEquals(listOf(\"a\", listOf(\"b\")), listOfAnyAndList, \"should be list + Any\")\n }\n\n @Test fun plusAssign() {\n \/\/ lets use a mutable variable of readonly list<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.utils.errors.requireIsInstance\nimport org.jetbrains.kotlin.fir.correspondingProperty\nimport org.jetbrains.kotlin.fir.declarations.FirFunction\nimport org.jetbrains.kotlin.fir.renderWithType","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirValueParameterSymbol\nimport org.jetbrains.kotlin.fir.types.varargElementType\nimport org.jetbrains.kotlin.name.Name\n\ninternal class KtFirValueParameterSymbol(\n override val firSymbol: FirValueParameterSymbol,<|endoftext|>"} {"prompt":"val x = { x }\n\n\/\/KT-787 AssertionError on code 'val x = x'","completion":"val z = z\n\n\/\/KT-329 Assertion failure on local function\nfun block(f : () -> Unit) = f()<|endoftext|>"} {"prompt":"import org.jetbrains.org.objectweb.asm.tree.MethodNode\nimport java.util.*\n\nclass RedundantNopsCleanupMethodTransformer : MethodTransformer() {\n override fun transform(internalClassName: String, methodNode: MethodNode) {\n LabelNormalizationMethodTransformer().transform(internalClassName, methodNode)\n\n val requiredNops = HashSet()","completion":"\/\/ NOP instruction is required, if it is a sole bytecode instruction in a try-catch block (TCB)\n recordNopsRequiredForTryCatchBlocks(methodNode, requiredNops)\n\n \/\/ NOP instruction is required, if it is a sole bytecode instruction in a debugger stepping interval\n recordNopsRequiredForDebugger(methodNode, requiredNops)<|endoftext|>"} {"prompt":"element.get(0)\n element!!.get(0).length\n}\n\nfun main5() {\n val list = A1.warningPlatformError()","completion":"val element = list.get(0)\n element.get(0)\n element!!.get(0).length\n}<|endoftext|>"} {"prompt":"override fun copy(newMode: MangleMode): IrMangleComputer =\n JvmIrManglerComputer(builder, newMode, compatibleMode)\n\n override fun addReturnTypeSpecialCase(function: IrFunction): Boolean = true\n\n override fun mangleTypePlatformSpecific(type: IrType, tBuilder: StringBuilder) {","completion":"if (type.hasAnnotation(JvmAnnotationNames.ENHANCED_NULLABILITY_ANNOTATION)) {\n tBuilder.append(MangleConstant.ENHANCED_NULLABILITY_MARK)\n }\n }\n }\n\n override fun getExportChecker(compatibleMode: Boolean): KotlinExportChecker = JvmIrExportChecker(compatibleMode)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.statistics.MetricValueValidationFailed\n\n\n\/**\n * Invokes build FUS service if the reporting service is initialised and add configuration time metrics.\n *\n * New value will be present in configuration cache if BuildFusService.Parameters are not calculated yet\n * [BuildFusService.reportFusMetrics] should be called for execution time metrics\n *\/","completion":"internal fun Project.addConfigurationMetrics(reportAction: (MetricContainer) -> Unit) {\n project.gradle.sharedServices.registrations.findByName(BuildFusService.serviceName)?.also {\n val parameters = it.parameters as BuildFusService.Parameters\n parameters.configurationMetrics.add(project.provider {\n val configurationTimeMetrics = MetricContainer()<|endoftext|>"} {"prompt":"class TypeVariableDirectionCalculator(\n private val c: VariableFixationFinder.Context,\n private val postponedKtPrimitives: List,\n topLevelType: KotlinTypeMarker\n) {\n enum class ResolveDirection {\n TO_SUBTYPE,\n TO_SUPERTYPE,\n UNKNOWN\n }","completion":"data class NodeWithDirection(val variableWithConstraints: VariableWithConstraints, val direction: ResolveDirection) {\n override fun toString() = \"$variableWithConstraints to $direction\"\n }\n\n private val directions = HashMap()\n\n init {\n setupDirections(topLevelType)\n }<|endoftext|>"} {"prompt":"ENTRY1,\n ENTRY2;\n constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())\n}\n\nenum class EnumerationADC(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {\n ENTRY1,\n ENTRY2();","completion":"constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())\n}\n\nenum class EnumerationADD(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {\n ENTRY1 { override fun abstractFunc() { TODO(\"Not yet implemented\") } },<|endoftext|>"} {"prompt":"private fun FirTypeRef.extractTypeParametersTo(result: MutableCollection) {\n if (this is FirResolvedTypeRef) {\n type.extractTypeParametersTo(result)\n }\n }\n\n private fun ConeKotlinType.extractTypeParametersTo(result: MutableCollection) {\n when (this) {","completion":"is ConeFlexibleType -> lowerBound.extractTypeParametersTo(result)\n is ConeDefinitelyNotNullType -> original.extractTypeParametersTo(result)\n is ConeTypeParameterType -> {\n result += lookupTag.typeParameterSymbol.fir\n }\n is ConeClassLikeType -> typeArguments.forEach {<|endoftext|>"} {"prompt":"interface Inv\ninterface In\ninterface Out\n\n\nval foo: Inv>> = null!!\n\/*\npsi: Inv>>\ntype: Inv>>\n typeParameter: defined in Inv\n typeProjection: out In>","completion":"psi: In>\n type: In>\n typeParameter: defined in In\n typeProjection: out Out\n psi: Out\n type: Out\n typeParameter: defined in Out\n typeProjection: out Int\n psi: Int\n type: Int<|endoftext|>"} {"prompt":"property.transformBackingField(this, data)\n }\n\n calculateDeprecations(property)\n } as FirStatement\n }\n\n private fun FirProperty.moveJavaDeprecatedAnnotationToBackingField() {\n val newPosition = session.annotationPlatformSupport.extractBackingFieldAnnotationsFromProperty(this, session) ?: return","completion":"this.replaceAnnotations(newPosition.propertyAnnotations)\n backingField?.replaceAnnotations(newPosition.backingFieldAnnotations)\n }\n\n override fun transformSimpleFunction(\n simpleFunction: FirSimpleFunction,\n data: Nothing?\n ): FirSimpleFunction {\n if (!shouldTransformDeclaration(simpleFunction)) return simpleFunction<|endoftext|>"} {"prompt":"info, explicitReceiverValue, parentGroup,\n ExplicitReceiverKind.EXTENSION_RECEIVER,\n )\n\n \/\/ Member scope of expression receiver\n processLevel(\n explicitReceiverValue.toMemberScopeTowerLevel(), info, parentGroup.Member, ExplicitReceiverKind.DISPATCH_RECEIVER\n )\n\n enumerateTowerLevels(","completion":"parentGroup = parentGroup,\n onScope = { scope, _, group ->\n processScopeForExplicitReceiver(\n scope,\n explicitReceiverValue,\n info,\n group\n )\n },\n onImplicitReceiver = { implicitReceiverValue, group ->\n \/\/ Member extensions\n processLevel(<|endoftext|>"} {"prompt":"* Special case:\n * - `NaN.sign` is `NaN`\n *\/\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline val Double.sign: Double get() = nativeSign(this)\n\n\/**\n * Returns this value with the sign bit same as of the [sign] value.\n *\n * If [sign] is `NaN` the sign of the result is undefined.\n *\/","completion":"@SinceKotlin(\"1.2\")\npublic actual fun Double.withSign(sign: Double): Double {\n val thisSignBit = doubleSignBit(this)\n val newSignBit = doubleSignBit(sign)\n return if (thisSignBit == newSignBit) this else -this\n}\n\n\/**\n * Returns this value with the sign bit same as of the [sign] value.\n *\/<|endoftext|>"} {"prompt":"override fun getLength(): Long = attributes.size()\n\n override fun refresh(asynchronous: Boolean, recursive: Boolean, postRunnable: Runnable?) {}\n\n override fun getInputStream(): InputStream =\n VfsUtilCore.inputStreamSkippingBOM(Files.newInputStream(path).buffered(), this)\n\n override fun getModificationStamp(): Long = 0","completion":"override fun equals(other: Any?): Boolean =\n other is CoreJrtVirtualFile && path == other.path && fileSystem == other.fileSystem\n\n override fun hashCode(): Int =\n path.hashCode()\n}<|endoftext|>"} {"prompt":"abstract override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?)\n\n abstract override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider)\n\n abstract override fun replaceContextReceivers(newContextReceivers: List)\n\n abstract override fun replaceControlFlowGraphReference(newControlFlowGraphReference: FirControlFlowGraphReference?)","completion":"abstract override fun replaceValueParameters(newValueParameters: List)\n\n abstract override fun replaceBody(newBody: FirBlock?)\n\n abstract override fun replaceContractDescription(newContractDescription: FirContractDescription?)\n\n abstract override fun replaceAnnotations(newAnnotations: List)<|endoftext|>"} {"prompt":"public actual open class FastArrayList internal constructor(\n var array: Array,\n var _size: Int = array.size,\n var arrayCapacity: Int = array.size,\n) : AbstractMutableList(), MutableListEx, RandomAccess {\n public actual constructor() : this(arrayOfNulls(16), 0) {}","completion":"public actual constructor(initialCapacity: Int) : this(arrayOfNulls(initialCapacity), 0) {}\n public actual constructor(elements: Collection) : this(elements.toTypedArray()) {}\n\n public actual fun trimToSize() {}\n public actual fun ensureCapacity(minCapacity: Int) {}\n actual override val size: Int get() = _size<|endoftext|>"} {"prompt":"if (this.w != null) w.propNullableAny\n if (this.w != null) w.funT()","completion":"if (this.w != null) w.funAny()\n if (this.w != null) w.funNullableT()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression\nimport org.jetbrains.kotlin.fir.expressions.UnresolvedExpressionTypeAccess\nimport org.jetbrains.kotlin.fir.types.ConeKotlinType\nimport org.jetbrains.kotlin.fir.visitors.FirTransformer","completion":"import org.jetbrains.kotlin.fir.visitors.FirVisitor\nimport org.jetbrains.kotlin.fir.visitors.transformInplace\n\n@OptIn(UnresolvedExpressionTypeAccess::class)\ninternal class FirVarargArgumentsExpressionImpl(\n override val source: KtSourceElement?,\n @property:UnresolvedExpressionTypeAccess<|endoftext|>"} {"prompt":"ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()\n if (predicate(classOrObject)) {\n val interfaceClass = kotlinAsJavaSupport.getLightClass(classOrObject) ?: continue\n val implsClass = interfaceClass.findInnerClassByName(syntheticName, false) ?: continue\n answer.add(implsClass)\n }\n }\n }","completion":"override fun getClassNames(psiPackage: PsiPackage, scope: GlobalSearchScope): Set {\n val packageFQN = FqName(psiPackage.qualifiedName)\n\n val declarations = kotlinAsJavaSupport.findClassOrObjectDeclarationsInPackage(packageFQN, scope)\n\n val answer = hashSetOf()<|endoftext|>"} {"prompt":"@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfBigDecimal\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumOf(selector: (UByte) -> java.math.BigDecimal): java.math.BigDecimal {","completion":"var sum: java.math.BigDecimal = 0.toBigDecimal()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n\/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n *\/\n@SinceKotlin(\"1.4\")<|endoftext|>"} {"prompt":"* Exposes the JavaScript [HTMLInputElement](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/HTMLInputElement) to Kotlin\n *\/\npublic external abstract class HTMLInputElement : HTMLElement, JsAny {\n open var accept: String\n open var alt: String\n open var autocomplete: String\n open var autofocus: Boolean\n open var defaultChecked: Boolean","completion":"open var checked: Boolean\n open var dirName: String\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open val files: FileList?\n open var formAction: String\n open var formEnctype: String\n open var formMethod: String\n open var formNoValidate: Boolean\n open var formTarget: String\n open var height: Int<|endoftext|>"} {"prompt":"OPTIONAL_JVM_INLINE_ANNOTATION\nvalue class Str(val string: T)\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class Obj(val obj: T)\n\nfun box(): String {\n var xz = Z(0)\n var xl = L(0L)\n var xs = Str(\"\")","completion":"var xo = Obj(\"\")\n\n run {\n xz = Z(42)\n xl = L(1234L)\n xs = Str(\"abc\")\n xo = Obj(\"def\")\n }\n\n if (xz.int != 42) throw AssertionError()\n if (xl.long != 1234L) throw AssertionError()<|endoftext|>"} {"prompt":"internal val commonizerClasspath: ConfigurableFileCollection = objectFactory.fileCollection()\n\n @get:Input\n internal val customJvmArgs: ListProperty = objectFactory\n .listProperty()\n .chainedFinalizeValueOnRead()\n\n private val kotlinCompilerArgumentsLogLevel = project.kotlinPropertiesProvider.kotlinCompilerArgumentsLogLevel","completion":"private val konanHome = project.file(project.konanHome)\n private val commonizerLogLevel = project.commonizerLogLevel\n private val additionalCommonizerSettings = project.additionalCommonizerSettings\n\n data class CInteropCommonizerDependencies(\n val commonizerTarget: CommonizerTarget,\n val dependencies: FileCollection,\n )\n\n \/**<|endoftext|>"} {"prompt":"package androidx.compose.compiler.plugins.kotlin\n\nimport org.intellij.lang.annotations.Language\n\nabstract class AbstractControlFlowTransformTests(\n useFir: Boolean\n) : AbstractIrTransformTest(useFir) {\n protected fun controlFlow(\n @Language(\"kotlin\")\n source: String,\n dumpTree: Boolean = false,","completion":") = verifyGoldenComposeIrTransform(\n \"\"\"\n import androidx.compose.runtime.Composable\n import androidx.compose.runtime.ReadOnlyComposable\n import androidx.compose.runtime.key\n import androidx.compose.runtime.NonRestartableComposable\n\n $source\n \"\"\".trimIndent(),\n \"\"\"<|endoftext|>"} {"prompt":"override fun visitExpressionStatement(x: JsExpressionStatement) {\n val expression = x.expression\n val assignment = JsAstUtils.decomposeAssignmentToVariable(expression)\n if (assignment != null) {\n val (name, value) = assignment\n handleDefinition(name, value, x)\n } else {\n if (handleExpression(expression)) {","completion":"invalidateTemporaries()\n }\n }\n }\n\n override fun visitVars(x: JsVars) {\n for (v in x.vars) {\n val initializer = v.initExpression\n if (initializer != null) {\n handleDefinition(v.name, initializer, v)\n }\n }\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.config.LanguageFeature\nimport org.jetbrains.kotlin.config.LanguageVersionSettings\nimport org.jetbrains.kotlin.descriptors.*\nimport org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor\nimport org.jetbrains.kotlin.diagnostics.DiagnosticFactory0","completion":"import org.jetbrains.kotlin.diagnostics.Errors.*\nimport org.jetbrains.kotlin.incremental.KotlinLookupLocation\nimport org.jetbrains.kotlin.lexer.KtTokens\nimport org.jetbrains.kotlin.psi.*\nimport org.jetbrains.kotlin.psi.psiUtil.hasActualModifier<|endoftext|>"} {"prompt":"fun CompiledProject.assertNoWarnings(sanitize: (String) -> String = { it }) {\n val clearedOutput = sanitize(output)\n val warnings = \"w: .*\".toRegex().findAll(clearedOutput).map { it.groupValues[0] }\n\n if (warnings.any()) {","completion":"val message = (listOf(\"Output should not contain any warnings:\") + warnings).joinToString(SYSTEM_LINE_SEPARATOR)\n throw IllegalStateException(message)\n }\n }\n\n fun CompiledProject.fileInWorkingDir(path: String) = File(File(workingDir, project.projectName), path)<|endoftext|>"} {"prompt":"print(\") \")\n bracedBlock {\n body?.acceptVoid(this@IrSourcePrinterVisitor)\n }\n }\n }\n\n override fun visitLocalDelegatedPropertyReference(\n expression: IrLocalDelegatedPropertyReference\n ) {\n print(\"::\")\n print(expression.delegate.owner.name)\n }","completion":"override fun visitLoop(loop: IrLoop) {\n print(\"<>\")\n }\n\n override fun visitPropertyReference(expression: IrPropertyReference) {\n val property = expression.symbol.owner\n expression.printExplicitReceiver()\n print(\"::\")\n print(property.name)\n }\n\n override fun visitSpreadElement(spread: IrSpreadElement) {<|endoftext|>"} {"prompt":"expect open class Base() {}\n\nactual abstract class Foo : Base(), I {\n \/\/ In non-KMP world, these two f\/o would squash into a single f\/o final fun foo()","completion":"\/\/ f\/o abstract fun foo(): Unit in intermediate\n \/\/ f\/o final fun foo(): Unit in platform\n}\n\n\/\/ MODULE: main()()(intermediate)\nactual open class Base {\n fun foo() {}\n}<|endoftext|>"} {"prompt":"assertFalse(byteArrayOf().iterator().hasNext())\n assertTrue(assertFails { byteArrayOf().iterator().next() } is NoSuchElementException)\n\n assertTrue(eqShort(shortArrayOf(0), ShortArray(1)))\n assertTrue(eqShort(shortArrayOf(1, 2, 3), ShortArray(3) { (it + 1).toShort() }))","completion":"assertTrue(eqShort(shortArrayOf(1), shortArrayOf(1).copyOf()))\n assertTrue(eqShort(shortArrayOf(1, 0), shortArrayOf(1).copyOf(2)))\n assertTrue(eqShort(shortArrayOf(1), shortArrayOf(1, 2).copyOf(1)))<|endoftext|>"} {"prompt":"suspend fun dummy() {}\n\nval c: suspend () -> Unit = {\n dummy()\n dummy()\n}\n\nfun blackhole(a: Any) {}\n\nclass A {\n suspend fun foo(a: A, s: String = \"\", block: suspend A.() -> Unit) {\n block()\n block()\n blackhole(this)\n blackhole(a)","completion":"blackhole(s)\n blackhole(block)\n }\n}\n\n\/\/ BEs generate continuation classes differently, JVM_IR generates more correctly\n\n\/\/ foo, c's lambda and foo's continuation\n\/\/ 3 LOCALVARIABLE \\$result Ljava\/lang\/Object;\n\n\/\/ foo x 3 since we split the local over restore code for the two calls to block(), and <|endoftext|>"} {"prompt":"x.z.x.propNullableAny\n x.z.x.funT()\n x.z.x.funAny()\n x.z.x.funNullableT()\n x.z.x.funNullableAny()\n }\n if (x.z.y != null && x.z.z != null) {\n x.z.y\n x.z.z","completion":"x.z.y.equals(null)\n x.z.y.propT\n x.z.y.propAny\n x.z.y.propNullableT\n x.z.y.propNullableAny\n x.z.y.funT()\n x.z.y.funAny()\n x.z.y.funNullableT()<|endoftext|>"} {"prompt":"if (typeArgument is IrSimpleType) {\n if (typeArgument.checkTypeArgumentsHasSelf(itselfClass)) return true\n }\n }\n\n return false\n }\n\n fun IrBuilderWithScope.serializerInstance(\n serializerClassOriginal: IrClassSymbol?,\n pluginContext: SerializationPluginContext,\n kType: IrType,","completion":"genericIndex: Int? = null,\n rootSerializableClass: IrClass? = null,\n genericGetter: ((Int, IrType) -> IrExpression)? = null,\n ): IrExpression? {\n val nullableSerClass = compilerContext.referenceProperties(SerialEntityNames.wrapIntoNullableCallableId).single()\n if (serializerClassOriginal == null) {<|endoftext|>"} {"prompt":"override fun hasNext() = index != array.size\n override fun nextShort() = if (index != array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\ninternal inline fun createShortArray(size: Int, init: (Int) -> Short): ShortArray {\n if (size < 0) throw IllegalArgumentException(\"Negative array size\")","completion":"val result = WasmShortArray(size)\n result.fill(size, init)\n return ShortArray(result)\n}\n\n\/**\n * An array of ints.\n * @constructor Creates a new array of the specified [size], with all elements initialized to zero.\n * @throws RuntimeException if the specified [size] is negative.\n *\/\npublic class IntArray(size: Int) {<|endoftext|>"} {"prompt":"?: error(\"The generated atomic array field [${it.render()}] should've already be initialized.\" + CONSTRAINTS_MESSAGE)\n it.initializer = null\n initBlock.updateFieldInitialization(atomicArrayField.symbol, it.symbol, initExpr, initExprIndex)\n }\n } else {\n val arraySize = initializer.getArraySizeArgument()","completion":"return irAtomicArrayField(\n atomicArrayField.name,\n atomicSymbols.getAtomicArrayClassByAtomicfuArrayType(atomicArrayField.type),\n atomicArrayField.isStatic,\n atomicArrayField.annotations,\n arraySize,\n (initializer as IrFunctionAccessExpression).dispatchReceiver,\n parentContainer\n )\n }\n }\n\n \/**<|endoftext|>"} {"prompt":"import org.junit.jupiter.api.io.TempDir\nimport java.nio.file.Path\nimport kotlin.io.path.writeText\nimport kotlin.test.assertEquals\n\n\n\/**\n * ## Test Scope\n * This test is intended to verify mapping and translation of types.\n * It therefore tests only a subset of the [ObjCExportHeaderGeneratorTest], but is more specialized and should be convenient","completion":"* for identifying and debugging issues in type mapping.\n *\n * The test is running with K1 as well as the Analysis-Api based implementation (using the injected [HeaderGenerator])\n *\/\nclass ObjCExportTypeTranslationTest(\n private val headerGenerator: HeaderGenerator,\n) {\n\n @TempDir\n lateinit var tempDir: Path\n\n @Test\n fun `test - function return type`() {<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.resolve.providers.impl\n\nimport org.jetbrains.kotlin.descriptors.SourceElement\nimport org.jetbrains.kotlin.fir.FirModuleData\nimport org.jetbrains.kotlin.fir.FirSession\nimport org.jetbrains.kotlin.fir.ThreadSafeMutableState","completion":"import org.jetbrains.kotlin.fir.caches.*\nimport org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin\nimport org.jetbrains.kotlin.fir.deserialization.*\nimport org.jetbrains.kotlin.fir.resolve.providers.FirSymbolNamesProvider<|endoftext|>"} {"prompt":"fun Unit> selectNumber(vararg x: T) = x[0]\n\nfun foo6(x: Int) {}\nfun foo6(x: Float) {}\nfun foo6(x: Number) {}\n\nfun main() {\n select(::foo, { it })","completion":"select(id(::foo), { x: Number -> }, { it })<|endoftext|>"} {"prompt":"val values = arrayOf(\"ac\", \"aD\", \"aba\")\n val indices = values.indices.toList().toIntArray()\n\n assertEquals(listOf(1, 2, 0), indices.sortedBy { values[it] })\n }\n\n @Test fun sortByStable() {\n val keyRange = 'A'..'D'","completion":"for (size in listOf(10, 100, 2000)) {\n val array = Array(size) { index -> Sortable(keyRange.random(), index) }\n\n array.sortedBy { it.key }.assertStableSorted()\n array.sortedByDescending { it.key }.assertStableSorted(descending = true)\n\n array.sortBy { it.key }<|endoftext|>"} {"prompt":"\"$taskPath task compiler arguments contains $notExpectedArgument. Actual content: $compilerArguments\"\n }\n}\n\n\/**\n * Asserts environment variables of the given K\/N compiler for given tasks' paths\n *\n * Note: Log level of output must be set to [LogLevel.INFO].\n *\n * @param tasksPaths tasks' paths, for which command line arguments should be checked with give assertions.","completion":"* @param toolName name of build tool\n * @param assertions assertions, with will be applied to each command line arguments of each given task\n *\/\nfun BuildResult.assertNativeTasksCustomEnvironment(\n vararg tasksPaths: String,\n toolName: NativeToolKind = NativeToolKind.KONANC,\n assertions: (Map) -> Unit,<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ DUMP_IR\n\/\/ This test checks that unresolved typealias in an abbreviated type does not crash the compiler or result in a compilation error.\n\/\/ Apparently, there's some demand for this behavior, see KT-45308, KT-58335.\n\n\/\/ MODULE: a\n\/\/ FILE: a.kt\npackage a\n\ntypealias A = String\n\n\/\/ MODULE: b(a)\n\/\/ FILE: b.kt","completion":"package b\n\nimport a.A\n\nfun foo(f: () -> A): A = f()\n\n\/\/ MODULE: main(b)\n\/\/ FILE: c.kt\nimport b.foo\n\nfun box(): String = foo { \"OK\" }<|endoftext|>"} {"prompt":"aNotNullNullNotNull: TypeArgumentsFromParameterBounds,\n aNotNullNullNull: TypeArgumentsFromParameterBounds,\n a: A, b: B\n): Unit {\n a.bar(aNotNullNotNullNotNull)\n \/\/ jspecify_nullness_mismatch","completion":"a.bar(aNotNullNotNullNull)\n \/\/ jspecify_nullness_mismatch\n a.bar(aNotNullNullNotNull)<|endoftext|>"} {"prompt":"fun testDumpFileReadHistory() {\n val sourceOutputDir = Files.createTempDirectory(\"kaptRunner\").toFile()\n val fileReadOutputFile = File.createTempFile(\"kapt_read_history\", \".txt\")\n try {\n doAnnotationProcessing(\n File(TEST_DATA_DIR, \"Simple.java\"),\n simpleProcessor(),\n sourceOutputDir,","completion":"fileReadOutput = fileReadOutputFile\n )\n assertTrue(fileReadOutputFile.exists())\n assertTrue(fileReadOutputFile.readText().contains(\"generated\/MyMethodMyAnnotation.java\"))\n assertTrue(fileReadOutputFile.readText().contains(\"java\/lang\/Enum.class\"))\n } finally {\n sourceOutputDir.deleteRecursively()<|endoftext|>"} {"prompt":"@MyNonnull\n public static JJJ staticNNN;\n}\n\n\/\/ FILE: k.kt\nfun test() {\n val a = J.staticN ?: null\n foo(a)\n val b = JJ.staticNN ?: null","completion":"foo(b)\n val c = JJJ.staticNNN ?: null\n foo(c)\n}\n\nfun foo(a: Any?) {\n}<|endoftext|>"} {"prompt":"interface ValueClassCannotHaveContextReceivers : KtFirDiagnostic {\n override val diagnosticClass get() = ValueClassCannotHaveContextReceivers::class\n }\n\n interface AnnotationOnIllegalMultiFieldValueClassTypedTarget : KtFirDiagnostic {","completion":"override val diagnosticClass get() = AnnotationOnIllegalMultiFieldValueClassTypedTarget::class\n val name: String\n }\n\n interface NoneApplicable : KtFirDiagnostic {\n override val diagnosticClass get() = NoneApplicable::class\n val candidates: List\n }<|endoftext|>"} {"prompt":"* This is an awful hack required to keep K1 compatibility.\n * See [convertToNonRawVersionAfterApproximationInK2].\n *\/\n return type.captureStatus(ctx) == CaptureStatus.FROM_EXPRESSION && with(ctx) { type.hasRawSuperType() }\n }\n }\n\n object TypeArgumentApproximation : AbstractCapturedTypesApproximation(null) {","completion":"override val integerLiteralConstantType: Boolean get() = true\n override val integerConstantOperatorType: Boolean get() = true\n override val intersectionTypesInContravariantPositions: Boolean get() = true\n }\n\n object IntegerLiteralsTypesApproximation : AllFlexibleSameValue() {\n override val integerLiteralConstantType: Boolean get() = true<|endoftext|>"} {"prompt":"@kotlin.internal.InlineOnly\npublic inline fun ceil(x: kotlin.Float): kotlin.Float\n\n@kotlin.SinceKotlin(version = \"1.2\")\n@kotlin.internal.InlineOnly\npublic inline fun cos(x: kotlin.Double): kotlin.Double\n\n@kotlin.SinceKotlin(version = \"1.2\")","completion":"@kotlin.internal.InlineOnly\npublic inline fun cos(x: kotlin.Float): kotlin.Float\n\n@kotlin.SinceKotlin(version = \"1.2\")\n@kotlin.internal.InlineOnly\npublic inline fun cosh(x: kotlin.Double): kotlin.Double\n\n@kotlin.SinceKotlin(version = \"1.2\")<|endoftext|>"} {"prompt":"package samples.collections\n\nimport samples.*\n\n@RunWith(Enclosed::class)\nclass Iterables {\n\n class Building {\n\n @Sample\n fun iterable() {\n val iterable = Iterable {\n iterator {\n yield(42)\n yieldAll(1..5 step 2)\n }\n }","completion":"val result = iterable.mapIndexed { index, value -> \"$index: $value\" }\n assertPrints(result, \"[0: 42, 1: 1, 2: 3, 3: 5]\")\n\n \/\/ can be iterated many times\n repeat(2) {\n val sum = iterable.sum()\n assertPrints(sum, \"51\")\n }\n }\n\n }<|endoftext|>"} {"prompt":"val missingDeclarationSymbol: IrSymbol\n ) : PartialLinkageCase\n\n \/**\n * Expression refers an IR declaration with a signature that uses an unusable (partially linked) classifier symbol.\n *\n * Applicable to: Expressions.\n *\/\n class ExpressionHasDeclarationWithUnusableClassifier(\n val expression: IrExpression,\n val referencedDeclarationSymbol: IrSymbol,","completion":"val cause: ExploredClassifier.Unusable\n ) : PartialLinkageCase\n\n \/**\n * Expression refers an IR declaration with the wrong type.\n * Example: An [IrEnumConstructorCall] that refers an [IrConstructor] of a regular class.\n *\n * Applicable to: Expressions.\n *\/\n class ExpressionHasWrongTypeOfDeclaration(<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.generators.builtins.numbers.primitives\n\nimport org.jetbrains.kotlin.generators.builtins.PrimitiveType\n\ninternal const val END_LINE = \"\\n\"\ninternal const val intrinsicConstEvaluationAnnotation = \"kotlin.internal.IntrinsicConstEvaluation\"","completion":"internal fun PrimitiveType.castToIfNecessary(otherType: PrimitiveType): String {\n if (this !in PrimitiveType.onlyNumeric || otherType !in PrimitiveType.onlyNumeric) {\n throw IllegalArgumentException(\"Cannot cast to non-numeric type\")\n }\n\n if (this == otherType) return \"\"<|endoftext|>"} {"prompt":"* - `log(x, b)` is `NaN` if either `x` or `b` are `NaN`\n * - `log(x, b)` is `NaN` when `x < 0` or `b <= 0` or `b == 1.0`\n * - `log(+Inf, +Inf)` is `NaN`","completion":"* - `log(+Inf, b)` is `+Inf` for `b > 1` and `-Inf` for `b < 1`\n * - `log(0.0, b)` is `-Inf` for `b > 1` and `+Inf` for `b > 1`\n *\n * See also logarithm functions for common fixed bases: [ln], [log10] and [log2].<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers\n\nimport org.gradle.api.Project\nimport org.gradle.api.artifacts.component.ProjectComponentIdentifier\nimport org.jetbrains.kotlin.gradle.dsl.multiplatformExtensionOrNull","completion":"import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinDependency\nimport org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType\nimport org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet\nimport org.jetbrains.kotlin.gradle.plugin.ide.IdeDependencyResolver<|endoftext|>"} {"prompt":"\/\/ It looks like in general this can only be decided by constructing a constraint system and checking\n \/\/ if it has a contradiction. Currently we use a heuristic that may not work ideally in all cases.\n \/\/ TODO: use constraint system to check if candidateKCallableType can be a subtype of expectedType\n val substituteDontCare = makeConstantSubstitutor(candidateTypeParameters, TypeUtils.DONT_CARE)","completion":"val subTypeSubstituted = substituteDontCare.substitute(subType, Variance.INVARIANT) ?: return true\n return ErrorTypesAreEqualToAnything.isSubtypeOf(subTypeSubstituted, superType)\n }\n\n private fun CallCandidateResolutionContext<*>.checkVisibilityWithoutReceiver() = checkAndReport {<|endoftext|>"} {"prompt":"a.hashCode = 99\n if (arg is String) {\n a = arg\n }\n }","completion":"println(value.a?.count { it in 'l' .. 'q' })\n}<|endoftext|>"} {"prompt":"override val size: Int\n override fun isEmpty(): Boolean\n override fun contains(element: @UnsafeVariance E): Boolean\n override fun iterator(): Iterator\n\n \/\/ Bulk Operations\n override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean\n\n \/\/ Positional Access Operations\n \/**\n * Returns the element at the specified index in the list.","completion":"*\/\n public operator fun get(index: Int): E\n\n \/\/ Search Operations\n \/**\n * Returns the index of the first occurrence of the specified element in the list, or -1 if the specified\n * element is not contained in the list.\n *\/\n public fun indexOf(element: @UnsafeVariance E): Int\n\n \/**<|endoftext|>"} {"prompt":"override fun accept(visitor: FirVisitor, data: D): R =\n visitor.visitCallableDeclaration(this, data)\n\n @Suppress(\"UNCHECKED_CAST\")\n override fun transform(transformer: FirTransformer, data: D): E =","completion":"transformer.transformCallableDeclaration(this, data) as E\n\n abstract override fun replaceAnnotations(newAnnotations: List)\n\n abstract override fun replaceStatus(newStatus: FirDeclarationStatus)\n\n abstract fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef)\n\n abstract fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?)<|endoftext|>"} {"prompt":"0x3fe921fb54442d18UL, 0x3ff1b6e192eba7deUL, 0x3fddac67056161b7UL, 0x3ff5368c951e8fcfUL,","completion":"0x3fcf5b75f92c1775UL, 0x4002d97c7f332fd2UL, 0x4002d97c7f3321d2UL, 0x4002d97c7f333dd2UL,<|endoftext|>"} {"prompt":"\"kotlinx\/serialization\/builtins\/BuiltinSerializersKt\", \"getNullable\",\n \"(\" + kSerializerType.descriptor + \")\" + kSerializerType.descriptor, false\n )\n\nfun InstructionAdapter.fillArray(type: Type, args: List, onEach: (Int, T) -> Unit) {\n iconst(args.size)","completion":"newarray(type)\n args.forEachIndexed { i, arg ->\n dup()\n iconst(i)\n onEach(i, arg)\n astore(type)\n }\n}\n\n\/\/\n\/\/ ======= Serializers Resolving =======\n\/\/\n\n\nclass JVMSerialTypeInfo(\n property: SerializableProperty,\n val type: Type,\n nn: String,<|endoftext|>"} {"prompt":"? & Inv\")!>x.propNullableT\n ? & Inv\")!>x.propNullableAny","completion":"? & Inv\")!>x.funT()\n ? & Inv\")!>x.funAny()<|endoftext|>"} {"prompt":"assertEquals(listOf(2, 5, 8), intList)\n\n val longList = mutableListOf()\n for (i in ((1L until 11L).reversed() step 2L).reversed() step 3L) {\n longList += i\n }\n assertEquals(listOf(2L, 5L, 8L), longList)","completion":"val charList = mutableListOf()\n for (i in (('a' until 'k').reversed() step 2).reversed() step 3) {\n charList += i\n }\n assertEquals(listOf('b', 'e', 'h'), charList)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)\n\n enableMetaInfoHandler()\n }\n}\n\nopen class AbstractJvmIrInterpreterTest(frontendKind: FrontendKind<*>) : AbstractIrInterpreterTest(frontendKind, TargetBackend.JVM_IR) {\n override fun configure(builder: TestConfigurationBuilder) {\n super.configure(builder)","completion":"with(builder) {\n globalDefaults {\n targetPlatform = JvmPlatforms.defaultJvmPlatform\n }\n\n defaultDirectives {\n +JvmEnvironmentConfigurationDirectives.FULL_JDK\n +JvmEnvironmentConfigurationDirectives.NO_RUNTIME\n +LanguageSettingsDirectives.ALLOW_KOTLIN_PACKAGE\n }<|endoftext|>"} {"prompt":"LLVMMoveBasicBlockAfter(block, this.entryBb)\n }\n\n fun alloca(type: LLVMTypeRef?, name: String = \"\", variableLocation: VariableDebugLocation? = null): LLVMValueRef {\n if (isObjectType(type!!)) {\n appendingTo(localsInitBb) {","completion":"val slotAddress = gep(type, slotsPhi!!, llvm.int32(slotCount), name)\n variableLocation?.let {\n slotToVariableLocation[slotCount] = it\n }\n slotCount++\n return slotAddress\n }\n }\n\n appendingTo(prologueBb) {\n val slotAddress = LLVMBuildAlloca(builder, type, name)!!<|endoftext|>"} {"prompt":"public fun kotlin.Array.asSequence(): kotlin.sequences.Sequence\n\npublic fun kotlin.BooleanArray.asSequence(): kotlin.sequences.Sequence\n\npublic fun kotlin.ByteArray.asSequence(): kotlin.sequences.Sequence","completion":"public fun kotlin.CharArray.asSequence(): kotlin.sequences.Sequence\n\npublic fun kotlin.DoubleArray.asSequence(): kotlin.sequences.Sequence\n\npublic fun kotlin.FloatArray.asSequence(): kotlin.sequences.Sequence<|endoftext|>"} {"prompt":"value class FooStarProjectedArray(val x: Array<*>, val y: Array<*>)\n\n@JvmInline\nvalue class FooStarProjectedArray2(val x: Array>, val y: Array>)\n\n\n@JvmInline","completion":"value class Bar(val u: Unit, val y: Unit)\n\n@JvmInline\nvalue class BarNullable(val u: Unit?, val y: Unit?)\n\n\n@JvmInline<|endoftext|>"} {"prompt":"fun foo() = warning\n }\n }\n }\n }\n\n Nothing is suppressed at foo, so we look above. While looking above we went up to the root (once) and propagated\n all the suppressors down, so now we have:\n\n foo - suppress(Y) from C\n C - suppress(Y) from C\n B - suppress(X) from A","completion":"A - suppress(X) from A\n Root - suppress() from Root\n\n Next time we look up anything under foo, we try the Y-suppressor and then immediately the X-suppressor, then to the empty\n suppressor at the root. All the intermediate empty nodes are skipped, because every suppressor remembers its definition point.\n\n This way we need no more lookups than the number of suppress() annotations from here to the root.<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.model.TestModule\nimport org.jetbrains.kotlin.test.services.ServiceRegistrationData\nimport org.jetbrains.kotlin.test.services.TestServices\nimport org.jetbrains.kotlin.test.services.compilerConfigurationProvider\nimport org.jetbrains.kotlin.test.services.service","completion":"class Fir2IrJvmResultsConverter(\n testServices: TestServices\n) : Frontend2BackendConverter(\n testServices,\n FrontendKinds.FIR,\n BackendKinds.IrBackend\n) {\n override val additionalServices: List<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_JS_STDLIB_DOM_API_INCLUDED\nimport org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_JS_YARN","completion":"import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_MPP_ALLOW_LEGACY_DEPENDENCIES\nimport org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_MPP_ANDROID_GRADLE_PLUGIN_COMPATIBILITY_NO_WARN<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl\nimport org.jetbrains.kotlin.incremental.components.LookupTracker\nimport org.jetbrains.kotlin.ir.backend.js.JsFactories\nimport org.jetbrains.kotlin.ir.backend.js.serializeModuleIntoKlib","completion":"import org.jetbrains.kotlin.js.test.utils.JsIrIncrementalDataProvider\nimport org.jetbrains.kotlin.js.test.utils.jsIrIncrementalDataProvider\nimport org.jetbrains.kotlin.library.KotlinAbiVersion\nimport org.jetbrains.kotlin.storage.LockBasedStorageManager<|endoftext|>"} {"prompt":"if (this is Collection && size <= 1) return toList()\n val list = toMutableList()\n list.reverse()\n return list\n \"\"\"\n }\n\n body(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) {\n \"\"\"\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list","completion":"\"\"\"\n }\n\n specialFor(CharSequences, Strings) {\n returns(\"SELF\")\n doc { \"Returns a ${f.collection} with characters in reversed order.\" }\n }\n body(CharSequences) { \"return StringBuilder(this).reverse()\" }\n specialFor(Strings) { inlineOnly() }<|endoftext|>"} {"prompt":"x.length\n runWithoutContract {\n x.length\n }\n x = 10\n }\n}\n\nfun test8() {\n var x: Any? = materialize()\n require(x is String)\n exactlyOnce {\n x.length","completion":"exactlyOnce {\n x.length\n }\n x = 10\n }\n}\n\nfun test9() {\n var x: Any? = materialize()\n require(x is String)\n atLeastOnce {\n x.length\n atLeastOnce {<|endoftext|>"} {"prompt":"actual var v3: Boolean = false\n private set\n\nactual open class C {\n actual var foo: Boolean = false\n protected set\n}\n\nopen class C2Typealias {\n var foo: Boolean = false\n protected set\n}","completion":"actual typealias C2 = C2Typealias<|endoftext|>"} {"prompt":"@Test3>(Test1(93))\n@Test4([Test3>(Test1(44)), Test3>(Test1(55)), Test3>(Test1(66))])","completion":"\/\/@Test5(*arrayOf(Test3(Test1(77))), *arrayOf(Test3(Test1(88)))) <-- KT-45414\nclass K {\n fun test(): String = \"K\"\n}\n\nfun box(): String = O().test() + K().test()<|endoftext|>"} {"prompt":"it.convertPathsToSystemIndependent()\n val compilerArgumentsXml = CompilerArgumentsSerializerV5(it).serializeTo(element)\n compilerArgumentsXml.dropVersionsIfNecessary(it)\n }\n}\n\nprivate fun saveElementsList(element: Element, elementsList: List, rootElementName: String, elementName: String) {","completion":"if (elementsList.isNotEmpty()) {\n element.addContent(\n Element(rootElementName).apply {\n val singleModule = elementsList.singleOrNull()\n if (singleModule != null) {\n addContent(singleModule)\n } else {\n elementsList.map { addContent(Element(elementName).apply { addContent(it) }) }\n }\n }\n )<|endoftext|>"} {"prompt":"listOfNotNull(\"org.jetbrains.kotlin:kotlin-$artifactBaseName:$version\", classifier).joinToString(\":\")\n\n@JvmOverloads\nfun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): Any {\n return if (kotlinBuildProperties.useBootstrapStdlib)","completion":"kotlinDep(listOfNotNull(\"stdlib\", suffix).joinToString(\"-\"), bootstrapKotlinVersion, classifier)\n else\n dependencies.project(listOfNotNull(\":kotlin-stdlib\", suffix).joinToString(\"-\"), classifier)\n}\n\n\/**\n * Use this function to declare a dependency on kotlin-test project artifacts.\n *<|endoftext|>"} {"prompt":")\n }\n }\n\n private fun IrDeclarationContainer.getOrBuildInlineLoopFunction(\n functionName: String,\n valueType: IrType,\n isArrayReceiver: Boolean\n ): IrSimpleFunction {\n val parent = this\n val mangledName = mangleAtomicExtensionName(functionName, isArrayReceiver)\n findDeclaration {","completion":"\/\/ check the type of the receiver here\n it.name.asString() == mangledName && it.checkSyntheticParameterTypes(isArrayReceiver, valueType)\n }?.let { return it }\n return pluginContext.irFactory.buildFun {\n name = Name.identifier(mangledName)\n isInline = true\n visibility = DescriptorVisibilities.PRIVATE<|endoftext|>"} {"prompt":"x.toByte()\n }\n}\n\n\/\/ TESTCASE NUMBER: 3\nfun case_3(x: Any?) {","completion":"if (x is Boolean || x !is Boolean is Boolean) {\n x\n x.prop_1<|endoftext|>"} {"prompt":"fun invokeMethodWithArguments(resolvedCall: ResolvedCall<*>, receiver: StackValue, codegen: ExpressionCodegen): StackValue {\n \/\/ it's important to use unsubstituted return type here to unbox value if it comes from type variable\n return StackValue.functionCall(returnType, returnKotlinType ?: resolvedCall.resultingDescriptor.original.returnType) {","completion":"codegen.invokeMethodWithArguments(this, resolvedCall, receiver)\n }\n }\n\n fun afterReceiverGeneration(v: InstructionAdapter, frameMap: FrameMap, state: GenerationState) {\n }\n\n}<|endoftext|>"} {"prompt":"getterAnnotations: List? = getter?.annotations,\n setter: FirFunction?,\n setterAnnotations: List? = setter?.annotations,\n): DeprecationAnnotationInfoPerUseSiteStorage = buildDeprecationAnnotationInfoPerUseSiteStorage {","completion":"val setterDeprecations = setter?.extractDeprecationInfoPerUseSite(session, customAnnotations = setterAnnotations)\n setterDeprecations?.storage?.forEach { (useSite, infos) ->\n if (useSite == null) {\n add(AnnotationUseSiteTarget.PROPERTY_SETTER, infos)\n } else {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder\nimport org.jetbrains.kotlin.test.frontend.fir.Fir2IrJsResultsConverter\nimport org.jetbrains.kotlin.test.frontend.fir.FirFrontendFacade\nimport org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact","completion":"import org.jetbrains.kotlin.test.model.Frontend2BackendConverter\nimport org.jetbrains.kotlin.test.model.FrontendFacade\nimport org.jetbrains.kotlin.test.model.FrontendKind\nimport org.jetbrains.kotlin.test.model.FrontendKinds<|endoftext|>"} {"prompt":"\/\/ CHECK-DEFAULTABI: [[SHORT_ID_PTR:%[0-9]+]] = load i16 (i16)*, i16 (i16)** @{{.*short_id}}\n\/\/ CHECK-DEFAULTABI: call signext i16 [[SHORT_ID_PTR]](i16 signext %0)","completion":"\/\/ CHECK-AAPCS: i16 [[SHORT_ID_BRIDGE]](i16 %0)\n\/\/ CHECK-AAPCS: [[SHORT_ID_PTR:%[0-9]+]] = load i16 (i16)*, i16 (i16)** @{{.*short_id}}<|endoftext|>"} {"prompt":"assertEquals(emptySet(), node.closure { it.children })\n }\n\n @Test\n fun `closureSequence with only self reference`() {\n val node = Node(\"a\")\n node.children.add(node)\n assertEquals(emptyList(), node.closureSequence { it.children }.toList())\n }\n\n @Test\n fun `closure on List`() {","completion":"val a = Node(\"a\")\n val b = Node(\"b\")\n val c = Node(\"c\")\n val d = Node(\"d\")\n val e = Node(\"e\")\n val f = Node(\"f\")\n val g = Node(\"g\")\n\n \/\/ a -> (b, c)\n \/\/ c -> (d)\n a.children.add(b)<|endoftext|>"} {"prompt":"override fun onLoad(project: JpsProject, settings: CompilerSettings) {\n project.kotlinCompilerSettings = settings\n }\n}\n\ninternal class KotlinJpsPluginSettingsSerializer : BaseJpsCompilerSettingsSerializer(\n SettingConstants.KOTLIN_JPS_PLUGIN_SETTINGS_SECTION, ::JpsPluginSettings\n) {","completion":"override fun onLoad(project: JpsProject, settings: JpsPluginSettings) {\n project.kotlinJpsPluginSettings = settings\n }\n}\n\ninternal class KotlinCommonCompilerArgumentsSerializer : BaseJpsCompilerSettingsSerializer(<|endoftext|>"} {"prompt":"typeParameters = typeParameters,\n members = members,\n nestedClasses = emptyList(),\n ir = declaration\n )\n }\n\n val parentFqName = declaration.getFqNameWithJsNameWhenAvailable(shouldIncludePackage = true).parentOrNull()\n\n return ExportedNamespace(","completion":"name = \"$NOT_EXPORTED_NAMESPACE${parentFqName?.asString()?.takeIf { it.isNotEmpty() }?.let { \".$it\" }.orEmpty()}\",\n declarations = listOf(exportedDeclaration),\n isPrivate = true\n )\n }\n\n private val IrClassifierSymbol.isInterface<|endoftext|>"} {"prompt":"private fun checkBoundsIndexes(startIndex: Int, endIndex: Int, size: Int) {\n if (startIndex < 0 || endIndex > size) {\n throw IndexOutOfBoundsException(\"startIndex: $startIndex, endIndex: $endIndex, size: $size\")\n }\n if (startIndex > endIndex) {","completion":"throw IllegalArgumentException(\"startIndex: $startIndex > endIndex: $endIndex\")\n }\n}\n\n@ExperimentalForeignApi\npublic class MemScope : ArenaBase() {\n\n public val memScope: MemScope\n get() = this\n\n public val CValues.ptr: CPointer<|endoftext|>"} {"prompt":"uintArrayOf(1u, 2u, 3u).associateWith { it.toString() }\n )\n assertEquals(\n mapOf(1.toUByte() to \"1\", 2.toUByte() to \"2\", 3.toUByte() to \"3\"),\n ubyteArrayOf(1u, 2u, 3u).associateWith { it.toString() }\n )","completion":"assertEquals(\n mapOf(1.toUShort() to \"1\", 2.toUShort() to \"2\", 3.toUShort() to \"3\"),\n ushortArrayOf(1u, 2u, 3u).associateWith { it.toString() }\n )\n assertEquals(\n mapOf(1UL to \"1\", 2UL to \"2\", 3UL to \"3\"),<|endoftext|>"} {"prompt":"assertFalse((-6).toShort() in range)\n\n assertTrue((-5).toShort() in range)\n assertTrue((-4).toShort() in range)\n assertTrue(0.toShort() in range)\n assertTrue(3.toShort() in range)\n assertTrue(8.toShort() in range)\n assertTrue(9.toShort() in range)","completion":"assertFalse(10.toShort() in range)\n assertFalse(239.toShort() in range)\n\n assertFalse(range.isEmpty())\n\n assertTrue(1.toByte() in range)\n assertTrue(1.toInt() in range)\n assertTrue(1.toLong() in range)\n\n assertFalse(Long.MAX_VALUE in range)<|endoftext|>"} {"prompt":"val target = JvmTarget.values().find { it.description == definedTarget }\n if (target == null) {\n messageCollector.report(\n CompilerMessageSeverity.STRONG_WARNING, \"Unknown JVM target \\\"$definedTarget\\\", using default\"\n )\n } else {\n put(JVMConfigurationKeys.JVM_TARGET, target)\n }\n }","completion":"val jdkHomeFromConfigurations = scriptCompilationConfiguration[ScriptCompilationConfiguration.jvm.jdkHome]\n \/\/ TODO: check if this is redundant and\/or incorrect since the default is now taken from the host configuration anyway (the one linked to the compilation config)\n ?: hostConfiguration[ScriptingHostConfiguration.jvm.jdkHome]\n if (jdkHomeFromConfigurations != null) {<|endoftext|>"} {"prompt":"fun runTestPipeline(moduleStructure: TestModuleStructure, services: TestServices) {\n val globalMetadataInfoHandler = testConfiguration.testServices.globalMetadataInfoHandler\n globalMetadataInfoHandler.parseExistingMetadataInfosFromAllSources()\n\n val modules = moduleStructure.modules\n val dependencyProvider = DependencyProviderImpl(services, modules)","completion":"services.registerDependencyProvider(dependencyProvider)\n\n testConfiguration.preAnalysisHandlers.forEach { preprocessor ->\n preprocessor.preprocessModuleStructure(moduleStructure)\n }\n\n testConfiguration.preAnalysisHandlers.forEach { preprocessor ->\n withAssertionCatching(WrappedException::FromPreAnalysisHandler) {<|endoftext|>"} {"prompt":"assert(f5.toString() == \"F5(x=4294967294)\") { f5.toString() }\n assert(f6.toString() == \"F6(x=678)\") { f6.toString() }","completion":"val aStr = \"A(f1=F1(x=1), f2=F2(x=4294967295), f3=F3(x=F1(x=1), y=F2(x=4294967295)), f4=F4(x=5), f5=F5(x=4294967294), f6=F6(x=678), f7=9,<|endoftext|>"} {"prompt":"return psiAnnotations.map { it.asSingleFqName() }.toSet()\n }\n\n private fun annotationsOnOuterDeclarations(declaration: FirDeclaration): Set {\n return getOwnersOfDeclaration(declaration)?.flatMap { annotationsOnDeclaration(it.fir) }.orEmpty().toSet()\n }\n}","completion":"private class FirOwnersStorage(private val declarationToOwner: Map>>) {\n fun getOwners(declaration: FirDeclaration): List>? = declarationToOwner[declaration]\n\n companion object {\n fun collectOwners(file: FirFile): FirOwnersStorage {<|endoftext|>"} {"prompt":".split(\",\")\n .map { it.trim() }\n .filter { it.isNotEmpty() }\n .toSet()\n }\n\n \/**\n * In case [Project.findProperty] can throw exception, this version catch it and return null\n *\/\n private fun Project.findPropertySafe(propertyName: String): Any? =\n try {\n findProperty(propertyName)","completion":"} catch (ex: Exception) {\n logger.warn(\"Error getting property $propertyName\", ex)\n null\n }\n\n fun findMainKaptConfiguration(project: Project) = project.findKaptConfiguration(SourceSet.MAIN_SOURCE_SET_NAME)\n\n fun createAptConfigurationIfNeeded(project: Project, sourceSetName: String): Configuration {<|endoftext|>"} {"prompt":"expectAnyFailure { cache.getById(i2.id) }\n\n cache.removeById(i2.id)\n\n assertEquals(i1, cache.getByString(i1.str.toLowerCase()))\n assertEquals(i1, cache.getByString(i1.str.toUpperCase()))","completion":"assertEquals(i1, cache.getById(i1.id))\n expectAnyFailure { cache.getByString(i2.str.toLowerCase()) }\n expectAnyFailure { cache.getByString(i2.str.toUpperCase()) }\n expectAnyFailure { cache.getById(i2.id) }\n\n cache.removeById(i1.id)<|endoftext|>"} {"prompt":"} else {\n staticsAndCompanion\n }\n\n val forMembersResolution = forConstructorHeader\n .addReceiver(labelName, towerElementsForClass.thisReceiver)\n .addContextReceiverGroup(towerElementsForClass.contextReceivers)\n\n \/*\n * Scope for enum entries is equal to initial scope for constructor header\n *","completion":"* The only difference is that we add value parameters to local scope for constructors\n * and should not do this for enum entries\n *\/\n\n @Suppress(\"UnnecessaryVariable\")\n val scopeForEnumEntries = forConstructorHeader\n\n val newTowerDataContextForStaticNestedClasses =\n if ((owner as? FirRegularClass)?.classKind?.isSingleton == true)<|endoftext|>"} {"prompt":"BINARY_SIG\n }\n\n companion object RootTypes {\n val OnlyBinary: Set = EnumSet.of(RootType.BINARY, RootType.BINARY_SIG)\n val OnlySource: Set = EnumSet.of(RootType.SOURCE)","completion":"val SourceAndBinary: Set = EnumSet.of(RootType.BINARY, RootType.BINARY_SIG, RootType.SOURCE)\n }\n}<|endoftext|>"} {"prompt":"public inline fun IntArray.dropLastWhile(predicate: (Int) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n\/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n *","completion":"* @sample samples.collections.Collections.Transformations.drop\n *\/\npublic inline fun LongArray.dropLastWhile(predicate: (Long) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n\/**<|endoftext|>"} {"prompt":"* Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.\n * \n * The arrays are also considered structurally equal if both are `null`.\n * \n * @param other the array to compare with this array.\n * @return `true` if the two arrays are structurally equal, `false` otherwise.\n *","completion":"* @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals\n *\/\n@SinceKotlin(\"1.4\")\npublic actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean {\n if (this === other) return true\n if (this === null || other === null) return false\n if (size != other.size) return false<|endoftext|>"} {"prompt":"fun select(vararg x: R) = x[0]\n\nfun poll0(): Flow {\n return flow {\n val inv = select({}, {})\n inv()\n }\n}\n\nfun poll01(): Flow {\n return flow {\n val inv = select({ 1 }, { 1f })\n inv()\n }\n}","completion":"fun poll1(flag: Boolean): Flow {\n return flow {\n val inv = if (flag) { {} } else { {} }\n inv()\n }\n}\n\nfun poll11(flag: Boolean): Flow {\n return flow {\n val inv = if (flag) { { 1 } } else { { 1f } }\n inv()\n }\n}<|endoftext|>"} {"prompt":"postLinkageSteps.add {\n irConstructor.body = irBuiltIns.createIrBuilder(irConstructor.symbol, SYNTHETIC_OFFSET, SYNTHETIC_OFFSET).irBlockBody {\n +IrDelegatingConstructorCallImpl.fromSymbolOwner(\n startOffset, endOffset,\n context.irBuiltIns.unitType, symbols.managedTypeConstructor","completion":").also {\n it.putTypeArgument(0, irConstructor.valueParameters[0].type)\n it.putValueArgument(0, irGet(irConstructor.valueParameters[0]))\n }\n +irInstanceInitializer(symbolTable.descriptorExtension.referenceClass(irClass.descriptor))\n }\n }\n }\n }\n }<|endoftext|>"} {"prompt":"arguments.add(visitor.convertToIrExpression(argument))\n }\n }\n }\n }\n\n is IrDynamicOperatorExpression -> apply {\n if (call == null) return@apply\n val (valueParameters, argumentMapping, substitutor) = extractArgumentsMapping(call)","completion":"if (argumentMapping != null && (visitor.annotationMode || argumentMapping.isNotEmpty())) {\n if (valueParameters != null) {\n val dynamicCallVarargArgument = argumentMapping.keys.firstOrNull() as? FirVarargArgumentsExpression\n ?: error(\"Dynamic call must have a single vararg argument\")\n for (argument in dynamicCallVarargArgument.arguments) {<|endoftext|>"} {"prompt":"return this.scheduler.release(ID_DEVICE_B)\n }\n }\n\n override fun toString(): String {\n return \"IdleTask\"\n }\n}\n\n\/**\n * A task that suspends itself after each time it has been run to simulate\n * waiting for data from an external device.\n * @param {Scheduler} scheduler the scheduler that manages this task","completion":"* @constructor\n *\/\nclass DeviceTask(var scheduler: Scheduler): Task {\n var v1: Packet? = null\n\n override fun run(packet: Packet?): TaskControlBlock? {\n if (packet == null) {\n if (this.v1 == null) return this.scheduler.suspendCurrent()\n val v = this.v1<|endoftext|>"} {"prompt":"synchronized(cacheEntryValue) { \/\/ Needs synchronization as CacheEntryValue is not thread-safe\n val value = cacheEntryValue.get() ?: valueProvider(key)\n cacheEntryValue.setStrongReference(value, currentTimePeriod.get())\n value\n }\n }\n }\n\n fun evictEntries() {","completion":"writeLock { \/\/ Write lock so that other threads don't read\/write the cache while this thread is updating it\n val lowestTimePeriodToKeepStrongRefs = currentTimePeriod.get() - maxTimePeriodsToKeepStrongReferences + 1\n val lowestTimePeriodToKeepSoftRefs = lowestTimePeriodToKeepStrongRefs - maxTimePeriodsToKeepSoftReferences<|endoftext|>"} {"prompt":"MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING !in exception.message.orEmpty(),\n \"Expected no classpath warning in the error message, since this cast was not failing because of isolated classloaders\"\n )\n }\n\n @Test\n fun `test downcast - with isolated classpath`() {\n class BImpl : B","completion":"val isolatedBInstance = isolatedClassLoader.loadClass(BImpl::class.java.name).constructors.single().newInstance()\n\n run {\n val exception = assertThrows(\n \"Expected 'ClassCastException' because of classloader isolation\"\n ) { isolatedBInstance.castIsolatedKotlinPluginClassLoaderAware() }<|endoftext|>"} {"prompt":"takeE(id(value))\n\n if (value != null) {\n takeV(value)\n takeE(value)\n takeE(id(value))\n }\n}","completion":"fun SLRUMap.getOrPutNN(value: V, l: List) {\n takeV(value)\n takeVList(l)\n\n takeE(value)\n takeEList(l)\n takeE(id(value))\n}<|endoftext|>"} {"prompt":"}\n else -> when (value_3) {\n true -> 1\n false -> 2\n null -> 3\n }\n}\n\n\/\/ TESTCASE NUMBER: 7\nfun case_7(value_1: Int, value_2: Int, value_3: Boolean?) {\n when {\n value_1 == 1 -> if (value_2 > 1000) \"1\"","completion":"value_1 == 2 -> if (value_2 > 1000) \"1\"\n else \"2\"\n value_1 == 3 -> if (value_2 < 100) \"1\"\n else if (value_2 < 10) \"2\"\n else \"4\"\n value_1 == 4 -> if (value_3 == null) \"1\"\n else if (value_3) \"2\"<|endoftext|>"} {"prompt":"x.funT()\n x.funAny()","completion":"x.funNullableT()\n x.funNullableAny()\n }\n}\n\n\/*\n * TESTCASE NUMBER: 2<|endoftext|>"} {"prompt":"val z1a: A = z1\n val z1b: B = z1\n val z2a: A = z2\n val z2b: B = z2\n return when {\n z1.foo(\"\", 0) != \"Z1\" -> \"Fail #1\"","completion":"z1a.foo(\"\", 0) != \"Z1\" -> \"Fail #2\"\n z1b.foo(\"\", 0) != \"Z1\" -> \"Fail #3\" \/\/FAIL\n z2.foo(\"\", 0) != \"Z2\" -> \"Fail #4\"\n z2a.foo(\"\", 0) != \"Z2\" -> \"Fail #5\"<|endoftext|>"} {"prompt":"package sample.win32\n\nimport kotlinx.cinterop.*\nimport platform.windows.*\n\nfun main() {\n val message = StringBuilder()\n memScoped {\n val buffer = allocArray(MAX_PATH)\n GetModuleFileNameW(null, buffer, MAX_PATH)","completion":"val path = buffer.toKString().split(\"\\\\\").dropLast(1).joinToString(\"\\\\\")\n message.append(\"\u042f \u043d\u0430\u0445\u043e\u0436\u0443\u0441\u044c \u0432 $path\\n\")\n }<|endoftext|>"} {"prompt":"if (!(4 in emptyCharSequence.indices) != !range1.contains(4)) throw AssertionError()\n if (!(4 !in emptyCharSequence.indices) != range1.contains(4)) throw AssertionError()\n \/\/ no local optimizations\n if (element22 in emptyCharSequence.indices != range1.contains(element22)) throw AssertionError()","completion":"if (element22 !in emptyCharSequence.indices != !range1.contains(element22)) throw AssertionError()\n if (!(element22 in emptyCharSequence.indices) != !range1.contains(element22)) throw AssertionError()\n if (!(element22 !in emptyCharSequence.indices) != range1.contains(element22)) throw AssertionError()\n}<|endoftext|>"} {"prompt":"@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int): Unit {\n nativeSort(comparison)\n}\n\n\/**","completion":"* Sorts the array in-place according to the order specified by the given [comparison] function.\n *\/\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit {<|endoftext|>"} {"prompt":"interface Id {\n val id: T\n}\n\ndata class Actor (\n override val id: Int,\n val firstName: String,\n val lastName: String\n) : Id\n\nfun box(): String {\n val a1 = Actor(1, \"Jeff\", \"Bridges\")\n\n val a1c = a1.copy()","completion":"if (a1c.id != a1.id) return \"Failed: a1.copy().id==${a1c.id}\"\n\n val a2 = Actor(2, \"Jeff\", \"Bridges\")\n if (a2 == a1) return \"Failed: a2==a1\"\n\n \/\/ Assume that our hashCode is good enough for this test :)<|endoftext|>"} {"prompt":"const val appendInFun = appendVararg(\"1\", \" \", \"2\", \" \", \"3\")\n\nconst val length1 = StringBuilder(3).append(\"1\").length","completion":"const val length2 = StringBuilder().append(\"123456789\").length\nconst val get0 = StringBuilder().append(\"1234556789\").get(0)<|endoftext|>"} {"prompt":"\/\/ !CHECK_TYPE\n\nclass G\n\nfun foo(p: P) {\n val v = p as G?","completion":"checkSubtype>(v!!)\n}<|endoftext|>"} {"prompt":"private const val P4 = -1.65339022054652515390e-06 \/* 0xBEBBBD41, 0xC5D26BF1 *\/\nprivate const val P5 = 4.13813679705723846039e-08 \/* 0x3E663769, 0x72BEA4D0 *\/","completion":"internal fun __ieee754_exp(_x: Double): Double \/* default IEEE double exp *\/ {\n var x: Double = _x\n var y: Double\n var hi: Double = 0.0\n var lo: Double = 0.0\n var c: Double\n var t: Double\n var k: Int = 0\n var xsb: Int\n var hx: UInt<|endoftext|>"} {"prompt":"val inv = when (flag) { true -> ::Foo6 false -> ::Foo6 }\n inv\n }\n}\n\nfun poll36(flag: Boolean): Flow {\n return flow {","completion":"val inv = when (flag) { true -> ::Foo7 false -> foo7() }\n inv\n }\n}\n\nfun poll4(): Flow {\n return flow {\n val inv = try { ::bar } finally { ::foo }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.readSourceFileWithMapping\nimport kotlin.reflect.KFunction2\n\nfun FirSession.buildFirViaLightTree(\n files: Collection,\n diagnosticsReporter: DiagnosticReporter? = null,\n reportFilesAndLines: ((Int, Int) -> Unit)? = null\n): List {","completion":"val firProvider = (firProvider as FirProviderImpl)\n val sourcesToPathsMapper = sourcesToPathsMapper\n val builder = LightTree2Fir(this, firProvider.kotlinScopeProvider, diagnosticsReporter)\n val shouldCountLines = (reportFilesAndLines != null)\n var linesCount = 0\n val firFiles = files.map { file -><|endoftext|>"} {"prompt":"open class OpenKlassOptInApiInheritorD: OpenKlassOptInApi()\n\nopen class OpenKlassOptInApiInheritorE: OpenKlassOptInApiInheritorB() \/\/ inheritance opt-in isn't propagated","completion":"open class OpenKlassOptInApiInheritorF: OpenKlassOptInApiInheritorC() \/\/ inheritance opt-in is propagated<|endoftext|>"} {"prompt":"return ValueOrClosed(\"OK\") as R\n }\n\n public final override suspend fun receiveOrClosed(): ValueOrClosed {\n return receiveSuspend()\n }\n}\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\nfun box(): String {\n var res = \"FAIL\"\n builder {","completion":"val channel: Channel = AbstractChannel()\n res = channel.receiveOrClosed().holder as String\n }\n TailCallOptimizationChecker.checkStateMachineIn(\"receiveOrClosed\")\n return res\n}<|endoftext|>"} {"prompt":"open val inBandMetadataTrackDispatchType: String\n open var mode: TextTrackMode\n open val cues: TextTrackCueList?\n open val activeCues: TextTrackCueList?\n open var oncuechange: ((Event) -> Unit)?\n open val sourceBuffer: SourceBuffer?\n fun addCue(cue: TextTrackCue)\n fun removeCue(cue: TextTrackCue)","completion":"}\n\npublic external abstract class TextTrackCueList : JsAny {\n open val length: Int\n fun getCueById(id: String): TextTrackCue?\n}\n\n@Suppress(\"UNUSED_PARAMETER\")\ninternal fun getMethodImplForTextTrackCueList(obj: TextTrackCueList, index: Int): TextTrackCue? { js(\"return obj[index];\") }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapParser\nimport org.jetbrains.kotlin.js.parser.sourcemaps.SourceMapSuccess\nimport org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader\nimport org.jetbrains.kotlin.metadata.DebugProtoBuf","completion":"import org.jetbrains.kotlin.metadata.js.DebugJsProtoBuf\nimport org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf\nimport org.jetbrains.kotlin.metadata.jvm.deserialization.BitEncoding\nimport org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.build.report.metrics.GradleBuildPerformanceMetric\nimport org.jetbrains.kotlin.build.report.metrics.GradleBuildTime\nimport org.jetbrains.kotlin.build.report.metrics.measure\nimport org.jetbrains.kotlin.incremental.*","completion":"import org.jetbrains.kotlin.incremental.classpathDiff.BreadthFirstSearch.findReachableNodes\nimport org.jetbrains.kotlin.incremental.classpathDiff.ClasspathSnapshotShrinker.shrinkClasspath\nimport org.jetbrains.kotlin.incremental.classpathDiff.ImpactedSymbolsComputer.computeImpactedSymbols<|endoftext|>"} {"prompt":"private val context: CommonBackendContext,\n private val headerInfoBuilder: HeaderInfoBuilder,\n private val scopeOwnerSymbol: () -> IrSymbol\n) {\n\n private val symbols = context.ir.symbols\n\n \/**\n * Extracts information for building the for-loop (as a [ForLoopHeader]) from the given\n * \"header\" statement that stores the iterator into the loop variable","completion":"* (e.g., `val it = someIterable.iterator()`).\n *\n * Returns null if the for-loop cannot be lowered.\n *\/\n fun extractHeader(variable: IrVariable): ForLoopHeader? {\n \/\/ Verify the variable type is a subtype of Iterator<*>.\n assert(variable.origin == IrDeclarationOrigin.FOR_LOOP_ITERATOR)<|endoftext|>"} {"prompt":"enableGradleDaemonMemoryLimitInMb,\n enableKotlinDaemonMemoryLimitInMb,\n gradleVersion,\n kotlinDaemonDebugPort\n )\n val gradleRunnerForBuild = gradleRunner\n .also { if (forceOutput) it.forwardOutput() }","completion":".also { if (environmentVariables.environmentalVariables.isNotEmpty()) it.withEnvironment(System.getenv() + environmentVariables.environmentalVariables) }\n .withDebug(enableGradleDebug)\n .withArguments(allBuildArguments)\n withBuildSummary(allBuildArguments) {\n val buildResult = gradleRunnerForBuild.build()<|endoftext|>"} {"prompt":"fun testDataFlowInfo1(a: Int?, b: Int?) {\n val c: Int = a ?: b!!\n doInt(c)\n \/\/ b is nullable if a != null\n b + 1\n}\n\nfun testDataFlowInfo2(a: Int?, b: Int?) {\n doInt(a ?: b!!)","completion":"\/\/ b is nullable if a != null\n b + 1\n}\n\nfun testTypeMismatch(a: String?, b: Any) {\n doInt(a ?: b)\n}<|endoftext|>"} {"prompt":"@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class, kotlin.ExperimentalStdlibApi::class})\n@kotlin.internal.InlineOnly\npublic inline fun kotlin.UInt.countLeadingZeroBits(): kotlin.Int\n\n@kotlin.SinceKotlin(version = \"1.5\")","completion":"@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class, kotlin.ExperimentalStdlibApi::class})\n@kotlin.internal.InlineOnly\npublic inline fun kotlin.ULong.countLeadingZeroBits(): kotlin.Int\n\n@kotlin.SinceKotlin(version = \"1.5\")<|endoftext|>"} {"prompt":"assertFalse(eqByteQDouble(0.toByte(), 1.toDouble()))\n assertFalse(eqByteQDouble(1.toByte(), 0.toDouble()))\n assertTrue(eqByteQDouble(1.toByte(), 1.toDouble()))\n assertFalse(eqByteQDouble(null, 0.toDouble()))\n assertFalse(eqByteQDouble(null, 1.toDouble()))","completion":"assertFalse(eqByteQDouble(undefined, 0.toDouble()))\n assertFalse(eqByteQDouble(undefined, 1.toDouble()))\n assertTrue(eqByteQDoubleQ(0.toByte(), 0.toDouble()))\n assertFalse(eqByteQDoubleQ(0.toByte(), 1.toDouble()))\n assertFalse(eqByteQDoubleQ(0.toByte(), null))<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.library.metadata\n\nimport org.jetbrains.kotlin.builtins.BuiltInsPackageFragment\nimport org.jetbrains.kotlin.descriptors.ModuleDescriptor\nimport org.jetbrains.kotlin.library.KotlinLibrary\nimport org.jetbrains.kotlin.metadata.ProtoBuf","completion":"import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl\nimport org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.serialization.deserialization.DeserializationComponents<|endoftext|>"} {"prompt":"* @param moduleName The name of the module being serialized to be written into the KLIB header.\n * @param irModuleFragment The IR to be serialized into the KLIB being produced, or `null` if this is going to be a metadata-only KLIB.\n * @param configuration Used to determine certain serialization parameters and enable\/disable serialization diagnostics.","completion":"* @param diagnosticReporter Used for reporting serialization-time diagnostics, for example, about clashing IR signatures.\n * @param compatibilityMode The information about KLIB ABI.\n * @param cleanFiles In the case of incremental compilation, the list of files that were not changed and therefore don't need to be\n * serialized again.\n * @param dependencies The list of KLIBs that the KLIB being produced depends on.<|endoftext|>"} {"prompt":"val bodyBlock = convertToBlock(bodyStatement)\n jsCondition = JsBooleanLiteral(true)\n\n if (doWhile) {\n \/\/ translate to: tmpSecondRun = false;\n \/\/ do { if(tmpSecondRun) { if(!tmpExprVar) break; } else tmpSecondRun=true; } while(true)","completion":"val secondRun = context.defineTemporary(JsBooleanLiteral(false).source(expression))\n conditionBlock.statements.add(breakIfConditionIsFalseStatement)\n val ifStatement = JsIf(secondRun, conditionBlock, assignment(secondRun, JsBooleanLiteral(true)).source(expression).makeStmt())<|endoftext|>"} {"prompt":"private fun testMultipleFrameworksImpl(testName: String, freeCompilerArgs: List, checks: TestRunChecks) {\n Assumptions.assumeTrue(targets.testTarget.family.isAppleFamily)\n\n val testDir = testSuiteDir.resolve(\"multiple\")\n val framework1Dir = testDir.resolve(\"framework1\")","completion":"val sharedDir = testDir.resolve(\"shared\")\n val moduleNameFirst = \"First\"\n val testCase1 = generateObjCFrameworkTestCase(\n TestKind.STANDALONE_NO_TR, extras, moduleNameFirst,\n listOf(\n framework1Dir.resolve(\"first.kt\"),\n framework1Dir.resolve(\"test.kt\"),<|endoftext|>"} {"prompt":"project.tasks.whenObjectAdded { throw TestException() }\n assertFails { project.evaluate() }\n\n \/* Project has failed: Lifecycle finished. We can still access futures! *\/\n run {\n \/* Failure state is still in 'EvaluateBuildscript' Stage *\/\n assertEquals(EvaluateBuildscript, project.kotlinPluginLifecycle.stage)","completion":"\/* None of the coroutines before was executed *\/\n assertEquals(emptyList(), executed)\n\n \/* Access configurationResult future as .getOrThrow *\/\n val result = project.configurationResult.getOrThrow()\n assertIsInstance(result)\n\n \/* Access configurationResult future as .future {} *\/<|endoftext|>"} {"prompt":"0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, \n 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff0000000000000UL, 0xfff0000000000000UL,","completion":"0x7ff8000000000000UL, 0xfff0000000000000UL, 0x7ff8000000000000UL, 0x7ff0000000000000UL, \n 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL,<|endoftext|>"} {"prompt":"\/\/ test 1: PTV is in consuming position (yield-case)\nfun testYield() {\n fun testTypeInfoOriginInsideLocalClass() {\n val buildee = build {\n class Local {\n fun localOnlyFunc(): T = UserKlass() as T\n\n fun initialize() {\n reference = Local()\n\n val arg: Local = Local()","completion":"yield(arg)\n }\n }\n Local().initialize()\n }\n val result = buildee.typeArgumentValue.localOnlyFunc()\n result\n }\n\n fun testThisExpression() {\n val buildee = build {\n class Local {<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_EXPRESSION -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_VALUE -VARIABLE_WITH_REDUNDANT_INITIALIZER\n\/\/ SKIP_TXT\n\n\/*","completion":"* KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE)\n *\n * SECTIONS: dfa\n * NUMBER: 40\n * DESCRIPTION: Raw data flow analysis test\n * HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses\n *\/\n\n\/*\n * TESTCASE NUMBER: 1\n * ISSUES: KT-8819\n *\/<|endoftext|>"} {"prompt":"fun Case1.emptyArray(): Array = TODO()\n\npublic fun emptyArray(): Array = TODO()\n\n\n\n\n\/\/ FILE: TestCase2.kt\n\/\/ TESTCASE NUMBER: 2\npackage testsCase2\nimport libPackageCase2.*\nimport libPackageCase2Explicit.emptyArray\n\nclass Case2(){","completion":"fun emptyArray(): Array = TODO()\n\n val emptyArray: A\n get() = A()\n\n fun case1() {\n fun Case2.emptyArray(): Array = TODO()<|endoftext|>"} {"prompt":"class A {\n val a = 1\n fun calc () : Int {\n class B() {\n val b = 2\n inner class C {\n val c = 3\n fun calc() = this@A.a + this@B.b + this.c\n }\n }\n return B().C().calc()\n }\n}\n\nfun box() : String {","completion":"return if (A().calc() == 6) \"OK\" else \"fail\" \n}<|endoftext|>"} {"prompt":"is FirEnumEntrySymbol -> {\n KtEnumEntryAnnotationValue(resolvedSymbol.callableId, sourcePsi)\n }\n\n else -> null\n }\n }\n\n is FirPropertyAccessExpression -> {\n val reference = calleeReference as? FirResolvedNamedReference ?: return null\n when (val resolvedSymbol = reference.resolvedSymbol) {","completion":"is FirEnumEntrySymbol -> {\n KtEnumEntryAnnotationValue(resolvedSymbol.callableId, sourcePsi)\n }\n\n else -> null\n }\n }\n\n is FirEnumEntryDeserializedAccessExpression -> KtEnumEntryAnnotationValue(CallableId(enumClassId, enumEntryName), sourcePsi)\n\n is FirGetClassCall -> {<|endoftext|>"} {"prompt":"for (delegated in delegatedConstructor.delegatedConstructorCalls) {\n if (delegated is FirLazyDelegatedConstructorCall) {\n return true\n }\n }\n }\n return false\n}\n\nprivate fun calculateLazyBodiesForField(designation: FirDesignation) {\n val field = designation.target as FirField","completion":"require(field.initializer is FirLazyExpression)\n\n \/\/ 'designation.path.last()' cannot be used here, as for dangling files designation target may be in a different file\n val psi = field.psi?.getStrictParentOfType()\n\n val newField = revive(designation, psi)<|endoftext|>"} {"prompt":"x\n x.equals(null)","completion":"x.propT\n x.propAny<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.mpp.*\nimport org.jetbrains.kotlin.gradle.plugin.usesPlatformOf\nimport org.jetbrains.kotlin.gradle.targets.KotlinTargetSideEffect","completion":"import org.jetbrains.kotlin.gradle.targets.native.internal.CInteropKlibLibraryElements.cinteropKlibLibraryElements\nimport org.jetbrains.kotlin.gradle.tasks.CInteropProcess\nimport org.jetbrains.kotlin.gradle.utils.*\nimport org.jetbrains.kotlin.gradle.utils.createConsumable<|endoftext|>"} {"prompt":"} else {\n lastVariableIfCanCacheLast = null\n lastExpression = last\n }\n\n val (tmpStepVar, tmpStepExpression) =\n createLoopTemporaryVariableIfNecessary(\n ensureNotNullable(headerInfo.step.asStepType()),\n nameHint = \"step\",\n irType = stepClass.defaultType\n )","completion":"stepVariable = tmpStepVar\n stepExpression = tmpStepExpression\n }\n }\n }\n\n private fun DeclarationIrBuilder.ensureNotNullable(expression: IrExpression) =\n if (expression.type is IrSimpleType && expression.type.isNullable()) {\n irImplicitCast(expression, expression.type.makeNotNull())\n } else {\n expression\n }<|endoftext|>"} {"prompt":"BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> descriptorExtension.declareSimpleFunctionFromLinker(descriptor as FunctionDescriptor, idSignature) { s: IrSimpleFunctionSymbol ->\n generateIrIfNeeded(s, file)\n s.owner\n }","completion":"BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> descriptorExtension.declarePropertyFromLinker(descriptor as PropertyDescriptor, idSignature) { s: IrPropertySymbol ->\n generateIrIfNeeded(s, file)\n s.owner\n }\n \/\/ TODO: better error message?<|endoftext|>"} {"prompt":"v.pop() \/\/ -> size, parcel, arr, index\n v.dup2X1() \/\/ -> size, arr, index, parcel, arr, index\n v.invokevirtual(asmType.internalName, \"valueAt\", \"(I)${valueType.descriptor}\", false) \/\/ -> size, arr, index, parcel, value\n valueSerializer.writeValue(v) \/\/ -> size, arr, index","completion":"v.aconst(1) \/\/ -> size, arr, index, (1)\n v.add(Type.INT_TYPE) \/\/ -> size, arr, (index + 1)\n v.dup2X1() \/\/ -> arr, (index + 1), size, arr, (index + 1)\n v.pop2() \/\/ -> arr, (index + 1), size<|endoftext|>"} {"prompt":"shouldBeSerializable: Boolean,\n requiredBridges: Collection,\n dynamicCall: IrCall\n ): IrCall {\n val samMethodType = jvmOriginalMethodType(samMethodSymbol)\n val implFunRawRef = irRawFunctionReference(context.irBuiltIns.anyType, implFunSymbol)\n val instanceMethodType = jvmOriginalMethodType(instanceMethodSymbol)","completion":"var bootstrapMethod = jdkMetafactoryHandle\n val bootstrapMethodArguments = arrayListOf(\n samMethodType,\n implFunRawRef,\n instanceMethodType\n )\n var bridgeMethodTypes = emptyList()\n\n var flags = 0\n\n if (shouldBeSerializable) {\n flags += LambdaMetafactory.FLAG_SERIALIZABLE<|endoftext|>"} {"prompt":"fun clang_indexSourceFileFullArgv(arg0: CXIndexAction?, client_data: CXClientData?, index_callbacks: CValuesRef?, index_callbacks_size: Int, index_options: Int, source_filename: String?, command_line_args: CValuesRef>?, num_command_line_args: Int, unsaved_files:","completion":"CValuesRef?, num_unsaved_files: Int, out_TU: CValuesRef?, TU_options: Int): Int {<|endoftext|>"} {"prompt":"status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL)\n\n val delegatedEntrySelfType = buildResolvedTypeRef {\n type =\n ConeClassLikeTypeImpl(\n this@buildAnonymousObject.symbol.toLookupTag(),\n emptyArray(),\n isNullable = false\n )\n }","completion":"registerSelfType(delegatedEntrySelfType)\n\n superTypeRefs += delegatedEnumSelfTypeRef\n val superTypeCallEntry = superTypeListEntries.firstIsInstanceOrNull()\n val correctedEnumSelfTypeRef = buildResolvedTypeRef {<|endoftext|>"} {"prompt":"private fun getArrayOfSymbol(arrayOfName: Name): FirNamedFunctionSymbol? {\n return session.symbolProvider\n .getTopLevelFunctionSymbols(StandardNames.BUILT_INS_PACKAGE_FQ_NAME, arrayOfName)\n .firstOrNull() \/\/ TODO: it should be single() after KTIJ-26465 is fixed\n }","completion":"fun resolveCallableReferenceWithSyntheticOuterCall(\n callableReferenceAccess: FirCallableReferenceAccess,\n expectedTypeRef: FirTypeRef?,\n context: ResolutionContext,\n resolutionMode: ResolutionMode,\n ): FirCallableReferenceAccess {\n val argumentList = buildUnaryArgumentList(callableReferenceAccess)\n\n val parameterTypeRef =\n when {<|endoftext|>"} {"prompt":"* Retains only elements of this [MutableCollection] that are contained in the given [elements] sequence.\n *\/\npublic fun MutableCollection.retainAll(elements: Sequence): Boolean {\n val list = elements.toList()\n if (list.isNotEmpty())\n return retainAll(list)\n else\n return retainNothing()\n}","completion":"private fun MutableCollection<*>.retainNothing(): Boolean {\n val result = isNotEmpty()\n clear()\n return result\n}\n\n\n\/**\n * Removes all elements from this [MutableIterable] that match the given [predicate].\n *\n * @return `true` if any element was removed from this collection, or `false` when no elements were removed and collection was not modified.\n *\/<|endoftext|>"} {"prompt":"expression.typeOperand = transformType(expression, expression.typeOperand, data)\n return super.visitTypeOperator(expression, data)\n }\n\n override fun visitVararg(expression: IrVararg, data: D): IrExpression {\n expression.varargElementType = transformType(expression, expression.varargElementType, data)\n return super.visitVararg(expression, data)","completion":"}\n}<|endoftext|>"} {"prompt":"public val Double.days: Duration get() = toDuration(DurationUnit.DAYS)\n\n\n\/** Returns a duration whose value is the specified [duration] value multiplied by this number. *\/\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\n@kotlin.internal.InlineOnly\npublic inline operator fun Int.times(duration: Duration): Duration = duration * this\n\n\/**","completion":"* Returns a duration whose value is the specified [duration] value multiplied by this number.\n *\n * The operation may involve rounding when the result cannot be represented exactly with a [Double] number.\n *\n * @throws IllegalArgumentException if the operation results in a `NaN` value.\n *\/\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)<|endoftext|>"} {"prompt":"* This exception is passed to [onError] for handling.\n * @throws FileSystemException if the source subtree contains an entry with an illegal name such as \".\" or \"..\".\n * This exception is passed to [onError] for handling.\n * @throws FileSystemLoopException if the recursive copy reaches a cycle.\n * This exception is passed to [onError] for handling.","completion":"* @throws SecurityException if a security manager is installed and access is not permitted to an entry in the source or target subtree.\n * This exception is passed to [onError] for handling.\n *\/\n@ExperimentalPathApi\n@SinceKotlin(\"1.8\")\npublic fun Path.copyToRecursively(\n target: Path,<|endoftext|>"} {"prompt":"if (values.any { value -> value.kind == SYNTHESIZED && value.containingClass?.isData == true }) {\n return null\n }\n\n val returnType = returnTypeCommonizer(values) ?: return null\n\n val unsafeNumberAnnotation = createUnsafeNumberAnnotationIfNecessary(\n classifiers.classifierIndices.targets, settings,","completion":"inputDeclarations = values,\n inputTypes = values.map { it.returnType },\n commonizedType = returnType,\n )\n\n val annotations = AnnotationsCommonizer.commonize(values.map { it.annotations }).orEmpty()\n .plus(listOfNotNull(unsafeNumberAnnotation))\n\n return FunctionOrProperty(\n name = values.first().name,<|endoftext|>"} {"prompt":"js(\"{ var a = ${ONE}; }\")\n js(\"{ var a = ${UONE}; }\")\n js(\"{ var a = ${HALF}; }\")\n js(\"{ var a = ${TRUE}; }\")\n js(\"{ var a = '${STR}'; }\")\n js(\"{ var a = '${CHAR}'; }\")\n}\n\nfun testArithmeticOperations() {","completion":"js(\"{ var a = ${1 + 2}; }\")\n js(\"{ var a = ${1 - 2}; }\")\n js(\"{ var a = ${1 * 2}; }\")\n js(\"{ var a = ${1 \/ 2}; }\")\n js(\"{ var a = ${1 % 2}; }\")\n js(\"{ var a = ${1.1 + 2.1}; }\")<|endoftext|>"} {"prompt":"+field(\"dispatchReceiver\", expression, nullable = true, withReplace = true).withTransform()\n +field(\"calleeReference\", reference, withReplace = true)\n +field(\"source\", sourceElementType, nullable = true, withReplace = true)\n generateBooleanFields(\"this\", \"super\")\n }\n\n multiDelegatedConstructorCall.configure {","completion":"+fieldList(\"delegatedConstructorCalls\", delegatedConstructorCall, withReplace = true).withTransform()\n }\n\n valueParameter.configure {\n +symbol(\"FirValueParameterSymbol\")\n +field(\"defaultValue\", expression, nullable = true, withReplace = true)\n +field(\"containingFunctionSymbol\", functionSymbolType.withArgs(TypeRef.Star)).apply {<|endoftext|>"} {"prompt":"if (x.statement is JsLoop) {\n statementsLabels[x.statement] = x\n }\n return true\n }\n\n override fun visit(x: JsLoop, ctx: JsContext): Boolean {\n loopOrSwitchStack.push(x)\n return true\n }","completion":"override fun visit(x: JsSwitch, ctx: JsContext): Boolean {\n loopOrSwitchStack.push(x)\n return true\n }\n\n fun endVisitLoopOrSwitch(x: JsStatement, ctx: JsContext) {\n val top = loopOrSwitchStack.pop()\n assert(top === x)<|endoftext|>"} {"prompt":"* - If the argument is infinite, then the result is an infinity with the same sign as the argument.\n * - If the argument is zero, then the result is a zero with the same sign as the argument.\n *\/\n@SinceKotlin(\"1.8\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun cbrt(x: Float): Float\n\n\n\/\/ extensions\n\n\n\/**","completion":"* Raises this value to the power [x].\n *\n * Special cases:\n * - `b.pow(0.0)` is `1.0`\n * - `b.pow(1.0) == b`\n * - `b.pow(NaN)` is `NaN`<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.diagnostics.Severity\nimport org.jetbrains.kotlin.diagnostics.impl.BaseDiagnosticsCollector\nimport org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory\nimport org.jetbrains.kotlin.psi","completion":"import org.jetbrains.kotlin.scripting.definitions.MessageReporter\nimport kotlin.reflect.KMutableProperty1\nimport kotlin.reflect.jvm.javaField\nimport kotlin.script.experimental.api.ResultWithDiagnostics\nimport kotlin.script.experimental.api.ScriptDiagnostic\nimport kotlin.script.experimental.api.SourceCode<|endoftext|>"} {"prompt":"val addedBenchmarks = report.addedBenchmarks\n val removedBenchmarks = report.removedBenchmarks\n if (failedBenchmarks.isEmpty()) {\n append(\"All benchmarks passed!\")\n }\n if (!failedBenchmarks.isEmpty() || !addedBenchmarks.isEmpty() || !removedBenchmarks.isEmpty()) {\n printBucketInfo(failedBenchmarks, \"Failed benchmarks\")","completion":"printBucketInfo(addedBenchmarks, \"Added benchmarks\")\n printBucketInfo(removedBenchmarks, \"Removed benchmarks\")\n }\n append(\"Total becnhmarks number: ${report.benchmarksNumber}\")\n append()\n }\n\n fun renderPerformanceSummary(report: SummaryBenchmarksReport) {<|endoftext|>"} {"prompt":"manyFoo(s = a)","completion":"manyFoo(v = a as Int)<|endoftext|>"} {"prompt":"} else {\n elementFactory.createTypeFromText(\n \/* text = *\/ \"${StandardClassIds.EnumEntries.asFqNameString()}<${enumClass.qualifiedName}>\",\n \/* context = *\/ enumClass,\n )\n }\n type.annotate { arrayOf(makeNotNullAnnotation(enumClass)) }\n }\n }\n }","completion":"private val parameterList = LightParameterListBuilder(manager, language).apply {\n if (kind == Kind.VALUE_OF) {\n val stringType = PsiType.getJavaLangString(manager, GlobalSearchScope.allScope(project))\n val valueParameter =\n object : LightParameter(\n DEFAULT_VALUE_PARAMETER.identifier,\n stringType,\n this,\n language,<|endoftext|>"} {"prompt":"@Suppress(\"DEPRECATION\")\n @Deprecated(\"Use toolOptions to configure the task\")\n @get:Internal\n val languageSettings: LanguageSettings = compilation.defaultSourceSet.languageSettings\n\n @Suppress(\"unused\")\n @get:Input\n protected val konanCacheKind: Provider = objectFactory.providerWithLazyConvention {","completion":"project.getKonanCacheKind(konanTarget)\n }\n\n @Suppress(\"unused\")\n @get:Input\n internal val useEmbeddableCompilerJar: Boolean = project.nativeUseEmbeddableCompilerJar\n\n @Suppress(\"unused\", \"UNCHECKED_CAST\")\n @Deprecated(\n \"Use toolOptions.freeCompilerArgs\",<|endoftext|>"} {"prompt":"fun testDefaultSourceSetsDsl() = with(Project(\"sample-lib\", gradleVersion, \"new-mpp-lib-and-app\")) {\n setupWorkingDir()\n\n val testOutputPrefix = \"# default source set \"\n val testOutputRegex = Regex(\"${Regex.escape(testOutputPrefix)} (.*?) (.*?) (.*)\")\n\n gradleBuildScript().appendText(","completion":"\"\\n\" + \"\"\"\n kotlin.targets.each { target ->\n target.compilations.each { compilation ->\n println \"$testOutputPrefix ${'$'}{target.name} ${'$'}{compilation.name} ${'$'}{compilation.defaultSourceSet.name}\"\n }\n }\n \"\"\".trimIndent()\n )\n\n build {<|endoftext|>"} {"prompt":"\/\/ disclaimer in the documentation and\/or other materials provided\n\/\/ with the distribution.\n\/\/ * Neither the name of Google Inc. nor the names of its\n\/\/ contributors may be used to endorse or promote products derived\n\/\/ from this software without specific prior written permission.\n\/\/\n\/\/ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS","completion":"\/\/ \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\/\/ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\/\/ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\/\/ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<|endoftext|>"} {"prompt":"isStringExtension && symbol.fir.valueParameters.singleOrNull { it.returnTypeRef.coneType.isNullableAny } != null\n }\n findFunction(firFunction)\n }\n\n override val memberStringPlus: IrSimpleFunctionSymbol by lazy {\n val firFunction = findFirMemberFunctions(StandardClassIds.String, OperatorNameConventions.PLUS).single {","completion":"it.fir.valueParameters.singleOrNull()?.returnTypeRef?.coneType?.isNullableAny == true\n }\n findFunction(firFunction)\n }\n\n override val arrayOf: IrSimpleFunctionSymbol by lazy {\n \/\/ distinct() is needed because we can get two Fir symbols for arrayOf function (from builtins and from stdlib)<|endoftext|>"} {"prompt":"fun foo()\nfun @[a] foo()\nfun @[a] T.foo()\nfun @[a] T.foo(a : foo) : bar\nfun @[a()] T.foo b>(a : foo) : bar\n\nfun foo();\nfun @[a] foo();\nfun @[a] T.foo();","completion":"fun @[a] T.foo(a : foo) : bar;\nfun @[a()] T.foo b>(a : foo) : bar;\n\nfun foo() {}\nfun @[a] foo() {}\nfun @[a] T.foo() {}\nfun @[a] T.foo(a : foo) : bar {}<|endoftext|>"} {"prompt":"while (nextIndex != -1 && count < expectedRepetitionTimes + 1) {\n count++\n currentOffset = nextIndex + expectedSubString.length\n nextIndex = output.indexOf(expectedSubString, currentOffset)\n }\n\n assert(count == expectedRepetitionTimes) {\n printBuildOutput()\n \"Build output contains \\\"$expectedSubString\\\" $count times\"\n }\n}","completion":"\/**\n * Asserts Gradle output does not contain [notExpectedSubString] string.\n *\n * @param wrappingCharsCount amount of chars to include before and after [notExpectedSubString] occurrence\n *\/\nfun BuildResult.assertOutputDoesNotContain(\n notExpectedSubString: String,\n wrappingCharsCount: Int = 100,\n) {<|endoftext|>"} {"prompt":"\/\/ This file was generated automatically. See compiler\/ir\/ir.tree\/tree-generator\/ReadMe.md.\n\/\/ DO NOT MODIFY IT MANUALLY.\n\npackage org.jetbrains.kotlin.ir.expressions\n\nimport org.jetbrains.kotlin.ir.visitors.IrElementTransformer\nimport org.jetbrains.kotlin.ir.visitors.IrElementVisitor","completion":"\/**\n * Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.throw]\n *\/\nabstract class IrThrow : IrExpression() {\n abstract var value: IrExpression\n\n override fun accept(visitor: IrElementVisitor, data: D): R =\n visitor.visitThrow(this, data)<|endoftext|>"} {"prompt":"val b = ?>?>?>?>?>? & Inv?>?>?>?>?>\")!>a.get()\n if (b != null) {","completion":"val c = ?>?>?>?>? & Out?>?>?>?>\")!>b.get()\n if (c != null) {<|endoftext|>"} {"prompt":"\/\/ LANGUAGE: -ReportErrorsForComparisonOperators\n\nfun nullableNothingIdentity(a: Int, b: Nothing?) {\n a === b\n}\n\nfun samePrimitiveIdentity(a: Int, b: Int) {\n a === b\n}","completion":"fun identityWithImplicitBoxing(a: Int, b: Any?) {\n a === b\n}\n\nenum class E1 { A, B }\nenum class E2 { C, D }\n\nfun nullableEnums(a: E1?, b: E2?) {\n a == b\n}<|endoftext|>"} {"prompt":"private val ClassDescriptor.isAnonymousObjectOrContained: Boolean\n get() {\n var current: DeclarationDescriptor? = this\n while (current != null) {\n if (DescriptorUtils.isAnonymousObject(current)) {\n return true\n }\n current = current.containingDeclaration\n }\n return false\n }","completion":"private fun checkEnum(descriptor: ClassDescriptor, declaration: KtDeclaration, trace: BindingTrace) {\n if (descriptor.kind != ClassKind.ENUM_CLASS) return\n\n val entryBySerialName = mutableMapOf()\n descriptor.enumEntries().forEach { entryDescriptor -><|endoftext|>"} {"prompt":"@GCUnsafeCall(\"Kotlin_io_Console_println0\")\npublic actual external fun println()\n\n\/**\n * Reads a line of input from the standard input stream and returns it,\n * or throws a [RuntimeException] if EOF has already been reached when [readln] is called.\n *\n * LF or CRLF is treated as the line terminator. Line terminator is not included in the returned string.\n *","completion":"* The input is interpreted as UTF-8. Invalid bytes are replaced by the replacement character '\\uFFFD'.\n *\/\n@SinceKotlin(\"1.6\")\npublic actual fun readln(): String = readlnOrNull() ?: throw ReadAfterEOFException(\"EOF has already been reached\")\n\n\/**\n * Reads a line of input from the standard input stream and returns it,<|endoftext|>"} {"prompt":"1 to 3 -> AT_LEAST_ONCE\n 2 to 2 -> MORE_THAN_ONCE\n 2 to 3 -> MORE_THAN_ONCE\n 3 to 3 -> MORE_THAN_ONCE\n else -> throw IllegalArgumentException()\n }\n\n fun or(x: EventOccurrencesRange, y: EventOccurrencesRange): EventOccurrencesRange =","completion":"fromRange(min(x.left, y.left), max(x.right, y.right))\n\n fun plus(x: EventOccurrencesRange, y: EventOccurrencesRange): EventOccurrencesRange =\n fromRange(x.left + y.left, x.right + y.right)\n }<|endoftext|>"} {"prompt":"return JsIrProgramFragments(result, exportFragment)\n }\n\n private fun Set.computeTag(declaration: IrDeclaration): String? {\n \/\/ Use LEGACY here because the declaration may come from an old klib, in which its `IdSignature.CommonSignature`","completion":"\/\/ doesn't have `description`, but only `id`. Hence, we always render the signature with `id` instead of `description`,\n \/\/ because otherwise there may be a mismatch when we're computing the tag first for the IrDeclaration deserialized from klib,\n \/\/ and then for the same declaration but constructed from a descriptor.\n \/\/<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM_IR\n\/\/ IGNORE_BACKEND_MULTI_MODULE: JVM_MULTI_MODULE_IR_AGAINST_OLD\n\/\/ FILE: 1.kt\npackage test\n\nclass C {\n var x: () -> Unit\n inline get() = {}\n inline set(noinline value) {\n bar(value)\n }","completion":"fun bar(i: I) = i.foo()\n}\n\nfun interface I {\n fun foo()\n}\n\n\/\/ FILE: 2.kt\nimport test.*\n\nfun box(): String {\n var result = \"fail\"\n val c = C()\n c.x = { result = \"OK\" }\n return result\n}<|endoftext|>"} {"prompt":"-100000000000000000000000000000000 checkType {","completion":"check<Short>()<|endoftext|>"} {"prompt":"return builder.irNull(builtIns.nothingNType)\n }\n\n \/\/ Handled by autoboxing transformer\n if (toType.isInlined() && !fromType.isInlined()) {\n return builder.irCall(\n symbols.unboxIntrinsic,\n toType,\n typeArguments = listOf(fromType, toType)\n ).also {","completion":"it.putValueArgument(0, value)\n }\n }\n\n if (!toType.isInlined() && fromType.isInlined()) {\n return builder.irCall(\n symbols.boxIntrinsic,\n toType,\n typeArguments = listOf(fromType, toType)\n ).also {\n it.putValueArgument(0, value)<|endoftext|>"} {"prompt":"\"return TProgression.fromClosedRange(last, first, -step)\"\n }\n }\n\n val f_step = fn(\"step(step: STEP)\") {\n include(ProgressionsOfPrimitives, rangePrimitives)\n } builder {\n infix(true)\n doc { \"Returns a progression that goes over the same range with the given step.\" }","completion":"sample(\"samples.ranges.Ranges.step$primitive\")\n signature(\"step(step: ${primitive!!.stepType})\", notForSorting = true)\n returns(\"TProgression\")\n body {\n \"\"\"\n checkStepIsPositive(step > 0, step)<|endoftext|>"} {"prompt":"* because there are no elements in it that _do not_ match the predicate.\n * See a more detailed explanation of this logic concept in [\"Vacuous truth\"](https:\/\/en.wikipedia.org\/wiki\/Vacuous_truth) article.\n * \n * @sample samples.collections.Collections.Aggregates.all\n *\/\npublic inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean {","completion":"for (element in this) if (!predicate(element)) return false\n return true\n}\n\n\/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n *\/\npublic fun Array.any(): Boolean {\n return !isEmpty()\n}\n\n\/**<|endoftext|>"} {"prompt":"irCall(backendContext.ir.symbols.enumValueOfFunction).apply {\n putValueArgument(0, javaClassReference(irClass.defaultType))\n putValueArgument(1, irGet(declaration.valueParameters[0]))\n }\n\n IrSyntheticBodyKind.ENUM_ENTRIES -> {\n \/\/ We're ensuring on FE level that this declaration exists only","completion":"\/\/ when the corresponding flag is set up (-> entriesField is never null)\n irGetField(null, entriesField!!)\n }\n }\n )\n }\n return declaration\n }\n }\n\n private inner class EnumClassCallTransformer : IrElementTransformerVoidWithContext() {\n override fun visitClassNew(declaration: IrClass): IrStatement =<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.calls.inference.extractAllContainingTypeVariables\nimport org.jetbrains.kotlin.resolve.calls.tower.ApplicabilityDetail\nimport org.jetbrains.kotlin.resolve.calls.tower.isSuccess\nimport org.jetbrains.kotlin.types.model.*","completion":"import org.jetbrains.kotlin.utils.SmartList\nimport org.jetbrains.kotlin.utils.addToStdlib.trimToSize\n\nprivate typealias Context = TypeSystemInferenceExtensionContext\n\nclass MutableVariableWithConstraints private constructor(\n private val context: Context,\n override val typeVariable: TypeVariableMarker,<|endoftext|>"} {"prompt":"super.configure(builder)\n with(builder) {\n defaultDirectives {\n +CodegenTestDirectives.IGNORE_FIR2IR_EXCEPTIONS_IF_FIR_CONTAINS_ERRORS\n }\n }\n }\n\n override fun TestConfigurationBuilder.configuration() {\n configureFirParser(parser)\n baseFirDiagnosticTestConfiguration()","completion":"facadeStep(::Fir2IrResultsConverter)\n irHandlersStep {\n useHandlers(\n ::IrDiagnosticsHandler\n )\n }\n\n useAdditionalService(::LibraryProvider)\n\n @OptIn(TestInfrastructureInternals::class)\n useModuleStructureTransformers(DuplicateFileNameChecker, PlatformModuleProvider)\n }\n}<|endoftext|>"} {"prompt":"is KtOperationExpression -> true\n is KtArrayAccessExpression -> true\n is KtCallableReferenceExpression -> true\n else -> false\n }\n\n protected companion object {","completion":"private val nonCallBinaryOperator: Set = setOf(KtTokens.ELVIS, KtTokens.EQEQEQ, KtTokens.EXCLEQEQEQ)\n }\n}<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\nclass Foo\n\nclass Bar {\n fun takeFoo(foo: Foo) {}\n}\n\nclass Out\n\ninterface A\nclass B : A\nclass C : A\n\nfun Out> main() {","completion":"val foo = Foo()\n Bar>().takeFoo(foo) \/\/ error in 1.3.72, no error in 1.4.31\n}<|endoftext|>"} {"prompt":"public abstract fun asSignature(symbol: S): KtVariableLikeSignature\n}\n\npublic interface KtSignatureSubstitutorMixIn : KtAnalysisSessionMixIn {\n \/**\n * Applies a [substitutor] to the given symbol and return a signature with substituted types.\n *","completion":"* @see KtSubstitutor.substitute\n *\/\n public fun S.substitute(substitutor: KtSubstitutor): KtCallableSignature =\n withValidityAssertion { analysisSession.signatureSubstitutor.substitute(this, substitutor) }\n\n \/**<|endoftext|>"} {"prompt":"override fun KotlinTypeMarker.isUnit(): Boolean {\n require(this is UnwrappedType, this::errorMessage)\n return KotlinBuiltIns.isUnit(this)\n }\n\n override fun KotlinTypeMarker.isBuiltinFunctionTypeOrSubtype(): Boolean {\n require(this is UnwrappedType, this::errorMessage)\n return isBuiltinFunctionalTypeOrSubtype","completion":"}\n\n override fun createFlexibleType(lowerBound: SimpleTypeMarker, upperBound: SimpleTypeMarker): KotlinTypeMarker {\n require(lowerBound is SimpleType, this::errorMessage)\n require(upperBound is SimpleType, this::errorMessage)\n return KotlinTypeFactory.flexibleType(lowerBound, upperBound)\n }<|endoftext|>"} {"prompt":"\/\/ test.kt:5 foo: $completion:kotlin.coroutines.Continuation=A$foo1$1","completion":"\/\/ test.kt:7 foo1: $completion:kotlin.coroutines.Continuation=Generated_Box_MainKt$main$1, $continuation:kotlin.coroutines.Continuation=A$foo1$1, $result:java.lang.Object=null, l:long=42:long<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.types.FirTypeRef\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource\n\n@FirBuilderDsl\nopen class FirFieldBuilder : FirVariableBuilder, FirAnnotationContainerBuilder {","completion":"override var source: KtSourceElement? = null\n override var resolvePhase: FirResolvePhase = FirResolvePhase.RAW_FIR\n override lateinit var moduleData: FirModuleData\n override lateinit var origin: FirDeclarationOrigin\n override var attributes: FirDeclarationAttributes = FirDeclarationAttributes()<|endoftext|>"} {"prompt":"public inline fun kotlin.ULongArray.elementAtOrElse(index: kotlin.Int, defaultValue: (kotlin.Int) -> kotlin.ULong): kotlin.ULong\n\n@kotlin.SinceKotlin(version = \"1.3\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.UShortArray.elementAtOrElse(index: kotlin.Int, defaultValue: (kotlin.Int) -> kotlin.UShort): kotlin.UShort\n\npublic fun kotlin.collections.Iterable.elementAtOrElse(index: kotlin.Int, defaultValue: (kotlin.Int) -> T): T<|endoftext|>"} {"prompt":"diagnosticSeverityStats.putIfAbsent(caseNumber, mutableMapOf())\n diagnosticSeverityStats[caseNumber]!!.run { put(severity, getOrDefault(severity, 0) + 1) }\n }\n }\n }\n\n private fun collectDiagnostics(files: List) {\n files.forEach { file ->","completion":"file.actualDiagnostics.forEach {\n val diagnosticName = it.diagnostic.factory.name\n diagnosticStats.run { put(diagnosticName, getOrDefault(diagnosticName, 0) + 1) }\n diagnostics.add(it.diagnostic)\n }\n }\n collectDiagnosticStatistic()\n }<|endoftext|>"} {"prompt":"\"priority is inconsistent: ${a.renderForDebugging()} v.s. ${b.renderForDebugging()}\"\n }\n val nameDiff = a.lookupTag.name.compareTo(b.lookupTag.name)\n if (nameDiff != 0) {\n return nameDiff\n }\n val nullabilityDiff = compare(a.nullability, b.nullability)","completion":"if (nullabilityDiff != 0) {\n return nullabilityDiff\n }\n return compare(a.typeArguments, b.typeArguments)\n }\n is ConeFlexibleType -> {\n require(b is ConeFlexibleType) {\n \"priority is inconsistent: ${a.renderForDebugging()} v.s. ${b.renderForDebugging()}\"\n }<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ LANGUAGE:-ProhibitMissedMustBeInitializedWhenThereIsNoPrimaryConstructor\n\/\/ DIAGNOSTICS: -DEBUG_INFO_LEAKING_THIS\nclass Foo() {\n constructor(x: Int) : this()\n\n var x: String\n set(value) {}\n\n init {","completion":"x = \"\"\n }\n}<|endoftext|>"} {"prompt":"fun x() = z { z { z { z { z { z { z { z { } } } } } } } }\nfun x() = z { z { z { z { z { z { z { z { } } } } } } } }","completion":"class x() {}<|endoftext|>"} {"prompt":"assertEquals(aif, nullToNullB(aif), \"AIF? as? IB?\")\n assertEquals(aij, nullToNullB(aij), \"AIJ? as? IB?\")\n assertEquals(baia, nullToNullB(baia), \"BAIA? as? IB?\")","completion":"assertEquals(baiaif, nullToNullB(baiaif), \"BAIAIF? as? IB?\")\n assertEquals(baiaij, nullToNullB(baiaij), \"BAIAIJ? as? IB?\")\n assertEquals(null, nullToNullB(c), \"C? as? IB?\")<|endoftext|>"} {"prompt":"* A sequence that returns values from the underlying [sequence] while the [predicate] function returns\n * `true`, and stops returning values once the function returns `false` for the next element.\n *\/\ninternal class TakeWhileSequence\nconstructor(\n private val sequence: Sequence,\n private val predicate: (T) -> Boolean\n) : Sequence {","completion":"override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n var nextState: Int = -1 \/\/ -1 for unknown, 0 for done, 1 for continue\n var nextItem: T? = null\n\n private fun calcNext() {\n if (iterator.hasNext()) {\n val item = iterator.next()<|endoftext|>"} {"prompt":"val case71 = '\\u2300'\n case71\n case71 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 72\nfun case72(){\n val case72 = '\\u23ff'","completion":"case72\n case72 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 73\nfun case73(){\n val case73 = '\\u2400'\n case73<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE -EXTENSION_SHADOWED_BY_MEMBER","completion":"-EXTENSION_FUNCTION_SHADOWED_BY_MEMBER_PROPERTY_WITH_INVOKE<|endoftext|>"} {"prompt":"val methodsAbi: List\n)\n\n\/** Snapshot of a Java class or a Java class member (field or method). *\/\nclass JavaElementSnapshot(\n\n \/** The name of the Java element. It is part of the Java element's ABI. *\/\n val name: String,\n\n \/** The hash of the Java element's ABI. *\/\n val abiHash: Long\n)","completion":"\/**\n * [ClassSnapshot] of an inaccessible class.\n *\n * A class is inaccessible if it can't be referenced from other source files (and therefore any changes in an inaccessible class will not\n * require recompilation of other source files).\n *\/\ndata object InaccessibleClassSnapshot : ClassSnapshot()<|endoftext|>"} {"prompt":"var attributes: FirDeclarationAttributes = FirDeclarationAttributes()\n lateinit var name: Name\n lateinit var symbol: FirTypeParameterSymbol\n lateinit var containingDeclarationSymbol: FirBasedSymbol<*>\n lateinit var variance: Variance\n var isReified: Boolean by kotlin.properties.Delegates.notNull()","completion":"val bounds: MutableList = mutableListOf()\n override val annotations: MutableList = mutableListOf()\n\n override fun build(): FirTypeParameter {\n return FirTypeParameterImpl(\n source,\n resolvePhase,\n moduleData,\n origin,\n attributes,\n name,\n symbol,<|endoftext|>"} {"prompt":"target: BuildTarget,\n dataPaths: BuildDataPaths?\n ): List {\n val moduleBuildTarget = target as? ModuleBuildTarget ?: return listOf()\n val module = moduleBuildTarget.module\n\n val result = mutableListOf()","completion":"\/\/ Add source roots with type KotlinSourceRootType.\n \/\/\n \/\/ Note: `KotlinSourceRootType` cannot be supported directly, since `SourceRootDescriptors` are computed by\n \/\/ `ModuleBuildTarget.computeAllTargets`. `ModuleBuildTarget` is required for incremental compilation.<|endoftext|>"} {"prompt":"class RepeatableAnnotationChecker(\n private val languageVersionSettings: LanguageVersionSettings,\n private val jvmTarget: JvmTarget,\n private val platformAnnotationFeaturesSupport: JvmPlatformAnnotationFeaturesSupport,\n private val module: ModuleDescriptor,\n) : AdditionalAnnotationChecker {\n override fun checkEntries(\n entries: List,","completion":"actualTargets: List,\n trace: BindingTrace,\n annotated: KtAnnotated?,\n languageVersionSettings: LanguageVersionSettings\n ) {\n if (entries.isEmpty()) return\n\n val annotations = entries.mapNotNull { entry ->\n val descriptor = trace.get(BindingContext.ANNOTATION, entry)<|endoftext|>"} {"prompt":"return if (this in Short.MIN_VALUE.toFloat()..Short.MAX_VALUE.toFloat()) this.toInt().toShort() else null\n}\n\n\/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n *\/","completion":"public infix fun Int.until(to: Byte): IntRange {\n return this .. (to.toInt() - 1).toInt()\n}\n\n\/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n *\/<|endoftext|>"} {"prompt":"private fun FirRegularClassSymbol.toResolvedQualifierExpressionReceiver(source: KtSourceElement?): ExpressionReceiverValue {\n val resolvedQualifier = buildResolvedQualifier {\n packageFqName = classId.packageFqName\n relativeClassFqName = classId.relativeClassName\n this.symbol = this@toResolvedQualifierExpressionReceiver","completion":"this.source = source?.fakeElement(KtFakeSourceElementKind.ImplicitReceiver)\n }.apply {\n setTypeOfQualifier(bodyResolveComponents)\n }\n return ExpressionReceiverValue(resolvedQualifier)\n }\n\n \/\/ For static entries we may return here FirResolvedQualifier, wrapped in ExpressionReceiverValue<|endoftext|>"} {"prompt":"fun deserialize(annotation: ProtoConstructorCall): AbiQualifiedName {\n val idSignature = deserializeIdSignature(annotation.symbol)\n val annotationClassName = when {\n idSignature is CommonSignature -> idSignature\n idSignature is CompositeSignature && idSignature.container is FileSignature -> idSignature.inner as CommonSignature","completion":"else -> error(\"Unexpected annotation signature encountered: ${idSignature::class.java}, ${idSignature.render()}\")\n }.extractQualifiedName { rawRelativeName ->\n check(rawRelativeName.endsWith(INIT_SUFFIX)) {\n \"Annotation constructor name does not have '$INIT_SUFFIX' suffix: $rawRelativeName\"\n }<|endoftext|>"} {"prompt":"\/\/ FILE: test.kt\n@file:JvmName(\"MultifileClass\")\n@file:JvmMultifileClass\n@file:JavaAnn\n@file:JavaClassAnn","completion":"@file:JavaSourceAnn\n\n\/\/ FILE: JavaAnn.java\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n@Target(ElementType.TYPE)\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface JavaAnn {\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.USE_JAVAC_BASED_ON_JVM_TARGET\nimport org.jetbrains.kotlin.test.model.TestModule\nimport org.jetbrains.kotlin.test.services.*\nimport org.jetbrains.kotlin.test.services.jvm.compiledClassesManager","completion":"import org.jetbrains.kotlin.test.util.KtTestUtil\nimport java.io.File\n\nclass JavaCompilerFacade(private val testServices: TestServices) {\n fun compileJavaFiles(module: TestModule, configuration: CompilerConfiguration, classFileFactory: ClassFileFactory) {\n if (module.javaFiles.isEmpty()) return\n val javaClasspath =<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives\nimport org.jetbrains.kotlin.test.model.TestModule\nimport org.jetbrains.kotlin.test.parseAnalysisFlags\nimport org.jetbrains.kotlin.test.services.EnvironmentConfigurator\nimport org.jetbrains.kotlin.test.services.TestServices","completion":"class CommonEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) {\n override val directiveContainers: List\n get() = listOf(ConfigurationDirectives)\n\n override fun provideAdditionalAnalysisFlags(\n directives: RegisteredDirectives,\n languageVersion: LanguageVersion\n ): Map, Any?> {<|endoftext|>"} {"prompt":"o[\"modifierSymbol\"] = modifierSymbol\n o[\"modifierSymbolLock\"] = modifierSymbolLock\n o[\"view\"] = view\n o[\"detail\"] = detail\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n\/**","completion":"* Exposes the JavaScript [InputEvent](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/InputEvent) to Kotlin\n *\/\npublic external open class InputEvent(type: String, eventInitDict: InputEventInit = definedExternally) : UIEvent {\n open val data: String\n open val isComposing: Boolean\n\n companion object {\n val NONE: Short<|endoftext|>"} {"prompt":"outer@ while (true) {\n inner@ while (x === null) {\n break@outer\n }\n }\n x","completion":"x.length\n}\n\n\/*\n * TESTCASE NUMBER: 3\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-22454\n *\/\nfun case_3(y: Nothing?) {<|endoftext|>"} {"prompt":"interfaceKDoc = COMMON_COMPILER_OPTIONS_KDOC,\n )\n }\n\n println(\"\\n### Attributes common for JVM and JS\\n\")\n generateMarkdown(commonCompilerOptions)\n\n return GeneratedOptions(commonCompilerInterfaceFqName, deprecatedCommonCompilerInterfaceFqName, commonCompilerOptions)\n}","completion":"private fun generateKotlinCommonOptionsImpl(\n srcDir: File,\n commonOptionsInterfaceFqName: FqName,\n commonToolImpl: FqName,\n commonToolCompilerHelperName: FqName,\n options: List>,\n withPrinterToFile: (targetFile: File, Printer.() -> Unit) -> Unit\n): GeneratedImplOptions {<|endoftext|>"} {"prompt":"is FirPropertySymbol -> filterOutOverriddenProperties(directOverriddenMembersWithBaseScope as List>)\n else -> directOverriddenMembersWithBaseScope\n }.map { it.member }\n\n val delegatedTo = delegatedWrapperData.wrapped.unwrapFakeOverrides().symbol","completion":"if (symbol.multipleDelegatesWithTheSameSignature == true) {\n if (directOverriddenMembersWithBaseScope.isNotEmpty() &&\n \/\/ We should report here if either 2+ members or single member with non-enhancement origin\n directOverriddenMembersWithBaseScope.singleOrNull()?.member?.origin != FirDeclarationOrigin.Enhancement\n ) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.analysis.checkers.getAllowedAnnotationTargets\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors\nimport org.jetbrains.kotlin.fir.declarations.toAnnotationClassId\nimport org.jetbrains.kotlin.fir.types.FirResolvedTypeRef","completion":"import org.jetbrains.kotlin.fir.types.FirTypeRef\nimport org.jetbrains.kotlin.fir.types.isSomeFunctionType\nimport org.jetbrains.kotlin.name.StandardClassIds\n\nobject FirTypeAnnotationChecker : FirTypeRefChecker(MppCheckerKind.Common) {<|endoftext|>"} {"prompt":"\/\/ CHECK_LABELS_COUNT: function=test name=loop_0 count=1 IGNORED_BACKENDS=JS\n\nfun test() {\n var i = 0\n var j = 0\n\n loop@ for (m in 1..10) {\n if (m == 4) break@loop\n j = m\n }\n\n loop@ for (k in 1..10) {","completion":"if (k == 4) break@loop\n i = k\n }\n\n assertEquals(3, j)\n assertEquals(3, i)\n}\n\nfun box(): String {\n test()\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.project.structure.KtDanglingFileModule\nimport org.jetbrains.kotlin.analysis.project.structure.KtModule\nimport org.jetbrains.kotlin.analysis.project.structure.KtSourceModule\nimport org.jetbrains.kotlin.analysis.providers.createPackagePartProvider","completion":"import org.jetbrains.kotlin.fir.BuiltinTypes\nimport org.jetbrains.kotlin.fir.SessionConfiguration\nimport org.jetbrains.kotlin.fir.deserialization.SingleModuleDataProvider\nimport org.jetbrains.kotlin.fir.java.deserialization.OptionalAnnotationClassesProvider<|endoftext|>"} {"prompt":"expectedConeType.isByte -> this.toByte()\n expectedConeType.isShort -> this.toShort()\n expectedConeType.isLong -> this.toLong()\n else -> this\n }\n } else this\n return value.createConstantIfAny(session) ?: buildErrorExpression {","completion":"diagnostic = ConeSimpleDiagnostic(\"Unknown value in JavaLiteralAnnotationArgument: $this\", DiagnosticKind.Java)\n }\n}\n\ninternal fun Any?.createConstantIfAny(session: FirSession, unsigned: Boolean = false): FirExpression? {\n return when (this) {\n is Byte -> buildLiteralExpression(<|endoftext|>"} {"prompt":"}\n\n fun exitResolvedQualifierNode(resolvedQualifier: FirResolvedQualifier) {\n graphBuilder.exitResolvedQualifierNode(resolvedQualifier).mergeIncomingFlow()\n }\n\n fun enterCallArguments(call: FirStatement, arguments: List) {\n val lambdas = arguments.mapNotNull { it.unwrapAnonymousFunctionExpression() }","completion":"graphBuilder.enterCall(lambdas.mapTo(mutableSetOf()) { it.symbol })\n context.variableAssignmentAnalyzer.enterFunctionCall(lambdas)\n graphBuilder.enterCallArguments(call, lambdas)?.mergeIncomingFlow()\n }\n\n fun exitCallArguments() {\n val (splitNode, exitNode) = graphBuilder.exitCallArguments()<|endoftext|>"} {"prompt":"@CheckersComponentInternal internal val allReturnExpressionCheckers: Set by lazy { returnExpressionCheckers + basicExpressionCheckers }\n @CheckersComponentInternal internal val allBlockCheckers: Set by lazy { blockCheckers + basicExpressionCheckers }","completion":"@CheckersComponentInternal internal val allAnnotationCheckers: Set by lazy { annotationCheckers + basicExpressionCheckers }\n @CheckersComponentInternal internal val allAnnotationCallCheckers: Set by lazy { annotationCallCheckers + annotationCheckers + basicExpressionCheckers + callCheckers }<|endoftext|>"} {"prompt":"@kotlin.jvm.JvmName(name = \"sumOfULong\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.ULongArray.sumOf(selector: (kotlin.ULong) -> kotlin.ULong): kotlin.ULong\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(name = \"sumOfDouble\")<|endoftext|>"} {"prompt":"when (node.tokenType) {\n KtNodeTypes.SECONDARY_CONSTRUCTOR -> {\n val valueParameterList = tree.valueParameterList(node)\n ?: return markElement(node, startOffset, endOffset, tree)\n return markRange(\n tree.constructorKeyword(node)!!,\n tree.lastChild(valueParameterList) ?: valueParameterList,","completion":"startOffset, endOffset, tree, node\n )\n }\n KtNodeTypes.CONSTRUCTOR_DELEGATION_CALL -> {\n val delegationReference = tree.findChildByType(node, KtNodeTypes.CONSTRUCTOR_DELEGATION_REFERENCE)\n if (delegationReference != null && tree.firstChild(delegationReference) == null) {<|endoftext|>"} {"prompt":"fun test_error_1(base: Base) {\n val x = when (base) {\n is A -> 1\n }\n}\n\nfun test_error_2(base: Base) {\n val x = when (base) {\n is A -> 1","completion":"is B.C -> 2\n }\n}\n\nfun test_error_3(sameFile: SameFile) {\n val x = when (sameFile) {\n is SameFile.A -> 1\n }\n}\n\nfun test_error_4(sameFile: SameFile) {<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ LAMBDAS: CLASS\n\/\/ WITH_REFLECT\n\npackage test\n\nclass C {\n val l: Any = {}\n}\n\nfun box(): String {\n val javaClass = C().l.javaClass\n val enclosingConstructor = javaClass.getEnclosingConstructor()","completion":"if (enclosingConstructor?.getDeclaringClass()?.getName() != \"test.C\") return \"ctor: $enclosingConstructor\"\n\n val enclosingClass = javaClass.getEnclosingClass()\n if (enclosingClass?.getName() != \"test.C\") return \"enclosing class: $enclosingClass\"<|endoftext|>"} {"prompt":"package org.jetbrains.kotlinx.jspo\n\nimport org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5\nimport org.jetbrains.kotlinx.jspo.runners.AbstractFirJsPlainObjectsIrJsBoxTest","completion":"import org.jetbrains.kotlinx.jspo.runners.AbstractFirJsPlainObjectsPluginDiagnosticTest\n\nfun main(args: Array) {\n generateTestGroupSuiteWithJUnit5(args) {\n testGroup(\n \"plugins\/js-plain-objects\/compiler-plugin\/tests-gen\",<|endoftext|>"} {"prompt":"val fqName = if (packageName.isNotBlank()) FqName(packageName) else FqName.ROOT\n javac.hasKotlinPackage(fqName)?.let { return it }\n\n return javac.findPackage(fqName)?.fqName\n }","completion":"private fun JavaClass.findVisibleInnerOrNestedClass(name: Name) = findInnerClass(name)?.let { innerOrNestedClass ->\n when (innerOrNestedClass.visibility) {\n DescriptorVisibilities.PRIVATE -> null\n JavaDescriptorVisibilities.PACKAGE_VISIBILITY -> {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.commonizer.TargetDependent\nimport org.jetbrains.kotlin.commonizer.mergedtree.*\nimport org.jetbrains.kotlin.commonizer.toTargetDependent\nimport org.jetbrains.kotlin.commonizer.tree.CirTreeModule\nimport org.jetbrains.kotlin.commonizer.tree.CirTreeRoot","completion":"import org.jetbrains.kotlin.commonizer.utils.KtInlineSourceCommonizerTestCase\nimport org.jetbrains.kotlin.commonizer.utils.MockModulesProvider\nimport org.jetbrains.kotlin.storage.LockBasedStorageManager\n\nabstract class AbstractMergeCirTreeTest : KtInlineSourceCommonizerTestCase() {<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\nfun foo(a: (String) -> Unit) {\n \"\".a()\n}\n\n\n\ninterface A : (String) -> Unit {}\ntypealias AliasedEFT = ExtensionFunctionType\n\nfun foo(a: @AliasedEFT A) {","completion":"\/\/ @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.\n \/\/ Only kotlin.Function{n} type annotated with @Extension should\n \"\".a()\n}<|endoftext|>"} {"prompt":"fun interface F4 : I4 {}\n\n\/\/ MODULE: jvm()()(common)\n\/\/ FILE: main.kt\nactual interface I1 {\n val a: Int\n fun foo()","completion":"}\n\nactual interface I2 {\n fun foo()\n val a: Int\n}\n\nactual interface I3 {\n fun foo(a: Int = 0)\n}\n\nactual interface I4 {\n fun foo()\n}<|endoftext|>"} {"prompt":"val allForkPointsData = constraintsFromAllForkPoints.toList()\n constraintsFromAllForkPoints.clear()\n\n var result: ConstraintSystemError? = null\n runTransaction {\n for ((position, forkPointData) in allForkPointsData) {\n if (!applyConstraintsFromFirstSuccessfulBranchOfTheFork(forkPointData, position)) {","completion":"result = NoSuccessfulFork(position)\n break\n }\n }\n\n false\n }\n\n constraintsFromAllForkPoints.addAll(allForkPointsData)\n\n return result\n }\n\n \/**\n * @return true if there is a successful constraints set for the fork\n *\/\n private fun applyConstraintsFromFirstSuccessfulBranchOfTheFork(<|endoftext|>"} {"prompt":"false -> DeprecationInfo(inheritedDeprecations, hasInheritedDeprecations = true)\n }\n false -> DeprecationInfo.EMPTY\n }\n }\n else -> DeprecationInfo.EMPTY\n }\n }\n\n private data class DeprecationInfo(\n val deprecations: List,","completion":"val hasInheritedDeprecations: Boolean,\n val hiddenInheritedDeprecations: List = emptyList()\n ) {\n companion object {\n val EMPTY = DeprecationInfo(emptyList(), hasInheritedDeprecations = false, emptyList())\n }\n }<|endoftext|>"} {"prompt":"\/* Ensure that the problematic androidTest\/kotlin source dir is 'in use' *\/\n val androidTestKotlinSourceDir = project.file(\"src\/androidTest\/kotlin\")\n androidTestKotlinSourceDir.mkdirs()\n project.evaluate()\n\n \/* Invoke checkers on all source sets *\/\n project.checkCreatedSourceSets()","completion":"project.checkDiagnostics(\"kt53709AndroidTest_kotlinInUse\")\n }\n\n @Test\n fun `test - android style source dir usage checker`() {\n val project = buildMinimalAndroidMultiplatformProject()\n val androidStyleMain = project.file(\"src\/main\/kotlin\")\n val androidStyleUnitTest = project.file(\"src\/test\/kotlin\")<|endoftext|>"} {"prompt":"internal fun printFactory(generationPath: File, model: Model): GeneratedFile = printGeneratedType(\n generationPath,\n TREE_GENERATOR_README,\n irFactoryType.packageName,\n irFactoryType.simpleName,\n) {\n println(\"interface \", irFactoryType.simpleName, \" {\")\n withIndent {\n println(\"val stageController: \", stageControllerType.render())","completion":"val factoryMethods = model.elements\n .filter { it.implementations.isNotEmpty() && it.generateIrFactoryMethod }\n .sortedWith(compareBy({ it.packageName }, { it.name }))\n .map(::FactoryMethod)\n\n factoryMethods.forEach { printFactoryMethod(it) }\n }\n println(\"}\")\n}<|endoftext|>"} {"prompt":"val structPointerFromPosix = getStructPointerFromPosix()\n\n object MyStruct {\n val struct = getMyStructPointer()?.pointed ?: error(\"Missing my struct\")\n val posixProperty: stat = struct.posixProperty\n val longProperty: Long = struct.longProperty\n val doubleProperty: Double = struct.doubleProperty","completion":"val int32tProperty: Int = struct.int32tProperty\n val int64TProperty: Long = struct.int64tProperty\n val linuxOnlyProperty: Boolean = struct.linuxOnlyProperty\n }\n}<|endoftext|>"} {"prompt":"to({ a, b, c, d -> }, { a, b, c, d -> }),\n to({ a, b, c, d -> }, { a, b, c, d -> }),\n to({ a, b, c, d -> }, { a, b, c, d -> }),\n to({ a, b, c, d -> }, { a, b, c, d -> }),","completion":"to({ a, b, c, d -> }, { a, b, c, d -> }),\n to({ a, b, c, d -> }, { a, b, c, d -> }),\n )\n}<|endoftext|>"} {"prompt":"actualTargets: List,\n trace: BindingTrace,\n annotated: KtAnnotated?,\n languageVersionSettings: LanguageVersionSettings\n ) {\n if (entries.isEmpty()) return\n\n val annotations = entries.mapNotNull { entry ->\n val descriptor = trace.get(BindingContext.ANNOTATION, entry)","completion":"val useSiteTarget = entry.useSiteTarget?.getAnnotationUseSiteTarget()\n if (descriptor != null) {\n ResolvedAnnotation(entry, descriptor, useSiteTarget)\n } else null\n }\n\n checkRepeatedEntries(annotations, trace)<|endoftext|>"} {"prompt":"val x = A3() \/\/ TODO: support reporting errors on typealias constructor calls","completion":"val x2 = A() \/\/ TODO: support reporting errors on typealias constructor calls<|endoftext|>"} {"prompt":"fun containingFileIfAny(): IrFile? = parentStack.getOrNull(0) as? IrFile\n\n inline fun withContainingFirClass(containingFirClass: FirClass, f: () -> Unit) {\n containingFirClassStack += containingFirClass\n try {\n f()\n } finally {\n containingFirClassStack.removeAt(containingFirClassStack.size - 1)","completion":"}\n }\n\n fun parentFromStack(): IrDeclarationParent = parentStack.last()\n\n fun scope(): Scope = scopeStack.last()\n\n fun parentAccessorOfPropertyFromStack(propertySymbol: IrPropertySymbol): IrSimpleFunction {\n \/\/ It is safe to access an owner of property symbol here, because this function may be called\n \/\/ only from property accessor of corresponding property<|endoftext|>"} {"prompt":"\")!>x\n \"), DEBUG_INFO_SMARTCAST!>x.first\n}","completion":"\/\/ TESTCASE NUMBER: 12\nfun case_12(x: Any?) {\n when {\n x !is Pair<*, *>? -> return\n else -> {\n ?\")!>x<|endoftext|>"} {"prompt":"override fun acceptChildren(visitor: FirVisitor, data: D) {\n annotations.forEach { it.accept(visitor, data) }\n expression.accept(visitor, data)\n }\n\n override fun transformChildren(transformer: FirTransformer, data: D): FirSpreadArgumentExpressionImpl {","completion":"transformAnnotations(transformer, data)\n expression = expression.transform(transformer, data)\n return this\n }\n\n override fun transformAnnotations(transformer: FirTransformer, data: D): FirSpreadArgumentExpressionImpl {\n annotations.transformInplace(transformer, data)\n return this\n }<|endoftext|>"} {"prompt":"val result = ArrayList(size)\n for (index in 0 until size) {\n result.add(transform(this[index], this[index + 1]))\n }\n return result\n}\n\n\/**\n * Creates an [Iterable] instance that wraps the original char sequence returning its characters when being iterated.\n *\/\npublic fun CharSequence.asIterable(): Iterable {","completion":"if (this is String && isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n\/**\n * Creates a [Sequence] instance that wraps the original char sequence returning its characters when being iterated.\n *\/\npublic fun CharSequence.asSequence(): Sequence {\n if (this is String && isEmpty()) return emptySequence()\n return Sequence { this.iterator() }<|endoftext|>"} {"prompt":"override var onloadedmetadata: ((Event) -> Unit)?\n override var onloadend: ((Event) -> Unit)?\n override var onloadstart: ((ProgressEvent) -> Unit)?\n override var onmousedown: ((MouseEvent) -> Unit)?\n override var onmouseenter: ((MouseEvent) -> Unit)?\n override var onmouseleave: ((MouseEvent) -> Unit)?","completion":"override var onmousemove: ((MouseEvent) -> Unit)?\n override var onmouseout: ((MouseEvent) -> Unit)?\n override var onmouseover: ((MouseEvent) -> Unit)?\n override var onmouseup: ((MouseEvent) -> Unit)?\n override var onwheel: ((WheelEvent) -> Unit)?\n override var onpause: ((Event) -> Unit)?<|endoftext|>"} {"prompt":"override fun getStyle() = Tokens.Comment.CommentStyle.JAVADOC\n override fun getText() = body\n override fun isDeprecated() = false\n}\n\nprivate class KaptDocCommentTable(map: Map = emptyMap()) : DocCommentTable {\n private val table = map.toMutableMap()","completion":"val map: Map\n get() = table\n\n override fun hasComment(tree: JCTree) = tree in table\n override fun getComment(tree: JCTree) = table[tree]\n override fun getCommentText(tree: JCTree) = getComment(tree)?.text<|endoftext|>"} {"prompt":"uu = 24, vv = 23, ww = 22, xx = 21, yy = 20, zz = 19, aaa = 18, bbb = 17, ccc = 16, ddd = 15, eee = 14, fff = 13,","completion":"ggg = 12, hhh = 11, iii = 10, jjj = 9, kkk = 8, lll = 7, mmm = 6, nnn = 5, ooo = 4, ppp = 3, qqq = 2, rrr = 1).toString()<|endoftext|>"} {"prompt":"private fun findClassifierQualifierToShorten(\n wholeQualifierClassId: ClassId,\n wholeQualifierElement: KtElement,\n ): ElementToShorten? {\n val positionScopes = shorteningContext.findScopesAtPosition(\n wholeQualifierElement,\n getNamesToImport(),\n towerContextProvider,\n withImplicitReceivers = false,","completion":") ?: return null\n\n val allClassIds = wholeQualifierClassId.outerClassesWithSelf\n val allQualifiedElements = wholeQualifierElement.qualifiedElementsWithSelf\n\n for ((classId, element) in allClassIds.zip(allQualifiedElements)) {\n if (!element.inSelection) continue<|endoftext|>"} {"prompt":"CallableId.PACKAGE_FQ_NAME_FOR_LOCAL\n } else {\n context.packageFqName\n }\n\n return if (context.className == FqName.ROOT) {\n CallableId(packageName, Name.special(\"\"))\n } else {","completion":"CallableId(packageName, context.className, context.className.shortName())\n }\n }\n\n\n \/**** Function utils ****\/\n fun MutableList.removeLast(): T {\n return removeAt(size - 1)\n }\n\n fun MutableList.pop(): T? {\n val result = lastOrNull()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.descriptors.Modality\nimport org.jetbrains.kotlin.fileClasses.JvmFileClassInfo\nimport org.jetbrains.kotlin.fileClasses.JvmFileClassUtil\nimport org.jetbrains.kotlin.fileClasses.JvmMultifileClassPartInfo","completion":"import org.jetbrains.kotlin.fileClasses.JvmSimpleFileClassInfo\nimport org.jetbrains.kotlin.ir.PsiIrFileEntry\nimport org.jetbrains.kotlin.ir.UNDEFINED_OFFSET\nimport org.jetbrains.kotlin.ir.declarations.*\nimport org.jetbrains.kotlin.ir.expressions.IrConst<|endoftext|>"} {"prompt":"when (this) {\n is IrFunctionAccessExpression -> {\n if (function.isExternal) {\n \/\/ External functions may have the default arguments declared in native implementations,\n \/\/ which are not available from Kotlin.\n return null\n } else if (this is IrEnumConstructorCall && (function.parent as? IrClass)?.symbol == builtIns.enumClass) {","completion":"\/\/ This is a special case. IrEnumConstructorCall don't contain arguments.\n return null\n }\n }\n is IrFunctionReference -> {\n \/\/ Function references don't contain arguments.\n return null\n }\n }\n\n \/\/ Default values are not kept in value parameters of fake override\/delegated\/override functions.\n \/\/ So we need to look up for default value across all overridden functions.<|endoftext|>"} {"prompt":"AnnotatedCallableKind.PROPERTY, AnnotatedCallableKind.PROPERTY_GETTER, AnnotatedCallableKind.PROPERTY_SETTER -> {\n protocol.propertyExtensionReceiverAnnotation?.let { proto.getExtension(it) }\n }\n else -> error(\"Unsupported callable kind with property proto for receiver annotations: $kind\")\n }","completion":"else -> error(\"Unknown message: $proto\")\n }.orEmpty()\n return annotations.map { annotationProto ->\n loadAnnotation(annotationProto, container.nameResolver)\n }\n }\n\n override fun loadTypeAnnotations(proto: ProtoBuf.Type, nameResolver: NameResolver): List {<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\nimport kotlin.test.*\n\ninterface I {\n inline class IC(val x: Int)\n}\n\ninterface I2 {\n inline class IC(val x: Int)\n}\n\nfun box(): String {\n assertEquals(42, I.IC(42).x)\n assertEquals(117, I2.IC(117).x)\n\n return \"OK\"","completion":"}<|endoftext|>"} {"prompt":"val CXIndexOpt_IndexFunctionLocalSymbols: CXIndexOptFlags get() = 2\n\nval CXIndexOpt_IndexImplicitTemplateInstantiations: CXIndexOptFlags get() = 4\n\nval CXIndexOpt_SuppressWarnings: CXIndexOptFlags get() = 8\n\nval CXIndexOpt_SkipParsedBodiesInSession: CXIndexOptFlags get() = 16","completion":"typealias CXIndexOptFlagsVar = IntVarOf\n\ntypealias CXIndexOptFlags = Int\nprivate external fun kniBridge0(p0: NativePtr): NativePtr\nprivate external fun kniBridge1(p0: NativePtr): Unit\nprivate external fun kniBridge2(p0: NativePtr): Unit\nprivate external fun kniBridge3(): Long<|endoftext|>"} {"prompt":"\/\/ Auto-generated by GenerateSteppedRangesCodegenTestData. Do not edit!\n\/\/ WITH_STDLIB\nimport kotlin.test.*\n\nfun two() = 2\n\nfun box(): String {\n val uintList = mutableListOf()\n val uintProgression = 1u..8u\n for (i in uintProgression step two()) {\n uintList += i\n }","completion":"assertEquals(listOf(1u, 3u, 5u, 7u), uintList)\n\n val ulongList = mutableListOf()\n val ulongProgression = 1uL..8uL\n for (i in ulongProgression step two().toLong()) {\n ulongList += i\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.api.types\n\npublic enum class KtTypeMappingMode {\n \/**\n * kotlin.Int is mapped to I\n *\/\n DEFAULT,\n\n \/**\n * kotlin.Int is mapped to I\n * Type aliases are mapped to their expanded form\n *\/\n DEFAULT_UAST,\n\n \/**","completion":"* kotlin.Int is mapped to Ljava\/lang\/Integer;\n *\/\n GENERIC_ARGUMENT,\n\n \/**\n * kotlin.Int is mapped to Ljava\/lang\/Integer;\n * No projections allowed in immediate arguments\n *\/\n SUPER_TYPE,\n\n \/**\n * Similar to [SUPER_TYPE], except for that Kotlin collections remain as-is.<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\n\/\/ WITH_REFLECT\n\/\/ FULL_JDK\n\nimport java.lang.reflect.GenericArrayType\nimport java.lang.reflect.ParameterizedType\nimport kotlin.reflect.KClass\nimport kotlin.reflect.jvm.javaType\nimport kotlin.test.assertEquals\nimport kotlin.test.assertTrue\n\nannotation class Z\nenum class E","completion":"annotation class Anno(\n val b: Byte,\n val s: String,\n val ss: Array,\n val z: Z,\n val zs: Array,\n val e: E,\n val es: Array,\n val k: KClass<*>,\n val ka: Array>\n)<|endoftext|>"} {"prompt":"\/\/ Setup a task that will abort the build if errors will be reported. This task should be the first in the taskgraph\n project.locateOrRegisterCheckKotlinGradlePluginErrorsTask()\n\n \/\/ Schedule diagnostics rendering\n launch {\n configurationResult.await()\n renderReportedDiagnostics(\n collectorProvider.get().getDiagnosticsForProject(project),\n logger,","completion":"diagnosticRenderingOptions\n )\n }\n\n \/\/ Schedule switching of Collector to transparent mode, so that any diagnostics reported\n \/\/ after projects are evaluated will be transparently rendered right away instead of being\n \/\/ silently swallowed\n gradle.projectsEvaluated {\n collectorProvider.get().switchToTransparentMode()\n }\n}<|endoftext|>"} {"prompt":"}\n\n init {\n X().A_X()\n X().T_X()\n\n Y().A_C_Y()\n Y().T_Y()\n }\n}\n\nclass B: A() {\n init {\n X().A_X()","completion":"X().T_X()\n\n Y().A_C_Y()\n Y().T_Y()<|endoftext|>"} {"prompt":"ScriptDiagnostic.unspecifiedError, message, mapLegacyDiagnosticSeverity(severity), null, mapLegacyScriptPosition(position)\n )\n}\n\nfun Iterable.mapToLegacyReports(): List = map { (_, message, severity, _, location, exception) ->\n val reportMessage = if (exception == null) message else \"$message ($exception)\"","completion":"ScriptReport(reportMessage, mapToLegacyScriptReportSeverity(severity), mapToLegacyScriptReportPosition(location))\n}<|endoftext|>"} {"prompt":"if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n\/**","completion":"* Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n *\/\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType<|endoftext|>"} {"prompt":"REMOVE_DEBUG_INFO_OPTION,\n REMOVE_DATA_CLASS_COPY_IF_CONSTRUCTOR_IS_PRIVATE_OPTION,\n PRESERVE_DECLARATION_ORDER_OPTION,\n REMOVE_PRIVATE_CLASSES_OPTION,\n TREAT_INTERNAL_AS_PRIVATE_OPTION,\n )","completion":"override fun processOption(option: AbstractCliOption, value: String, configuration: CompilerConfiguration) {\n when (option) {\n OUTPUT_PATH_OPTION -> configuration.put(JvmAbiConfigurationKeys.OUTPUT_PATH, value)\n REMOVE_DEBUG_INFO_OPTION -> configuration.put(JvmAbiConfigurationKeys.REMOVE_DEBUG_INFO, value == \"true\")<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\n\/\/ FILE: test.kt\nfun box(): String {\n val p = Triple(\"X\",\"O\",\"K\")\n\n val ( _ , o, k ) = p\n\n return o + k\n}\n\n\/\/ EXPECTATIONS JVM_IR\n\/\/ test.kt:5 box:\n\/\/ test.kt:7 box: p:kotlin.Triple=kotlin.Triple","completion":"\/\/ test.kt:9 box: p:kotlin.Triple=kotlin.Triple, o:java.lang.String=\"O\":java.lang.String, k:java.lang.String=\"K\":java.lang.String\n\n\/\/ EXPECTATIONS JS_IR\n\/\/ test.kt:5 box:\n\/\/ test.kt:7 box: p=kotlin.Triple<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.plugin.createConstructor\nimport org.jetbrains.kotlin.fir.plugin.createMemberFunction\nimport org.jetbrains.kotlin.fir.plugin.createNestedClass\nimport org.jetbrains.kotlin.fir.plugin.fqn","completion":"import org.jetbrains.kotlin.fir.types.constructStarProjectedType\nimport org.jetbrains.kotlin.fir.symbols.impl.*\nimport org.jetbrains.kotlin.name.CallableId\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.name.SpecialNames\n\n\/*<|endoftext|>"} {"prompt":"\/\/ Load declarations referenced during `context` initialization\n loadedIr.loadUnboundSymbols()\n\n val dirtyFiles = dirtyFileExports.entries.associateTo(newHashMapWithExpectedSize(dirtyFileExports.size)) {\n it.key to HashSet(it.value.keys)\n }\n\n stopwatch.startNext(\"Processing IR - updating intrinsics and builtins dependencies\")","completion":"updater.updateStdlibIntrinsicDependencies(loadedIr, mainModuleFragment, dirtyFiles)\n\n stopwatch.startNext(\"Incremental cache - building artifacts\")\n val incrementalCachesArtifacts = updater.buildAndCommitCacheArtifacts(loadedIr)\n\n stopwatch.stop()<|endoftext|>"} {"prompt":"var value_2: Int\n\n try {\n funWithAtLeastOnceCallsInPlace { value_2 = 10 }\n } catch (e: Exception) {\n funWithExactlyOnceCallsInPlace { value_2 = 1 }\n }\n\n value_2++\n}\n\n\/\/ TESTCASE NUMBER: 6\nfun case_6() {\n var value_2: Int","completion":"try {\n funWithAtLeastOnceCallsInPlace { value_2 = 10 }\n } catch (e: Exception) {\n throw Exception()\n } finally {\n funWithAtLeastOnceCallsInPlace { value_2 = 10 }\n }\n\n value_2++\n}\n\n\/\/ TESTCASE NUMBER: 7\nfun case_7() {\n var value_1: Int<|endoftext|>"} {"prompt":"open class l : FromBeta()\n open class m : FromGamma()\n\n \/\/ INVISIBLE: We don't see classifiers from companions of \"cousin\" superclasses","completion":"open class o : FromCompanionAlpha()\n open class p : FromCompanionBeta()\n open class q : FromCompanionGamma()\n\n \/\/ DEPRECATED: Classifiers from supertypes of our own companion<|endoftext|>"} {"prompt":"else -> error(\"Unknown Apple family: ${target.family}\")\n }\n contents.append(\"\"\"\n | DTXcode<\/key>\n | 1500<\/string>\n | DTXcodeBuild<\/key>\n | 15A240d<\/string>\n | DTSDKBuild<\/key>","completion":"| $sdkBuild<\/string>\n | DTPlatformBuild<\/key>\n | $sdkBuild<\/string>\n\n \"\"\".trimMargin())\n }\n\n contents.append(\"\"\"\n <\/dict>\n <\/plist>\n \"\"\".trimIndent())\n\n return contents.toString()\n }<|endoftext|>"} {"prompt":"\/\/ If referencedSymbol is null, it means the reference goes to a package.\n val parent = expression.parent as? KtDotQualifiedExpression ?: return emptyList()\n val fqNameSegments =\n when (expression) {\n parent.selectorExpression -> parent.fqNameSegments() ?: return emptyList()","completion":"parent.receiverExpression -> listOf(expression.getReferencedName())\n else -> return emptyList()\n }\n return listOfNotNull(symbolBuilder.createPackageSymbolIfOneExists(FqName.fromSegments(fqNameSegments)))\n }\n val referencedClass = referencedSymbol.fir<|endoftext|>"} {"prompt":"is ClassDescriptor -> computeClassInternalName(declaration) ?: computeSupertypeInternalName(declaration)\n else -> error(\"Unexpected declaration type: $declaration\")\n }\n }\n\n private fun computeClassInternalName(descriptor: ClassDescriptor): String? {\n val selfName = descriptor.name.takeIf { !it.isSpecial } ?: return null","completion":"return when (val parent = descriptor.containingDeclaration) {\n is PackageFragmentDescriptor -> {\n val packageInternalName = parent.fqName.asString().replace('.', '\/')\n \"$packageInternalName\/$selfName\"\n }\n is ClassDescriptor -> {\n val parentInternalName = computeClassInternalName(parent)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.platform.isJs\nimport org.jetbrains.kotlin.platform.isWasm\nimport org.jetbrains.kotlin.platform.jvm.isJvm\n\nprivate class CaptureCollector {","completion":"val captures = mutableSetOf()\n val capturedDeclarations = mutableSetOf()\n val hasCaptures: Boolean get() = captures.isNotEmpty() || capturedDeclarations.isNotEmpty()\n\n fun recordCapture(local: IrValueDeclaration) {\n captures.add(local)\n }<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\nimport kotlin.reflect.KProperty1\n\nclass Sample(val str: String)\n\nclass Inv\n\nclass Form {\n operator fun get(field: KProperty1<*, F>): Inv = TODO()\n}","completion":"fun foo(i: Inv) {}\n\nfun test(f: Form) {\n foo(f[Sample::str])\n}<|endoftext|>"} {"prompt":"BLUE(0x0000FF)\n}\n\nenum class Color1(var rgb: Int) {\n RED(0xFF0000),\n GREEN(0x00FF00),\n BLUE(0x0000FF);\n\n init { this.rgb += 1 }\n}\n\n@MyThreadLocal\nvar a = 3\nenum class Color2() {\n RED(),\n GREEN(),\n BLUE();","completion":"var rgb: Int = 2\n set(value: Int) {\n a = value\n }\n}\n\nenum class Color3() {\n RED(),\n GREEN(),\n BLUE();\n\n var field1: Int by Delegate()\n}\n\nenum class Color4 {\n RED {\n var a = 2\n override fun foo() { a = 42 }\n },\n GREEN,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.checkers.OptInNames.SUBCLASS_OPT_IN_REQUIRED_FQ_NAME\nimport org.jetbrains.kotlin.resolve.checkers.OptInNames.OPT_IN_ANNOTATION_CLASS","completion":"import org.jetbrains.kotlin.resolve.checkers.OptInNames.WAS_EXPERIMENTAL_FQ_NAME\nimport org.jetbrains.kotlin.resolve.constants.ArrayValue\nimport org.jetbrains.kotlin.resolve.constants.EnumValue\nimport org.jetbrains.kotlin.resolve.constants.KClassValue<|endoftext|>"} {"prompt":"*\/\n val startOffset: Int\n\n \/**\n * The end offset of the syntax node from which this IR node was generated,\n * in number of characters from the start of the source file. If there is no source information for this IR node,\n * the [UNDEFINED_OFFSET] constant is used. In order to get the line number and the column number from this offset,","completion":"* [IrFileEntry.getLineNumber] and [IrFileEntry.getColumnNumber] can be used.\n *\n * @see IrFileEntry.getSourceRangeInfo\n *\/\n val endOffset: Int\n\n \/**\n * Runs the provided [visitor] on the IR subtree with the root at this node.\n *\n * @param visitor The visitor to accept.<|endoftext|>"} {"prompt":"\"LOCAL_VARIABLE\" to EnumSet.of(KotlinTarget.LOCAL_VARIABLE),\n \"PARAMETER\" to EnumSet.of(KotlinTarget.VALUE_PARAMETER),\n \"CONSTRUCTOR\" to EnumSet.of(KotlinTarget.CONSTRUCTOR),","completion":"\"METHOD\" to EnumSet.of(KotlinTarget.FUNCTION, KotlinTarget.PROPERTY_GETTER, KotlinTarget.PROPERTY_SETTER),\n \"TYPE_USE\" to EnumSet.of(KotlinTarget.TYPE)\n )<|endoftext|>"} {"prompt":"if (element14 in charSequence.indices != range0.contains(element14)) throw AssertionError()\n if (element14 !in charSequence.indices != !range0.contains(element14)) throw AssertionError()\n if (!(element14 in charSequence.indices) != !range0.contains(element14)) throw AssertionError()","completion":"if (!(element14 !in charSequence.indices) != range0.contains(element14)) throw AssertionError()\n}\n\nfun testR0xE15() {\n \/\/ with possible local optimizations\n if (2L in charSequence.indices != range0.contains(2L)) throw AssertionError()<|endoftext|>"} {"prompt":"binOp(intrinsics.jsBitShiftRU, JsBinaryOperator.SHRU)\n binOp(intrinsics.jsBitShiftL, JsBinaryOperator.SHL)\n\n binOp(intrinsics.jsInstanceOf, JsBinaryOperator.INSTANCEOF)","completion":"binOp(intrinsics.jsIn, JsBinaryOperator.INOP)\n\n prefixOp(intrinsics.jsTypeOf, JsUnaryOperator.TYPEOF)\n\n add(intrinsics.jsIsEs6) { _, _ -> JsBooleanLiteral(backendContext.es6mode) }<|endoftext|>"} {"prompt":"assertOutputContains(USING_JVM_INCREMENTAL_COMPILATION_MESSAGE)\n }\n\n build(\n \"assemble\",\n buildOptions = defaultBuildOptions.copy(logLevel = LogLevel.LIFECYCLE)\n ) {\n assertOutputDoesNotContain(USING_JVM_INCREMENTAL_COMPILATION_MESSAGE)","completion":"}\n }\n }\n\n @DisplayName(\"Conversion between Kotlin and Java\")\n @GradleTest\n fun testConvertJavaToKotlin(gradleVersion: GradleVersion) {\n project(\"convertBetweenJavaAndKotlin\", gradleVersion) {\n val barKt = javaSourcesDir().resolve(\"foo\/Bar.kt\")<|endoftext|>"} {"prompt":"@Retention(value = AnnotationRetention.BINARY)\ninternal annotation class InternalForKotlinNative\n\n\/**\n * Marks a class that has a freeze hook.\n *\/\n@Target(AnnotationTarget.CLASS)\n@FreezingIsDeprecated\ninternal annotation class HasFreezeHook\n\n\/**\n * Indicates that calls of this function will be replaced with calls to the","completion":"* [callee] implemented in the C++ part of the runtime.\n *\n * This annotation is unsafe and should be used with care: [callee] is\n * responsible for correct interaction with the garbage collector, like\n * placing safe points and switching thread state when using blocking APIs.\n *\/\n@Target(AnnotationTarget.FUNCTION)\n@Retention(value = AnnotationRetention.BINARY)<|endoftext|>"} {"prompt":"\"${env[\"HOSTNAME\"]}${env[\"COMPUTERNAME\"]}\"\n}\n\nfun anonymizeComponentVersion(version: String): String {\n val parts = version.toLowerCase().replace('-', '.')\n .split(\".\")\n .plus(listOf(\"0\", \"0\", \"0\")) \/\/ pad with zeros\n .take(4)","completion":"val mainVersion = parts.take(3).map { s -> s.toIntOrNull()?.toString() ?: \"0\" }\n\n val suffix = when {\n parts[3].matches(\"(rc|m|beta)\\\\d{0,1}\".toRegex()) -> \"-${parts[3]}\"<|endoftext|>"} {"prompt":"firFile.accept(object : FirVisitorVoid() {\n override fun visitElement(element: FirElement) {\n val psi = element.psi as? KtElement\n if (psi != null) {\n psiSetViaFir += psi\n }\n element.acceptChildren(this)\n }\n })","completion":"ktFile.accept(object : KtTreeVisitor() {\n override fun visitKtElement(element: KtElement, data: Nothing?): Void? {\n psiSetDirect += element\n return super.visitKtElement(element, data)\n }\n })\n psiSetDirect -= psiSetViaFir<|endoftext|>"} {"prompt":" kotlin.Unit) -> kotlin.Unit)? & (() -> kotlin.Unit) -> kotlin.Unit\")!>a.funNullableAny()","completion":" kotlin.Unit)? & () -> kotlin.Unit\"), DEBUG_INFO_SMARTCAST!>b.equals(null)\n kotlin.Unit)? & () -> kotlin.Unit\"), DEBUG_INFO_SMARTCAST!>b.propT<|endoftext|>"} {"prompt":"* Generated from: [org.jetbrains.kotlin.fir.tree.generator.FirTreeBuilder.callableDeclaration]\n *\/\nsealed class FirCallableDeclaration : FirMemberDeclaration() {\n abstract override val source: KtSourceElement?\n abstract override val annotations: List\n abstract override val moduleData: FirModuleData","completion":"abstract override val origin: FirDeclarationOrigin\n abstract override val attributes: FirDeclarationAttributes\n abstract override val typeParameters: List\n abstract override val status: FirDeclarationStatus\n abstract val returnTypeRef: FirTypeRef\n abstract val receiverParameter: FirReceiverParameter?\n abstract val deprecationsProvider: DeprecationsProvider<|endoftext|>"} {"prompt":"value class F3(val x: F1, val y: F2)\n\n@JvmInline\nvalue class F4(val x: Int)\n\n@JvmInline\nvalue class F5(val x: UInt)\n\n@JvmInline\nvalue class F6(val x: String)\n\n@JvmInline\nvalue class A(\n val f1: F1,","completion":"val f2: F2,\n val f3: F3,\n val f4: F4,\n val f5: F5,\n val f6: F6,\n val f7: Int,\n val f8: UInt,\n val f9: String,\n)\n\n@JvmInline\nvalue class B(val a1: A, val a2: A) {<|endoftext|>"} {"prompt":"if (element4 in emptyCharSequence.indices != range1.contains(element4)) throw AssertionError()\n if (element4 !in emptyCharSequence.indices != !range1.contains(element4)) throw AssertionError()\n if (!(element4 in emptyCharSequence.indices) != !range1.contains(element4)) throw AssertionError()","completion":"if (!(element4 !in emptyCharSequence.indices) != range1.contains(element4)) throw AssertionError()\n}\n\nfun testR1xE5() {\n \/\/ with possible local optimizations\n if (0.toShort() in emptyCharSequence.indices != range1.contains(0.toShort())) throw AssertionError()<|endoftext|>"} {"prompt":"0x0011, 0x0009, 0x0005, 0x0006, 0x7084, 0x0018, 0x4624, 0x6b46, 0x0005, 0x0006, 0x0004, 0x0006, 0x10c6, 0x0086, 0x0006, 0x0011, 0x0018, 0x0011,","completion":"0x0005, 0x0006,<|endoftext|>"} {"prompt":"irCall(symbols.interopObjCObjectRawValueGetter).apply {\n extensionReceiver = receiver\n }\n}\n\n\/**\n * Lowers some interop intrinsic calls.\n *\/\nprivate class InteropLoweringPart2(val generationState: NativeGenerationState) : FileLoweringPass {\n override fun lower(irFile: IrFile) {","completion":"val transformer = InteropTransformer(generationState, irFile)\n irFile.transformChildrenVoid(transformer)\n\n while (transformer.newTopLevelDeclarations.isNotEmpty()) {\n val newTopLevelDeclarations = transformer.newTopLevelDeclarations.toList()\n transformer.newTopLevelDeclarations.clear()<|endoftext|>"} {"prompt":"if (c != null || this.c != null) this.c.funNullableT()\n if (c != null || this.c != null) this.c.funNullableAny()","completion":"if (c != null || this.c != null) this.c\n\n if (d != null) d.equals(null)<|endoftext|>"} {"prompt":"fun buildImports(): List = importedNameToPkg.mapNotNull { (name, pkg) ->\n if (pkg == \"kotlin\" || pkg == \"kotlinx.cinterop\") {\n \/\/ Is already imported either by default or with '*':\n null\n } else {\n \"import $pkg.${name.asSimpleName()}\"\n }","completion":"}.sorted()\n\n}\n\ninternal fun getTopLevelPropertyDeclarationName(scope: KotlinScope, property: PropertyStub): String {\n val receiverName = property.receiverType?.underlyingTypeFqName\n return getTopLevelPropertyDeclarationName(scope, receiverName, property.name)\n}\n\n\/\/ Try to use the provided name. If failed, mangle it with underscore and try again:<|endoftext|>"} {"prompt":"build(\"assemble\")\n\n testAddDependencyInLib_modifyProject()\n\n build(\"assemble\") {\n assertTasksExecuted(\":lib:$compileKotlinTaskName\")\n assertTasksUpToDate(\":app:$compileKotlinTaskName\")\n assertCompiledKotlinSources(","completion":"subProject(\"lib\").projectPath.resolve(\"src\").allKotlinSources.relativizeTo(projectPath),\n output\n )\n }\n }\n }\n\n @DisplayName(\"ABI change in lib after lib clean\")\n @GradleTest\n override fun testAbiChangeInLib_afterLibClean(gradleVersion: GradleVersion) {<|endoftext|>"} {"prompt":"ENTRY2;\n constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())\n constructor() : this(UserKlass(), UserKlass())\n}","completion":"enum class EnumerationAEC(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass()) {\n ENTRY1,\n ENTRY2();\n constructor(arg: UserKlass = UserKlass()) : this(arg, UserKlass())<|endoftext|>"} {"prompt":"assertTrue(arg1(\"\").zipWithNext { a: Char, b: Char -> a.toString() + b }.isEmpty())\n assertTrue(arg1(\"a\").zipWithNext { a: Char, b: Char -> a.toString() + b }.isEmpty())\n }\n\n @Test fun zipWithNextPairs() = withOneCharSequenceArg { arg1 ->","completion":"assertEquals(listOf('a' to 'b', 'b' to 'c'), arg1(\"abc\").zipWithNext())\n assertTrue(arg1(\"\").zipWithNext().isEmpty())\n assertTrue(arg1(\"a\").zipWithNext().isEmpty())\n }\n\n\n @Test\n fun chunked() = withOneCharSequenceArg { arg1 ->\n val size = 7<|endoftext|>"} {"prompt":"is ConeUnmatchedTypeArgumentsError ->\n ErrorClassTypeQualifierBuilder.createQualifiersForUnmatchedTypeArgumentsType(coneDiagnostic, builder)\n else -> error(\"Unsupported ${coneDiagnostic::class}\")\n }\n }\n\n\n override val nullability: KtTypeNullability get() = withValidityAssertion { coneType.nullability.asKtNullability() }","completion":"override val errorMessage: String get() = withValidityAssertion { coneDiagnostic.reason }\n\n override val annotationsList: KtAnnotationsList by cached {\n KtFirAnnotationListForType.create(coneType, builder)\n }\n\n\n override val candidateClassSymbols: Collection by cached {<|endoftext|>"} {"prompt":"fun box(): String {\n val f = object : Foo() {}\n val f2 = object : Foo(2) {}\n val b = object : Bar() {}\n\n f.args.let { if (it != \"1\") return \"Fail 1: $it\" }\n f2.args.let { if (it != \"2\") return \"Fail 2: $it\" }","completion":"TF.args.let { if (it != \"1\") return \"Fail 3: $it\" }\n TF2.args.let { if (it != \"2\") return \"Fail 4: $it\" }\n b.args.let { if (it != \"1\") return \"Fail 5: $it\" }\n b.baseArgs.let { if (it != \"1\") return \"Fail 6: $it\" }<|endoftext|>"} {"prompt":"fun createCompilerJvmOptions(): KotlinJvmCompilerOptions\n\n \/**\n * Creates a Kotlin compile task.\n *\/\n @Deprecated(\n message = \"Replaced by registerKotlinJvmCompileTask with module name\",\n replaceWith = ReplaceWith(\"registerKotlinJvmCompileTask(taskName: String, moduleName: String)\")\n )","completion":"fun registerKotlinJvmCompileTask(taskName: String): TaskProvider\n\n\n \/**\n * Creates a Kotlin JVM compile task.\n *\n * @param taskName The name of the task to be created.\n * @param moduleName The name of the module for which the task is being created.<|endoftext|>"} {"prompt":"val c: String = notInPlaceRun { c }\n\n val d: String by simpleDelegate(d)\n val e: String by inPlaceDelegate { e }\n val f: String by notInPlaceDelegate { f }\n\n val g: Int","completion":"val h = 1.also { g = 2 }\n val i: Int\n val j by lazy { i = 2; 1 }\n val k: Int\n get() {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.services.moduleStructure\nimport java.io.File\n\nclass ClassicFrontendFailingTestSuppressor(testServices: TestServices) : AbstractFailingTestSuppressor(testServices) {\n\n override fun testFile(): File {\n return testServices.moduleStructure.originalTestDataFiles.first()\n }","completion":"override fun hasFailure(failedAssertions: List): Boolean {\n return failedAssertions.any {\n when (it) {\n is WrappedException.FromFacade -> it.facade is ClassicFrontendFacade\n is WrappedException.FromHandler -> it.handler.artifactKind == FrontendKinds.ClassicFrontend\n else -> false\n }\n }\n }<|endoftext|>"} {"prompt":"return sb.toString() != desc\n }\n\n override fun requiresPropertySignature(descriptor: FirProperty, desc: String): Boolean {\n return desc != mapTypeDefault(descriptor.returnTypeRef)\n }\n\n private fun mapTypeDefault(typeRef: FirTypeRef): String? {","completion":"val classId = typeRef.coneTypeSafe()?.classId\n return if (classId == null) null else ClassMapperLite.mapClass(classId.asString())\n }\n}<|endoftext|>"} {"prompt":"internal const val HEADER_CACHE_DIR_NAME = \"__header_cache__\"\n\ninternal fun prettyHash(hash: Int): String = hash.toUInt().toString(16).padStart(8, '0')\n\n\/**\n * Returns the expression to be parsed by Kotlin as string literal with given contents,\n * i.e. transforms `foo$bar` to `\"foo\\$bar\"`.\n *\/","completion":"internal fun String.quoteAsKotlinStringLiteral(): String = buildString {\n append('\"')\n\n this@quoteAsKotlinStringLiteral.forEach { c ->\n when (c) {\n in charactersAllowedInKotlinStringLiterals -> append(c)\n '$' -> append(\"\\\\$\")<|endoftext|>"} {"prompt":"val BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED: KtDiagnosticFactory0 by error0()\n val REIFIED_TYPE_PARAMETER_NO_INLINE: KtDiagnosticFactory0 by error0(SourceElementPositioningStrategies.REIFIED_MODIFIER)","completion":"val TYPE_PARAMETERS_NOT_ALLOWED: KtDiagnosticFactory0 by error0(SourceElementPositioningStrategies.TYPE_PARAMETERS_LIST)\n val TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER: KtDiagnosticFactory0 by error0()<|endoftext|>"} {"prompt":"setClasspath(project.files(\"a.jar\", \"b.jar\"))\n }\n\n project.configurationResult.await()\n assertEquals(\n project.files(\"a.jar\", \"b.jar\").files,\n kotlin.jvm().mainRun.await()?.task?.get()?.classpath?.files\n )\n }\n\n @Test","completion":"fun `test - jvmRun task is already registered`() = buildProjectWithMPP().runLifecycleAwareTest {\n val kotlin = multiplatformExtension\n kotlin.jvm()\n tasks.register(\"jvmRun\")\n configurationResult.await()\n checkDiagnostics(\"jvmRunTask-conflict\")\n }\n\n @Test<|endoftext|>"} {"prompt":"import org.junit.Assert\nimport java.io.File\n\nprivate const val library = \"inline fun foo(fn: () -> T): T = fn()\"\nprivate const val script = \"import foo\\nval x = foo { 0 }\"\n\nclass ReplCompilerJava8Test : KtUsefulTestCase() {\n private lateinit var tmpdir: File\n\n override fun setUp() {","completion":"super.setUp()\n tmpdir = KotlinTestUtils.tmpDirForTest(this)\n\n File(tmpdir, \"library.kt\").writeText(library)\n\n val configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.FULL_JDK).apply {<|endoftext|>"} {"prompt":"inline operator fun setValue(thisRef: Any?, kProperty: Any, newValue: T) {\n _value = newValue\n }\n}\n\nclass C {\n val delegatedVal by Mut(1)\n var delegatedVar by Mut(2)\n val delegatedValByProvider by Provider(1)\n var delegatedVarByProvider by Provider(2)\n}","completion":"val topLevelDelegatedVal by Mut(1)\nvar topLevelDelegatedVar by Mut(2)\nval topLevelDelegatedValByProvider by Provider(1)\nvar topLevelDelegatedVarByProvider by Provider(2)\n\nfun box(): String {\n val localDelegatedVal by Mut(1)\n var localDelegatedVar by Mut(2)<|endoftext|>"} {"prompt":"VERSION_REQUIREMENT_TABLE,\n JVM_EXT_PACKAGE_MODULE_NAME,\n JVM_EXT_PACKAGE_LOCAL_VARIABLE_LIST,\n JS_EXT_PACKAGE_FQ_NAME,\n BUILT_INS_EXT_PACKAGE_FQ_NAME,\n KLIB_EXT_PACKAGE_FQ_NAME\n }","completion":"fun difference(old: ProtoBuf.Package, new: ProtoBuf.Package): EnumSet {\n val result = EnumSet.noneOf(ProtoBufPackageKind::class.java)\n\n if (!checkEqualsPackageFunction(old, new)) result.add(ProtoBufPackageKind.FUNCTION_LIST)<|endoftext|>"} {"prompt":"callsInPlace(init, InvocationKind.EXACTLY_ONCE)\n }\n return FirConstructorBuilder().apply(init).build()\n}\n\n@OptIn(ExperimentalContracts::class)\ninline fun buildConstructorCopy(original: FirConstructor, init: FirConstructorBuilder.() -> Unit): FirConstructor {\n contract {","completion":"callsInPlace(init, InvocationKind.EXACTLY_ONCE)\n }\n val copyBuilder = FirConstructorBuilder()\n copyBuilder.source = original.source\n copyBuilder.resolvePhase = original.resolvePhase\n copyBuilder.moduleData = original.moduleData\n copyBuilder.origin = original.origin\n copyBuilder.attributes = original.attributes.copy()<|endoftext|>"} {"prompt":"fun Array?.assertFilePathsDontContain(pathSubString: String) {\n if (this == null) return\n val badFiles = filter { it.contains(pathSubString) }\n if (badFiles.isEmpty()) return\n fail(\"Following files contain unexpected '$pathSubString' substring in their paths: \\n${badFiles.joinToString(\"\\n\")}\")","completion":"}\n\n compileLinuxX64.createCompilerArguments(default).libraries.assertFilePathsDontContain(\"linux_x64\")\n compileLinuxArm64.createCompilerArguments(default).libraries.assertFilePathsDontContain(\"linux_arm64\")<|endoftext|>"} {"prompt":"class E {\n T getT() {\n return null;\n }\n}\n\ninterface I1 {}\ninterface I2 {}\n\n\/\/ FILE: test.kt\nfun test() {\n val t = X.E.t","completion":"..I1<(kotlin.Any..kotlin.Any?), (kotlin.Any..kotlin.Any?),<|endoftext|>"} {"prompt":"override val converter: Constructor>\n get() = ::Fir2IrJsResultsConverter\n\n override val backendFacade: Constructor>\n get() = ::FirJsKlibBackendFacade","completion":"override fun configure(builder: TestConfigurationBuilder) {\n builder.configureFirParser(FirParser.Psi)\n super.configure(builder)\n }\n}\n\nopen class AbstractClassicJsLibraryAbiReaderTest : AbstractJsLibraryAbiReaderTest() {\n final override val frontend: FrontendKind<*><|endoftext|>"} {"prompt":"private fun classExportability(klass: IrClass): Exportability {\n when (klass.kind) {\n ClassKind.ANNOTATION_CLASS ->\n return Exportability.Prohibited(\"Class ${klass.fqNameWhenAvailable} with kind: ${klass.kind}\")\n\n ClassKind.OBJECT,\n ClassKind.CLASS,\n ClassKind.INTERFACE,","completion":"ClassKind.ENUM_CLASS,\n ClassKind.ENUM_ENTRY -> {\n }\n }\n\n if (klass.isJsImplicitExport()) {\n return Exportability.Implicit\n }\n\n if (klass.isSingleFieldValueClass)\n return Exportability.Prohibited(\"Inline class ${klass.fqNameWhenAvailable}\")\n\n return Exportability.Allowed<|endoftext|>"} {"prompt":"suspend inline fun suspendInlineAcceptsVCAnyNullable(i: Int, vc: VCAnyNullable) {\n result = vc\n }\n\n suspend inline fun suspendInlineAcceptsVCInt(i: Int, vc: VCInt) {\n result = vc\n }","completion":"suspend inline fun suspendInlineAcceptsVCIntNullable(i: Int, vc: VCIntNullable) {\n result = vc\n }\n\n suspend inline fun suspendInlineAcceptsVCString_Null(i: Int, vc: VCString?) {\n result = vc\n }<|endoftext|>"} {"prompt":"expect interface StringDemoInterface\n\ninterface KotlinXStringDemoInterface {\n val value: String\n}\n\nexpect fun StringDemoInterface.plusK(): String\n\n\/\/ MODULE: js()()(common, intermediate)\n\/\/ TARGET_PLATFORM: JS\n\n\/\/ FILE: StringDemoInterfaceJs.kt","completion":"actual typealias StringDemoInterface = KotlinXStringDemoInterface<|endoftext|>"} {"prompt":"private fun compareByDomainCapacity(type1: PrimitiveType, type2: PrimitiveType): Int {\n return if (type1.isIntegral && type2.isIntegral) type1.byteSize - type2.byteSize else type1.ordinal - type2.ordinal\n }","completion":"private fun docForConversionFromFloatingToIntegral(fromFloating: PrimitiveType, toIntegral: PrimitiveType): String {\n require(fromFloating.isFloatingPoint)\n require(toIntegral.isIntegral)\n\n val thisName = fromFloating.capitalized\n val otherName = toIntegral.capitalized<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.serialization.deserialization.DeserializationConfiguration\n\nopen class CompilerDeserializationConfiguration(\n protected val languageVersionSettings: LanguageVersionSettings\n) : DeserializationConfiguration {\n\n final override val skipMetadataVersionCheck = languageVersionSettings.getFlag(AnalysisFlags.skipMetadataVersionCheck)","completion":"final override val skipPrereleaseCheck = languageVersionSettings.getFlag(AnalysisFlags.skipPrereleaseCheck)\n\n final override val reportErrorsOnPreReleaseDependencies =\n !skipPrereleaseCheck && !languageVersionSettings.isPreRelease() && !KotlinCompilerVersion.isPreRelease()<|endoftext|>"} {"prompt":"expectOrder(\"x(4) in low(1) .. 3\", \"LX\") { assertFalse(x(4) in low(1) .. 3) }\n expectOrder(\"x(4) !in low(1) .. high(3)\", \"LHX\") { assertTrue(x(4) !in low(1) .. high(3)) }","completion":"expectOrder(\"4 !in low(1) .. high(3)\", \"LH\") { assertTrue(4 !in low(1) .. high(3)) }\n expectOrder(\"x(4) !in 1 .. high(3)\", \"HX\") { assertTrue(x(4) !in 1 .. high(3)) }<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY\n\nfun emptyList(): List = null!!\n\nfun foo() {\n typealias LT = List","completion":"val a: LT = emptyList()\n\n fun localFun(): LT {\n typealias LLT = List<|endoftext|>"} {"prompt":"private val utilityInternalProperties = listOf(\n KOTLIN_INTERNAL_DIAGNOSTICS_USE_PARSABLE_FORMATTING,\n KOTLIN_INTERNAL_DIAGNOSTICS_SHOW_STACKTRACE,\n KOTLIN_INTERNAL_DIAGNOSTICS_COMPILER_ARGUMENTS_LOG_LEVEL\n)\n\n\/*\nExpected format","completion":"w: [DIAGNOSTIC_ID | WARNING] first line of diagnostic's text\nor (fatals don't have 'w:' or 'e:' prefix):\n [DIAGNOSTIC_ID | FATAL] Fatal diagnostic\n *\/\nprivate val DIAGNOSTIC_START_REGEX = \"\"\"\\s*([we]:)?\\s*\\[\\w+ \\| \\w+].*\"\"\".toRegex()<|endoftext|>"} {"prompt":"public val KtPropertySymbol.setterDeprecationStatus: DeprecationInfo?\n get() = withValidityAssertion { analysisSession.symbolInfoProvider.getSetterDeprecation(this) }\n\n public val KtPropertySymbol.javaGetterName: Name\n get() = withValidityAssertion {\n analysisSession.symbolInfoProvider.getJavaGetterName(this)","completion":"}\n\n public val KtPropertySymbol.javaSetterName: Name?\n get() = withValidityAssertion {\n analysisSession.symbolInfoProvider.getJavaSetterName(this)\n }\n\n \/** Gets the set of applicable targets for an annotation class symbol. Returns `null` if the symbol is not an annotation class. *\/<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.calls.tower.StubTypesBasedInferenceSession\nimport org.jetbrains.kotlin.resolve.calls.tower.PSICallResolver\nimport org.jetbrains.kotlin.resolve.calls.tower.PSIPartialCallInfo\nimport org.jetbrains.kotlin.types.error.ErrorUtils","completion":"import org.jetbrains.kotlin.types.TypeConstructor\nimport org.jetbrains.kotlin.types.UnwrappedType\nimport org.jetbrains.kotlin.util.OperatorNameConventions\n\nclass DelegateInferenceSession(\n val variableDescriptor: VariableDescriptorWithAccessors,\n val expectedType: UnwrappedType?,<|endoftext|>"} {"prompt":"}\n\n typeExpression\n }\n\n val callExpression = with (function) {\n assert(argumentTypes.size == parameters.size)\n val arguments = argumentTypes.mapIndexed { index, type ->\n \"${type}(${parameters[index].name})\"\n }\n when {\n isCxxInstanceMethod -> {","completion":"val parametersPart = arguments.drop(1).joinToString()\n \"(${parameters[0].name})->${name}($parametersPart)\"\n }\n isCxxConstructor -> {\n val parametersPart = arguments.drop(1).joinToString()\n \"new(${parameters[0].name}) ${cxxReceiverClass!!.spelling}($parametersPart)\"\n }<|endoftext|>"} {"prompt":"sb.appendLine(\"After\")\n } catch (e: Throwable) {\n sb.appendLine(\"Caught Throwable\")\n }\n\n sb.appendLine(\"Done\")\n\n assertEquals(\"\"\"\n Before\n Caught Throwable\n Done\n\n \"\"\".trimIndent(), sb.toString())\n return \"OK\"\n}\n\nfun foo() {","completion":"throw Error(\"Error happens\")\n sb.appendLine(\"After in foo()\")\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.findTopMostOverriddenDescriptors\nimport org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue\nimport org.jetbrains.kotlin.types.KotlinType\nimport org.jetbrains.kotlin.types.TypeUtils\nimport java.util.*","completion":"fun getReceiverTypePredicate(resolvedCall: ResolvedCall<*>, receiverValue: ReceiverValue): TypePredicate? {\n val callableDescriptor = resolvedCall.resultingDescriptor ?: return null\n\n when (receiverValue) {\n resolvedCall.extensionReceiver -> {\n val receiverParameter = callableDescriptor.extensionReceiverParameter<|endoftext|>"} {"prompt":"expression.transformChildrenVoid()\n parameterMapping[expression.symbol]?.let { return irSet(it.symbol, expression.value) }\n return expression\n }\n\n override fun visitReturn(expression: IrReturn): IrExpression {\n expression.transformChildrenVoid()\n if (expression.returnTargetSymbol == irConstructor.symbol) {","completion":"return irReturn(irBlock(expression.startOffset, expression.endOffset) {\n +expression.value\n +genReturnValue()\n })\n }\n\n return expression\n }\n })\n }\n +irReturn(genReturnValue())\n }\n }\n\n private fun getInlineClassBackingField(irClass: IrClass): IrField =<|endoftext|>"} {"prompt":"final override fun visitRawContractDescription(rawContractDescription: FirRawContractDescription, data: D): FirContractDescription {\n return transformRawContractDescription(rawContractDescription, data)\n }\n\n open fun transformResolvedContractDescription(resolvedContractDescription: FirResolvedContractDescription, data: D): FirContractDescription {\n return transformElement(resolvedContractDescription, data)\n }","completion":"final override fun visitResolvedContractDescription(resolvedContractDescription: FirResolvedContractDescription, data: D): FirContractDescription {\n return transformResolvedContractDescription(resolvedContractDescription, data)\n }\n}<|endoftext|>"} {"prompt":"get() = IntRange(0, lastIndex)\npublic val LongArray.indices: IntRange\n get() = IntRange(0, lastIndex)\npublic val FloatArray.indices: IntRange\n get() = IntRange(0, lastIndex)\npublic val DoubleArray.indices: IntRange\n get() = IntRange(0, lastIndex)\npublic val BooleanArray.indices: IntRange","completion":"get() = IntRange(0, lastIndex)\npublic val CharArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\npublic inline fun Array.isEmpty(): Boolean {\n return size == 0\n}\n\npublic val Array.lastIndex: Int\n get() = size - 1\npublic val ByteArray.lastIndex: Int<|endoftext|>"} {"prompt":"assertNull(empty.minOfWithOrNull(naturalOrder()) { it.toString() })\n assertNull(empty.maxOfWithOrNull(naturalOrder()) { it.toString() })\n assertFailsWith { empty.minOfWith(naturalOrder()) { it.toString() } }","completion":"assertFailsWith { empty.maxOfWith(naturalOrder()) { it.toString() } }\n }\n\n}<|endoftext|>"} {"prompt":"private fun reportError(internalName: String, vararg another: JvmDeclarationOrigin) {\n val duplicateClasses =\n another.mapNotNull { it.descriptor }.joinToString { DescriptorRenderer.ONLY_NAMES_WITH_SHORT_TYPES.render(it) }\n\n for (origin in another) {","completion":"state.reportDuplicateClassNameError(origin, internalName, duplicateClasses)\n }\n }\n}<|endoftext|>"} {"prompt":"0x3ff921fb54442d18UL, 0x3ff921fb54442d18UL, 0x3ff921fb54442d18UL, 0x3ff921fb54442d18UL,","completion":"0x3fe921fb54437d2cUL, 0x3fe921fb5442cd40UL, 0x3fe921fb54442d18UL, 0x3ff1b6e192eb77e6UL,<|endoftext|>"} {"prompt":"CompilerMode.NON_INCREMENTAL_COMPILER -> {\n doCompile(sessionId, daemonReporter, tracer = null) { _, _ ->\n val exitCode = compiler.exec(messageCollector, Services.EMPTY, k2PlatformArgs)\n\n val perfString = compiler.defaultPerformanceManager.renderCompilerPerformance()\n compilationResults?.also {","completion":"(it as CompilationResults).add(\n CompilationResultCategory.BUILD_REPORT_LINES.code,\n arrayListOf(perfString)\n )\n }\n\n exitCode\n }\n }\n CompilerMode.INCREMENTAL_COMPILER -> {\n val gradleIncrementalArgs = compilationOptions as IncrementalCompilationOptions<|endoftext|>"} {"prompt":"val currentSubstitutor = constraintSystem.build().currentSubstitutor\n val newSubstitution = object : DelegatedTypeSubstitution(currentSubstitutor.substitution) {\n override fun approximateContravariantCapturedTypes() = true\n }","completion":"var expectedType = newSubstitution.buildSubstitutor().substitute(effectiveExpectedType, Variance.IN_VARIANCE)\n\n if (expectedType == null || TypeUtils.isDontCarePlaceholder(expectedType)) {\n expectedType = argumentTypeResolver.getShapeTypeOfFunctionLiteral(\n functionLiteral,\n context.scope,\n context.trace,<|endoftext|>"} {"prompt":"val returnType = expression.getter?.owner?.returnType ?: expression.field!!.owner.type\n\n val getterCallableReference = expression.getter?.owner?.let { getter ->\n getter.dispatchReceiverParameter.let {\n if (it != null && expression.dispatchReceiver == null)\n receiverTypes.add(it.type)\n }","completion":"getter.extensionReceiverParameter.let {\n if (it != null && expression.extensionReceiver == null)\n receiverTypes.add(it.type)\n }\n val getterKFunctionType = this@WasmPropertyReferenceLowering.context.irBuiltIns.getKFunctionType(\n returnType,\n receiverTypes\n )\n IrFunctionReferenceImpl(<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1285\npackage foo\n\nclass A {\n operator fun component1(): Int = 1\n}\noperator fun A.component2(): String = \"n\"\n\nfun box(): String {\n val list = Array(1, { A() })\n\n var i = 0;\n var s = \"\"\n for ((a, b) in list) {","completion":"i = a;\n s = b;\n }\n\n if (i != 1) return \"i != 1, it: \" + i\n if (s != \"n\") return \"s != 'n', it: \" + s\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"delegateOperatorCall: Call,\n delegateOperatorResults: OverloadResolutionResults,\n delegateExpression: KtExpression\n ): Boolean {\n val resolutionErrorFactory = when {\n delegateOperatorResults.isSingleResult ||\n delegateOperatorResults.isIncomplete ||","completion":"delegateOperatorResults.resultCode == OverloadResolutionResults.Code.MANY_FAILED_CANDIDATES ->\n DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE\n\n delegateOperatorResults.isAmbiguity -> DELEGATE_SPECIAL_FUNCTION_AMBIGUITY\n\n else -> null\n }\n\n resolutionErrorFactory?.let {<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.session\n\nimport org.jetbrains.kotlin.KtSourceElement\nimport org.jetbrains.kotlin.config.JvmAnalysisFlags\nimport org.jetbrains.kotlin.config.LanguageVersionSettings\nimport org.jetbrains.kotlin.fir.*","completion":"import org.jetbrains.kotlin.fir.analysis.CheckersComponent\nimport org.jetbrains.kotlin.fir.analysis.FirOverridesBackwardCompatibilityHelper\nimport org.jetbrains.kotlin.fir.analysis.checkers.FirInlineCheckerPlatformSpecificComponent<|endoftext|>"} {"prompt":"internal fun Project.setupCInteropPropagatedDependencies() {\n val kotlin = this.multiplatformExtensionOrNull ?: return\n\n kotlin.forAllSharedNativeCompilations { compilation ->\n compilation.compileDependencyFiles += getPropagatedCInteropDependenciesOrEmpty(compilation)\n }","completion":"kotlin.forAllDefaultKotlinSourceSets { sourceSet ->\n addIntransitiveMetadataDependencyIfPossible(\n sourceSet, getPropagatedCInteropDependenciesOrEmpty(sourceSet)\n )\n }\n}\n\ninternal fun Project.getPropagatedCInteropDependenciesOrEmpty(sourceSet: DefaultKotlinSourceSet): FileCollection =<|endoftext|>"} {"prompt":"* @see absoluteValue extension property for [Int]\n *\/\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun abs(n: Int): Int = nativeMath.abs(n)\n\n\/**\n * Returns the smaller of two values.\n *\/\n@SinceKotlin(\"1.2\")\n@InlineOnly","completion":"public actual inline fun min(a: Int, b: Int): Int = nativeMath.min(a, b)\n\n\/**\n * Returns the greater of two values.\n *\/\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun max(a: Int, b: Int): Int = nativeMath.max(a, b)\n\n\/**\n * Returns the absolute value of this value.\n *<|endoftext|>"} {"prompt":"const val INLINE_CHEAP_SOURCE_MAP = \"inline-cheap-source-map\"\n const val INLINE_CHEAP_MODULE_SOURCE_MAP = \"inline-cheap-module-source-map\"\n const val INLINE_SOURCE_MAP = \"inline-source-map\"\n const val INLINE_NOSOURCES_SOURCE_MAP = \"inline-nosources-source-map\"","completion":"const val INLINE_NOSOURCES_CHEAP_SOURCE_MAP = \"inline-nosources-cheap-source-map\"\n const val INLINE_NOSOURCES_CHEAP_MODULE_SOURCE_MAP = \"inline-nosources-cheap-module-source-map\"\n const val SOURCE_MAP = \"source-map\"<|endoftext|>"} {"prompt":"* exponent. Returns the closest float value to the real number.\n\n * @param s the String that will be parsed to a floating point\n * @param e an int represent the 10 to part\n * @return the float closest to the real number\n * @exception NumberFormatException if the String doesn't represent a positive integer value\n *\/\n@GCUnsafeCall(\"Kotlin_native_FloatingPointParser_parseFloatImpl\")","completion":"private external fun parseFloatImpl(s: String, e: Int): Float\n\n\/**\n * Used to parse a string and return either a single or double precision\n * floating point number.\n *\/\ninternal object FloatingPointParser {\n \/*\n * All number with exponent larger than MAX_EXP can be treated as infinity.\n * All number with exponent smaller than MIN_EXP can be treated as zero.\n * Exponent is 10 based.<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\nannotation class AllOpen\n\nannotation class Plain(val name: String, val index: Int) {\n companion object {\n @JvmStatic val staticProperty = 42\n @JvmStatic fun staticFun() {}\n }\n}\n\n@AllOpen\nannotation class MyComponent(val name: String, val index: Int) {\n companion object {","completion":"@JvmStatic val staticProperty = 42\n @JvmStatic fun staticFun() {}\n }\n}<|endoftext|>"} {"prompt":"\/\/ FILE: test.kt\n\nfun foo() {\n try {\n mightThrow()\n } catch (e: Throwable) {\n return\n }\n \n val t = try {\n mightThrow2()\n } catch (e: Throwable) {\n return\n }\n\n val x = try {\n mightThrow3()\n } catch (e: Throwable) {\n return","completion":"}\n}\n\nvar throw1 = false\nvar throw2 = false\nvar throw3 = false\n\nfun mightThrow() {\n if (throw1) throw Exception()\n}\n\nfun mightThrow2() {\n if (throw2) throw Exception()\n}\n\nfun mightThrow3(): Int {\n if (throw3) throw Exception()\n return 42\n}\n\nfun box() {\n foo()<|endoftext|>"} {"prompt":"modifierFnLock, modifierHyper, modifierNumLock, modifierScrollLock, modifierSuper, modifierSymbol, modifierSymbolLock, view, detail, bubbles, cancelable, composed","completion":"};\") }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.util.render\nimport org.jetbrains.kotlin.ir.visitors.IrElementVisitor\n\n\/* Make sure that all the variable references and type parameter references are within the scope of the corresponding variables and\n type parameters.\n*\/\nclass ScopeValidator(\n private val reportError: ReportError\n) {\n\n fun check(element: IrElement) {","completion":"element.accept(Checker(), Visibles(emptySet(), mutableSetOf()))\n }\n\n inner class Visibles(val typeParameters: Set, val values: MutableSet) {\n fun visitTypeAccess(element: IrElement, type: IrType) {\n if (type !is IrSimpleType) return<|endoftext|>"} {"prompt":"val refinedConfiguration = when (refineResults) {\n is ResultWithDiagnostics.Failure ->\n return DependenciesResolver.ResolveResult.Failure(refineResults.reports.mapScriptReportsToDiagnostics())\n is ResultWithDiagnostics.Success -> {\n diagnostics.addAll(refineResults.reports.mapScriptReportsToDiagnostics())\n refineResults.value\n }\n }","completion":"if (refinedConfiguration != scriptCompilationConfiguration) {\n onConfigurationUpdated(script, refinedConfiguration)\n }\n\n val newClasspath = refinedConfiguration[ScriptCompilationConfiguration.dependencies]\n ?.flatMap { (it as JvmDependency).classpath } ?: emptyList()\n\n return DependenciesResolver.ResolveResult.Success(\n \/\/ TODO: consider returning only increment from the initial config<|endoftext|>"} {"prompt":"if (spilledVariables != setOf(\"label\" to \"1\", \"I$0\" to \"0\", \"L$0\" to \"a0\", \"L$1\" to \"null\")) return \"FAIL 1: $spilledVariables\"\n c?.resume(Unit)","completion":"if (spilledVariables != setOf(\"label\" to \"4\", \"I$0\" to \"0\", \"L$0\" to \"null\", \"L$1\" to \"null\")) return \"FAIL 2: $spilledVariables\"\n c?.resume(Unit)<|endoftext|>"} {"prompt":"package test\n\nannotation class Ann(\n val p1: Int,\n val p2: Int,\n val p3: Long,\n val p4: Long,\n val p5: Int\n)\n\n@Ann(\n p1 = java.lang.Integer.MAX_VALUE + 1,\n p2 = 1 + 1,","completion":"p3 = java.lang.Integer.MAX_VALUE + 1,\n p4 = 1.toInt() + 1.toInt(),\n p5 = 1.toInt() + 1.toInt()\n) class MyClass<|endoftext|>"} {"prompt":"val x = 1\n const val y = \"\"\n }\n\n\n constructor(s: Int) {}\n init {}\n fun function() {}","completion":"val property get() = Unit\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.cfg.pseudocode.instructions.KtElementInstruction\nimport org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicInstruction\nimport org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicKind","completion":"import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.ReadValueInstruction\nimport org.jetbrains.kotlin.cfg.pseudocodeTraverser.TraversalOrder\nimport org.jetbrains.kotlin.cfg.pseudocodeTraverser.traverse<|endoftext|>"} {"prompt":"it.findFieldIncludingSupertypes(name)?.let { return it }\n }\n\n return parent?.findField(javaClass, name)\n }\n\n private fun JavaClass.enclosingClasses(): List = arrayListOf().also { classes ->\n classes.add(this)","completion":"outerClass?.let { classes.addAll(it.enclosingClasses()) }\n }\n\n}<|endoftext|>"} {"prompt":"is FirExplicitSimpleImportingScope -> KtScopeKind.ExplicitSimpleImportingScope(indexInTower)\n is FirExplicitStarImportingScope -> KtScopeKind.ExplicitStarImportingScope(indexInTower)\n is FirDefaultSimpleImportingScope -> KtScopeKind.DefaultSimpleImportingScope(indexInTower)","completion":"is FirDefaultStarImportingScope -> KtScopeKind.DefaultStarImportingScope(indexInTower)\n\n is FirScriptDeclarationsScope -> KtScopeKind.ScriptMemberScope(indexInTower)\n\n else -> unexpectedElementError(\"scope\", firScope)\n }\n\n private fun createPackageScope(fqName: FqName): KtFirPackageScope {<|endoftext|>"} {"prompt":"public class Test {\n public static class Test2 {\n public Integer foo(Integer x) { return 1; }\n public static class Test4 {\n public Integer foo(Integer x) { return 1; }\n }\n public class Test5 {\n public Integer foo(Integer x) { return 1; }\n }\n }\n public class Test3 {\n public Integer foo(Integer x) { return 1; }","completion":"public class Test5 {\n public Integer foo(Integer x) { return 1; }\n }\n }\n}\n\n\/\/ FILE: main.kt\nimport test.Test\n\nfun main(x: Test) {<|endoftext|>"} {"prompt":"public inline fun kotlin.ByteArray.runningReduce(operation: (acc: kotlin.Byte, kotlin.Byte) -> kotlin.Byte): kotlin.collections.List\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.CharArray.runningReduce(operation: (acc: kotlin.Char, kotlin.Char) -> kotlin.Char): kotlin.collections.List\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"@Test\n fun `closureSequence on empty list`() {\n assertSame(\n emptySequence(), listOf().closureSequence { it.children },\n \"Expected no Set being allocated on empty closure\"\n )\n }\n\n @Test\n fun `closure - on list - no edges`() {\n assertSame(","completion":"emptySet(), listOf(Node(\"a\"), Node(\"b\")).closure { it.children },\n \"Expected no Set being allocated on empty closure\"\n )\n }\n\n @Test\n fun `closureSequence - on list - no edges`() {\n assertEquals(<|endoftext|>"} {"prompt":"return \"kotlin.jvm.internal.markers.KMappedMarker\"\n } else if (mapping.kotlinMutable == classId) {\n return \"kotlin.jvm.internal.markers.K\" + classId.relativeClassName.asString()","completion":".replace(\"MutableEntry\", \"Entry\") \/\/ kotlin.jvm.internal.markers.KMutableMap.Entry for some reason\n .replace(\".\", \"$\")\n }\n }\n\n return null\n }\n}\n\nprivate val PsiQualifiedReference.nameFromSource: String?\n get() {\n val name = referenceName ?: return null<|endoftext|>"} {"prompt":"NATIVE_TARGETS_ALIAS, \"Comma-separated list of hardware targets\", mandatory = false\n) {\n override fun parse(rawValue: String, onError: (reason: String) -> Nothing): Option> {\n val targetNames = rawValue.split(',')\n if (targetNames.isEmpty()) onError(\"No hardware targets specified: $rawValue\")","completion":"val targets = targetNames.mapTo(HashSet()) { targetName ->\n predefinedTargets[targetName] ?: onError(\"Unknown hardware target: $targetName\")\n }.sortedBy { it.name }\n\n return Option(this, targets)\n }\n}<|endoftext|>"} {"prompt":"fun flow(block: suspend FlowCollector.() -> Unit): Flow = Flow(block)\n\nclass Flow(private val block: suspend FlowCollector.() -> Unit)\n\nfun select(vararg x: R) = x[0]\n\nfun poll0(): Flow {\n return flow {","completion":"val inv = select(::bar, ::foo)\n inv()\n }\n}\n\nfun poll01(): Flow {\n return flow {\n val inv = select(::bar2, ::foo2)\n inv()\n }\n}\n\nfun poll02(): Flow {\n return flow {\n val inv = select(::bar3, ::foo3)\n inv()\n }<|endoftext|>"} {"prompt":"\/\/ _Arrays.kt:... box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass, $this$map\\25:java.lang.Object[]=java.lang.Integer[], $i$f$map\\25\\459:int=0:int,","completion":"$this$mapTo\\26:java.lang.Object[]=java.lang.Integer[], destination\\26:java.util.Collection=java.util.ArrayList, $i$f$mapTo\\26\\451:int=0:int, item\\26:java.lang.Object=java.lang.Integer<|endoftext|>"} {"prompt":"private fun Project.registerPackageGeneration(\n taskNamePrefix: String,\n swiftApiModuleName: Provider,\n swiftApiLibraryName: Provider,\n kotlinStaticLibraryName: Provider,\n swiftExportTask: TaskProvider,\n staticLibrary: StaticLibrary,\n syntheticBuildRoot: Provider,","completion":"): TaskProvider {\n val spmPackageGenTaskName = taskNamePrefix + \"GenerateSPMPackage\"\n val packageGenerationTask = locateOrRegisterTask(spmPackageGenTaskName) { task ->\n task.group = BasePlugin.BUILD_GROUP<|endoftext|>"} {"prompt":"val metrics = ArrayList()\n MetricsContainer.readFromFile(statFile) {\n metrics.add(it)\n }\n\n assertEquals(2, metrics.size, \"Invalid number of MerticContainers was read\")\n assertEquals(\n \"true\",\n metrics[0].getMetric(StringMetrics.USE_FIR)?.getValue()","completion":")\n\n assertEquals(\n \"1.2.3\",\n metrics[0].getMetric(StringMetrics.KOTLIN_COMPILER_VERSION)?.getValue()\n )\n\n assertEquals(\n null,\n metrics[1].getMetric(StringMetrics.KOTLIN_COMPILER_VERSION)?.getValue()\n )\n }<|endoftext|>"} {"prompt":"\/\/ We consider these methods fast enough, so don't switch thread state to Native.\n ret(genSendMessage(returnType, valueParameterTypes, instance, nsNumberInitSelector, value))\n }\n\n setObjCExportTypeInfo(boxClass, converter.toConstPointer())\n}\n\nprivate fun ObjCExportCodeGenerator.generateContinuationToRetainedCompletionConverter(","completion":"blockGenerator: BlockGenerator\n): LlvmCallable = with(blockGenerator) {\n generateWrapKotlinObjectToRetainedBlock(\n BlockType(numberOfParameters = 2, returnsVoid = true),\n convertName = \"convertContinuation\",\n invokeName = \"invokeCompletion\"\n ) { continuation, arguments ->\n check(arguments.size == 2)<|endoftext|>"} {"prompt":"contextReceivers.forEach { it.accept(visitor, data) }\n controlFlowGraphReference?.accept(visitor, data)\n valueParameters.forEach { it.accept(visitor, data) }\n body?.accept(visitor, data)\n contractDescription?.accept(visitor, data)\n annotations.forEach { it.accept(visitor, data) }","completion":"typeParameters.forEach { it.accept(visitor, data) }\n }\n\n override fun transformChildren(transformer: FirTransformer, data: D): FirSimpleFunctionImpl {\n transformStatus(transformer, data)\n transformReturnTypeRef(transformer, data)\n transformReceiverParameter(transformer, data)<|endoftext|>"} {"prompt":"b.funNullableAny()\n if (x == null == true || (c != null && !c)) {\n\n } else {","completion":"x\n x.equals(null)<|endoftext|>"} {"prompt":"val lhs = expression.statements[0] as IrVariable\n val rhsStatement = expression.statements[1]\n val rhs = when (rhsStatement) {\n is IrBlock -> {\n if (rhsStatement.statements.size == 2) {\n val target = rhsStatement.statements[1]\n when (target) {\n is IrVariable -> target.initializer","completion":"else -> target\n }\n } else rhsStatement\n }\n else -> {\n rhsStatement\n }\n } as? IrWhen\n val call = rhs?.let { it.branches.last().result as? IrCall }\n if (call == null) {\n expression.statements.printJoin(\"\\n\")\n return\n }<|endoftext|>"} {"prompt":"@Throws(Exception1::class) override fun foo() {}\n}\n\nclass OverrideIncompatibleThrowsOnFakeOverride2 : IncompatibleThrowsOnFakeOverride {\n @Throws(Exception2::class) override fun foo() {}\n}","completion":"class InheritIncompatibleThrowsOnFakeOverride : IncompatibleThrowsOnFakeOverride {\n override fun foo() {}\n}\n\n@Throws\nsuspend fun suspendThrowsNothing() {}\n\ninterface SuspendFun {\n suspend fun foo()\n}<|endoftext|>"} {"prompt":"dispatch_async(dispatch_get_global_queue(QOS_CLASS_BACKGROUND.convert(), 0),\n Continuator.wrap({ println(\"In queue ${dispatch_get_current_queue()}\")}) {\n println(\"After in queue ${dispatch_get_current_queue()}: $index\")\n })\n\n appDelegate.canClick = false","completion":"\/\/ Fetch URL in the background on the button click.\n httpDelegate.fetchUrl(\"https:\/\/jsonplaceholder.typicode.com\/todos\/${index++}\")\n }\n\n @ObjCAction\n fun onQuit() {\n NSApplication.sharedApplication().stop(this)\n }\n\n @ObjCAction\n fun onRequest() {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.KotlinTestUtils\nimport org.jetbrains.kotlin.test.TestJdkKind\nimport org.jetbrains.kotlin.test.testFramework.RunAll\nimport org.jetbrains.kotlin.utils.PathUtil\nimport org.junit.Assert\nimport java.io.File","completion":"import java.nio.file.Files\nimport kotlin.reflect.KClass\nimport kotlin.script.experimental.annotations.KotlinScript\nimport kotlin.script.experimental.api.*\nimport kotlin.script.experimental.host.*\nimport kotlin.script.experimental.jvm.*<|endoftext|>"} {"prompt":"assertFailsWith {\n arr.getULongAt(-1)\n }\n assertFailsWith {\n arr.getULongAt(Int.MAX_VALUE)\n }\n assertFailsWith {\n arr.getULongAt(Int.MIN_VALUE)\n }\n }","completion":"@Test fun setULongOutOfBounds() {\n val arr = ByteArray(10) { 0 }\n arr.setULongAt(0, 1U)\n arr.setULongAt(2, 1U)\n assertFailsWith {\n arr.setULongAt(3, 1U)\n }<|endoftext|>"} {"prompt":"public inline fun > FloatArray.filterIndexedTo(destination: C, predicate: (index: Int, Float) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n\/**","completion":"* Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n *\/<|endoftext|>"} {"prompt":"assertEquals(expected, string.replaceFirstChar { it.lowercase() })\n }\n testDecapitalize(\"a\", \"A\")\n testDecapitalize(\"a\", \"a\")\n testDecapitalize(\"abcd\", \"abcd\")\n testDecapitalize(\"abcd\", \"Abcd\")\n testDecapitalize(\"uRL\", \"URL\")\n }","completion":"@Test fun slice() {\n val iter = listOf(4, 3, 0, 1)\n \/\/ abcde\n \/\/ 01234\n assertEquals(\"bcd\", \"abcde\".substring(1..3))\n assertEquals(\"dcb\", \"abcde\".slice(3 downTo 1))\n assertEquals(\"edab\", \"abcde\".slice(iter))\n }<|endoftext|>"} {"prompt":"typealias Experimental0 = RequiresOptIn\ntypealias OptIn0 = OptIn\nfun f3(e: Experimental0 \/* TODO *\/) {}","completion":"fun f4(u: OptIn0 \/* TODO *\/) {}\n\n\n\/\/ Usages as ::class literals should be errors\n\nannotation class VarargKClasses(vararg val k: KClass<*>)\n\n@VarargKClasses(\n RequiresOptIn::class,<|endoftext|>"} {"prompt":"return fir.convertWithOffsets { startOffset, endOffset ->\n Fir2IrLazyProperty(\n c, startOffset, endOffset, originForProperty, fir, firContainingClass, symbols, lazyParent, isFakeOverride\n )\n }\n }\n\n fun createIrLazyConstructor(\n fir: FirConstructor,\n symbol: IrConstructorSymbol,","completion":"declarationOrigin: IrDeclarationOrigin,\n lazyParent: IrDeclarationParent,\n ): Fir2IrLazyConstructor = fir.convertWithOffsets { startOffset, endOffset ->\n Fir2IrLazyConstructor(c, startOffset, endOffset, declarationOrigin, fir, symbol, lazyParent)\n }\n\n fun createIrLazyClass(\n firClass: FirRegularClass,<|endoftext|>"} {"prompt":"\/\/ SKIP_WHEN_OUT_OF_CONTENT_ROOT\n\/\/ MODULE: dep\n\/\/ FILE: issue\/pack\/RowIcon.kt\npackage issue.pack;\n\nclass RowIcon {\n class RClass\n}\n\n\/\/ MODULE: main(dep)\n\/\/ FILE: usage.kt\npackage usage\n\nfun testJavaNestedClass(alignment: issue.pack.RowIcon.RClass<\/expr>) {","completion":"}<|endoftext|>"} {"prompt":"fun t4(a: A) {\n a = A()\n}\n\n\/\/ ------------------------------------------------\n\/\/ reassigned vals\n\nfun t1() {\n val a : Int = 1","completion":"a = 2\n\n var b : Int = 1\n b = 3\n}\n\nenum class ProtocolState {\n WAITING {<|endoftext|>"} {"prompt":"fun writeJsCodeIntoModuleCache(outputJsFile: File, outputJsMapFile: File?): CompilationOutputsBuiltForCache {\n sourceMap?.let { outputJsMapFile?.writeText(it) }\n outputJsFile.writeText(rawJsCode)\n return CompilationOutputsBuiltForCache(outputJsFile, outputJsMapFile, this)\n }\n}","completion":"class CompilationOutputsCached(\n private val jsCodeFile: File,\n private val sourceMapFile: File?,\n private val tsDefinitionsFile: File?\n) : CompilationOutputs() {\n override val tsDefinitions: TypeScriptFragment?\n get() = tsDefinitionsFile?.let { TypeScriptFragment(it.readText()) }\n\n override val jsProgram: JsProgram?<|endoftext|>"} {"prompt":"val diff = expectedDeclarations - actualDeclarations\n assert(diff.isEmpty()) {\n val expectedDeclarationsString = expectedDeclarations.joinToString(separator = \"\\n\", prefix = \"Expected declarations:\\n\")\n val actualDeclarationsString = actualDeclarations.joinToString(separator = \"\\n\", prefix = \"Actual declarations:\\n\")","completion":"\"$expectedDeclarationsString\\n\\n$actualDeclarationsString\"\n }\n}<|endoftext|>"} {"prompt":"IdSignatureValues._byte, IdSignatureValues._short, IdSignatureValues._int,\n IdSignatureValues.uByte, IdSignatureValues.uShort, IdSignatureValues.uInt, IdSignatureValues.uLong,\n IdSignatureValues._float, IdSignatureValues._double,\n -> false\n else -> true\n }\n }","completion":"private fun IrExpression.explicitlyConvertedToString(): IrExpression {\n assert(type.shouldExplicitlyConvertToString)\n\n return if (type.isNullable()) {\n JsIrBuilder.buildCall(context.ir.symbols.extensionToString).apply {\n extensionReceiver = this@explicitlyConvertedToString\n }\n } else {<|endoftext|>"} {"prompt":"assertEquals(\"NativeFooNWrapper(nativeFooN=null) (object)\", describeNativeFooNWrapperN(NativeFooNWrapper(null)))\n assertEquals(\"null (object)\", describeNativeFooNWrapperN(null))\n}\n\nexternal var intWrapper: IntWrapper\nexternal var intWrapperN: IntWrapper?\nexternal var intNWrapper: IntNWrapper","completion":"external var intNWrapperN: \/*boxed*\/ IntNWrapper?\nexternal var fooWrapper: FooWrapper\nexternal var fooWrapperN: FooWrapper?\nexternal var fooNWrapper: FooNWrapper\nexternal var fooNWrapperN: \/*boxed*\/ FooNWrapper?\nexternal var nativeFooWrapper: NativeFooWrapper\nexternal var nativeFooWrapperN: NativeFooWrapper?<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.builders.*\nimport org.jetbrains.kotlin.ir.builders.declarations.addValueParameter\nimport org.jetbrains.kotlin.ir.builders.declarations.buildFun\nimport org.jetbrains.kotlin.ir.declarations.*\nimport org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl","completion":"import org.jetbrains.kotlin.ir.expressions.*\nimport org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl\nimport org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl\nimport org.jetbrains.kotlin.ir.symbols.IrFieldSymbol<|endoftext|>"} {"prompt":"JvmProtoBufUtil.readClassDataFrom(data, strings)\n } ?: return null\n val source = KotlinJvmBinarySourceElement(\n kotlinClass, kotlinClass.incompatibility, kotlinClass.isPreReleaseInvisible, kotlinClass.abiStability\n )","completion":"return ClassData(nameResolver, classProto, kotlinClass.classHeader.metadataVersion, source)\n }\n\n fun createKotlinPackagePartScope(descriptor: PackageFragmentDescriptor, kotlinClass: KotlinJvmBinaryClass): MemberScope? {<|endoftext|>"} {"prompt":"}?.let { SMAPAndMethodNode(it, SMAP(listOf())) }\n\ninternal fun generateInlineIntrinsic(\n descriptor: FunctionDescriptor,\n asmMethod: Method,\n typeSystem: TypeSystemCommonBackendContext\n): SMAPAndMethodNode? {\n return generateInlineIntrinsicForIr(descriptor) ?: when {","completion":"isSpecialEnumMethod(descriptor) ->\n createSpecialEnumMethodBody(descriptor.name.asString(), descriptor.original.typeParameters.single(), typeSystem)\n TypeOfChecker.isTypeOf(descriptor) ->\n typeSystem.createTypeOfMethodBody(descriptor.original.typeParameters.single())\n descriptor.isBuiltinAlwaysEnabledAssert() -><|endoftext|>"} {"prompt":") : KtIntegerLiteralType(), KtFirType {\n override val token: KtLifetimeToken get() = builder.token\n\n override val isUnsigned: Boolean get() = withValidityAssertion { coneType.isUnsigned }\n\n override val value: Long get() = withValidityAssertion { coneType.value }","completion":"override val possibleTypes: List by cached {\n coneType.possibleTypes.map { possibleType ->\n builder.typeBuilder.buildKtType(possibleType) as KtClassType\n }\n }\n\n override val annotationsList: KtAnnotationsList by cached {\n KtFirAnnotationListForType.create(coneType, builder)\n }<|endoftext|>"} {"prompt":"B()\n B()\n}\n\n\/\/ FILE: Lib3.kt\npackage lib.case3\n\n\/\/fun A() : String = \"\"\n\nobject A {","completion":"\/*operator*\/ fun invoke() : Int = 1\n}<|endoftext|>"} {"prompt":"fun isNotEqualNullableUnboxedRight(s: A?, t: A) = s != t\n\nfun box(): String {\n if (!isNotNullVacuousLeft(A(\"\"))) return \"Fail 1\"\n if (!isNotNullVacuousRight(A(\"\"))) return \"Fail 2\"","completion":"if (!isNotNullLeft(A(\"\"))) return \"Fail 3\"\n if (!isNotNullRight(A(\"\"))) return \"Fail 4\"\n if (isNotNullLeft(null)) return \"Fail 5\"\n if (isNotNullRight(null)) return \"Fail 6\"\n if (isNotEqualSame(A(\"\"), A(\"\"))) return \"Fail 7\"<|endoftext|>"} {"prompt":"override val kFunctionClass = builtIns.getBuiltInClassByFqName(FqName(\"kotlin.reflect.KFunction\")).toIrSymbol()\n\n override val annotationClass: IrClassSymbol = builtIns.annotation.toIrSymbol()\n override val annotationType: IrType = builtIns.annotationType.toIrType()","completion":"override fun getKPropertyClass(mutable: Boolean, n: Int): IrClassSymbol = when (n) {\n 0 -> if (mutable) kMutableProperty0Class else kProperty0Class\n 1 -> if (mutable) kMutableProperty1Class else kProperty1Class\n 2 -> if (mutable) kMutableProperty2Class else kProperty2Class<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.native\n\nimport org.gradle.testkit.runner.BuildResult\nimport org.gradle.util.GradleVersion\nimport org.jetbrains.kotlin.gradle.testbase.*\nimport org.junit.jupiter.api.DisplayName\n\n@DisplayName(\"Tests for K\/N builds with embeddable compiler jar\")","completion":"@NativeGradlePluginTests\ninternal class NativeEmbeddableCompilerJarIT : KGPBaseTest() {\n\n private fun String.isRegularJar() = this.endsWith(\"\/kotlin-native.jar\")\n private fun String.isEmbeddableJar() = this.endsWith(\"\/kotlin-native-compiler-embeddable.jar\")<|endoftext|>"} {"prompt":"class B : A() {\n @Throws(RuntimeException::class)\n override fun foo() = Unit\n }\n class C : B() {\n @Throws(IndexOutOfBoundsException::class)\n override fun foo() = Unit\n }\n \"\"\".trimIndent()\n )\n\n analyze(file) {","completion":"val fooA = file.getClassOrFail(\"A\").getMemberScope().getFunctionOrFail(\"foo\")\n assertEquals(listOf(\"IllegalStateException\"), fooA.effectiveThrows.mapName())\n assertEquals(listOf(\"IllegalStateException\"), fooA.definedThrows.mapName())<|endoftext|>"} {"prompt":"existingContext.dropElement()\n context = existingContext\n }\n }\n\n @OptIn(PrivateForInline::class)\n inline fun withLabelAndReceiverType(\n labelName: Name?,\n owner: FirDeclaration,\n type: ConeKotlinType?,\n block: () -> R\n ): R {","completion":"val (implicitReceiverValue, implicitCompanionValues) = context.sessionHolder.collectImplicitReceivers(type, owner)\n val existingContext = context\n implicitCompanionValues.forEach { value ->\n context = context.addImplicitReceiver(null, value)\n }\n implicitReceiverValue?.let {\n context = context.addImplicitReceiver(labelName, it)<|endoftext|>"} {"prompt":"\/\/ library.kt:57 box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass, this_\\12:MyClass=MyClass, $i$f$f1\\12\\436:int=0:int,","completion":"$i$a$-f1-LibraryKt$foo$3\\14\\439\\1:int=0:int, $i$f$test\\15\\436:int=0:int<|endoftext|>"} {"prompt":"* @throws NoSuchElementException if the char sequence is empty.\n *\/\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly","completion":"public inline fun CharSequence.minOfWith(comparator: Comparator, selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])<|endoftext|>"} {"prompt":"\/\/ test.kt:11 box: map:java.util.Map=java.util.Collections$SingletonMap\n\/\/ test.kt:9 box: map:java.util.Map=java.util.Collections$SingletonMap","completion":"\/\/ test.kt:14 box: map:java.util.Map=java.util.Collections$SingletonMap, e:java.util.Map$Entry=java.util.AbstractMap$SimpleImmutableEntry\n\/\/ test.kt:11 box: map:java.util.Map=java.util.Collections$SingletonMap<|endoftext|>"} {"prompt":"return js(\"jsInInlineFunctionInnerBox()\") as String\n}\n\nfun testCaptureVariables(param1: String = \"parameter\"): String {\n val STR1 = \"local variable\"\n\n js(\"\"\"\n function testCaptureVariablesInnerBox() { \n if (param$LIB_INT != 'parameter') { return \"Not OK parameter\"; }","completion":"if ($STR$LIB_INT != 'local variable') { return \"Not OK local variable\"; }\n \n return \"OK\";\n }\n \"\"\")\n return js(\"testCaptureVariablesInnerBox()\") as String\n}\n\ninline fun jsInInlineFunctionCaptureVariables(param1: String = \"parameter\") {\n val STR1 = \"local variable\"\n\n js(\"\"\"<|endoftext|>"} {"prompt":"classOrObject.body?.declarations?.forEach { declaration ->\n when (declaration) {\n is KtConstructor<*> -> addDeclaration(memberDeserializer.loadConstructor(declaration, classOrObject, this))\n is KtNamedFunction -> addDeclaration(memberDeserializer.loadFunction(declaration, symbol, session))","completion":"is KtProperty -> addDeclaration(memberDeserializer.loadProperty(declaration, symbol))\n is KtEnumEntry -> addDeclaration(memberDeserializer.loadEnumEntry(declaration, symbol, classId))\n is KtClassOrObject -> {\n val name = declaration.name ?: errorWithAttachment(\"Class doesn't have name $declaration\") {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.asJava.elements.KtLightField\nimport org.jetbrains.kotlin.asJava.elements.KtLightMethod\nimport org.jetbrains.kotlin.asJava.elements.KtUltraLightModifierList\nimport org.jetbrains.kotlin.asJava.toLightClass","completion":"import org.jetbrains.kotlin.backend.common.CodegenUtil\nimport org.jetbrains.kotlin.backend.common.DataClassMethodGenerator\nimport org.jetbrains.kotlin.builtins.KotlinBuiltIns\nimport org.jetbrains.kotlin.builtins.StandardNames<|endoftext|>"} {"prompt":"fun foo(x: K) {}\nval x1 = foo<(unresolved) -> Float> { it.toFloat() }","completion":"val x2 = foo<(unresolved) -> Float> { it -> it.toFloat() }<|endoftext|>"} {"prompt":"expectedReturnType: ConeKotlinType?,\n isPassedAsFunctionArgument: Boolean,\n returnExpressions: Collection,\n): ConeKotlinType {\n val expandedExpectedReturnType = expectedReturnType?.fullyExpandedType(session)\n val unitType = session.builtinTypes.unitType.type\n if (isLambda) {","completion":"if (expandedExpectedReturnType?.isUnitOrFlexibleUnit == true) {\n \/\/ If the expected type is Unit or flexible Unit, always infer the lambda's type to Unit.\n \/\/ If a return statement in a lambda has a different type, RETURN_TYPE_MISMATCH will be reported for that return statement\n \/\/ by FirFunctionReturnTypeMismatchChecker.\n \/\/\n \/\/ For example:<|endoftext|>"} {"prompt":"assertEquals(listOf(0..2, 4..3, 5..7), \"abc--def\".rangesDelimitedBy('-').toList())\n assertEquals(listOf(0..2, 5..7, 9..10), \"abc--def-xy\".rangesDelimitedBy(\"--\", \"-\").toList())","completion":"assertEquals(listOf(0..2, 7..9, 14..16), \"123
456
789\".rangesDelimitedBy(\"
\", ignoreCase = true).toList())\n assertEquals(listOf(2..2, 4..6), \"a=b=c=d\".rangesDelimitedBy(\"=\", startIndex = 2, limit = 2).toList())<|endoftext|>"} {"prompt":"fun testRelocatablePluginClasspath() {\n initProject(LibraryDependency.JVM_FULL_RUNTIME)\n\n \/\/create lib\n val libraryName = \"module1-1.0-SNAPSHOT\"\n val libraryJar = MockLibraryUtilExt.compileJvmLibraryToJar(workDir.resolve(\"non-existent-folder\").absolutePath, libraryName)","completion":"val module1Lib = this.workDir.resolve(\"lib\").resolve(\"$libraryName.jar\")\n Files.createDirectories(module1Lib.parentFile.toPath())\n Files.copy(libraryJar.toPath(), module1Lib.toPath(), StandardCopyOption.REPLACE_EXISTING)\n assert(module1Lib.exists())\n\n \/\/ Add facet<|endoftext|>"} {"prompt":"with(analysisSession) { unsubstitutedKtSignature.substitute(substitutor) },\n fir.dispatchReceiver?.toKtReceiverValue(),\n fir.extensionReceiver?.toKtReceiverValue()\n )\n } else {","completion":"KtPartiallyAppliedSymbol(unsubstitutedKtSignature, _dispatchReceiver = null, _extensionReceiver = null)\n }\n\n return when (fir) {\n is FirAnnotationCall -> {\n if (unsubstitutedKtSignature.symbol !is KtConstructorSymbol) return null<|endoftext|>"} {"prompt":"): FirSimpleFunctionBuilder {\n return FirSimpleFunctionBuilder().apply {\n moduleData = session.moduleData\n origin = FirDeclarationOrigin.Synthetic.FakeFunction\n this.symbol = symbol\n this.name = name\n status = FirDeclarationStatusImpl(Visibilities.Public, Modality.FINAL)\n returnTypeRef = returnType","completion":"resolvePhase = FirResolvePhase.BODY_RESOLVE\n }\n }\n\n private fun FirResolvedTypeRef.toValueParameter(\n nameAsString: String, functionSymbol: FirFunctionSymbol<*>, isVararg: Boolean = false\n ): FirValueParameter {\n val name = Name.identifier(nameAsString)\n return buildValueParameter {<|endoftext|>"} {"prompt":"val result = resolveUserTypeToSymbol(typeRef, scopeClassDeclaration, useSiteFile, supertypeSupplier, resolveDeprecations)\n val resolvedType = resolveUserType(\n typeRef,\n result,\n areBareTypesAllowed,\n scopeClassDeclaration.topContainer ?: scopeClassDeclaration.containingDeclarations.lastOrNull(),\n isOperandOfIsOperator,\n )","completion":"FirTypeResolutionResult(resolvedType, (result as? TypeResolutionResult.Resolved)?.typeCandidate?.diagnostic)\n }\n is FirFunctionTypeRef -> createFunctionType(typeRef)\n is FirDynamicTypeRef -> {\n val attributes = typeRef.annotations.computeTypeAttributes(\n session,\n shouldExpandTypeAliases = true\n )<|endoftext|>"} {"prompt":"@file:Suppress(\"UNRESOLVED_REFERENCE\", \"ANNOTATION_ARGUMENT_MUST_BE_CONST\", \"NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION\", \"UNSUPPORTED_FEATURE\")\nimport java.util.Calendar\nimport kotlin.reflect.KClass\n\ntypealias Coocoo = ABC","completion":"typealias Coocoo2 = ABC\ntypealias Coocoo3 = ABC\n\ntypealias Nested1 = ABC\ntypealias Nested2 = Nested1\n\n@Anno(Blah::class, arrayOf(NoFoo1::class, NoBar1::class), [NoFoo2::class, String::class], Boolean::class, NoBar3::class)<|endoftext|>"} {"prompt":"toolRunner.run(buildFirstStageArgs(intermediateKlib))\n logger.info(\"Start second stage\")\n toolRunner.run(buildSecondStageArgs(intermediateKlib))\n } else {\n toolRunner.run(buildSingleStageArgs())\n }\n }\n}","completion":"abstract class KonanCompileNativeBinary @Inject constructor(layout: ProjectLayout) : KonanCompileTask(layout) {\n @Input\n override var enableTwoStageCompilation: Boolean = false\n}\n\nabstract class KonanCompileProgramTask @Inject constructor(layout: ProjectLayout): KonanCompileNativeBinary(layout) {<|endoftext|>"} {"prompt":"\/\/ MODULE: lib\n\/\/ FILE: A.kt\n\/\/ VERSION: 1\n\nopen class X {\n fun foo(): String = \"final method\"\n val bar: String = \"final property\"\n}\n\nclass Y: X()\n\n\/\/ FILE: B.kt\n\/\/ VERSION: 2\n\nopen class X {\n open fun foo(): String = \"open method\"\n open val bar: String = \"open property\"\n}","completion":"class Y: X() {\n override fun foo(): String = \"derived method\"\n override val bar: String = \"derived property\"\n}\n\n\/\/ MODULE: mainLib(lib)\n\/\/ FILE: mainLib.kt\n\nclass Z: X() \n\nfun lib(): String = when {\n X().foo() != \"open method\" -> \"fail 1\"<|endoftext|>"} {"prompt":"\/\/ As far as protected members can't be accessed outside of the class hierarchy, we need special accessors.\n fun protectedToPublicOverriddenFunctionAccess() = protectedToPublicOverriddenFunction()\n fun protectedToInternalOverriddenFunctionAccess() = protectedToInternalOverriddenFunction()\n fun protectedToInternalPAOverriddenFunctionAccess() = protectedToInternalPAOverriddenFunction()","completion":"fun protectedToPrivateOverriddenFunctionAccess() = protectedToPrivateOverriddenFunction()\n\n \/\/ Functions that accedentally start to override\/conflict with functions added to Container since version v2:\n public fun newPublicFunction() = \"ContainerImpl.newPublicFunction\"\n public fun newOpenPublicFunction() = \"ContainerImpl.newOpenPublicFunction\"\n protected fun newProtectedFunction() = \"ContainerImpl.newProtectedFunction\"<|endoftext|>"} {"prompt":"@Test fun maxValueToMinValue() {\n doTest(MaxI..MinI, MaxI, MinI, 1, listOf())\n doTest(MaxB..MinB, MaxB.toInt(), MinB.toInt(), 1, listOf())\n doTest(MaxS..MinS, MaxS.toInt(), MinS.toInt(), 1, listOf())","completion":"doTest(MaxL..MinL, MaxL, MinL, 1L, listOf())\n\n doTest(MaxC..MinC, MaxC, MinC, 1, listOf())\n\n doTest(MaxUI..MinUI, MaxUI, MinUI, 1, listOf())\n doTest(MaxUL..MinUL, MaxUL, MinUL, 1L, listOf())\n }<|endoftext|>"} {"prompt":"\/\/ and not enter it later even though we explicitly depend on it in D's module-info\n val a = module(\"moduleA\")\n val b = module(\"moduleB\", listOf(a))\n val c = module(\"moduleC\", listOf(a, b))\n module(\"moduleD\", listOf(c, b, a))\n }","completion":"fun testInheritedDeclarationFromTwiceTransitiveDependency() {\n \/\/ module A <-t- module B <-t- module C <--- module D\n\n \/\/ Java: class A { String ok() { \/* ... *\/ } }\n val a = module(\"moduleA\")\n\n \/\/ Java: class B extends A\n val b = module(\"moduleB\", listOf(a))<|endoftext|>"} {"prompt":"private open fun self() : D = this\n}\n\nclass E : D() {\n internal override fun self() = this\n\n fun test() {\n val s : E = self()\n }","completion":"}\n\n\/\/------------\nopen class F {\n protected open fun protected_fun() {}\n}\n\nclass G : F() {\n override fun protected_fun() {}\n}\n\nfun test_fun_stays_protected(g: G) {\n g.protected_fun()\n}\n\n\/\/------------\nopen class H {<|endoftext|>"} {"prompt":"fun testVarArgs() {\n doTest(\"annotationArguments\/varargs.kt\")\n }\n\n fun testSourceRetainedAnnotation() {\n doTest(\"sourceRetainedAnnotation.kt\")\n }\n\n fun testBinaryRetainedAnnotation() {\n doTest(\"binaryRetainedAnnotation.kt\")\n }\n\n fun testPropertyAccessorAnnotations() {","completion":"doTest(\"propertyAccessorAnnotations.kt\")\n }\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.commonizer.mergedtree\n\nimport org.jetbrains.kotlin.commonizer.TargetDependent\nimport org.jetbrains.kotlin.commonizer.cir.CirEntityId\nimport org.jetbrains.kotlin.commonizer.utils.CommonizerMap\n\nclass CirKnownClassifiers(","completion":"val classifierIndices: TargetDependent,\n val targetDependencies: TargetDependent,\n val commonizedNodes: CirCommonizedClassifierNodes,\n val commonDependencies: CirProvidedClassifiers,\n val associatedIdsResolver: AssociatedClassifierIdsResolver =<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/KT-580 Type inference failed\n\npackage whats.the.difference\n\nimport java.util.*\n\nfun iarray(vararg a : String) = a \/\/ BUG\n\nfun main() {\n val vals = iarray(\"789\", \"678\", \"567\")\n val diffs = ArrayList()\n for (i in vals.indices) {","completion":"for (j in i..vals.lastIndex()) \/\/ Type inference failed\n diffs.add(vals[i].length - vals[j].length)\n for (j in i..vals.lastIndex) \/\/ Type inference failed\n diffs.add(vals[i].length - vals[j].length)\n }\n}\n\nfun Array.lastIndex() = size - 1<|endoftext|>"} {"prompt":"public fun <@OnlyInputTypes T> assertContentEquals(expected: Set?, actual: Set?, message: String? = null): Unit =\n assertContentEquals(expected, actual?.asIterable(), message)\n\n\/**\n * Asserts that the [expected] sequence is *structurally* equal to the [actual] sequence, with an optional [message].\n *","completion":"* Two sequences are considered structurally equal if they have the same size,\n * and elements at corresponding positions, following the iteration order, are equal.\n * Elements are compared for equality using the [equals][Any.equals] function.\n * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n *<|endoftext|>"} {"prompt":"\/\/ library.kt:21 box: m:int=1:int, $i$f$foo\\8\\45:int=0:int, fooVar\\8:int=100:int, x1Var\\9:int=1:int, $i$f$x1\\9\\127:int=0:int, y1\\9:int=1:int, x3Var\\11:int=3:int,","completion":"$i$f$x3\\11\\134:int=0:int<|endoftext|>"} {"prompt":"existingAnnotation.annotationTypeRef.coneType,\n classSymbol.defaultType(),\n this\n )\n }\n }\n }\n }\n\n private fun FirAnnotation.hasSameArguments(other: FirAnnotation, session: FirSession): Boolean {\n val m1 = argumentMapping.mapping\n val m2 = other.argumentMapping.mapping","completion":"if (m1.keys != m2.keys) return false\n for ((key, v1) in m1) {\n val v2 = m2.getValue(key)\n if (!v1.isEqualTo(v2, session)) return false\n }\n return true\n }\n\n private fun FirExpression.isEqualTo(other: FirExpression, session: FirSession): Boolean {<|endoftext|>"} {"prompt":"setObjCExportTypeInfo(irClass, typeAdapter = typeAdapter)\n } else {\n \/\/ Optimization: avoid generating huge initializers;\n \/\/ handled with \"Kotlin_ObjCExport_initTypeAdapters\" below.\n }\n }\n }\n\n fun emitSortedAdapters(nameToAdapter: Map, prefix: String) {","completion":"val sortedAdapters = nameToAdapter.toList().sortedBy { it.first }.map {\n it.second\n }\n\n if (sortedAdapters.isNotEmpty()) {\n val type = sortedAdapters.first().llvmType\n val sortedAdaptersPointer = staticData.placeGlobalConstArray(\"\", type, sortedAdapters)<|endoftext|>"} {"prompt":"return path.hashCode() xor id\n }\n\n override fun equals(other: Any?): Boolean {\n return other is KotlinSourceFile && other.path == path && other.id == id\n }\n\n \/\/ for debugging purposes only\n override fun toString(): String = \"${File(path).name}${if (id != 0) \".$id\" else \"\"}\"\n\n companion object {","completion":"fun fromProtoStream(input: CodedInputStream): KotlinSourceFile {\n val path = input.readString()\n val fileIndex = input.readInt32()\n return KotlinSourceFile(path, fileIndex)\n }\n\n \/**\n * Source file paths in one module may clash;\n * for example, common and platform parts of the module could have files with the same root paths.<|endoftext|>"} {"prompt":"at DefaultJsAsserter.failWithMessage_0 (\/Users\/user\/repos\/check-kotlin-js-test\/build\/js\/packages_imported\/kotlin-test\/1.3.0-SNAPSHOT\/src\/main\/kotlin\/kotlin\/test\/DefaultJsAsserter.kt:80:18 <-","completion":"\/Users\/user\/repos\/check-kotlin-js-test\/build\/js\/packages\/check-kotlin-js-test-test\/adapter.js:1569:13)<|endoftext|>"} {"prompt":"}\n }\n for (child in stub.childrenStubs) {\n builder.append(\"\\n\").append(\" \".repeat(level))\n extractAdditionInfo(child, builder, level + 1)\n }\n}\n\nprivate fun appendFlexibleTypeInfo(builder: StringBuilder, typeBean: KotlinTypeBean) {\n when (typeBean) {","completion":"is KotlinClassTypeBean -> {\n builder.append(typeBean.classId.asFqNameString())\n val arguments = typeBean.arguments\n if (arguments.isNotEmpty()) {\n builder.append(\"<\")\n arguments.forEachIndexed { index, arg ->\n if (index > 0) builder.append(\", \")<|endoftext|>"} {"prompt":"JvmKt.foo(-1);\n JvmKt.foo(5, 5);\n return \"OK\";\n }\n}\n\n\/\/ FILE: jvm.kt\n\nimport kotlin.test.assertEquals\n\n@JvmOverloads\nactual fun foo(j: Int, i: Int) {\n assertEquals(j, i)\n}\n\nfun box(): String {","completion":"foo(-1)\n foo(5, 5)\n return J.test();\n}<|endoftext|>"} {"prompt":"if (name == INVOKE_SUSPEND_METHOD_NAME && desc == \"(Ljava\/lang\/Object;)Ljava\/lang\/Object;\") {\n return null\n }\n\n return object : MethodNode(Opcodes.API_VERSION, access, name, desc, signature, exceptions) {","completion":"override fun visitMethodInsn(opcode: Int, owner: String, name: String, desc: String, itf: Boolean) {\n val methodCall = MethodInfo(owner, name, desc)\n if (inlinedMethods.contains(methodCall)) {\n val fromCall = MethodInfo(className, this.name, this.desc)\n\n \/\/skip delegation to interface DefaultImpls from child class<|endoftext|>"} {"prompt":"}\n\n @OptIn(SymbolInternals::class)\n private fun createJsPlainObjectsFunction(\n callableId: CallableId,\n parent: FirClassSymbol<*>,\n jsPlainObjectInterface: FirRegularClassSymbol,\n getParameterDefaultValueFromProperty: FirPropertySymbol.() -> FirExpression?\n ): FirSimpleFunction {","completion":"val jsPlainObjectProperties = session.jsPlainObjectPropertiesProvider.getJsPlainObjectsPropertiesForClass(jsPlainObjectInterface)\n\n val functionTarget = FirFunctionTarget(null, isLambda = false)\n val jsPlainObjectInterfaceDefaultType = jsPlainObjectInterface.defaultType()\n\n return buildSimpleFunction {\n moduleData = jsPlainObjectInterface.moduleData<|endoftext|>"} {"prompt":"selectorCall = receiverInfo.selectorCall\n )\n\n addResolvedKtPrimitive(resolvedAtom)\n } else {\n var convertedTypeAfterSubtyping: UnwrappedType? = null\n csBuilder.runTransaction {\n val resolvedAtom = resolveKtPrimitive(\n csBuilder,\n argument,\n expectedType,\n this@resolveKotlinArgument,","completion":"receiverInfo,\n convertedArgument?.unknownIntegerType?.unwrap(),\n inferenceSession\n )\n\n if (!hasContradiction) {\n addResolvedKtPrimitive(resolvedAtom)\n return@runTransaction true\n }\n\n convertedTypeAfterSubtyping =\n TypeConversions.performCompositeConversionAfterSubtyping(<|endoftext|>"} {"prompt":"fun concatNFloat(x: T?) = \"[[$x]]\"\nfun concatNDouble(x: T?) = \"[[$x]]\"\n\nfun box(): String {\n assertEquals(\"[[true]]\", concatNBoolean(true))\n assertEquals(\"[[0]]\", concatNByte(0.toByte()))","completion":"assertEquals(\"[[1]]\", concatNShort(1.toShort()))\n assertEquals(\"[[2]]\", concatNInt(2))\n assertEquals(\"[[3]]\", concatNLong(3L))\n assertEquals(\"[[4.4]]\", concatNFloat(4.4f))<|endoftext|>"} {"prompt":"val javaLangReflectFieldSetAccessible: IrSimpleFunctionSymbol =\n javaLangReflectField.functionByName(\"setAccessible\")\n\n val javaLangReflectMethodSetAccessible: IrSimpleFunctionSymbol =\n javaLangReflectMethod.functionByName(\"setAccessible\")\n\n val javaLangReflectConstructorSetAccessible: IrSimpleFunctionSymbol =","completion":"javaLangReflectConstructor.functionByName(\"setAccessible\")\n\n val getDeclaredField: IrSimpleFunctionSymbol =\n context.ir.symbols.javaLangClass.functionByName(\"getDeclaredField\")\n\n val getDeclaredMethod: IrSimpleFunctionSymbol =\n context.ir.symbols.javaLangClass.functionByName(\"getDeclaredMethod\")<|endoftext|>"} {"prompt":"}\n\n class B {\n val a = 1\n\n companion object CO {\n fun bar(a: \/*p:foo p:foo.A p:foo.A.B p:foo.A.B.CO p:foo.A.Companion*\/Int) {}\n }\n }\n\n inner class C\n\n companion object {\n val a = 1\n fun baz() {}","completion":"}\n\n object O {\n var v = \"vvv\"\n }\n}\n\n\/*p:foo*\/interface I {\n var a: \/*p:foo p:foo.I*\/Int\n fun foo()\n\n class NI\n}\n\n\/*p:foo*\/object Obj : \/*p:foo*\/I {\n override var a = 1\n override fun foo() {}\n val b = 1<|endoftext|>"} {"prompt":"fun getInternalPackageFqn(classSimpleName: String): FqName =\n SerializationPackages.internalPackageFqName.child(Name.identifier(classSimpleName))\n\nfun ModuleDescriptor.getClassFromInternalSerializationPackage(classSimpleName: String) =\n requireNotNull(\n findClassAcrossModuleDependencies(\n ClassId(\n SerializationPackages.internalPackageFqName,","completion":"Name.identifier(classSimpleName)\n )\n )\n ) { \"Can't locate class $classSimpleName from package ${SerializationPackages.internalPackageFqName}\" }\n\nfun ModuleDescriptor.getClassFromSerializationDescriptorsPackage(classSimpleName: String) =\n requireNotNull(\n findClassAcrossModuleDependencies(\n ClassId(<|endoftext|>"} {"prompt":"generateSequence(this) { it.outerClassId }.drop(classesToDrop).firstOrNull()\n\n \/**\n * @return How many qualifiers needs to be dropped from [wholeType] to get [nestedType].\n *\n * Example: to get `foo.bar` from `foo.bar.Baz.Inner`, you need to drop 2 qualifiers (`Inner` and `Baz`).","completion":"*\/\n private fun countQualifiersToDrop(wholeType: KtUserType, nestedType: KtUserType): Int {\n val qualifierIndex = generateSequence(wholeType) { it.qualifier }.indexOf(nestedType)\n require(qualifierIndex != -1) { \"Whole type $wholeType should contain $nestedType, but it didn't\" }\n return qualifierIndex<|endoftext|>"} {"prompt":"abstract override val annotations: List\n abstract val classTypeRef: FirTypeRef\n\n override fun accept(visitor: FirVisitor, data: D): R =\n visitor.visitClassReferenceExpression(this, data)\n\n @Suppress(\"UNCHECKED_CAST\")","completion":"override fun transform(transformer: FirTransformer, data: D): E =\n transformer.transformClassReferenceExpression(this, data) as E\n\n abstract override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?)\n\n abstract override fun replaceAnnotations(newAnnotations: List)<|endoftext|>"} {"prompt":"\/\/ MODULE: context\n\n\/\/ FILE: lib.kt\npackage lib\n\n@Target(AnnotationTarget.FUNCTION)\nannotation class Anno(val x: String = \"foo\")\n\n\/\/ FILE: context.kt\nimport lib.Anno\n\n@Anno\nfun foo(): Int = 5\n\n@Anno(x = \"bar\")\nfun bar(): Int = 10\n\nfun test() {","completion":"val x = 0\n}\n\n\n\/\/ MODULE: main\n\/\/ MODULE_KIND: CodeFragment\n\/\/ CONTEXT_MODULE: context\n\n\/\/ FILE: fragment.kt\n\/\/ CODE_FRAGMENT_KIND: EXPRESSION\nfoo() + bar()<|endoftext|>"} {"prompt":"transformResult(transformer, data)\n transformOtherChildren(transformer, data)\n return this\n }\n\n override fun transformCondition(transformer: FirTransformer, data: D): FirWhenBranchImpl {\n condition = condition.transform(transformer, data)\n return this\n }","completion":"override fun transformResult(transformer: FirTransformer, data: D): FirWhenBranchImpl {\n result = result.transform(transformer, data)\n return this\n }\n\n override fun transformOtherChildren(transformer: FirTransformer, data: D): FirWhenBranchImpl {\n return this\n }\n}<|endoftext|>"} {"prompt":"fun _>>, _> foo9(): Foo_>>","completion":"{<|endoftext|>"} {"prompt":"override val isContextReceiver: Boolean\n get() = true\n}\n\nclass ContextReceiverValueForCallable(\n boundSymbol: FirCallableSymbol<*>,\n type: ConeKotlinType,\n labelName: Name?,\n useSiteSession: FirSession,\n scopeSession: ScopeSession,\n mutable: Boolean = true,\n contextReceiverNumber: Int,","completion":") : ContextReceiverValue>(\n boundSymbol, type, labelName, useSiteSession, scopeSession, mutable, contextReceiverNumber\n) {\n override fun createSnapshot(keepMutable: Boolean): ContextReceiverValue> =<|endoftext|>"} {"prompt":"if (expr is JsNameRef && (expr.name?.let { tracker.isReferenceToRemovableCandidate(it) } ?: false)) return true\n\n val staticRef = name?.staticRef\n return staticRef != null && staticRef == expr && isFunctionReference(expr)\n }\n}","completion":"\/\/ For RHS of `var a = b;` checks whether *b* is a reference to a function or a closure instantiation, direct or indirect.\nprivate fun isFunctionReference(expr: JsExpression): Boolean {\n val qualifier = when (expr) {\n \/\/ `var tmp = foo(closure)`, where `foo` is a closure constructor.\n is JsInvocation -> expr.qualifier<|endoftext|>"} {"prompt":"publishingConfiguration.code()\n\n val components = publishingConfiguration\n .modules\n .mapValues { (_, module) -> project.createModulePublication(module) }\n\n val componentsWithExternals = publishingConfiguration\n .modules\n .filter { (_, module) -> module.includes.isNotEmpty() }\n .mapValues { (moduleName, module) ->","completion":"val mainComponent = components[moduleName] ?: error(\"Component with name $moduleName wasn't created\")\n val externalComponents = module.includes\n .map { components[it.name] ?: error(\"Component with name ${it.name} wasn't created\") }\n .toSet()\n ComponentWithExternalVariants(mainComponent, externalComponents)\n }<|endoftext|>"} {"prompt":"listOf(), listOf(File(\"compiler\/testData\/kotlinClassFinder\/nestedClass.kt\")), tmpdir, testRootDisposable, null\n )\n\n val environment = createEnvironment(tmpdir)\n val project = environment.project\n\n val classFinder = createClassFinder(project)\n\n val className = \"test.A.B.C\"","completion":"val classId = ClassId(FqName(\"test\"), FqName(\"A.B.C\"), isLocal = false)\n val found = classFinder.findClass(classId)\n assertNotNull(found, \"Class not found for $className\")\n\n val binaryClass = VirtualFileFinder.SERVICE.getInstance(project).findKotlinClass(found, JvmMetadataVersion.INSTANCE)<|endoftext|>"} {"prompt":"fun createErrorScope(kind: ErrorScopeKind, throwExceptions: Boolean, vararg formatParams: String): ErrorScope =\n if (throwExceptions) ThrowingScope(kind, *formatParams) else ErrorScope(kind, *formatParams)\n\n @JvmStatic\n fun createErrorType(kind: ErrorTypeKind, vararg formatParams: String): ErrorType =","completion":"createErrorTypeWithArguments(kind, emptyList(), *formatParams)\n\n fun createErrorType(kind: ErrorTypeKind, typeConstructor: TypeConstructor, vararg formatParams: String): ErrorType =\n createErrorTypeWithArguments(kind, emptyList(), typeConstructor, *formatParams)<|endoftext|>"} {"prompt":".replaceText(\"XCFramework(\\\"other\\\")\", \"XCFramework()\")\n\n buildAndFail(\"tasks\") {\n assertOutputContains(\"Cannot add task 'assembleSharedReleaseXCFramework' as a task with that name already exists.\")\n }\n }\n }\n\n @DisplayName(\"K\/N project with XCFramework, that contains frameworks with different names\")","completion":"@GradleTest\n fun shouldCheckConfigurationErrorForXCFrameworkWithDifferentFrameworksNames(gradleVersion: GradleVersion) {\n project(\"appleXCFramework\", gradleVersion) {\n subProject(\"shared\")\n .buildGradleKts\n .replaceFirst(\"baseName = \\\"shared\\\"\", \"baseName = \\\"awesome\\\"\")\n\n buildAndFail(\"tasks\") {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.util.DumpIrTreeOptions\nimport org.jetbrains.kotlin.ir.util.allOverridden\nimport org.jetbrains.kotlin.ir.util.dump\nimport org.jetbrains.kotlin.ir.util.dumpTreesFromLineNumber\nimport org.jetbrains.kotlin.name.ClassId","completion":"import org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.test.Constructor\nimport org.jetbrains.kotlin.test.backend.ir.IrBackendInput\nimport org.jetbrains.kotlin.test.directives.CodegenTestDirectives<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.psi.KtSimpleNameExpression\nimport org.jetbrains.org.objectweb.asm.Label\nimport org.jetbrains.org.objectweb.asm.Opcodes\nimport org.jetbrains.org.objectweb.asm.Type\nimport org.jetbrains.org.objectweb.asm.commons.InstructionAdapter","completion":"class InFloatingPointRangeLiteralExpressionGenerator(\n operatorReference: KtSimpleNameExpression,\n private val rangeLiteral: BoundedValue,\n private val comparisonGenerator: ComparisonGenerator,\n private val frameMap: FrameMap\n) : InExpressionGenerator {\n init {<|endoftext|>"} {"prompt":"\/\/ This file was generated automatically. See compiler\/fir\/tree\/tree-generator\/Readme.md.\n\/\/ DO NOT MODIFY IT MANUALLY.\n\npackage org.jetbrains.kotlin.fir.types\n\nimport org.jetbrains.kotlin.KtSourceElement\nimport org.jetbrains.kotlin.fir.FirElement","completion":"import org.jetbrains.kotlin.fir.expressions.FirAnnotation\nimport org.jetbrains.kotlin.fir.visitors.FirTransformer\nimport org.jetbrains.kotlin.fir.visitors.FirVisitor\n\n\/**<|endoftext|>"} {"prompt":"class EnumEntriesListTest {\n\n enum class EmptyEnum\n\n enum class NonEmptyEnum {\n A, B, C\n }\n\n @Test\n fun testCannotBeCasted() {\n val list = enumEntries(EmptyEnum::values)\n assertTrue { list !is MutableList<*> }\n }\n\n @Test","completion":"fun testForEmptyEnum() {\n val list = enumEntries(EmptyEnum::values)\n assertTrue(list.isEmpty())\n assertEquals(0, list.size)\n assertFalse { list is MutableList<*> }\n assertFailsWith { list[0] }<|endoftext|>"} {"prompt":"return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes","completion":"@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UShortArray.maxWith(comparator: Comparator): UShort? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))<|endoftext|>"} {"prompt":"val lexicalScope = context.trace.bindingContext[BindingContext.LEXICAL_SCOPE, kotlinCall.psiCall.callElement]\n val nearestScopeDescriptor = lexicalScope?.ownerDescriptor\n \/\/ Don't need to store lambda psi element if it can be accessed though unmarked `this`","completion":"nearestScopeDescriptor != null && nearestScopeDescriptor != (receiver as? ExtensionReceiver)?.declarationDescriptor\n }\n\n if (receiverType != newReceiverType) {\n val typeVariables = substitutionMap.map { it.key as NewTypeVariableConstructor }<|endoftext|>"} {"prompt":"UNDEFINED(Character.DIRECTIONALITY_UNDEFINED.toInt()),\n\n \/**\n * Strong bidirectional character type \"L\" in the Unicode specification.\n *\/\n LEFT_TO_RIGHT(Character.DIRECTIONALITY_LEFT_TO_RIGHT.toInt()),\n\n \/**\n * Strong bidirectional character type \"R\" in the Unicode specification.","completion":"*\/\n RIGHT_TO_LEFT(Character.DIRECTIONALITY_RIGHT_TO_LEFT.toInt()),\n\n \/**\n * Strong bidirectional character type \"AL\" in the Unicode specification.\n *\/\n RIGHT_TO_LEFT_ARABIC(Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC.toInt()),\n\n \/**<|endoftext|>"} {"prompt":"if (arg != null) {\n this.putValueArgument(it.index, arg)\n }\n }\n}\n\nval IrField.hasNonConstInitializer: Boolean\n get() = initializer?.expression.let { it != null && it !is IrConst<*> && it !is IrConstantValue }","completion":"fun IrExpression.isNullConst() = this is IrConst<*> && this.kind == IrConstKind.Null\n\nfun IrExpression.isTrueConst() = this is IrConst<*> && this.kind == IrConstKind.Boolean && this.value == true\n\nfun IrExpression.isFalseConst() = this is IrConst<*> && this.kind == IrConstKind.Boolean && this.value == false<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +UnrestrictedBuilderInference\n\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER -UNCHECKED_CAST -DEPRECATION -OPT_IN_IS_NOT_ENABLED -UNUSED_VARIABLE\n\/\/ WITH_STDLIB\n\n\/\/ FILE: Test.java\n\nclass Test {\n static T foo(T x) { return x; }","completion":"}\n\n\/\/ FILE: main.kt\nimport kotlin.experimental.ExperimentalTypeInference\n\n@OptIn(ExperimentalTypeInference::class)\nfun build(block: TestInterface.() -> Unit): R1 = TODO()\n\n@OptIn(ExperimentalTypeInference::class)<|endoftext|>"} {"prompt":"private fun List.item(): Item? =\n firstOrNull { it.name == \"ComposableTarget\" }?.let { Token(it.value) }\n ?: firstOrNull { it.name == \"ComposableOpenTarget\" }?.let { Open(it.value.toInt()) }\n\nval composable = listOf(Annotation(\"Composable\"))","completion":"val uiTarget = listOf(Annotation(\"ComposableTarget\", \"UI\"))\nval vectorTarget = listOf(Annotation(\"ComposableTarget\", \"Vector\"))\nfun composableLambda() = FunctionType(\"lambda\", annotations = composable)\nfun call(name: String, vararg args: Node) = Call(Ref(name), arguments = args.toList())<|endoftext|>"} {"prompt":"function is IrConstructor && function.constructedClass.isMultiFieldValueClass ->\n JvmLoweredDeclarationOrigin.STATIC_MULTI_FIELD_VALUE_CLASS_CONSTRUCTOR\n\n else -> replacementOrigin\n }\n name =\n if (function.isLocal && (function !is IrSimpleFunction || function.overriddenSymbols.isEmpty())) function.name","completion":"else InlineClassAbi.mangledNameFor(context, function, mangleReturnTypes = false, useOldMangleRules = false)\n }\n\n private fun makeAndAddGroupedValueParametersFrom(\n sourceFunction: IrFunction,\n includeDispatcherReceiver: Boolean,\n substitutionMap: Map,\n targetFunction: IrFunction,<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.wasm.test.tools\n\nimport org.jetbrains.kotlin.platform.wasm.BinaryenConfig\nimport org.jetbrains.kotlin.utils.addToStdlib.runIf\nimport java.io.File\nimport kotlin.test.fail\n\nsealed interface WasmOptimizer {","completion":"fun run(wasmInput: ByteArray, withText: Boolean = false): OptimizationResult\n\n data class OptimizationResult(val wasm: ByteArray, val wat: String?)\n\n object Binaryen : WasmOptimizer {\n private val binaryenPath = System.getProperty(\"binaryen.path\")\n\n override fun run(wasmInput: ByteArray, withText: Boolean): OptimizationResult {<|endoftext|>"} {"prompt":"val res1 = atomicIntArr.compareAndSet(2, 20, 222) \/\/ success\n assertTrue(res1 && atomicIntArr[2] == 222, \"compareAndSet: FAIL 1\")\n val res2 = atomicIntArr.compareAndSet(2, 222, 2222) \/\/ success","completion":"assertTrue(res2 && atomicIntArr[2] == 2222, \"compareAndSet: FAIL 2\")\n val res3 = atomicIntArr.compareAndSet(2, 223, 22222) \/\/ should fail\n assertTrue(!res3 && atomicIntArr[2] == 2222, \"compareAndSet: FAIL 3\")<|endoftext|>"} {"prompt":"* [shortenedReference] will be \"bar\" when we shorten:\n * ```\n * import my.package.foo as bar\n * ... my.package.foo ... \/\/ -> we can replace this with `bar`.\n * ```\n *\/\npublic data class QualifierToShortenInfo(\n val qualifierToShorten: SmartPsiElementPointer,","completion":"val shortenedReference: String?,\n)\n\n\/**\n * A class with a reference to [KtThisExpression] with a label qualifier ([KtThisExpression.labelQualifier]) that can be safely removed\n * without changing the semantics of the code.\n *\/\npublic data class ThisLabelToShortenInfo(\n val labelToShorten: SmartPsiElementPointer,\n)<|endoftext|>"} {"prompt":"description = \"\"\"Transform '(' and ')' in method names to some other character sequence.\nThis mode can BREAK BINARY COMPATIBILITY and should only be used as a workaround for\nproblems with parentheses in identifiers on certain platforms.\"\"\"\n )\n var sanitizeParentheses = false\n set(value) {\n checkFrozen()\n field = value\n }\n\n @Argument(","completion":"value = \"-Xfriend-paths\",\n valueDescription = \"\",\n description = \"Paths to output directories for friend modules (modules whose internals should be visible).\"\n )\n var friendPaths: Array? = null\n set(value) {\n checkFrozen()\n field = value\n }\n\n @Argument(<|endoftext|>"} {"prompt":"\"(a, b)\",\n \"\"\"\n @UnsafeNumber([\"a: kotlin.UInt\", \"b: kotlin.ULong\"])\n typealias X = UInt\n \"\"\".trimIndent()\n )\n }\n\n fun `test ULong and UByte - typealias`() {\n val result = commonize {\n outputTarget(\"(a, b)\")","completion":"setting(OptimisticNumberCommonizationEnabledKey, true)\n registerFakeStdlibIntegersDependency(\"(a, b)\")\n simpleSingleSourceTarget(\"a\", \"typealias X = ULong\")\n simpleSingleSourceTarget(\"b\", \"typealias X = UByte\")\n }\n\n result.assertCommonized(\n \"(a, b)\",\n \"\"\"<|endoftext|>"} {"prompt":"recordLambdasInvocations(trace, moduleDescriptor)\n recordResultInfo(trace, moduleDescriptor)\n }\n\n private fun ResolvedCall<*>.recordResultInfo(trace: BindingTrace, moduleDescriptor: ModuleDescriptor) {\n if (this !is NewResolvedCallImpl) return","completion":"val resultDFIfromES = effectSystem.getDataFlowInfoForFinishedCall(this, trace, moduleDescriptor)\n this.updateResultingDataFlowInfo(resultDFIfromES)\n }\n\n private fun ResolvedCall<*>.recordLambdasInvocations(trace: BindingTrace, moduleDescriptor: ModuleDescriptor) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.DescriptorUtils\nimport org.jetbrains.kotlin.resolve.DescriptorUtils.isEnumClass\nimport org.jetbrains.kotlin.resolve.DescriptorUtils.isEnumEntry\nimport org.jetbrains.kotlin.resolve.constants.CompileTimeConstant","completion":"import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator\nimport org.jetbrains.kotlin.resolve.descriptorUtil.classId\nimport org.jetbrains.kotlin.types.KotlinType\nimport org.jetbrains.kotlin.types.TypeUtils<|endoftext|>"} {"prompt":"get() = if (!shouldSaveDeserializationState) error(\"File deserialization state are not cached inside the instance because `shouldSaveDeserializationState` was set as `false`\") else field\n\n protected val moduleReversedFileIndex = hashMapOf()\n\n override val moduleDependencies by lazy {\n moduleDescriptor.allDependencyModules","completion":".filter { it != moduleDescriptor }\n .map { linker.resolveModuleDeserializer(it, null) }\n }\n\n override fun fileDeserializers(): Collection {\n return fileToDeserializerMap.values.filterNot { strategyResolver(it.file.fileEntry.name).onDemand }\n }<|endoftext|>"} {"prompt":"value class A(val x1: Any, val x2: Any) {\n var nonNullTest: Z\n get() = Z(global.x1 + this.x1 as UInt, global.x2 + this.x2 as Int)\n set(value) {\n global = Z(this.x1 as UInt + value.x1, this.x2 as Int + value.x2)\n }","completion":"var nullableTest: Z?\n get() = Z(global.x1 + this.x1 as UInt, global.x2 + this.x2 as Int)\n set(value) {\n global = Z(this.x1 as UInt + value!!.x1, this.x2 as Int + value!!.x2)\n }\n\n}\n\nfun box(): String {<|endoftext|>"} {"prompt":"\/\/ JsIrBuilder.buildCall(isCharSymbol).apply { dispatchReceiver = argument }\n\n private fun generateSuspendFunctionCheck(argument: IrExpression, toType: IrType): IrExpression {\n val arity = (toType.classifierOrFail.owner as IrClass).typeParameters.size - 1 \/\/ drop return type\n\n val irBuiltIns = context.irBuiltIns","completion":"return JsIrBuilder.buildCall(isSuspendFunctionSymbol, irBuiltIns.booleanType).apply {\n putValueArgument(0, argument)\n putValueArgument(1, JsIrBuilder.buildInt(irBuiltIns.intType, arity))\n }\n }\n\n private fun generateTypeOfCheck(argument: IrExpression, toType: IrType): IrExpression {<|endoftext|>"} {"prompt":"* 2. `unit` is a tail-call function.\n *\n * When `unit` is a not tail-call function, calling `resumeWith` on its continuation will resume `unit`,\n * it will hit { GETSTATIC Unit; ARETURN } and this Unit will be the result of the suspend call. `unit`'s continuation will then call","completion":"* `main` continuation's `resumeWith`, passing the Unit instance. The continuation in turn will resume `main` and the Unit will be\n * the result of `unit()` call. This result will then printed.\n *\n * However, when `unit` is a tail-call function, there is no continuation, generated for it. This is the point of tail-call<|endoftext|>"} {"prompt":"x.prop_8\n x.prop_8.prop_8\n x.prop_8.prop_8.prop_8","completion":"x.prop_8.prop_8.prop_8.prop_8\n }\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun case_2(x: Class?) {\n if (x?.prop_8?.prop_8?.prop_8?.prop_8 !== null) {<|endoftext|>"} {"prompt":"\/* Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *","completion":"* http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\/<|endoftext|>"} {"prompt":"return@Predicate fqName.isRoot || fqName.pathSegments().first() in packagesNames\n }\n\n if (checkTypeEnabled && descriptor.name in NAMES_OF_CHECK_TYPE_HELPER) return@Predicate false\n\n true\n }\n\n return RECURSIVE.filterRecursion(stepIntoFilter)","completion":".withValidationStrategy(DescriptorValidator.ValidationVisitor.errorTypesAllowed())\n .checkFunctionContracts(true)\n }\n\n private fun getTopLevelPackagesFromFileList(files: List): Set =\n files.mapTo(LinkedHashSet()) { file -><|endoftext|>"} {"prompt":"rootCause.causingTypes,\n rootCause.kind,\n isError = rootCause.isError\n )\n\n is AdaptedCallableReferenceIsUsedWithReflection -> FirErrors.ADAPTED_CALLABLE_REFERENCE_AGAINST_REFLECTION_TYPE.createOn(\n qualifiedAccessSource\n )\n\n \/\/ Reported later\n is TypeParameterAsExpression -> null","completion":"is AmbiguousInterceptedSymbol -> FirErrors.PLUGIN_AMBIGUOUS_INTERCEPTED_SYMBOL.createOn(source, rootCause.pluginNames)\n\n is MissingInnerClassConstructorReceiver -> FirErrors.INNER_CLASS_CONSTRUCTOR_NO_RECEIVER.createOn(\n qualifiedAccessSource ?: source,\n rootCause.candidateSymbol\n )<|endoftext|>"} {"prompt":")\n}\n\nprivate fun linkAllDependencies(generationState: NativeGenerationState, generatedBitcodeFiles: List) {\n val (runtimeModules, additionalModules) = collectLlvmModules(generationState, generatedBitcodeFiles)\n \/\/ TODO: Possibly slow, maybe to a separate phase?","completion":"val optimizedRuntimeModules = RuntimeLinkageStrategy.pick(generationState, runtimeModules).run()\n\n \/\/ When the main module `generationState.llvmModule` is very large it is much faster to\n \/\/ link all the auxiliary modules together first before linking with the main module.\n val linkedModules = (optimizedRuntimeModules + additionalModules).reduceOrNull { acc, module -><|endoftext|>"} {"prompt":"@DisplayName(\"Should ignore if verification mode is 'ignore' and kotlin and java targets are different\")\n @GradleTest\n internal fun shouldNotPrintAnythingIfJavaAndKotlinJvmTargetsAreDifferent(\n gradleVersion: GradleVersion\n ) {\n project(\n projectName = \"kotlinJavaProject\".fullProjectName,\n gradleVersion = gradleVersion\n ) {","completion":"setJavaCompilationCompatibility(JavaVersion.VERSION_1_8)\n useToolchainToCompile(11)\n \/\/language=properties\n gradleProperties.append(\n \"\"\"\n # suppress inspection \"UnusedProperty\"\n kotlin.jvm.target.validation.mode = ignore\n \"\"\".trimIndent()\n )\n\n build(\"assemble\") {<|endoftext|>"} {"prompt":"if (node.tokenType == KtNodeTypes.LABEL_QUALIFIER) {\n return super.mark(node, startOffset, endOffset - 1, tree)\n }\n if (node.tokenType == KtNodeTypes.PACKAGE_DIRECTIVE) {\n val referenceExpression = tree.findLastDescendant(node) {","completion":"it.tokenType == KtNodeTypes.REFERENCE_EXPRESSION\n }\n if (referenceExpression != null) {\n return markElement(referenceExpression, startOffset, endOffset, tree, node)\n }\n }\n return DEFAULT.mark(node, startOffset, endOffset, tree)\n }\n }<|endoftext|>"} {"prompt":"wrapper.read()\n }\n }\n\n @Test\n fun incorrectPadding() {\n for (base64 in listOf(Base64, Base64.Mime)) {\n val inputStream = \"Zm9vZm=9v\".byteInputStream()\n val wrapper = inputStream.decodingWith(base64)\n\n wrapper.use {","completion":"assertEquals('f'.code, it.read())\n assertEquals('o'.code, it.read())\n assertEquals('o'.code, it.read())\n\n \/\/ the second group is incorrectly padded\n assertFailsWith {\n it.read()\n }\n }\n\n \/\/ closed\n assertFailsWith {\n wrapper.read()<|endoftext|>"} {"prompt":"val loadedInProjects = multipleProjectsHolder.getAffectedProjects(project, kotlinPluginVersion)!!\n if (PropertiesProvider(project).ignorePluginLoadedInMultipleProjects != true) {\n project.logger.warn(\"\\n$MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING\")\n project.logger.warn(","completion":"MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_WARNING + loadedInProjects.joinToString(limit = 4) { \"'$it'\" }\n )\n }\n project.logger.info(\n \"$MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_INFO: \" +<|endoftext|>"} {"prompt":"testR1xE1()\n testR1xE2()\n testR1xE3()\n testR1xE4()\n return \"OK\"\n}\n\nfun testR0xE0() {\n \/\/ with possible local optimizations\n if (0u in 1u..<3u != range0.contains(0u)) throw AssertionError()","completion":"if (0u !in 1u..<3u != !range0.contains(0u)) throw AssertionError()\n if (!(0u in 1u..<3u) != !range0.contains(0u)) throw AssertionError()\n if (!(0u !in 1u..<3u) != range0.contains(0u)) throw AssertionError()<|endoftext|>"} {"prompt":"public inline fun UIntArray.reversedArray(): UIntArray {\n return UIntArray(storage.reversedArray())\n}\n\n\/**\n * Returns an array with elements of this array in reversed order.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reversedArray(): ULongArray {","completion":"return ULongArray(storage.reversedArray())\n}\n\n\/**\n * Returns an array with elements of this array in reversed order.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reversedArray(): UByteArray {\n return UByteArray(storage.reversedArray())\n}\n\n\/**<|endoftext|>"} {"prompt":"return desc == Type.getMethodDescriptor(ownerType, *multiFieldValueClassUnboxInfo.unboxedTypes.toTypedArray())\n}\n\nprivate fun MethodInsnNode.isInlineClassUnboxingMethodDescriptor(state: GenerationState): Boolean {\n if (name != KotlinTypeMapper.UNBOX_JVM_METHOD_NAME) return false","completion":"val ownerType = Type.getObjectType(owner)\n val unboxedType = unboxedTypeOfInlineClass(ownerType, state) ?: return false\n return desc == Type.getMethodDescriptor(unboxedType)\n}\n\nprivate fun MethodInsnNode.isMultiFieldValueClassUnboxingMethodDescriptor(state: GenerationState): Boolean {<|endoftext|>"} {"prompt":"class Example {\n infix fun e8(s: String, a: Int = 0) {}\n infix fun e9(s: String, a: Int) {}","completion":"infix fun e10() {}\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.kotlinp.jvm.test\n\nimport com.intellij.openapi.Disposable\nimport com.intellij.openapi.util.Disposer\nimport org.jetbrains.kotlin.test.util.KtTestUtil\nimport org.junit.Test\nimport org.junit.runner.RunWith","completion":"import org.junit.runners.Parameterized\nimport java.io.File\n\n@RunWith(Parameterized::class)\nclass KotlinpCompilerTestDataTest(private val file: File) {\n private class TestDisposable : Disposable {\n override fun dispose() {}\n }\n\n @Test\n fun doTest() {<|endoftext|>"} {"prompt":"internal fun ReflectionState.asProxy(callInterceptor: CallInterceptor): ReflectionProxy {\n return when (this) {\n is KPropertyState -> when {\n this.isKMutableProperty0() -> KMutableProperty0Proxy(this, callInterceptor)\n this.isKProperty0() -> KProperty0Proxy(this, callInterceptor)","completion":"this.isKMutableProperty1() -> KMutableProperty1Proxy(this, callInterceptor)\n this.isKProperty1() -> KProperty1Proxy(this, callInterceptor)\n this.isKMutableProperty2() -> KMutableProperty2Proxy(this, callInterceptor)\n this.isKProperty2() -> KProperty2Proxy(this, callInterceptor)\n else -> TODO()\n }<|endoftext|>"} {"prompt":"\/\/ test.kt:71 $N.\n\/\/ test.kt:67 $N. (16, 8)\n\/\/ test.kt:68 $N.\n\/\/ test.kt:16 $box (4, 6, 6, 6, 6, 4, 4)\n\/\/ test.kt:73 $O. (16, 16)","completion":"\/\/ test.kt:17 $box (4, 6, 9, 9, 9, 9, 4)\n\/\/ test.kt:74 $O. (36, 31)\n\/\/ test.kt:75 $O.\n\/\/ test.kt:18 $box<|endoftext|>"} {"prompt":"package one.two\n\nclass Foo\n\nfun Foo.ext() {}\n\n\/**\n * [one.two.ext]\n * [one.two.ext]\n *\n * [Foo.ext]\n * [one.two.Foo.ext]\n *","completion":"* [one.two.Foo.ext]\n * [one.two.Foo.ext]\n *\/\nfun usage() {}<|endoftext|>"} {"prompt":"require(args.size == 2) { \"The call to ${callSite.symbol.owner.name.asString()} expects 2 value arguments.\" }\n val address = arrayGetElementAddress(callSite, args[0], args[1])","completion":"return loadSlot(callSite.llvmReturnType, address, isVar = true, resultSlot, memoryOrder = LLVMAtomicOrdering.LLVMAtomicOrderingSequentiallyConsistent)\n }\n\n private fun FunctionGenerationContext.transformArgsForAtomicArray(callSite: IrCall, args: List): List {<|endoftext|>"} {"prompt":"return Pair(first, second)\n}\n\n\/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n *\/","completion":"public inline fun LongArray.partition(predicate: (Long) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }<|endoftext|>"} {"prompt":"package org.jetbrains.benchmarksLauncher\n\nimport org.jetbrains.report.BenchmarkResult\n\ninterface AbstractBenchmarkEntry {\n open val useAutoEvaluatedNumberOfMeasure: Boolean\n}\n\nopen class BenchmarkEntryWithInit(val ctor: ()->Any, val lambda: (Any) -> Any?): AbstractBenchmarkEntry {\n companion object {","completion":"inline fun create(noinline ctor: ()->T, crossinline lambda: T.() -> Any?) = BenchmarkEntryWithInit(ctor) { (it as T).lambda() }\n }\n\n override val useAutoEvaluatedNumberOfMeasure: Boolean = true\n}<|endoftext|>"} {"prompt":"testR1xE15()\n testR1xE16()\n testR1xE17()\n testR1xE18()\n testR1xE19()\n testR1xE20()\n testR1xE21()\n testR1xE22()\n testR1xE23()\n testR2xE0()\n testR2xE1()","completion":"testR2xE2()\n testR2xE3()\n testR2xE4()\n testR2xE5()\n testR2xE6()\n testR2xE7()\n testR2xE8()\n testR2xE9()\n testR2xE10()\n testR2xE11()\n testR2xE12()<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\n\/\/ MODULE: a\n\/\/ FILE: A.kt\n\n\/\/class FirstClass : SecondClass()\n\/\/\n\/\/open class SecondClass\n\nclass ConfigurationTarget(@ConfigField val target: String)\n\n@Retention(AnnotationRetention.RUNTIME)\nannotation class ConfigField()\n\n\/\/ MODULE: b\n\/\/ FILE: B.kt\n\n@Retention(AnnotationRetention.RUNTIME)","completion":"annotation class ConfigField()\n\nclass ConfigurationTarget(@ConfigField val target: String)<|endoftext|>"} {"prompt":"if (z != null) {\n `.`` & case_25.``.``?\"), DEBUG_INFO_SMARTCAST!>z.a","completion":"`.`` & case_25.``.``?\"), DEBUG_INFO_SMARTCAST!>z.a.equals(null)<|endoftext|>"} {"prompt":" & Out?\"), DEBUG_INFO_SMARTCAST!>x.propAny\n & Out?\")!>x.propNullableT","completion":" & Out?\")!>x.propNullableAny\n & Out?\"), DEBUG_INFO_SMARTCAST!>x.funT()<|endoftext|>"} {"prompt":"fun buildConstructorCall(\n target: IrConstructorSymbol,\n typeArguments: List? = null,\n constructorTypeArguments: List? = null,\n origin: IrStatementOrigin = JsStatementOrigins.SYNTHESIZED_STATEMENT\n ): IrConstructorCall {\n val owner = target.owner","completion":"val irClass = owner.parentAsClass\n\n return IrConstructorCallImpl(\n UNDEFINED_OFFSET,\n UNDEFINED_OFFSET,\n owner.returnType,\n target,\n typeArgumentsCount = irClass.typeParameters.size,\n constructorTypeArgumentsCount = owner.typeParameters.size,\n valueArgumentsCount = owner.valueParameters.size,<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\nvar capturedLambda: ((Int) -> Int)? = null\n\nfun captureLambda(): Boolean {\n val lambda = { x: Int -> x + 1 }\n if (capturedLambda == null) {\n capturedLambda = lambda\n } else if (capturedLambda !== lambda) {\n return false\n }\n return true\n}","completion":"fun box(): String {\n captureLambda()\n if (!captureLambda())\n return \"FAIL\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"assertEquals(\"${'a'.toChar()}\", ('a'.toChar() as Char?).toString(), \"char template failed\")\n\n for(b in 0..255) {\n assertEquals(\"${b.toByte()}\", (b.toByte() as Byte?).toString(), \"byte conversion failed\")\n }","completion":"assertEquals(23.21.myToString(), 23.21.toString(), \"23.21 failed\")\n\n assertEquals(Double.MIN_VALUE.myToString(), Double.MIN_VALUE.toString(), \"Double.MIN_VALUE failed\")\n assertEquals(Double.MAX_VALUE.myToString(), Double.MAX_VALUE.toString(), \"Double.MAX_VALUE failed\")<|endoftext|>"} {"prompt":"* which will be substituted with actual parameters used in the call being updated. The imports used in the file\n * containing the deprecated function or property are NOT accessible; if the replacement expression refers\n * on any of those imports, they need to be specified explicitly in the [imports] parameter.\n * @property imports the qualified names that need to be imported in order for the references in the\n * replacement expression to be resolved correctly.\n *\/","completion":"@Target()\n@Retention(BINARY)\n@MustBeDocumented\npublic annotation class ReplaceWith(val expression: String, vararg val imports: String)\n\n\/**\n * Possible levels of a deprecation. The level specifies how the deprecated element usages are reported in code.\n *\n * @see Deprecated\n *\/\npublic enum class DeprecationLevel {\n \/** Usage of the deprecated element will be reported as a warning. *\/<|endoftext|>"} {"prompt":"return doAnalyze(psiFile, importedScripts, codeLine.addNo(priority))\n }\n\n protected fun runAnalyzer(linePsi: KtFile, importedScripts: List): TopDownAnalysisContext {\n return topDownAnalyzer.analyzeDeclarations(topDownAnalysisContext.topDownAnalysisMode, listOf(linePsi) + importedScripts)\n }","completion":"private fun doAnalyze(linePsi: KtFile, importedScripts: List, codeLine: SourceCodeByReplLine): ReplLineAnalysisResult {\n scriptDeclarationFactory.setDelegateFactory(\n FileBasedDeclarationProviderFactory(resolveSession.storageManager, listOf(linePsi) + importedScripts)\n )\n replState.submitLine(linePsi)<|endoftext|>"} {"prompt":"return result\n}\n\n\/**\n * Create binary search for when that emit when expressions in leafs\n * when (a) {\n * 123 -> expr1\n * 456 -> expr2\n * else -> elseExpr\n * }\n * crates binary search linked to index of branch\n * BLOCK\n * IF (a < 456) {\n * IF (a == 123)\n * #expr1","completion":"* GOTO END BLOCK\n * END IF\n * ELSE\n * IF (1 == 456)\n * #expr2\n * GOTO END BLOCK\n * END IF\n * END IF\n * elseExpr\n * END BLOCK\n * }\n*\/\nprivate fun BodyGenerator.createBinaryTable(\n selectorLocal: WasmLocal,<|endoftext|>"} {"prompt":"val argumentType = mycType.arguments.single().type!!\n if (!argumentType.isMarkedNullable)\n return \"Fail on $fn: argument type should be seen as nullable\"\n\n val annotations = argumentType.annotations\n if (annotations.toString() != \"[@Anno(value=OK)]\")\n return \"Fail on $fn: $annotations\"\n }","completion":"return \"OK\"\n}<|endoftext|>"} {"prompt":"fun foo1(x: T?, y: Bar) {}\n fun foo2(x: K?, y: Bar) {}\n}\n\nfun foo14(x: K?, y: Bar) where K: Comparable, K: CharSequence {}","completion":"fun foo15(x: T, y: Bar) {}\nfun foo16(x: K, y: Bar) {}\nfun Bar.foo18(x: T) {}\n\nfun foo21(x: K?, y: Foo>>) {}<|endoftext|>"} {"prompt":"* companion object Key : AbstractCoroutineContextKey(BaseElement, { it as? DerivedElement })\n * }\n * \/\/ Now it is possible to query both `BaseElement` and `DerivedElement`\n * someContext[BaseElement] \/\/ Returns BaseElement?, non-null both for BaseElement and DerivedElement instances","completion":"* someContext[DerivedElement] \/\/ Returns DerivedElement?, non-null only for DerivedElement instance\n * ```\n * @param B base class of a polymorphic element\n * @param baseKey an instance of base key\n * @param E element type associated with the current key\n * @param safeCast a function that can safely cast abstract [CoroutineContext.Element] to the concrete [E] type<|endoftext|>"} {"prompt":"abstract fun run(method: KProperty0, fn: (T1) -> Boolean): String\n}\n\nfun box(): String {\n var result = ( object : Checker() {\n override fun run(method: KProperty0, fn: (T1) -> Boolean): String {\n return \"OK\"\n }\n } ).check()","completion":"return result\n}<|endoftext|>"} {"prompt":"override fun processHiddenParameters() {\n if (!DescriptorAsmUtil.isStaticMethod((sourceCompiler as PsiSourceCompilerForInline).context.contextKind, functionDescriptor)) {\n hiddenParameters += invocationParamBuilder.addNextParameter(methodOwner, false, actualDispatchReceiver) to\n codegen.frameMap.enterTemp(methodOwner)\n }","completion":"for (param in jvmSignature.valueParameters) {\n if (param.kind == JvmMethodParameterKind.VALUE) {\n break\n }\n hiddenParameters += invocationParamBuilder.addNextParameter(param.asmType, false) to\n codegen.frameMap.enterTemp(param.asmType)\n }\n \/\/ TODO: Add context receivers as hiddenParameters\n }<|endoftext|>"} {"prompt":"\/\/ Also, EnhancedTypeAnnotationDescriptor is not a \"real\" annotation descriptor, there's no corresponding ClassDescriptor, etc.\n if (extensions.enhancedNullability.hasEnhancedNullability(kotlinType)) {\n irAnnotations.addIfNotNull(extensions.generateEnhancedNullabilityAnnotationCall())\n }\n\n if (flexibleType.isNullabilityFlexible()) {","completion":"irAnnotations.addIfNotNull(extensions.generateFlexibleNullabilityAnnotationCall())\n }\n if (flexibleType.isMutabilityFlexible()) {\n irAnnotations.addIfNotNull(extensions.generateFlexibleMutabilityAnnotationCall())\n }\n\n if (flexibleType is RawType) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.scripting.resolve.KotlinScriptDefinitionFromAnnotatedTemplate\nimport org.jetbrains.kotlin.test.ConfigurationKind\nimport org.jetbrains.kotlin.test.KotlinTestUtils\nimport org.jetbrains.kotlin.test.TestJdkKind","completion":"import org.jetbrains.kotlin.test.util.KtTestUtil\nimport org.jetbrains.org.objectweb.asm.Opcodes\nimport java.io.File\nimport kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration\nimport kotlin.script.templates.ScriptTemplateDefinition\n\nclass ScriptGenTest : CodegenTestCase() {\n companion object {<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.scopes\n\nimport org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration\nimport org.jetbrains.kotlin.fir.originalForSubstitutionOverride\nimport org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirIntersectionCallableSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol\nimport org.jetbrains.kotlin.name.Name<|endoftext|>"} {"prompt":"}\n\nfun foo() {\n @kotlin.jvm.JvmOverloads fun quux(s: String = \"OK\") {\n }\n\n class D {\n @kotlin.jvm.JvmOverloads fun foo(s: String = \"OK\") {\n }\n }","completion":"val x = object {\n @kotlin.jvm.JvmOverloads fun foo(s: String = \"OK\") {\n }\n }\n}<|endoftext|>"} {"prompt":"classPath.joinToString(File.pathSeparator, transform = { File(it.toURI()).absolutePath }),\n ) + mainClassAndArguments\n\n val process = ProcessBuilder(command).start()\n\n \/\/ Extract the chosen port from the output of the newly started java process.\n \/\/ The java process prints a line with the format:\n \/\/","completion":"\/\/ Listening for transport dt_socket at address: \n val port = process.inputStream.bufferedReader().readLine().split(\"address:\").last().trim().toInt()\n\n \/\/ Attach debugger to the separate java process, setup initial event requests,\n \/\/ and run the debugger loop to step through the program.\n val virtualMachine = attachDebugger(port)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.builtins.StandardNames\nimport org.jetbrains.kotlin.fir.*\nimport org.jetbrains.kotlin.fir.declarations.*\nimport org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty","completion":"import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor\nimport org.jetbrains.kotlin.fir.declarations.utils.isLocal\nimport org.jetbrains.kotlin.fir.resolve.providers.firProvider\nimport org.jetbrains.kotlin.fir.resolve.providers.symbolProvider<|endoftext|>"} {"prompt":"\/\/ |) or | - add an empty node.\n if (lexemes.lookBack == Lexer.CHAR_VERTICAL_BAR) {\n children.add(EmptySet(fSet))\n }\n\n \/\/ Restore flags.\n if (flags != savedFlags && !saveChangedFlags) {\n flags = savedFlags\n lexemes.restoreFlags(flags)\n }","completion":"when (ch) {\n Lexer.CHAR_NONCAP_GROUP -> return NonCapturingJointSet(children, fSet)\n Lexer.CHAR_POS_LOOKAHEAD -> return PositiveLookAheadSet(children, fSet)\n Lexer.CHAR_NEG_LOOKAHEAD -> return NegativeLookAheadSet(children, fSet)<|endoftext|>"} {"prompt":"override fun indexOf(element: T): Int {\n @Suppress(\"SENSELESS_COMPARISON\")\n if (element === null) return -1 \/\/ WA for JS IR bug\n \/\/ Check identity due to UnsafeVariance\n val ordinal = element.ordinal\n val target = entries.getOrNull(ordinal)\n return if (target === element) ordinal else -1\n }","completion":"override fun lastIndexOf(element: T): Int = indexOf(element)\n\n @Suppress(\"unused\")\n private fun writeReplace(): Any {\n \/\/ Used for Java serialization: EESP ensures that deserialized object **always** reflects the state of the enum on the target classpath\n return EnumEntriesSerializationProxy(entries)\n }\n}<|endoftext|>"} {"prompt":"val SVG_ZOOMANDPAN_DISABLE: Short\n val SVG_ZOOMANDPAN_MAGNIFY: Short\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short","completion":"val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short<|endoftext|>"} {"prompt":"if (w != null || this.w != null) this.w.funT()\n if (w != null || this.w != null) this.w.funAny()","completion":"if (w != null || this.w != null) this.w.funNullableT()\n if (w != null || this.w != null) this.w.funNullableAny()<|endoftext|>"} {"prompt":"x.length\n}\n\nfun test_2(foo: Foo, x: Any) {\n foo.assertIs(x)\n x.length\n}\n\nfun test_3(foo: Foo): Int {\n val x: Int\n foo.myRun {\n x = 1","completion":"}\n return x + 1\n}<|endoftext|>"} {"prompt":"if (!aptCache.updateCache(processors, failedToAnalyzeSources)) {\n javaCache.invalidateAll()\n return\n }\n \/\/ Compilation is fully incremental, record types defined in generated .class files\n processors.forEach { processor ->\n processor.getGeneratedClassFilesToTypes().forEach { (classFile, type) ->","completion":"val classFileStructure = ClassFileStructure(classFile.toURI(), type)\n javaCache.addSourceStructure(classFileStructure)\n }\n }\n }\n\n \/**\n * From set of changed sources, get list of files to recompile using structural information and dependency information from\n * annotation processing.\n *\/\n fun invalidateAndGetDirtyFiles(<|endoftext|>"} {"prompt":"wildcard(type) { argument ->\n assertEquals(emptyList(), argument.lowerBounds.toList())\n val bound = argument.upperBounds.singleOrNull() ?: fail(\"Type is not an extends-wildcard: $type (${type::class.java.name})\")\n block(bound)\n }\n }\n\n \/\/ ? super ...","completion":"private fun wildcardSuper(type: Type, block: (lowerBound: Type) -> Unit) {\n wildcard(type) { argument ->\n assertEquals(listOf(Any::class.java), argument.upperBounds.toList())\n val bound = argument.lowerBounds.singleOrNull() ?: fail(\"Type is not a super-wildcard: $type (${type::class.java.name})\")<|endoftext|>"} {"prompt":"\/* pio4 *\/ 7.85398163397448278999e-01, \/* 3FE921FB, 54442D18 *\/\n\/* pio4lo *\/ 3.06161699786838301793e-17 \/* 3C81A626, 33145C07 *\/\n)\nprivate val one = xxx[13]\nprivate val pio4 = xxx[14]","completion":"private val pio4lo = xxx[15]\nprivate val T = xxx\n\/* INDENT ON *\/\n\ninternal fun __kernel_tan(_x: Double, _y: Double, iy: Int): Double {\n var x: Double = _x\n var y: Double = _y\n var z: Double\n var r: Double\n var v: Double\n var w: Double\n var s: Double<|endoftext|>"} {"prompt":"* UNEXPECTED BEHAVIOUR\n * ISSUES: KT-28329\n *\/\nfun case_10(x: Any?) {\n if (!!(x !is Interface3) === true && true) else {\n x","completion":"x.itest()\n x.itest3()\n }\n}<|endoftext|>"} {"prompt":"}\n\n return ExitCode.OK\n }\n\n private fun prepareEnvironment(\n arguments: K2NativeCompilerArguments,\n configuration: CompilerConfiguration,\n rootDisposable: Disposable\n ): KotlinCoreEnvironment {\n val environment = KotlinCoreEnvironment.createForProduction(rootDisposable,\n configuration, EnvironmentConfigFiles.NATIVE_CONFIG_FILES)","completion":"configuration.put(CLIConfigurationKeys.FLEXIBLE_PHASE_CONFIG, createFlexiblePhaseConfig(arguments))\n\n \/* Set default version of metadata version *\/\n val metadataVersionString = arguments.metadataVersion\n if (metadataVersionString == null) {\n configuration.put(CommonConfigurationKeys.METADATA_VERSION, KlibMetadataVersion.INSTANCE)\n }<|endoftext|>"} {"prompt":"if (l.removeAt(0) != \"abc\") return \"fail 2\"\n\n val anyList: MutableList = a as MutableList\n if (anyList.removeAt(0) != \"abc\") return \"fail 3\"\n\n val container: Container = a\n if (container.removeAt(0) != \"abc\") return \"fail 4\"","completion":"return \"OK\"\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\nimport kotlin.test.assertEquals\n\nfun > sumIndices(c: T): Int {\n var sum = 0\n for (i in c.indices) {\n sum += i\n }\n return sum\n}\n\nfun box(): String {\n val list = listOf(0, 0, 0, 0)","completion":"val sum = sumIndices(list)\n assertEquals(6, sum)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"fun TestFunctionVsDelegatedPrimaryConstructorCall() {}\n\n class TestFunctionVsDelegatedPrimaryConstructorCallReverse constructor(placeholder: UserKlass) {\n constructor() : this(UserKlass())\n }\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun TestFunctionVsDelegatedPrimaryConstructorCallReverse() {}","completion":"open class SuperConstructorSource constructor(placeholder: UserKlass)\n\n class TestFunctionVsDelegatedSuperConstructorCall: SuperConstructorSource {\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor() : super(UserKlass())\n }\n fun TestFunctionVsDelegatedSuperConstructorCall() {}<|endoftext|>"} {"prompt":"container.findMethodBySignature(jvmSignature.methodName, jvmSignature.methodDesc) as Member?\n }\n is JavaMethod -> jvmSignature.method as Member\n is JavaConstructor -> jvmSignature.constructor as Member\n is FakeJavaAnnotationConstructor -> {\n val methods = jvmSignature.methods","completion":"return@caller AnnotationConstructorCaller(container.jClass, methods.map { it.name }, POSITIONAL_CALL, JAVA, methods)\n }\n }\n\n when (member) {\n is Constructor<*> ->\n createConstructorCaller(member, descriptor, false)\n is Method -> when {\n !Modifier.isStatic(member.modifiers) -><|endoftext|>"} {"prompt":"hashCode = 31 * hashCode + getArgument(i).hashCode(stringIndexes, fqNameIndexes, typeById)\n }\n\n if (hasNullable()) {\n hashCode = 31 * hashCode + nullable.hashCode()\n }\n\n if (hasFlexibleTypeCapabilitiesId()) {\n hashCode = 31 * hashCode + stringIndexes(flexibleTypeCapabilitiesId)","completion":"}\n\n if (hasFlexibleUpperBound()) {\n hashCode = 31 * hashCode + flexibleUpperBound.hashCode(stringIndexes, fqNameIndexes, typeById)\n }\n\n if (hasFlexibleUpperBoundId()) {<|endoftext|>"} {"prompt":"@kotlin.SinceKotlin(version = \"1.3\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly","completion":"public inline fun > kotlin.UShortArray.filterIndexedTo(destination: C, predicate: (index: kotlin.Int, kotlin.UShort) -> kotlin.Boolean): C<|endoftext|>"} {"prompt":".toMutableSet()\n .apply {\n add(outputDirectory.resolve(\"META-INF\/$moduleName.kotlin_module\").relativeTo(outputDirectory))\n }\n val notDeclaredFiles = hashSetOf()\n for (file in outputDirectory.walk()) {\n if (!file.isRegularFile()) continue\n val currentFile = file.relativeTo(outputDirectory)","completion":"filesLeft.remove(currentFile).also { wasPreviously ->\n if (!wasPreviously) notDeclaredFiles.add(currentFile)\n }\n }\n assert(filesLeft.isEmpty()) {\n \"The following files were declared as expected, but not actually produced: $filesLeft\"\n }\n assert(notDeclaredFiles.isEmpty()) {<|endoftext|>"} {"prompt":"append(if (fqName.isRoot) \"root package\" else renderFqName(fqName))\n\n if (withSourceFileForTopLevel &&\n containingDeclaration is PackageFragmentDescriptor &&\n descriptor is DeclarationDescriptorWithSource\n ) {\n descriptor.source.containingFile.name?.let { sourceFileName ->","completion":"append(\" \").append(renderMessage(\"in file\")).append(\" \").append(sourceFileName)\n }\n }\n }\n }\n\n private fun StringBuilder.renderAnnotations(annotated: Annotated, target: AnnotationUseSiteTarget? = null) {\n if (DescriptorRendererModifier.ANNOTATIONS !in modifiers) return<|endoftext|>"} {"prompt":"public operator fun Map.plus(pairs: Sequence>): Map =\n LinkedHashMap(this).apply { putAll(pairs) }.optimizeReadOnlyMap()\n\n\/**\n * Creates a new read-only map by replacing or adding entries to this map from another [map].\n *","completion":"* The returned map preserves the entry iteration order of the original map.\n * Those entries of another [map] that are missing in this map are iterated in the end in the order of that [map].\n *\/\npublic operator fun Map.plus(map: Map): Map =\n LinkedHashMap(this).apply { putAll(map) }<|endoftext|>"} {"prompt":"1 -> fun() {}\n 2 -> fun(): Int { return 1 }\n 3 -> fun(): () -> Unit { return fun() {} }\n 4 -> fun_1\n }\n}\n\n\/\/ TESTCASE NUMBER: 19\nfun case_19(value_1: Int): Any {\n val lambda_1 = { 0 }\n\n return when (value_1) {\n 1 -> lambda_1","completion":"2 -> { { {} } }\n else -> { -> (Int)\n { arg: Int -> { { println(arg) } } }\n }\n }\n}\n\n\/\/ TESTCASE NUMBER: 20\nfun case_20(value_1: Int) {\n val object_1 = object {\n val prop_1 = 1\n }\n\n when (value_1) {<|endoftext|>"} {"prompt":"public var isInstanceType: KmType? = null\n\n \/**\n * Arguments of an `&&`-expression. If this list is non-empty, the resulting effect expression is a conjunction of this expression\n * and elements of the list.\n *\/\n public val andArguments: MutableList = ArrayList(0)\n\n \/**","completion":"* Arguments of an `||`-expression. If this list is non-empty, the resulting effect expression is a disjunction of this expression\n * and elements of the list.\n *\/\n public val orArguments: MutableList = ArrayList(0)\n}\n\n\/**\n * Represents a constant value used in an effect expression.\n *<|endoftext|>"} {"prompt":"abstract fun KtAnalysisSession.collectSymbols(ktFile: KtFile, testServices: TestServices): SymbolsData\n\n override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {\n val directives = mainModule.testModule.directives","completion":"val directiveToIgnoreSymbolRestore = directives.doNotCheckSymbolRestoreDirective()\n val directiveToIgnoreNonPsiSymbolRestore = directives.doNotCheckNonPsiSymbolRestoreDirective()\n\n val prettyRenderer = buildList {\n addIfNotNull(defaultRendererOption)\n addAll(directives[PRETTY_RENDERER_OPTION])<|endoftext|>"} {"prompt":"leftClass.functions.single { it.isEquals() }\n }\n +irCall(newEquals).apply {\n dispatchReceiver = leftArgument\n putValueArgument(0, rightArgument)\n }.transform(this@JvmMultiFieldValueClassLowering, null)\n } else if (rightNode != null) {\n \/\/ left one is boxed, right one is unboxed","completion":"if (leftArgument.isNullConst()) {\n \/\/ left argument is always null, right one is unboxed\n val hasPureFlattenedGetters = rightNode.mapLeaves { it.hasPureUnboxMethod }.all { it }\n if (hasPureFlattenedGetters) {\n val rightExpressions = flattenExpression(rightArgument)<|endoftext|>"} {"prompt":"var c: Continuation? = null\n\nsuspend fun suspendMe(): T = suspendCoroutine {\n @Suppress(\"UNCHECKED_CAST\")\n c = it as Continuation\n}\n\nabstract class ResultReceiver {\n abstract suspend fun receive(result: Result)\n}","completion":"inline fun ResultReceiver(crossinline f: (Result) -> Unit): ResultReceiver =\n object : ResultReceiver() {\n override suspend fun receive(result: Result) {\n f(result)\n }\n }\n\nfun test() {\n var invoked = false\n val receiver = ResultReceiver { result -><|endoftext|>"} {"prompt":"@file:Suppress(\"unused\") \/\/ Used by compiler\n\npackage kotlin.wasm.internal\n\ninternal const val TYPE_INFO_ELEMENT_SIZE = 4\n\ninternal const val TYPE_INFO_TYPE_PACKAGE_NAME_LENGTH_OFFSET = 0","completion":"internal const val TYPE_INFO_TYPE_PACKAGE_NAME_ID_OFFSET = TYPE_INFO_TYPE_PACKAGE_NAME_LENGTH_OFFSET + TYPE_INFO_ELEMENT_SIZE\ninternal const val TYPE_INFO_TYPE_PACKAGE_NAME_PRT_OFFSET = TYPE_INFO_TYPE_PACKAGE_NAME_ID_OFFSET + TYPE_INFO_ELEMENT_SIZE<|endoftext|>"} {"prompt":"approximateToSuperType(argumentType, conf, depth) ?: continue@loop \/\/ null means that this type we can leave as is\n if (approximatedSuperType.isTrivialSuper()) {\n val approximatedSubType =\n approximateToSubType(argumentType, conf, depth) ?: continue@loop \/\/ seems like this is never null","completion":"if (!approximatedSubType.isTrivialSub()) {\n newArguments[index] = createTypeArgument(approximatedSubType, TypeVariance.IN)\n continue@loop\n }\n }\n\n if (AbstractTypeChecker.equalTypes(this, argumentType, approximatedSuperType)) {\n newArguments[index] = approximatedSuperType.asTypeArgument()<|endoftext|>"} {"prompt":"fun freshName() =\n suggestedName + \"_\" + i\n\n while (isReserved(freshName())) {\n i++\n }\n\n suggestedNameLastIdx[suggestedName] = i\n\n return freshName()\n }\n}\n\nfun NameTable.dump(): String =","completion":"\"Names: \\n\" + names.toList().joinToString(\"\\n\") { (declaration, name) ->\n val decl: FqName? = (declaration as IrDeclarationWithName).fqNameWhenAvailable\n val declRef = decl ?: declaration\n \"--- $declRef => $name\"\n }<|endoftext|>"} {"prompt":"val test6 = \"\".bar(40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, u = 20, v = 19,","completion":"w = 18, x = 17, y = 16, z = 15, aa = 14, bb = 13, cc = 12, dd = 11, ee = 10, ff = 9, gg = 8, hh = 7, ii = 6,\n jj = 5, kk = 4, ll = 3, mm = 2, nn = 1)<|endoftext|>"} {"prompt":"val first = BoxedTypes(\n true as java.lang.Boolean,\n '#' as java.lang.Character,\n 3.toByte() as java.lang.Byte,\n 10.toShort() as java.lang.Short,\n -300 as java.lang.Integer,\n -5.0f as java.lang.Float,\n Long.MAX_VALUE as java.lang.Long,","completion":"3.14 as java.lang.Double)\n\n first.writeToParcel(parcel, 0)\n\n val bytes = parcel.marshall()\n parcel.unmarshall(bytes, 0, bytes.size)\n parcel.setDataPosition(0)\n\n val first2 = parcelableCreator().createFromParcel(parcel)<|endoftext|>"} {"prompt":"* Converts [java.time.Duration][java.time.Duration] value to [kotlin.time.Duration][Duration] value.\n *\n * Accuracy of conversion:\n * - Durations in range of \u00b1146 years are converted exactly.\n * - Durations out of that range, but in range of \u00b1146 million years can be rounded to millisecond precision.","completion":"* - Durations greater than that are converted to a positive or negative infinite Duration (see [Duration.INFINITE]).\n *\/\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\n@kotlin.internal.InlineOnly\npublic inline fun java.time.Duration.toKotlinDuration(): Duration =<|endoftext|>"} {"prompt":"putReifiedOperationMarkerIfTypeIsReifiedParameter(typeOperand, operationKind)\n mv.checkcast(boxedRightType)\n } else {\n assert(expression.operator == IrTypeOperator.CAST) { \"IrTypeOperator.SAFE_CAST should have been lowered.\" }\n TypeIntrinsics.checkcast(mv, kotlinType, boxedRightType, false)\n }","completion":"MaterialValue(this, boxedRightType, expression.type)\n }\n\n IrTypeOperator.REINTERPRET_CAST -> {\n val targetType = typeMapper.mapType(typeOperand)\n expression.argument.accept(this, data).materialize()\n MaterialValue(this, targetType, typeOperand)\n }\n\n IrTypeOperator.INSTANCEOF -> {<|endoftext|>"} {"prompt":"c.trace.record(BindingContext.VALUE_PARAMETER, parameter, descriptor)\n descriptor\n }\n }\n\n override fun visitContextReceiverList(contextReceiverList: KtContextReceiverList) {\n checkContextReceiversAreEnabled(c.trace, languageVersionSettings, contextReceiverList)\n }","completion":"override fun visitDynamicType(type: KtDynamicType) {\n result = type(dynamicCallableDescriptors.dynamicType.replaceAnnotations(annotations))\n if (!dynamicTypesSettings.dynamicTypesAllowed) {\n c.trace.report(UNSUPPORTED.on(type, \"Dynamic types are not supported in this context\"))\n }\n }<|endoftext|>"} {"prompt":"return \"Wrong elements for MinL..MinL step 1: $list4\"\n }\n\n val list5 = ArrayList()\n val range5 = MinC..MinC step 1\n for (i in range5) {\n list5.add(i)\n if (list5.size > 23) break\n }\n if (list5 != listOf(MinC)) {","completion":"return \"Wrong elements for MinC..MinC step 1: $list5\"\n }\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"if (!(-1 in 1L..<3L) != !range0.contains(-1)) throw AssertionError()\n if (!(-1 !in 1L..<3L) != range0.contains(-1)) throw AssertionError()\n \/\/ no local optimizations\n if (element2 in 1L..<3L != range0.contains(element2)) throw AssertionError()","completion":"if (element2 !in 1L..<3L != !range0.contains(element2)) throw AssertionError()\n if (!(element2 in 1L..<3L) != !range0.contains(element2)) throw AssertionError()\n if (!(element2 !in 1L..<3L) != range0.contains(element2)) throw AssertionError()\n}<|endoftext|>"} {"prompt":"* control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 2 -> sentence 1\n * control--and-data-flow-analysis, control-flow-graph, expressions-1, boolean-operators -> paragraph 0 -> sentence 0\n * control--and-data-flow-analysis, control-flow-graph, statements-1 -> paragraph 0 -> sentence 0\n *\/","completion":"enum class Color { RED, GREEN, BLUE }\n\nfun foo(arr: Array): Color {\n loop@ for (color in arr) {\n when (color) {\n Color.RED -> return color\n Color.GREEN -> break@loop\n Color.BLUE -> if (arr.size == 1) return color else continue@loop<|endoftext|>"} {"prompt":"operator fun A.component2(): String = \"n\"\n\nfun box(): String {\n var i = 0;\n var s = \"\"\n for ((a, b) in C(0)..C(2)) {\n i = a;\n s = b;\n }\n\n if (i != 1) return \"i != 1, it: \" + i","completion":"if (s != \"n\") return \"s != 'n', it: \" + s\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"}\n}\n\n\/\/ TESTCASE NUMBER: 12\nfun case_12(value_1: Int, value_2: Int, value_3: Int, value_4: Int?) {\n var mutableValue1 = value_2\n var mutableValue2 = value_3\n\n when (value_1) {","completion":"mutableValue1++ -> {}\n mutableValue2-- -> {}\n value_4!! -> {}\n }\n}\n\n\/\/ TESTCASE NUMBER: 13<|endoftext|>"} {"prompt":"add(intrinsics.writeSharedBox) { call, context: JsGenerationContext ->\n val args = translateCallArguments(call, context)\n val box = args[0]\n val value = args[1]\n jsAssignment(JsNameRef(Namer.SHARED_BOX_V, box), value)\n }","completion":"val suspendInvokeTransform: (IrCall, JsGenerationContext) -> JsExpression = { call, context: JsGenerationContext ->\n \/\/ Because it is intrinsic, we know everything about this function\n \/\/ There is callable reference as extension receiver\n val invokeFun = invokeFunForLambda(call)\n\n val jsInvokeFunName = context.getNameForMemberFunction(invokeFun)<|endoftext|>"} {"prompt":"override val diagnosticClass get() = NameInConstraintIsNotATypeParameter::class\n val typeParameterName: Name\n val typeParametersOwner: KtSymbol\n }\n\n interface BoundOnTypeAliasParameterNotAllowed : KtFirDiagnostic {\n override val diagnosticClass get() = BoundOnTypeAliasParameterNotAllowed::class\n }","completion":"interface ReifiedTypeParameterNoInline : KtFirDiagnostic {\n override val diagnosticClass get() = ReifiedTypeParameterNoInline::class\n }\n\n interface TypeParametersNotAllowed : KtFirDiagnostic {\n override val diagnosticClass get() = TypeParametersNotAllowed::class\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.scripting.ide_common.idea.util\n\nimport com.intellij.psi.PsiElement\nimport org.jetbrains.kotlin.config.LanguageFeature\nimport org.jetbrains.kotlin.descriptors.*\nimport org.jetbrains.kotlin.idea.FrontendInternals","completion":"import org.jetbrains.kotlin.scripting.ide_common.idea.resolve.ResolutionFacade\nimport org.jetbrains.kotlin.scripting.ide_common.idea.resolve.frontendService\nimport org.jetbrains.kotlin.scripting.ide_common.idea.resolve.getDataFlowValueFactory<|endoftext|>"} {"prompt":"fun jvm(name: String) = jvm(name) { }\n fun jvm(name: String, configure: Action) = jvm(name) { configure.execute(this) }\n fun jvm(configure: Action) = jvm { configure.execute(this) }\n\n fun androidTarget(\n name: String = \"android\",","completion":"configure: KotlinAndroidTarget.() -> Unit = { }\n ): KotlinAndroidTarget =\n configureOrCreate(\n name,\n @Suppress(\"DEPRECATION\")\n presets.getByName(\"android\") as KotlinAndroidTargetPreset,\n configure\n )\n\n fun androidTarget() = androidTarget(\"android\") { }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.backend.jvm.lower\n\nimport org.jetbrains.kotlin.backend.common.ClassLoweringPass\nimport org.jetbrains.kotlin.backend.common.phaser.PhaseDescription\nimport org.jetbrains.kotlin.backend.jvm.JvmBackendContext","completion":"import org.jetbrains.kotlin.builtins.StandardNames\nimport org.jetbrains.kotlin.descriptors.annotations.KotlinTarget\nimport org.jetbrains.kotlin.ir.UNDEFINED_OFFSET\nimport org.jetbrains.kotlin.ir.declarations.IrClass<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.EMPTY_OBJC_NAME\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.INAPPLICABLE_EXACT_OBJC_NAME","completion":"import org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.INAPPLICABLE_OBJC_NAME\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.INVALID_OBJC_NAME<|endoftext|>"} {"prompt":"classReader.accept(selectiveClassVisitor, ClassReader.SKIP_CODE)\n\n \/\/ 3. Sort fields and methods as their order is not important\n sortClassMembers(classNode)\n\n \/\/ 4. Snapshot the class\n val classMemberLevelSnapshot = if (granularity == CLASS_MEMBER_LEVEL) {\n JavaClassMemberLevelSnapshot(","completion":"classAbiExcludingMembers = JavaElementSnapshot(classNode.name, snapshotClassExcludingMembers(classNode)),\n fieldsAbi = classNode.fields.map { JavaElementSnapshot(it.name, snapshotField(it)) },\n methodsAbi = classNode.methods.map { JavaElementSnapshot(it.name, snapshotMethod(it, classNode.version)) }\n )\n } else {<|endoftext|>"} {"prompt":"fun foo() {\n var x = 0\n x = x - 1 - 1\n\n x = x \/ 1\n x = 1 \/ x","completion":"x = -1 + x\n}<|endoftext|>"} {"prompt":"package kotlin.metadata.internal\n\nimport kotlin.metadata.*\nimport org.jetbrains.kotlin.metadata.ProtoBuf\nimport org.jetbrains.kotlin.metadata.deserialization.Flags\nimport org.jetbrains.kotlin.metadata.serialization.StringTable","completion":"public fun KmAnnotation.writeAnnotation(strings: StringTable): ProtoBuf.Annotation.Builder =\n ProtoBuf.Annotation.newBuilder().apply {\n id = strings.getClassNameIndex(className)\n for ((name, argument) in arguments) {\n addArgument(ProtoBuf.Annotation.Argument.newBuilder().apply {<|endoftext|>"} {"prompt":"public abstract fun getAnonymousObjectSymbol(psi: KtObjectLiteralExpression): KtAnonymousObjectSymbol\n public abstract fun getClassOrObjectSymbol(psi: KtClassOrObject): KtClassOrObjectSymbol?\n public abstract fun getNamedClassOrObjectSymbol(psi: KtClassOrObject): KtNamedClassOrObjectSymbol?","completion":"public abstract fun getPropertyAccessorSymbol(psi: KtPropertyAccessor): KtPropertyAccessorSymbol\n public abstract fun getClassInitializerSymbol(psi: KtClassInitializer): KtClassInitializerSymbol\n public abstract fun getDestructuringDeclarationEntrySymbol(psi: KtDestructuringDeclarationEntry): KtLocalVariableSymbol<|endoftext|>"} {"prompt":"override fun copyOf(): Freezable = copyK2MetadataCompilerArguments(this, K2MetadataCompilerArguments())\n\n override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap, Any> =\n super.configureAnalysisFlags(collector, languageVersion).also {\n it[AnalysisFlags.metadataCompilation] = true","completion":"}\n\n override fun configureExtraLanguageFeatures(map: HashMap) {\n map[LanguageFeature.MultiPlatformProjects] = LanguageFeature.State.ENABLED\n }\n}<|endoftext|>"} {"prompt":"ExpectedData(0x3931ac68c5f1b2c9UL, 0xa53a6b64b1ac85c9UL, 0xd50e7f86ee1b832bUL, 0x7bab08fdd26ba0a4UL, 0x7587743c18fe2475UL),","completion":"ExpectedData(0xb98fb0606f416754UL, 0xdbfaae9642b3205aUL, 0xf676a1339402bcb9UL, 0xf4f12a5b1ac11f29UL, 0x7db8bad81249dee4UL),<|endoftext|>"} {"prompt":"assert64BitHash(\"a\", 12917804110809363939UL)\n assert64BitHash(\"abc\", 2640714258260161385UL)\n assert64BitHash(\"a\".repeat(20), 15065261471293997870UL)\n assert64BitHash(\"b\".repeat(50), 1117739638843767388UL)","completion":"assert64BitHash(\"Hello World!\".repeat(40), 9211247178963271761UL)\n }\n\n fun testSimple128() {\n assert128BitHash(\"a\", 7969074168056553668UL, 5955762262185338209UL)\n assert128BitHash(\"abc\", 4143508125394299908UL, 11566915719555882565UL)<|endoftext|>"} {"prompt":"val writerDescriptor = writerDeclaration.getDeclarationDescriptorIncludingConstructors(bindingContext)\n \/\/ Access is after some writerDeclaration\n if (variableContainingDeclaration != writerDescriptor && !accessElement.before(writerDeclaration)) {\n return false\n }\n }\n \/\/ Access is before all writers\n return true\n}","completion":"private fun DeclarationDescriptorWithVisibility.isInvisibleFromOtherModules(): Boolean {\n if (DescriptorVisibilities.INVISIBLE_FROM_OTHER_MODULES.contains(visibility)) return true\n\n val containingDeclaration = containingDeclaration\n return containingDeclaration is DeclarationDescriptorWithVisibility && containingDeclaration.isInvisibleFromOtherModules()\n}<|endoftext|>"} {"prompt":"assertEquals(\"17\\n17\\n42\\n42\\n\", sb.toString())\n return \"OK\"\n}\n\nfun foo(x: Any?) {\n val y = x as T\n sb.appendLine(y.toString())\n}\n\nfun bar(x: Any?) {\n val y = x as? T","completion":"sb.appendLine(y.toString())\n}<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\n\/\/ WITH_STDLIB\n\ninterface In\nopen class A : In
\nopen class B : In\n\ninline fun select(x: T, y: T) = T::class.java.simpleName","completion":"\/\/ This test checks mostly that no StackOverflow happens while mapping type argument of select-call (In)\n\/\/ See KT-10972\nfun foo(): String = select(A(), B())\n\nfun box(): String {\n if (foo() != \"In\") return \"fail\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"return filteredOverridden.minOf { (it.member.fir as FirMemberDeclaration).modality ?: Modality.ABSTRACT }\n }\n\n private fun > realOverridden(\n symbol: D,\n scope: FirTypeScope,\n processDirectOverridden: ProcessOverriddenWithBaseScope,","completion":"): Collection> {\n val result = mutableSetOf>()\n\n collectRealOverridden(symbol, scope, result, mutableSetOf(), processDirectOverridden)\n\n return result\n }\n\n private fun > collectRealOverridden(\n symbol: D,\n scope: FirTypeScope,<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: -ApproximateAnonymousReturnTypesInPrivateInlineFunctions\n\nprivate inline fun foo1(crossinline f: () -> Int) = object {\n fun bar(): Int = f()\n}\n\ninterface I1\ninterface I2","completion":"private inline fun foo2(crossinline f: () -> Int) = object : I1 {\n fun bar(): Int = f()\n}<|endoftext|>"} {"prompt":"protected fun serialize(comment: JsComment): JsAstProtoBuf.Comment {\n val builder = JsAstProtoBuf.Comment.newBuilder().apply {\n text = comment.text\n multiline = when (comment) {\n is JsSingleLineComment -> false\n is JsMultiLineComment -> true\n else -> error(\"Unknown type of comment ${comment.javaClass.name}\")","completion":"}\n }\n return builder.build()\n }\n\n private inline fun withLocation(node: JsNode, fileConsumer: (Int) -> Unit, locationConsumer: (JsAstProtoBuf.Location) -> Unit, inner: () -> Unit) {\n val location = extractLocation(node)\n var fileChanged = false\n if (location != null) {<|endoftext|>"} {"prompt":"UsefulTestCase.assertSameElements(getMethodsOfClass(facadeWithB), \"\", \"b\", \"getB\", \"setB\")\n\n\n if (IncrementalCompilation.isEnabledForJvm()) {\n checkWhen(touch(\"module1\/src\/a.kt\"), null, packageClasses(\"module1\", \"module1\/src\/a.kt\", \"test.TestPackage\"))","completion":"checkWhen(touch(\"module2\/src\/b.kt\"), null, packageClasses(\"module2\", \"module2\/src\/b.kt\", \"test.TestPackage\"))\n }\n else {\n val allClasses = myProject.outputPaths()\n checkWhen(touch(\"module1\/src\/a.kt\"), null, allClasses)<|endoftext|>"} {"prompt":"@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.onEach(action: (ULong) -> Unit): ULongArray {\n return apply { for (element in this) action(element) }\n}\n\n\/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n *\/\n@SinceKotlin(\"1.4\")","completion":"@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.onEach(action: (UByte) -> Unit): UByteArray {\n return apply { for (element in this) action(element) }\n}\n\n\/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n *\/\n@SinceKotlin(\"1.4\")<|endoftext|>"} {"prompt":"funWithAtLeastOnceCallsInPlace {\n var value_1: Int\n funWithAtLeastOnceCallsInPlace {\n value_1 = 10\n }\n funWithAtLeastOnceCallsInPlace {\n value_1.inc()\n }\n value_1++\n }","completion":"funWithAtLeastOnceCallsInPlace {\n value_1 = 1\n }\n value_1--\n}<|endoftext|>"} {"prompt":"* MAIN LINK: declarations, classifier-declaration, class-declaration, abstract-classes -> paragraph 2 -> sentence 1\n * NUMBER: 3\n * DESCRIPTION: Abstract classes may contain one or more abstract members, which should be implemented in a subtype of this abstract class\n * HELPERS: checkType, functions\n *\/\n\n\n\/\/ TESTCASE NUMBER: 1\n\/\/ NOTE: attempt to implement inner abstract class as anonymous class","completion":"open class MainCase1() {\n private val priv = \"privet\"\n\n val implVal = object : MainCase1.InnerAbstractBase() {\n override fun foo(s: String) {\n println(\"object {$s}\")\n }\n }\n\n abstract inner class InnerAbstractBase() {\n protected abstract fun foo(s: String)\n fun boo() {\n foo(priv)<|endoftext|>"} {"prompt":").map { \"\\\"$it\\\"\" },\n fromKotlinOptionConverterProp = \"\"\"\n this?.let { ${typeOf()}.fromMode(it) }\n \"\"\".trimIndent(),\n toKotlinOptionConverterProp = \"\"\"\n this?.mode\n \"\"\".trimIndent()\n )","completion":"object JsSourceMapNamesPolicies : DefaultValues(\n \"null\",\n typeOf(),\n typeOf(),\n possibleValues = listOf(\n K2JsArgumentConstants.SOURCE_MAP_NAMES_POLICY_NO,<|endoftext|>"} {"prompt":"x.funNullableT()\n x.funNullableAny()\n }\n }\n}\n\n\/\/ TESTCASE NUMBER: 27\nfun case_27() {","completion":"if (Object.prop_1 == null == true == true == true == true == true == true == true == true == true == true == true == true == true == true)\n else {\n Object.prop_1<|endoftext|>"} {"prompt":"fakeTypeArguments.add(TypeProjectionImpl(typeProjection.projectionKind, DONT_CARE))\n }\n\n val oldReceiverTypeConstructor = receiverType.constructor\n val receiverTypeConstructor = if (oldReceiverTypeConstructor is IntersectionTypeConstructor) {\n oldReceiverTypeConstructor.transformComponents { supertype ->","completion":"val fakeArguments = supertype.arguments.map { TypeProjectionImpl(it.projectionKind, DONT_CARE) }\n supertype.replace(fakeArguments)\n } ?: oldReceiverTypeConstructor\n } else {\n oldReceiverTypeConstructor\n }\n\n return KotlinTypeFactory.simpleTypeWithNonTrivialMemberScope(<|endoftext|>"} {"prompt":"}\n is PsiWildcardType -> {\n if (!isBounded) {\n sb.append(\"?\")\n } else {\n if (isSuper) {\n sb.append(PsiWildcardType.SUPER_PREFIX)\n } else {\n sb.append(PsiWildcardType.EXTENDS_PREFIX)\n }","completion":"bound?.renderType(sb)\n }\n }\n is PsiPrimitiveType -> {\n sb.append(name)\n }\n else -> {\n sb.append(getCanonicalText(\/* annotated = *\/ true))\n }\n }\n }\n\n\n private fun PsiReferenceList?.renderRefList(keyword: String, sortReferences: Boolean = true): String {<|endoftext|>"} {"prompt":"}\n r.run()\n}\n\ninline fun transform(crossinline c: suspend () -> Unit) {\n builder { c() }\n}\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\n\/\/ FILE: box.kt\nimport kotlin.coroutines.*\nimport helpers.*\n\nfun box() : String {","completion":"var res = \"FAIL 1\"\n builder {\n test1 {\n res = \"OK\"\n }\n }\n if (res != \"OK\") return res\n\n res = \"FAIL 2\"\n builder {\n test2 {\n res = \"OK\"\n }\n }\n if (res != \"OK\") return res\n\n res = \"FAIL 3\"\n builder {<|endoftext|>"} {"prompt":"* `this` and other referenced types into the import collector passed as context.\n *\/\n context(ImportCollector)\n fun renderTo(appendable: Appendable)\n\n object Star : TypeRef {\n\n override fun substitute(map: TypeParameterSubstitutionMap) = this\n\n override fun toString(): String = \"*\"\n\n context(ImportCollector)","completion":"override fun renderTo(appendable: Appendable) {\n appendable.append(toString())\n }\n }\n}\n\n\/**\n * Prints this type as a string with all its arguments and question marks, while recursively collecting\n * `this` and other referenced types into the import collector passed as context.\n *\/\ncontext(ImportCollector)<|endoftext|>"} {"prompt":"suspend fun test1(p: String): String {\n return \"A\" + p\n}\n\nsuspend fun test2(p: String): String {\n return p\n}\n\nsuspend fun foo(): Array {\n return externalLog(test1(\"B\"))\n}\n\nsuspend fun bar(): Array {\n return externalLog(test2(\"C\"), \"D\", test2(\"E\"))","completion":"}\n\nsuspend fun qux(): Array {\n return externalLog(test2(\"G\"), test2(\"F\"))\n}\n\nsuspend fun test3(s1: String, s2: String): Array {\n return arrayOf(s1, \"Y\", s2)\n}\n\nsuspend fun tef(): Array {<|endoftext|>"} {"prompt":"private fun generateWhenSubjectVariable(whenExpression: FirWhenExpression): IrVariable? {\n val subjectVariable = whenExpression.subjectVariable\n val subjectExpression = whenExpression.subject\n return when {\n subjectVariable != null -> subjectVariable.accept(this, null) as IrVariable\n subjectExpression != null -> {","completion":"applyParentFromStackTo(callablesGenerator.declareTemporaryVariable(convertToIrExpression(subjectExpression), \"subject\"))\n }\n else -> null\n }\n }\n\n private fun FirWhenBranch.toIrWhenBranch(whenExpressionType: ConeKotlinType): IrBranch {\n return convertWithOffsets { startOffset, _ ->\n val condition = condition<|endoftext|>"} {"prompt":"fun case_4(value_1: String, value_2: String, value_3: String) {\n when (value_1) {\n \"...\" + value_2 + \"\" + \"$value_3\" + \"...\" -> {}\n value_2 + getString() -> {}\n }\n}\n\n\/\/ TESTCASE NUMBER: 5","completion":"fun case_5(value_1: Int, value_2: Int, value_3: Boolean?) {\n when (value_1) {\n when {\n value_2 > 1000 -> 1\n value_2 > 100 -> 2\n else -> 3\n } -> {}\n when (value_3) {\n true -> 1\n false -> 2\n null -> 3\n } -> {}<|endoftext|>"} {"prompt":"return PackagePartClassUtils.getPackagePartFqName(packageFqName, file.name)\n}\n\nprivate fun patchClassForName(className: FqName, oldPackage: FqName, text: String, conservativeRenameSchemeheme: Boolean): String {\n if (!conservativeRenameSchemeheme && !oldPackage.isRoot) return text\n return text.replace(","completion":"(\"Class\\\\.forName\\\\(\\\"\" + oldPackage.child(className.shortName()).asString()).toRegex(),\n \"Class.forName(\\\"\" + className.asString()\n )\n}\n\nprivate fun patchRootPartNamesInStrings(\n className: FqName,\n oldPackage: FqName,\n isJvmName: Boolean,\n text: String<|endoftext|>"} {"prompt":"resolvedCallsAt.joinToString(\"\\n\\n\", prefix = \"$originalText\\n\\n\\n\") { (_, resolvedCall) ->\n resolvedCall?.renderToText().toString()\n }\n\n protected fun extractCarets(text: String): Pair> {\n val parts = text.split(\"\")","completion":"if (parts.size < 2) return text to emptyList()\n \/\/ possible to rewrite using 'scan' function to get partial sums of parts lengths\n val indices = mutableListOf()\n val resultText = buildString {\n parts.dropLast(1).forEach { part ->\n append(part)\n indices.add(this.length)\n }\n append(parts.last())<|endoftext|>"} {"prompt":"var FirProperty.isReferredViaField: Boolean? by FirDeclarationDataRegistry.data(IsReferredViaField)\nvar FirProperty.fromPrimaryConstructor: Boolean? by FirDeclarationDataRegistry.data(IsFromPrimaryConstructor)\nvar FirProperty.componentFunctionSymbol: FirNamedFunctionSymbol? by FirDeclarationDataRegistry.data(ComponentFunctionSymbolKey)","completion":"var FirClassLikeDeclaration.sourceElement: SourceElement? by FirDeclarationDataRegistry.data(SourceElementKey)\nvar FirRegularClass.moduleName: String? by FirDeclarationDataRegistry.data(ModuleNameKey)\n\n\/**\n * @see [FirBasedSymbol.klibSourceFile]\n *\/\nvar FirDeclaration.klibSourceFile: SourceFile? by FirDeclarationDataRegistry.data(KlibSourceFile)<|endoftext|>"} {"prompt":"nj !== j","completion":"val test_fnf = f === nf || nf === f || f !== nf ||<|endoftext|>"} {"prompt":"override fun getDiagnostics(): Diagnostics = storageManager.compute { context.diagnostics }\n\n override fun get(slice: ReadOnlySlice, key: K) = storageManager.compute { context.get(slice, key) }","completion":"override fun getKeys(slice: WritableSlice) = storageManager.compute { context.getKeys(slice) }\n\n override fun addOwnDataTo(trace: BindingTrace, commitDiagnostics: Boolean) {\n storageManager.compute { context.addOwnDataTo(trace, commitDiagnostics) }\n }\n\n @TestOnly<|endoftext|>"} {"prompt":"if (f != null) this.f.propNullableAny\n if (f != null) this.f.funT()","completion":"if (f != null) this.f.funAny()\n if (f != null) this.f.funNullableT()<|endoftext|>"} {"prompt":"\/\/ Built function overrides originalSuperMethod, while, if parent class is already lowered, it would\n \/\/ transformedSuperMethod in its declaration list. We need not fake override in that case.\n \/\/ Later lowerings will fix it and replace function with one overriding transformedSuperMethod.\n ignoredParentSymbols = listOf(transformedSuperMethod.symbol)\n )\n\n postprocessCreatedObjectProxy(subclass)","completion":"return subclass\n }\n\n private fun generateEqualsHashCode(klass: IrClass, superType: IrType, functionDelegateField: IrField) =\n SamEqualsHashCodeMethodsGenerator(context, klass, superType) { receiver ->\n irGetField(receiver, functionDelegateField)\n }.generate()\n\n private fun getAdditionalSupertypes(supertype: IrType) =<|endoftext|>"} {"prompt":"}\n }\n candidate.isStatic -> {\n return dispatchReceiverForStatics\n }\n else -> return null\n }\n }\n\n private fun shouldSkipCandidateWithInconsistentExtensionReceiver(candidate: FirCallableSymbol<*>): Boolean {\n \/\/ Pre-check explicit extension receiver for default package top-level members","completion":"if (scope !is FirDefaultStarImportingScope || !areThereExtensionReceiverOptions()) return false\n\n val declarationReceiverType = candidate.resolvedReceiverTypeRef?.coneType as? ConeClassLikeType ?: return false\n val startProjectedDeclarationReceiverType = declarationReceiverType.lookupTag.constructClassType(<|endoftext|>"} {"prompt":"if (!(4.toByte() !in charSequence.indices) != range0.contains(4.toByte())) throw AssertionError()\n \/\/ no local optimizations\n if (element20 in charSequence.indices != range0.contains(element20)) throw AssertionError()","completion":"if (element20 !in charSequence.indices != !range0.contains(element20)) throw AssertionError()\n if (!(element20 in charSequence.indices) != !range0.contains(element20)) throw AssertionError()\n if (!(element20 !in charSequence.indices) != range0.contains(element20)) throw AssertionError()\n}<|endoftext|>"} {"prompt":"* If the [other] value is less than or equal to `this` value, then the returned range is empty.\n *\/\n @SinceKotlin(\"1.9\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public operator fun rangeUntil(other: Int): IntRange\n\n \/**\n * Creates a range from this value up to but excluding the specified [other] value.","completion":"*\n * If the [other] value is less than or equal to `this` value, then the returned range is empty.\n *\/\n @SinceKotlin(\"1.9\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public operator fun rangeUntil(other: Long): LongRange\n\n \/**\n * Shifts this value left by the [bitCount] number of bits.<|endoftext|>"} {"prompt":"assertConstraint(jvmSourceSet, IdeMultiplatformImport.SourceSetConstraint.isLeaf, isMatchExpected = true)\n assertConstraint(jvmSourceSet, IdeMultiplatformImport.SourceSetConstraint.isNative, isMatchExpected = false)","completion":"assertConstraint(jvmSourceSet, IdeMultiplatformImport.SourceSetConstraint.isSinglePlatformType, isMatchExpected = true)\n assertConstraint(jvmSourceSet, IdeMultiplatformImport.SourceSetConstraint.unconstrained, isMatchExpected = true)\n }\n\n for (androidSourceSet in listOf(androidMain, androidUnitTest, androidInstrumentedTest)) {<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION\n\ninterface Rec, out B>\n\nfun select(vararg args: S): S = TODO()\n\ninterface I1\ninterface I2 : I1\ninterface I3 : I1\ninterface I4","completion":"object Obj2 : Rec\nobject Obj3 : Rec\nobject Obj4 : Rec\n\nfun testOutOut() {\n val cst1 = select(Obj2, Obj3)\n val cst2 = select(Obj2, Obj4)<|endoftext|>"} {"prompt":"if (v != null || this.v != null) v.funAny()","completion":"if (v != null || this.v != null) v.funNullableT()<|endoftext|>"} {"prompt":"\" public class \\$\\$\\$\\$\\${}\\n\" +\n \"}\\n\" +\n \"\\n\" +\n \"}\", \"TopLevel\")\n\n assertCanFind(manager, \"foo\", \"TopLevel\")\n\n assertCanFind(manager, \"foo\", \"TopLevel.I\\$nner\")","completion":"assertCanFind(manager, \"foo\", \"TopLevel.I\\$nner.I\\$nner\")\n assertCanFind(manager, \"foo\", \"TopLevel.I\\$nner.\\$Inner\")\n assertCanFind(manager, \"foo\", \"TopLevel.I\\$nner.In\\$ne\\$r\\$\")<|endoftext|>"} {"prompt":"val currentClasspath = reporter.measure(GradleBuildTime.INCREMENTAL_LOAD_CURRENT_CLASSPATH_SNAPSHOT) {\n when (shrinkMode) {\n is ShrinkMode.ChangedLookupsUnchangedClasspath ->\n CachedClasspathSnapshotSerializer\n .load(classpathChanges.classpathSnapshotFiles.currentClasspathEntrySnapshotFiles, reporter)","completion":".removeDuplicateAndInaccessibleClasses()\n is ShrinkMode.ChangedLookupsChangedClasspath -> shrinkMode.currentClasspathSnapshot\n }\n }\n val shrunkCurrentClasspathAgainstPrevLookups =<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.util.enableDependencyVerification\nimport kotlin.test.Test\n\nclass WasmDependencyResolutionSmokeTest {\n\n @Test\n fun `test - project to project ide dependency resolution`() {\n val rootProject = buildProject()\n val consumer = buildProject(projectBuilder = { withName(\"consumer\").withParent(rootProject) })","completion":"val producer = buildProject(projectBuilder = { withName(\"producer\").withParent(rootProject) })\n\n rootProject.subprojects { project ->\n project.enableDependencyVerification(false)\n project.applyMultiplatformPlugin()\n project.repositories.mavenLocal()\n project.repositories.mavenCentralCacheRedirector()\n }<|endoftext|>"} {"prompt":"CXCompletionChunk_RightBrace(11),\n CXCompletionChunk_LeftAngle(12),\n CXCompletionChunk_RightAngle(13),\n CXCompletionChunk_Comma(14),\n CXCompletionChunk_ResultType(15),\n CXCompletionChunk_Colon(16),","completion":"CXCompletionChunk_SemiColon(17),\n CXCompletionChunk_Equal(18),\n CXCompletionChunk_HorizontalSpace(19),\n CXCompletionChunk_VerticalSpace(20),\n ;\n \n companion object {\n \n @Deprecated(\"Will be removed.\", ReplaceWith(\"\"), DeprecationLevel.WARNING)<|endoftext|>"} {"prompt":"class Case3() : I {\n companion object {\n operator fun invoke(x1: ()->CharSequence, x2: Any = \"\"): Unit = print(3) \/\/ (3)\n operator fun invoke(y1: ()->CharSequence, y2: String = \"\"): Any { print(4); return \"\" } \/\/ (4)\n }\n\n val x = \"\"","completion":"fun x() = \"\" as CharSequence\n\n fun case() {\n I.invoke(::x)<|endoftext|>"} {"prompt":"* strong reference to the `LLFirSession`. See the documentation of [LLFirSession][org.jetbrains.kotlin.analysis.low.level.api.fir.sessions.LLFirSession]\n * for more information.\n *\/\n@OptIn(KtAnalysisApiInternals::class, KtAnalysisNonPublicApi::class)\n@Suppress(\"AnalysisApiMissingLifetimeCheck\")","completion":"internal class KtFirAnalysisSession\nprivate constructor(\n val project: Project,\n val firResolveSession: LLFirResolveSession,\n token: KtLifetimeToken,\n) : KtAnalysisSession(token) {\n\n internal val firSymbolBuilder: KtSymbolByFirBuilder = KtSymbolByFirBuilder(project, this, token)<|endoftext|>"} {"prompt":"exitCodeCheck = TestRunCheck.ExitCode.Expected(0).takeUnless { isExpectedFailure },\n fileCheckMatcher = fileCheckStage?.let { TestRunCheck.FileCheckMatcher(settings, testDataFile) }\n ),\n fileCheckStage = fileCheckStage,\n extras = WithTestRunnerExtras(runnerType = TestRunnerType.DEFAULT)\n )","completion":"testCase.initialize(\n givenModules = customKlibs.klibs.mapToSet(TestModule::Given),\n findSharedModule = sharedModules::get\n )\n\n return testCase\n }\n\n private fun retrieveFileCheckStage(): String? {\n val fileCheckStages = structure.directives.multiValues(FILECHECK_STAGE.name)<|endoftext|>"} {"prompt":"private fun Array.subarrayContentEquals(offset: Int, length: Int, other: List<*>): Boolean {\n if (length != other.size) return false\n var i = 0\n while (i < length) {\n if (this[offset + i] != other[i]) return false\n i++\n }\n return true\n}","completion":"internal fun Array.copyOfUninitializedElements(newSize: Int): Array {\n @Suppress(\"UNCHECKED_CAST\")\n return copyOf(newSize) as Array\n}\n\ninternal fun Array.resetAt(index: Int) {\n @Suppress(\"UNCHECKED_CAST\")<|endoftext|>"} {"prompt":"assertSame(projectB.projectNameProperty, projectB.projectNameProperty)\n }\n\n @Test\n fun `test - counterProperty`() {\n val projectA = buildProject()\n val projectB = buildProject()\n\n assertEquals(Value(0), projectA.counterProperty)\n assertEquals(Value(0), projectA.counterProperty)","completion":"assertEquals(Value(1), projectB.counterProperty)\n assertEquals(Value(1), projectB.counterProperty)\n }\n\n @Test\n fun `test - Scope`() {\n val project = buildProject()\n val scopeA = Scope(\"a\")\n val scopeB = Scope(\"b\")\n\n with(scopeA) {<|endoftext|>"} {"prompt":"override val meta: StubContainerMeta = StubContainerMeta(),\n override val classes: List = emptyList(),\n override val functions: List = emptyList(),\n override val properties: List = emptyList(),\n override val typealiases: List = emptyList(),","completion":"override val simpleContainers: List = emptyList()\n) : StubContainer() {\n\n override fun accept(visitor: StubIrVisitor, data: T): R {\n return visitor.visitSimpleStubContainer(this, data)\n }\n}\n\nval StubContainer.children: List<|endoftext|>"} {"prompt":"val prev = value.nextDown()\n if (prev > 0) {\n assertEquals(value, prev + prev.ulp)\n } else {\n assertEquals(prev, value - value.ulp)\n }\n\n val toZero = value.nextTowards(0.0)\n if (toZero != 0.0) {","completion":"assertEquals(value, toZero + toZero.ulp.withSign(toZero))\n }\n\n assertEquals(Double.POSITIVE_INFINITY, Double.MAX_VALUE.nextUp())\n assertEquals(Double.MAX_VALUE, Double.POSITIVE_INFINITY.nextDown())<|endoftext|>"} {"prompt":"reportSourceSetCommonizerDependencies {\n val nativeMain = getCommonizerDependencies(\"nativeMain\")\n val konanDataDirProperty = buildOptions.konanDataDir\n ?: error(\"konanDataDir must not be null in this test. Please set a custom konanDataDir property.\")","completion":"nativeMain.withoutNativeDistributionDependencies(konanDataDirProperty).assertDependencyFilesMatches(\".*cinterop-dummy\")\n nativeMain.onlyNativeDistributionDependencies(konanDataDirProperty).assertNotEmpty()\n nativeMain.assertTargetOnAllDependencies(CommonizerTarget(LINUX_X64, LINUX_ARM64, MINGW_X64))<|endoftext|>"} {"prompt":"fun `test typealias and class`() {\n val result = commonize {\n outputTarget(\"(a,b)\")\n simpleSingleSourceTarget(\"a\", \"\"\"class X \"\"\")\n simpleSingleSourceTarget(\n \"b\", \"\"\"\n class B\n typealias X = B\n \"\"\"\n )\n }\n\n result.assertCommonized(\"(a,b)\", \"expect class X()\")","completion":"}\n\n fun `test typealias to different classes`() {\n val result = commonize {\n outputTarget(\"(a, b)\", \"(c, d)\", \"(e, f)\", \"(a, b, c, d)\", \"(a, b, c, d, e, f)\")\n simpleSingleSourceTarget(\n \"a\", \"\"\"\n class AB\n typealias x = AB\n \"\"\"\n )<|endoftext|>"} {"prompt":"val jarB = tmp.newFile(\"inputB.jar\").also { jar ->\n ZipOutputStream(jar.outputStream()).use {\n it.putNextEntry(ZipEntry(\"test\/B.class\"))\n it.write(emptyClass(\"test\/B\"))\n it.closeEntry()\n\n it.putNextEntry(ZipEntry(\"test\/A.class\"))","completion":"it.write(emptyClass(\"test\/A\"))\n it.closeEntry()\n }\n }\n val outputsB = TransformOutputsMock(tmp.newFolder())\n transform(jarB, outputsB)\n\n assertArrayEquals(outputsA.createdOutputs.single().readBytes(), outputsB.createdOutputs.single().readBytes())\n }\n\n @Test<|endoftext|>"} {"prompt":"KotlinBuildStatsMXBean {\n\n override fun report(metric: BooleanMetrics, value: Boolean, subprojectName: String?, weight: Long?): Boolean =\n report(kotlinBuildLogger.sessionLogger, metric, value, subprojectName, weight)","completion":"override fun report(metric: NumericalMetrics, value: Long, subprojectName: String?, weight: Long?): Boolean =\n report(kotlinBuildLogger.sessionLogger, metric, value, subprojectName, weight)\n\n override fun report(metric: StringMetrics, value: String, subprojectName: String?, weight: Long?): Boolean =<|endoftext|>"} {"prompt":"override fun getListOfAcceptableFunctions(): List {\n return listOf(\"kotlin.internal.ir.dataClassArrayMemberToString\")\n }\n\n private fun arrayToString(array: Any?): String {\n return when (array) {\n null -> \"null\"\n is Array<*> -> Arrays.toString(array)","completion":"is ByteArray -> Arrays.toString(array)\n is ShortArray -> Arrays.toString(array)\n is IntArray -> Arrays.toString(array)\n is LongArray -> Arrays.toString(array)\n is CharArray -> Arrays.toString(array)\n is BooleanArray -> Arrays.toString(array)\n is FloatArray -> Arrays.toString(array)<|endoftext|>"} {"prompt":"private fun checkOnlyInputTypes(bounds: Collection, possibleAnswer: KotlinType): Boolean {\n if (!typeVariable.hasOnlyInputTypesAnnotation()) return true\n\n \/\/ Only type mentioned in bounds might be the result\n val typesInBoundsSet =","completion":"bounds.filter { it.isProper && it.constrainingType.constructor.isDenotable }.map { it.constrainingType }.toSet()\n \/\/ Flexible types are equal to inflexible\n if (typesInBoundsSet.any { KotlinTypeChecker.DEFAULT.equalTypes(it, possibleAnswer) }) return true<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.js.inline\n\nimport org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor\nimport org.jetbrains.kotlin.descriptors.PropertySetterDescriptor\nimport org.jetbrains.kotlin.js.backend.ast.*","completion":"import org.jetbrains.kotlin.js.backend.ast.metadata.descriptor\nimport org.jetbrains.kotlin.js.backend.ast.metadata.forcedReturnVariable\nimport org.jetbrains.kotlin.js.backend.ast.metadata.isInline\nimport org.jetbrains.kotlin.js.backend.ast.metadata.psiElement<|endoftext|>"} {"prompt":"fun TestFile.toLightTreeShortName() = name.substringAfterLast('\/').substringAfterLast('\\\\')\n\nfun SourceFileProvider.getKtSourceFilesForSourceFiles(\n testFiles: Collection,\n): Map {\n return testFiles.mapNotNull {\n if (!it.isKtFile) return@mapNotNull null","completion":"val shortName = it.toLightTreeShortName()\n val ktSourceFile = KtInMemoryTextSourceFile(shortName, \"\/$shortName\", getContentOfSourceFile(it))\n it to ktSourceFile\n }.toMap()\n}\n\nval TestFile.isKtFile: Boolean\n get() = name.endsWith(\".kt\") || name.endsWith(\".kts\")<|endoftext|>"} {"prompt":"val isClass: Boolean,\n val canHaveSubtypesAccordingToK1: Boolean,\n) {\n override fun toString() = \"$type\"\n}\n\nprivate val FirClassSymbol<*>.isBuiltin get() = isPrimitiveType() || classId == StandardClassIds.String || isEnumClass","completion":"internal val TypeInfo.isNullableEnum get() = isEnumClass && type.isNullable\n\ninternal val TypeInfo.isIdentityLess get() = isPrimitive || isValueClass\n\ninternal val TypeInfo.isNotNullPrimitive get() = isPrimitive && !type.isNullable\n\nprivate val FirClassSymbol<*>.isFinalClass get() = isClass && isFinal<|endoftext|>"} {"prompt":"public actual fun > maxOf(a: T, b: T, c: T): T {\n return maxOf(a, maxOf(b, c))\n}\n\n\/**\n * Returns the greater of three values.\n *\/\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly","completion":"public actual inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte {\n return JsMath.max(a.toInt(), b.toInt(), c.toInt()).unsafeCast()\n}\n\n\/**\n * Returns the greater of three values.\n *\/\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"\/\/ NATIVE error: name contains illegal characters: \"$\"\n\/\/ IGNORE_BACKEND: NATIVE\n\/\/ WITH_STDLIB\n\nimport kotlin.reflect.KClass\nimport kotlin.test.assertEquals\n\nfun check(klass: KClass<*>, expectedName: String) {\n assertEquals(expectedName, klass.simpleName)\n}\n\nfun localInMethod() {","completion":"fun localInMethod(unused: Any?) {\n class Local\n check(Local::class, \"Local\")\n\n class `Local$With$Dollars`\n check(`Local$With$Dollars`::class, \"Local\\$With\\$Dollars\")\n }\n localInMethod(null)\n\n class Local\n check(Local::class, \"Local\")<|endoftext|>"} {"prompt":"if (signature != null) {\n proto.setExtension(JvmProtoBuf.propertySignature, signature)\n }\n\n if (property.isJvmFieldPropertyInInterfaceCompanion() && versionRequirementTable != null) {\n proto.setExtension(JvmProtoBuf.flags, JvmFlags.getPropertyFlags(true))\n }","completion":"if (getter?.needsInlineParameterNullCheckRequirement() == true || setter?.needsInlineParameterNullCheckRequirement() == true) {\n versionRequirementTable?.writeInlineParameterNullCheckRequirement(proto::addVersionRequirement)\n }\n }\n\n private fun FirProperty.isJvmFieldPropertyInInterfaceCompanion(): Boolean {<|endoftext|>"} {"prompt":"* or a positive number if it's greater than other.\n *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public operator fun compareTo(other: Float): Int\n\n \/**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,","completion":"* or a positive number if it's greater than other.\n *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public override operator fun compareTo(other: Double): Int\n\n \/** Adds the other value to this value. *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public operator fun plus(other: Byte): Double<|endoftext|>"} {"prompt":"import org.jetbrains.jps.model.module.JpsModuleSourceRootType\n\nsealed class KotlinSourceRootType() : JpsElementTypeBase(), JpsModuleSourceRootType {\n\n override fun createDefaultProperties() = JpsJavaExtensionService.getInstance().createSourceRootProperties(\"\")\n\n}","completion":"object SourceKotlinRootType : KotlinSourceRootType()\n\nobject TestSourceKotlinRootType : KotlinSourceRootType() {\n override fun isForTests() = true\n}\n\nval ALL_KOTLIN_SOURCE_ROOT_TYPES = setOf(SourceKotlinRootType, TestSourceKotlinRootType)<|endoftext|>"} {"prompt":"final override val fqName: FqName\n) : DeclarationDescriptorNonRootImpl(module, Annotations.EMPTY, fqName.shortNameOrSpecial(), SourceElement.NO_SOURCE),\n PackageFragmentDescriptor {\n \/\/ Not inlined in order to not capture ref on 'module'\n private val debugString: String = \"package $fqName of $module\"","completion":"override fun accept(visitor: DeclarationDescriptorVisitor, data: D): R =\n visitor.visitPackageFragmentDescriptor(this, data)\n\n override fun getContainingDeclaration(): ModuleDescriptor {\n return super.getContainingDeclaration() as ModuleDescriptor\n }\n\n override fun getSource(): SourceElement {<|endoftext|>"} {"prompt":"\/\/ FILE: jvm.kt\n@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.CLASS)\nactual annotation class ExpectIsSubsetOfActual\n\n@Target(AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.CLASS)","completion":"actual annotation class ExpectIsSubsetOfActualDifferentOrder\n\n@Target(AnnotationTarget.FUNCTION)\nactual annotation class MoreTargetsOnExpect\n\n@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CLASS, AnnotationTarget.TYPEALIAS)\nactual annotation class RepeatedTargetsInExpect\n\n@Target(AnnotationTarget.FUNCTION)\nactual annotation class EmptyTargetsActual<|endoftext|>"} {"prompt":"Double.fromBits(0x0010000000000000) to 2.812644285236262E-103, \/\/ smallest normal value\n Double.fromBits(0x1L) to 1.7031839360032603E-108, \/\/ smallest value (denormal)\n Double.MAX_VALUE to 5.643803094122362E102,\n 0.0 to 0.0,","completion":"0.9 to 0.9654893846056297,\n 9.9 to 2.1472291690189413,\n 27.0 to 3.0,\n 399.1289 to 7.362710510208026,\n 8123.452 to 20.102351976782558,\n 21717.639 to 27.9,<|endoftext|>"} {"prompt":"val arr = IntArray(5)\n arr[1] = 1\n arr[3] = -1\n assertEquals(1, arr[1])\n assertEquals(-1, arr[3])\n }\n\n @Test fun longArraySet() {\n val arr = LongArray(5)\n arr[1] = 1\n arr[3] = -1","completion":"assertEquals(1, arr[1])\n assertEquals(-1, arr[3])\n }\n\n @Test fun arrayGetOutOfBounds() {\n val arr = Array(5) { null }\n assertFailsWith {\n arr[arr.size]\n }\n assertFailsWith {<|endoftext|>"} {"prompt":"expression2MfvcNodeInstanceAccessor[setterExpressions] = MfvcNodeInstanceAccessor.Setter(instance, values)\n +setterExpressions\n return setterExpressions\n }\n\n fun IrBlockBuilder.addReplacement(expression: IrCall): IrExpression? {\n val function = expression.symbol.owner","completion":"val property = function.property?.takeIf { function.isGetter } ?: return null\n val dispatchReceiver = expression.dispatchReceiver\n dispatchReceiver?.get(this, property.name)?.let { +it; return it }\n val node = replacements.getMfvcPropertyNode(property) ?: return null\n val typeArguments = makeTypeArgumentsFromFunction(expression)<|endoftext|>"} {"prompt":"if (1.toByte() in 1L..3L != range0.contains(1.toByte())) throw AssertionError()\n if (1.toByte() !in 1L..3L != !range0.contains(1.toByte())) throw AssertionError()","completion":"if (!(1.toByte() in 1L..3L) != !range0.contains(1.toByte())) throw AssertionError()\n if (!(1.toByte() !in 1L..3L) != range0.contains(1.toByte())) throw AssertionError()\n \/\/ no local optimizations<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1\nimport kotlin.contracts.ExperimentalContracts\nimport kotlin.contracts.InvocationKind\nimport kotlin.contracts.contract\n\n@OptIn(ExperimentalContracts::class)\nfun returnsNullContract(foo: Any?): Any? {","completion":"contract {\n returns(null) implies (foo == null)\n }\n return foo\n}<|endoftext|>"} {"prompt":"* Returns the [KClass] instance representing the runtime class to which this type is erased to on JVM.\n *\/\n@SinceKotlin(\"1.1\")\nval KType.jvmErasure: KClass<*>\n get() = classifier?.jvmErasure ?: throw KotlinReflectionInternalError(\"Cannot calculate JVM erasure for type: $this\")","completion":"internal val KClassifier.jvmErasure: KClass<*>\n get() = when (this) {\n is KClass<*> -> this\n is KTypeParameter -> {\n \/\/ See getRepresentativeUpperBound in typeSignatureMapping.kt\n val bounds = upperBounds\n val representativeBound = bounds.firstOrNull {<|endoftext|>"} {"prompt":"\/\/ LANGUAGE: +MultiPlatformProjects\n\/\/ ISSUE: KT-66960\n\n\/\/ MODULE: common\n\/\/ FILE: common.kt\nexpect sealed class Base()\n\nclass CommonDerived : Base()\n\n\/\/ should be an error\nfun commonTest(x: Base) = when (x) {\n is CommonDerived -> 1\n}","completion":"\/\/ MODULE: main()()(common)\n\/\/ FILE: test.kt\nactual typealias Base = PlatformBase\n\nsealed class PlatformBase\n\nclass PlatformDerived : PlatformBase()\n\n\/\/ should be ok\nfun platformTest_1(x: Base) = when (x) {\n is CommonDerived -> 1\n is PlatformDerived -> 2\n}\n\n\/\/ should be an error<|endoftext|>"} {"prompt":"forConstructorHeaders: FirTowerDataContext? = null,\n forEnumEntries: FirTowerDataContext? = null,\n primaryConstructorPureParametersScope: FirLocalScope? = null,\n primaryConstructorAllParametersScope: FirLocalScope? = null,\n ) : this(","completion":"enumMap(regular, forClassHeaderAnnotations, forNestedClasses, forCompanionObject, forConstructorHeaders, forEnumEntries),\n primaryConstructorPureParametersScope,\n primaryConstructorAllParametersScope,\n FirTowerDataMode.REGULAR\n )\n\n val currentContext: FirTowerDataContext?\n get() = modeMap[activeMode]<|endoftext|>"} {"prompt":"arguments: List,\n erasedParameters: MutableSet?,\n leaveNonReifiedAsIs: Boolean,\n ) =\n arguments.memoryOptimizedMap { argument ->\n (argument as? IrTypeProjection)?.let { proj ->","completion":"remapType(proj.type, erasedParameters, leaveNonReifiedAsIs)?.let { newType ->\n makeTypeProjection(newType, proj.variance)\n } ?: IrStarProjectionImpl\n }\n ?: argument\n }\n\n override fun remapType(type: IrType) = remapType(type, defaultNonReifiedTypeParameterRemappingMode)<|endoftext|>"} {"prompt":"val list4 = ArrayList()\n val range4 = (MaxL - 2).toLong()..MaxL\n for (i in range4) {\n list4.add(i)\n if (list4.size > 23) break\n }\n if (list4 != listOf((MaxL - 2).toLong(), (MaxL - 1).toLong(), MaxL)) {","completion":"return \"Wrong elements for (MaxL - 2).toLong()..MaxL: $list4\"\n }\n\n val list5 = ArrayList()\n val range5 = (MaxC - 2)..MaxC\n for (i in range5) {\n list5.add(i)\n if (list5.size > 23) break\n }<|endoftext|>"} {"prompt":"\/\/ CHECK-OPT-NOT: Foo#toString(){}kotlin.String\"\n\/\/ CHECK-OPT: %struct.ObjHeader* @\"kfun:kotlin.text.StringBuilder#append(kotlin.String?)\n\/\/ CHECK-OPT: %struct.ObjHeader* @\"kfun:kotlin.text.StringBuilder#append(kotlin.String?)","completion":"\/\/ CHECK-OPT-NOT: %struct.ObjHeader* @\"kfun:kotlin.text.StringBuilder#append\n\/\/ CHECK-OPT: %struct.ObjHeader* @\"kfun:codegen.stringConcatenationTypeNarrowing.kt53119_append_generated.Foo#toString(){}kotlin.String\"<|endoftext|>"} {"prompt":"because there are no ${f.element.pluralize()} in it that _do not_ match the predicate.\n See a more detailed explanation of this logic concept in [\"Vacuous truth\"](https:\/\/en.wikipedia.org\/wiki\/Vacuous_truth) article. \n \"\"\"\n }\n sample(\"samples.collections.Collections.Aggregates.all\")\n returns(\"Boolean\")","completion":"body {\n \"\"\"\n ${when (f) {\n Iterables -> \"if (this is Collection && isEmpty()) return true\"\n Maps -> \"if (isEmpty()) return true\"\n else -> \"\"\n }}\n for (element in this) if (!predicate(element)) return false\n return true\n \"\"\"\n }\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.declarations.*\nimport org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor\nimport org.jetbrains.kotlin.fir.declarations.utils.*\nimport org.jetbrains.kotlin.fir.expressions.*","completion":"import org.jetbrains.kotlin.fir.references.FirThisReference\nimport org.jetbrains.kotlin.fir.references.symbol\nimport org.jetbrains.kotlin.fir.resolve.fullyExpandedType\nimport org.jetbrains.kotlin.fir.resolve.toSymbol<|endoftext|>"} {"prompt":"0x401d8e64b8d4ddaeUL, 0x3ff48b5e3c3e8186UL, 0x404b4c902e273a58UL, 0x3fd78b56362cef38UL,","completion":"0x3fd78b56362df217UL, 0x3fd78b56362bec59UL, 0x3fe368b2fc6f960aUL, 0x3fc152aaa3bf81ccUL, \n 0x3fe8ebef9eac820bUL, 0x3f92c155b8213cf4UL, \n )<|endoftext|>"} {"prompt":"returns(true).let { it implies (x is Number) } \/\/ 'ConditionalEffect' as result\n }\n return x is Number\n}\n\n\/\/ TESTCASE NUMBER: 5\nfun case_5(x: Any?): Boolean {\n contract {","completion":"returns(true).run { implies (x is Number) } \/\/ 'ConditionalEffect' as result\n }\n return x is Number\n}\n\n\/\/ TESTCASE NUMBER: 6\nfun case_6(x: Any?): Boolean {\n contract {<|endoftext|>"} {"prompt":"}\n\n val size = expression.valueArgumentsCount\n\n for (i in 0 until size) {\n val argument = expression.getValueArgument(i)\n val parameter = expression.symbol.owner.valueParameters[i]\n val varargElementType = parameter.varargElementType\n if (argument == null && varargElementType != null) {","completion":"val arrayInfo = InlineClassArrayInfo(context, varargElementType, parameter.type)\n val emptyArray = with(arrayInfo) {\n boxArrayIfNeeded(toPrimitiveArrayLiteral(emptyList()))\n }\n\n expression.putValueArgument(i, emptyArray)\n }\n }\n\n return expression\n }\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\nclass C {\n var x: Int = 0\n}\n\nfun test(\u0441: C?, a: Any) {\n \u0441?.x = if (a is String) 0 else throw Exception();\n a.toUpperCase()\n}\n\n\nfun main(args: Array) {\n test(null, 1)","completion":"}<|endoftext|>"} {"prompt":"if (irBranches.size == 1) {\n val irBranch0 = irBranches[0]\n return buildStatement(ktIf.startOffsetSkippingComments, ktIf.endOffset) {\n irIfThenMaybeElse(resultType, irBranch0.condition, irBranch0.result, irElseResult, IrStatementOrigin.IF)\n }\n }","completion":"val irWhen = IrWhenImpl(ktIf.startOffsetSkippingComments, ktIf.endOffset, resultType, IrStatementOrigin.IF)\n\n irWhen.branches.addAll(irBranches)\n\n irElseResult?.let {\n irWhen.branches.add(elseBranch(it))\n }\n\n return irWhen\n }<|endoftext|>"} {"prompt":"var x: Any = materialize()\n exactlyOnce {\n while (x is String) {\n x.length\n x = 10\n }\n }\n}\n\nfun test47() {\n var x: Any = materialize()\n atLeastOnce {\n while (x is String) {","completion":"x.length\n x = 10\n }\n }\n}\n\nfun test48() {\n var x: Any = materialize()\n runWithoutContract {\n while (x is String) {\n x.length\n x = 10\n }\n }\n}<|endoftext|>"} {"prompt":"val incrementalDataOutputDir = options.incrementalDataOutputDir ?: return\n\n val reportOutputFiles = kaptContext.generationState.configuration.getBoolean(CommonConfigurationKeys.REPORT_OUTPUT_FILES)\n kaptContext.generationState.factory.writeAll(\n incrementalDataOutputDir,","completion":"if (!reportOutputFiles) null else fun(sources: List, output: File) {\n messageCollector.report(OUTPUT, OutputMessageUtil.formatOutputMessage(sources, output))\n }\n )\n }\n\n protected abstract fun loadProcessors(): LoadedProcessors\n}\n\n\ninline fun measureTimeMillis(block: () -> T): Pair {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinaryClass\nimport org.jetbrains.kotlin.load.kotlin.MemberSignature\nimport org.jetbrains.kotlin.load.kotlin.getPropertySignature\nimport org.jetbrains.kotlin.metadata.ProtoBuf","completion":"import org.jetbrains.kotlin.metadata.deserialization.*\nimport org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf\nimport org.jetbrains.kotlin.metadata.jvm.deserialization.JvmFlags\nimport org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil<|endoftext|>"} {"prompt":"origin = origin\n )\n }\n\n private fun createFakeBridgeBuilderResult(\n fqName: String,\n namesToBeDeclared: List\n ): BridgeBuilderResult {\n val nativeBridges = object : NativeBridges {\n override fun isSupported(nativeBacked: NativeBacked): Boolean = true","completion":"override val kotlinLines: Sequence = emptySequence()\n override val nativeLines: Sequence = emptySequence()\n }\n val kotlinFile = object : KotlinFile(fqName, namesToBeDeclared) {\n override val mappingBridgeGenerator: MappingBridgeGenerator\n get() = error(\"Not needed for tests.\")\n }<|endoftext|>"} {"prompt":"private val guardToLoopLabel = mutableMapOf()\n\n fun apply(): Boolean {\n analyze()\n perform()\n return hasChanges\n }\n\n private fun analyze() {\n object : RecursiveJsVisitor() {\n override fun visitLabel(x: JsLabel) {\n val statement = x.statement","completion":"if (statement is JsDoWhile) {\n processDoWhile(statement, x.name)\n }\n else {\n super.visitLabel(x)\n }\n }\n\n override fun visitDoWhile(x: JsDoWhile) = processDoWhile(x, null)\n\n private fun processDoWhile(x: JsDoWhile, label: JsName?) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.calls.components.CheckVisibility\nimport org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo\nimport org.jetbrains.kotlin.resolve.calls.components.CompatibilityOfPartiallyApplicableSamConversion","completion":"import org.jetbrains.kotlin.resolve.calls.components.CreateFreshVariablesSubstitutor\nimport org.jetbrains.kotlin.resolve.calls.components.EagerResolveOfCallableReferences\nimport org.jetbrains.kotlin.resolve.calls.components.MapArguments<|endoftext|>"} {"prompt":"* Structural changes in the base list are synchronized with the view, and vice verse.\n *\/\n @ExperimentalJsExport\n @ExperimentalJsCollectionsApi\n @SinceKotlin(\"2.0\")\n public fun asJsArrayView(): JsArray = createJsArrayViewFrom(this)\n}\n\n\/**\n * A generic unordered collection of elements that does not support duplicate elements.","completion":"* Methods in this interface support only read-only access to the set;\n * read\/write access is supported through the [MutableSet] interface.\n * @param E the type of elements contained in the set. The set is covariant in its element type.\n *\/\npublic interface Set : Collection {\n \/\/ Query Operations\n\n override val size: Int\n\n override fun isEmpty(): Boolean<|endoftext|>"} {"prompt":"$i$a$-foo-LibraryKt$flaf$1\\3\\60\\1:int=0:int, x\\3:int=1:int","completion":"\/\/ library.kt:5 box: $i$f$flaf\\1\\27:int=0:int, flafVar\\1:int=0:int, fooParam\\2:int=0:int, $i$f$foo\\2\\58:int=0:int, fooVar\\2:int=0:int, it\\3:int=42:int,<|endoftext|>"} {"prompt":"ProperArrayConventionSetterWithDefaultCalls(KOTLIN_1_5, kind = OTHER),\n AdaptedCallableReferenceAgainstReflectiveType(null),\n InferenceCompatibility(KOTLIN_1_5, kind = BUG_FIX),\n RequiredPrimaryConstructorDelegationCallInEnums(KOTLIN_1_5, kind = BUG_FIX),","completion":"ApproximateAnonymousReturnTypesInPrivateInlineFunctions(KOTLIN_1_5, kind = BUG_FIX),\n ForbidReferencingToUnderscoreNamedParameterOfCatchBlock(KOTLIN_1_5, kind = BUG_FIX),\n UseCorrectExecutionOrderForVarargArguments(KOTLIN_1_5, kind = BUG_FIX),<|endoftext|>"} {"prompt":"class TestAcceptedAnnotationsAsyncResolver : AsyncDependenciesResolver, AcceptedAnnotationsCheck {\n @AcceptedAnnotations(TestAnno1::class, TestAnno3::class)\n override suspend fun resolveAsync(scriptContents: ScriptContents, environment: Environment): ResolveResult {\n return checkHasAnno1Annotation(scriptContents)\n }\n}","completion":"class TestAcceptedAnnotationsLegacyResolver : ScriptDependenciesResolver, AcceptedAnnotationsCheck {\n @AcceptedAnnotations(TestAnno1::class, TestAnno3::class)\n override fun resolve(\n script: ScriptContents,\n environment: Environment?,\n report: (ScriptDependenciesResolver.ReportSeverity, String, ScriptContents.Position?) -> Unit,<|endoftext|>"} {"prompt":"* In order to go backwards the [step] must be negative.\n *\n * [step] must be greater than `Int.MIN_VALUE` and not equal to zero.\n *\/\n public fun fromClosedRange(rangeStart: Int, rangeEnd: Int, step: Int): IntProgression = IntProgression(rangeStart, rangeEnd, step)\n }\n}\n\n\/**","completion":"* A progression of values of type `Long`.\n *\/\npublic open class LongProgression\n internal constructor\n (\n start: Long,\n endInclusive: Long,\n step: Long\n ) : Iterable {\n init {\n if (step == 0L) throw kotlin.IllegalArgumentException(\"Step must be non-zero.\")<|endoftext|>"} {"prompt":"this.isConst -> FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE\n else -> FirResolvePhase.BODY_RESOLVE\n }\n lazyResolveToPhase(requiredPhase)\n return fir.initializer\n }\n\n val resolvedDefaultValue: FirExpression?\n get() {\n val valueParameter = fir as? FirValueParameter","completion":"if (valueParameter?.defaultValue == null) return null\n\n lazyResolveToPhase(FirResolvePhase.BODY_RESOLVE)\n return valueParameter.defaultValue\n }\n}\n\nopen class FirPropertySymbol(callableId: CallableId, ) : FirVariableSymbol(callableId), PropertySymbolMarker {<|endoftext|>"} {"prompt":"pipelineType = testRunSettings.get(),\n dependencies = moduleDependencies.map {\n if (useHeaders) it.klibFile.toHeaderCacheArtifact().toDependency() else it.klibFile.toStaticCacheArtifact().toDependency()\n } + klib.toKlib().toDependency(),\n expectedArtifact = klib.toStaticCacheArtifact()","completion":")\n\n compilation.trigger()\n }\n\n private inner class LightDependencyWithVersion(\n val name: String, val version: Int\n ) {\n val module: TestModule.Exclusive = TestModule.Exclusive(\n name = name,\n directDependencySymbols = emptySet(),\n directFriendSymbols = emptySet(),<|endoftext|>"} {"prompt":"\/** Computes the sine of the angle [x] given in radians.\n *\n * Special cases:\n * - `sin(NaN|+Inf|-Inf)` is `NaN`\n *\/\n@SinceKotlin(\"1.2\")\n@GCUnsafeCall(\"Kotlin_math_sinf\")\nexternal public actual fun sin(x: Float): Float","completion":"\/** Computes the cosine of the angle [x] given in radians.\n *\n * Special cases:\n * - `cos(NaN|+Inf|-Inf)` is `NaN`\n *\/\n@SinceKotlin(\"1.2\")\n@GCUnsafeCall(\"Kotlin_math_cosf\")\nexternal public actual fun cos(x: Float): Float<|endoftext|>"} {"prompt":"equal(lam2, { (genericFakeOverride as GenericMFVCHolderWithImpls).p = dPoint })\n equal(lam4, { genericFakeOverride.p1 = dPoint })\n equal(lam4, { (genericFakeOverride as GenericMFVCHolderWithImpls).p1 = dPoint })\n equal(lam10, { reifiedFakeOverride.p = dPoint })","completion":"equal(lam10, { (reifiedFakeOverride as ReifiedMFVCHolderWithImpls).p = dPoint })\n equal(lam12, { reifiedFakeOverride.p1 = dPoint })\n equal(lam12, { (reifiedFakeOverride as ReifiedMFVCHolderWithImpls).p1 = dPoint })<|endoftext|>"} {"prompt":"internal inline fun withLogFile(prefix: String, suffix: String = \".log\", printLogOnException: Boolean = true, body: (File) -> Unit) {\n val logFile = FileUtil.createTempFile(prefix, suffix)\n try {\n body(logFile)\n }\n catch (e: Exception) {\n if (printLogOnException) {","completion":"Thread.sleep(100) \/\/ trying to wait log flushing\n System.err.println(\"--- log file ${logFile.name}:\\n${logFile.readText()}\\n---\")\n }\n throw e\n }\n}\n\n\/\/ java.util.Logger used in the daemon silently forgets to log into a file specified in the config on Windows,<|endoftext|>"} {"prompt":"open fun testTypeParameterWithMultipleShuffledUpperBoundsBB(arg: T) where T: UserInterfaceA {}","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) open fun testTypeParameterWithMultipleShuffledUpperBoundsBC(arg: Invariant) where T: UserInterfaceB {}<|endoftext|>"} {"prompt":"if (isVarargs && this.javaClass == Array::class.java)\n \/\/ if the array came from varargs and already is array of Any, copying isn't required\n @Suppress(\"UNCHECKED_CAST\") (this as Array)\n else\n java.util.Arrays.copyOf(this, this.size, Array::class.java)","completion":"@PublishedApi\n@SinceKotlin(\"1.3\")\n@InlineOnly\ninternal actual inline fun checkIndexOverflow(index: Int): Int {\n if (index < 0) {\n if (apiVersionIsAtLeast(1, 3, 0))\n throwIndexOverflow()\n else\n throw ArithmeticException(\"Index overflow has happened.\")\n }\n return index\n}\n\n@PublishedApi<|endoftext|>"} {"prompt":"x\n x.inv()\n }\n}\n\n\/*\n * TESTCASE NUMBER: 2","completion":"* UNEXPECTED BEHAVIOUR\n * ISSUES: KT-29935\n *\/\nfun case_2(x: Int?) {\n if (x != @RetentionSourceAndTargetExpression null == true) {\n x<|endoftext|>"} {"prompt":"dir.findChild(fileName)?.takeIf(VirtualFile::isValid)\n }?.takeIf { it in scope }\n\n private fun findSigFileIfEnabled(\n dir: VirtualFile,\n simpleName: String\n ) = if (enableSearchInCtSym) dir.findChild(\"$simpleName.sig\") else null","completion":"private fun findBinaryOrSigClass(classId: ClassId, simpleName: String, rootType: Set) =\n index.findClass(classId, acceptedRootTypes = rootType) { dir, _ ->\n val file = dir.findChild(\"$simpleName.class\") ?: findSigFileIfEnabled(dir, simpleName)<|endoftext|>"} {"prompt":"class A {\n val lambda: () -> Unit = TODO()\n val memberInvoke: B = TODO()\n val extensionInvoke: C = TODO()\n}\n\nclass B {\n operator fun invoke() {}\n}\n\nclass C\noperator fun C.invoke() {}\n\nfun test(a: A?) {","completion":"a?.lambda()\n a?.memberInvoke()\n a?.extensionInvoke()\n}<|endoftext|>"} {"prompt":"interface In\n\nclass En : In\nclass A : In\nfun select(x: T, y: T): T = x ?: y\n\n\/\/ This test just checks that no internal error happens in backend\n\/\/ Return type should be In<*> nor In\nfun foobar(e: En<*>) = select(A(), e)","completion":"fun box() = \"OK\"<|endoftext|>"} {"prompt":"assertTrue(file.isDirectory, \"$name is not directory, only directories should be left\")\n assertFalse(namesTopDownLeave.contains(name), \"$name is left twice\")\n namesTopDownLeave.add(name)\n assertTrue(namesTopDownEnter.contains(name), \"$name is left before entrance\")\n }\n\n fun visit(file: File) {","completion":"val name = file.relativeToOrSelf(basedir).invariantSeparatorsPath\n if (file.isDirectory) {\n assertTrue(namesTopDownEnter.contains(name), \"$name is visited before entrance\")\n namesTopDown.add(name)\n assertFalse(namesTopDownLeave.contains(name), \"$name is visited after leaving\")\n }\n if (file == basedir)<|endoftext|>"} {"prompt":"fun foo(total: String) = 10\n\nfun id(x: T) = x\n\nfun main() {\n var newValue = A()\n newValue += id { total -> A() }\n newValue += id(fun(total) = A())","completion":"newValue += id(fun(total): A { return A() })\n newValue += id(::foo)\n}<|endoftext|>"} {"prompt":"assertFalse(eqByteDoubleQ(1.toByte(), 0.toDouble()))\n assertTrue(eqByteDoubleQ(1.toByte(), 1.toDouble()))\n assertFalse(eqByteDoubleQ(1.toByte(), null))\n assertFalse(eqByteDoubleQ(1.toByte(), undefined))\n assertTrue(eqByteQDouble(0.toByte(), 0.toDouble()))","completion":"assertFalse(eqByteQDouble(0.toByte(), 1.toDouble()))\n assertFalse(eqByteQDouble(1.toByte(), 0.toDouble()))\n assertTrue(eqByteQDouble(1.toByte(), 1.toDouble()))\n assertFalse(eqByteQDouble(null, 0.toDouble()))\n assertFalse(eqByteQDouble(null, 1.toDouble()))<|endoftext|>"} {"prompt":"val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n\/**\n * Exposes the JavaScript [SVGCursorElement](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/SVGCursorElement) to Kotlin\n *\/","completion":"public external abstract class SVGCursorElement : SVGElement, SVGURIReference, JsAny {\n open val x: SVGAnimatedLength\n open val y: SVGAnimatedLength\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short<|endoftext|>"} {"prompt":"fun test_ok_1(base: Base) {\n val x = when (base) {\n is A -> 1\n is B -> 2\n is E -> 3\n }\n}\n\nfun test_ok_2(base: Base) {\n val x = when (base) {\n is A -> 1\n is B.C -> 2\n is B.D -> 3\n E.First -> 4","completion":"E.Second -> 5\n }\n}\n\nfun test_ok_3(sameFile: SameFile) {\n val x = when (sameFile) {\n is SameFile.A -> 1\n is SameFile.B -> 2\n }\n}\n\nfun test_error_1(base: Base) {<|endoftext|>"} {"prompt":"val answers = arrayOf(\n 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x3ff0000000000000UL, 0xbfefffe62ecfab75UL, \n 0x7ff8000000000000UL, 0x3fd745ba83a7adcaUL, 0x3ff0000000000000UL, 0x3ff0000000000000UL,","completion":"0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL, \n 0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL,<|endoftext|>"} {"prompt":"override fun getDeclaredClass(symbol: IrClassSymbol) = symbol\n\n override fun getDeclaredScript(symbol: IrScriptSymbol) = symbol\n\n override fun getDeclaredFunction(symbol: IrSimpleFunctionSymbol) = symbol\n\n override fun getDeclaredProperty(symbol: IrPropertySymbol) = symbol","completion":"override fun getDeclaredField(symbol: IrFieldSymbol) = symbol\n\n override fun getDeclaredFile(symbol: IrFileSymbol) = symbol\n\n override fun getDeclaredConstructor(symbol: IrConstructorSymbol) = symbol\n\n override fun getDeclaredEnumEntry(symbol: IrEnumEntrySymbol) = symbol<|endoftext|>"} {"prompt":"override val diagnosticClass get() = OverrideCannotBeStatic::class\n }\n\n interface JvmStaticNotInObjectOrClassCompanion : KtFirDiagnostic {\n override val diagnosticClass get() = JvmStaticNotInObjectOrClassCompanion::class\n }","completion":"interface JvmStaticNotInObjectOrCompanion : KtFirDiagnostic {\n override val diagnosticClass get() = JvmStaticNotInObjectOrCompanion::class\n }\n\n interface JvmStaticOnNonPublicMember : KtFirDiagnostic {\n override val diagnosticClass get() = JvmStaticOnNonPublicMember::class\n }<|endoftext|>"} {"prompt":"override fun conflictinglyAnnotatedProduce(): String?\n}\n\nfun test(\n a: conflictinglyannotatedpackage.UnannotatedType,\n b: unannotatedpackage.ConflictinglyAnnotatedType,\n c: unannotatedpackage.UnannotatedType\n) {","completion":"a.unannotatedConsume(null)\n b.unannotatedConsume(null)\n c.conflictinglyAnnotatedConsume(null)<|endoftext|>"} {"prompt":"a.propNullableAny\n a.funT()","completion":"a.funAny()\n a.funNullableT()<|endoftext|>"} {"prompt":"public fun maxOf(a: kotlin.ULong, vararg other: kotlin.ULong): kotlin.ULong\n\n@kotlin.SinceKotlin(version = \"1.5\")\n@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})","completion":"public fun maxOf(a: kotlin.UShort, b: kotlin.UShort): kotlin.UShort\n\n@kotlin.SinceKotlin(version = \"1.5\")\n@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"\":allTests\",\n )\n assertNoTestsStateFileException()\n }\n\n build(\":allTests\") {\n assertTasksUpToDate(\n \":jsNodeTest\",\n \":jsTest\",\n \":jvmWithoutJavaTest\",\n \":${nativeTarget}Test\",\n \":allTests\",\n )\n assertNoTestsStateFileException()\n }","completion":"build(\":jvmWithoutJavaTest\") {\n assertTasksUpToDate(\n \":jvmWithoutJavaTest\",\n )\n assertNoTestsStateFileException()\n }\n\n build(\":jsTest\") {\n assertTasksUpToDate(\n \":jsNodeTest\",\n )\n assertNoTestsStateFileException()\n }<|endoftext|>"} {"prompt":"(irConstructor.body as IrBlockBody).statements.forEach { statement ->\n statement.setDeclarationsParent(result)\n +statement.transformStatement(object : IrElementTransformerVoid() {\n override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall): IrExpression {\n expression.transformChildrenVoid()\n\n return irBlock(expression) {","completion":"thisVar = if (irConstructor.isPrimary) {\n \/\/ Note: block is empty in this case.\n result.valueParameters.single()\n } else {\n val value = lowerConstructorCallToValue(expression, expression.symbol.owner)\n irTemporary(value)\n }\n }\n }\n\n override fun visitGetValue(expression: IrGetValue): IrExpression {<|endoftext|>"} {"prompt":"if (a.b !== null) a.b.funNullableAny()\n if (a.b !== null) a.b","completion":"if (a.e !== null) a.e.equals(null)\n if (a.e !== null) a.e.propT<|endoftext|>"} {"prompt":"classpath = getMainKtsClassPath()\n )\n }\n\n @Test\n fun testStandardScriptWithDepsViaKotlinc() {\n runWithKotlinc(\n \"$TEST_DATA_DIR\/integration\/withDependencyOnCompileClassPath.kts\", listOf(\"Hello from standard kts!\"),\n classpath = getMainKtsClassPath()\n )","completion":"}\n\n @Test\n fun testExpression() {\n runWithK2JVMCompiler(\n arrayOf(\n \"-expression\",\n \"val x = 7; println(x * 6); for (arg in args) println(arg)\",\n \"--\",\n \"hi\",\n \"there\"\n ),\n listOf(\"42\", \"hi\", \"there\")\n )\n }<|endoftext|>"} {"prompt":"?> & ClassWithThreeTypeParameters?>?\")!>x.propT<|endoftext|>"} {"prompt":"if (3u in 1u..3u != range0.contains(3u)) throw AssertionError()\n if (3u !in 1u..3u != !range0.contains(3u)) throw AssertionError()\n if (!(3u in 1u..3u) != !range0.contains(3u)) throw AssertionError()","completion":"if (!(3u !in 1u..3u) != range0.contains(3u)) throw AssertionError()\n \/\/ no local optimizations\n if (element3 in 1u..3u != range0.contains(element3)) throw AssertionError()\n if (element3 !in 1u..3u != !range0.contains(element3)) throw AssertionError()<|endoftext|>"} {"prompt":"+\" CG NODE #${constraintNode.id}: ${constraintNode.toString(allTypes)}\"\n }\n +\"Returns: #${ids[function.body.returns]}\"\n +\"\"\n }\n }\n\n suitableTypes.forEach {\n it?.and(instantiatingClasses)\n it?.set(VIRTUAL_TYPE_ID)","completion":"}\n }\n\n private fun createFunctionConstraintGraph(symbol: DataFlowIR.FunctionSymbol, isRoot: Boolean): Function? {\n if (symbol is DataFlowIR.FunctionSymbol.External) return null\n constraintGraph.functions[symbol]?.let { return it }<|endoftext|>"} {"prompt":"if (x != null) this.x.funNullableT()\n if (x != null) this.x.funNullableAny()","completion":"if (x != null) this.x\n if (this.x != null) x.equals(null)<|endoftext|>"} {"prompt":"if (log != expectedLog) throw AssertionError(\"$id expectedLog: $expectedLog, actual: $log\")\n}\n\nobject A {\n var x = 0\n get() = field.also { log += \"get-A.x;\" }\n set(value: Int) {\n log += \"set-A.x;\"\n field = value\n }\n\n}","completion":"fun getA() = A.also { log += \"getA();\" }\n\nobject B {\n var x = 0\n\n operator fun get(i1: Int, i2: Int, i3: Int): Int = x.also { log += \"get-B($i1, $i2, $i3);\" }<|endoftext|>"} {"prompt":"\/\/ `LLFirSessionCache` is used as a disposable parent so that disposal is triggered after the Kotlin plugin is unloaded. We don't\n \/\/ register a module as a disposable parent, because (1) IJ `Module`s may persist beyond the plugin's lifetime, (2) not all\n \/\/ `KtModule`s have a corresponding `Module`, and (3) sessions are invalidated (and subsequently cleaned up) when their module is","completion":"\/\/ removed.\n Disposer.register(LLFirSessionCache.getInstance(project), disposable)\n\n disposable\n }\n\n \/**\n * Returns an already registered [Disposable] which is alive until the session is invalidated. It can be used as a parent disposable for<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.utils.addToStdlib.runUnless\nimport org.jetbrains.org.objectweb.asm.Type\n\nclass FirJvmTypeMapper(val session: FirSession) : FirSessionComponent {\n companion object {\n val NON_EXISTENT_ID = ClassId.topLevel(StandardNames.NON_EXISTENT_CLASS)","completion":"private val typeForNonExistentClass = NON_EXISTENT_ID.toLookupTag().constructClassType(ConeTypeProjection.EMPTY_ARRAY, isNullable = false)\n }\n\n fun mapType(\n type: ConeKotlinType,\n mode: TypeMappingMode = TypeMappingMode.DEFAULT,\n sw: JvmSignatureWriter? = null,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtReceiverParameterSymbol\nimport org.jetbrains.kotlin.analysis.api.descriptors.symbols.descriptorBased.base.toKtType","completion":"import org.jetbrains.kotlin.analysis.api.descriptors.symbols.isEqualTo\nimport org.jetbrains.kotlin.analysis.api.descriptors.symbols.pointers.KtFe10NeverRestoringSymbolPointer<|endoftext|>"} {"prompt":"private val rendererForC: DiagnosticParameterRenderer?,\n private val rendererForD: DiagnosticParameterRenderer?,\n) : AbstractDiagnosticWithParametersRenderer>(message) {","completion":"override fun renderParameters(diagnostic: DiagnosticWithParameters4<*, A, B, C, D>): Array {\n val context = RenderingContext.of(diagnostic.a, diagnostic.b, diagnostic.c, diagnostic.d)\n return arrayOf(\n renderParameter(diagnostic.a, rendererForA, context),<|endoftext|>"} {"prompt":"state: GenerationState\n ): Set> {\n\n val functionHandle = DescriptorBasedFunctionHandleForJvm(function, state)\n val fake = !functionHandle.isDeclaration\n val overriddenBuiltin = function.getOverriddenBuiltinReflectingJvmDescriptor()!!\n\n val reachableDeclarations = findAllReachableDeclarations(function, state)","completion":"\/\/ e.g. `getSize()I`\n val methodItself = signatureByDescriptor(function)\n \/\/ e.g. `size()I`\n val specialBridgeSignature = signatureByDescriptor(overriddenBuiltin)\n\n val specialBridgeExists = function.getSpecialBridgeSignatureIfExists(signatureByDescriptor) != null<|endoftext|>"} {"prompt":"\/\/ _Arrays.kt:... box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass, $this$map\\21:java.lang.Object[]=java.lang.Integer[], $i$f$map\\21\\450:int=0:int,","completion":"$this$mapTo\\22:java.lang.Object[]=java.lang.Integer[], destination\\22:java.util.Collection=java.util.ArrayList, $i$f$mapTo\\22\\451:int=0:int, item\\22:java.lang.Object=java.lang.Integer<|endoftext|>"} {"prompt":"class UnsafeCall(val actualType: ConeKotlinType) : ResolutionDiagnostic(UNSAFE_CALL)\n\nobject LowerPriorityToPreserveCompatibilityDiagnostic : ResolutionDiagnostic(RESOLVED_NEED_PRESERVE_COMPATIBILITY)\n\nobject LowerPriorityForDynamic : ResolutionDiagnostic(RESOLVED_LOW_PRIORITY)","completion":"object CandidateChosenUsingOverloadResolutionByLambdaAnnotation : ResolutionDiagnostic(RESOLVED)\n\nclass UnstableSmartCast(val argument: FirSmartCastExpression, val targetType: ConeKotlinType, val isCastToNotNull: Boolean, val isImplicitInvokeReceiver: Boolean) :\n ResolutionDiagnostic(UNSTABLE_SMARTCAST)<|endoftext|>"} {"prompt":"override fun lower(irFile: IrFile) {\n irFile.transformChildrenVoid(object : IrElementTransformerVoid() {\n override fun visitClass(declaration: IrClass): IrStatement {\n declaration.transformChildrenVoid()\n if (declaration.kind == ClassKind.ENUM_CLASS)\n EnumClassTransformer(declaration).run()\n return declaration\n }","completion":"})\n }\n\n private inner class EnumClassTransformer(val irClass: IrClass) {\n private val valuesField = context.irFactory.buildField {\n startOffset = irClass.startOffset\n endOffset = irClass.endOffset\n origin = DECLARATION_ORIGIN_ENUM\n name = \"VALUES\".synthesizedName<|endoftext|>"} {"prompt":"fun javaClassesDir(\n sourceSet: String = \"main\",\n ): Path = classesDir(sourceSet, language = \"java\")\n\n fun kotlinSourcesDir(\n sourceSet: String = \"main\",\n ): Path = projectPath.resolve(\"src\/$sourceSet\/kotlin\")\n\n fun javaSourcesDir(\n sourceSet: String = \"main\",","completion":"): Path = projectPath.resolve(\"src\/$sourceSet\/java\")\n\n fun relativeToProject(\n files: List,\n ): List = files.map { projectPath.relativize(it) }\n}\n\n\/**\n * You need at least [TestVersions.Gradle.G_7_0] for supporting environment variables with gradle runner\n *\/\n@JvmInline<|endoftext|>"} {"prompt":"val classDescriptor = (serializerDescriptor.containingDeclaration as? ClassDescriptor) ?: return null\n if (!classDescriptor.shouldHaveGeneratedSerializer) return null\n return classDescriptor\n}\n\nfun ClassDescriptor.checkSerializableClassPropertyResult(prop: PropertyDescriptor): Boolean =","completion":"prop.returnType!!.isSubtypeOf(getClassFromSerializationPackage(SerialEntityNames.SERIAL_DESCRIPTOR_CLASS).toSimpleType(false)) \/\/ todo: cache lookup\n\n\/\/ todo: serialization: do an actual check better that just number of parameters\nfun ClassDescriptor.checkSaveMethodParameters(parameters: List): Boolean =\n parameters.size == 2<|endoftext|>"} {"prompt":"private fun CheckerContext.checkCustomSerializerIsNotLocal(\n source: KtSourceElement?,\n classSymbol: FirClassSymbol<*>,\n serializerType: ConeKotlinType,\n reporter: DiagnosticReporter\n ) {\n val serializerClassId = serializerType.classId ?: return\n if (serializerClassId.isLocal) {","completion":"reporter.reportOn(\n source ?: classSymbol.serializableOrMetaAnnotationSource(session),\n FirSerializationErrors.LOCAL_SERIALIZER_USAGE,\n serializerType,\n this\n )\n }\n }\n\n private fun CheckerContext.checkSerializerNullability(\n classType: ConeKotlinType,<|endoftext|>"} {"prompt":"* PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 3\n * SECONDARY LINKS: statements, assignments, operator-assignments -> paragraph 2 -> sentence 1\n * statements, assignments, operator-assignments -> paragraph 2 -> sentence 2","completion":"* statements, assignments, operator-assignments -> paragraph 2 -> sentence 3\n * NUMBER: 1\n * DESCRIPTION: nullable receiver\n *\/\n\nfun box(): String {\n val a: A? = A(B())\n val c: C = C()\n\n a?.b += c\n if (f3 && !f1 && !f2 && !f4) {\n f3 = false<|endoftext|>"} {"prompt":"fun testTypeParameterWithTypeAliasedUpperBoundsB(arg: T) {}\n\n fun testTypeParameterWithTypeAliasedUpperBoundsBReverse(arg: T) {}","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun testTypeParameterWithTypeAliasedUpperBoundsBReverse(arg: T) {}\n\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun testTypeParameterWithTypeAliasedUpperBoundsC(arg: Invariant) {}<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !LANGUAGE: +ForbidUsingExtensionPropertyTypeParameterInDelegate\n\/\/ WITH_REFLECT\n\nimport kotlin.reflect.KProperty\nimport kotlin.properties.ReadOnlyProperty\n\nfun logged(getter: (T) -> V) =\n ReadOnlyProperty { thisRef, property ->","completion":"println(\"Getter for $property is invoked\")\n getter(thisRef)\n }\n\nval List.second: T by logged { it[1] }\n\nclass Delegate(private val fn: (List) -> T) {\n private var cache: T? = null\n\n operator fun getValue(thisRef: List, kProperty: KProperty<*>) =<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.CompileTimeConstantUtils\nimport org.jetbrains.kotlin.resolve.bindingContextUtil.getEnclosingFunctionDescriptor\nimport org.jetbrains.kotlin.resolve.bindingContextUtil.recordUsedAsExpression\nimport org.jetbrains.kotlin.resolve.calls.util.getResolvedCall","completion":"import org.jetbrains.kotlin.resolve.calls.model.ArgumentMatch\nimport org.jetbrains.kotlin.resolve.calls.model.ResolvedCall\nimport org.jetbrains.kotlin.resolve.calls.model.VariableAsFunctionResolvedCall\nimport org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kotlin.descriptors.PropertyDescriptor\nimport org.jetbrains.kotlin.types.KotlinType\nimport org.jetbrains.kotlin.types.lowerIfFlexible\nimport org.jetbrains.org.objectweb.asm.Type","completion":"import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter\n\nclass ResourcePropertyStackValue(\n val receiver: StackValue,\n private val typeMapper: KotlinTypeMapper,\n val resource: PropertyDescriptor,\n val container: ClassDescriptor,\n private val containerOptions: ContainerOptionsProxy,\n private val androidPackage: String,<|endoftext|>"} {"prompt":") : KtCallCandidateInfo(candidate, isInBestCandidates)\n\n\/**\n * A candidate that is NOT applicable for a call. A candidate is inapplicable if a call argument is missing or is not assignable to the\n * candidate's parameters, OR a call type argument is missing or does not fit the constraints of the candidate's type parameters.\n *\/\npublic class KtInapplicableCallCandidateInfo(","completion":"candidate: KtCall,\n isInBestCandidates: Boolean,\n private val _diagnostic: KtDiagnostic,\n) : KtCallCandidateInfo(candidate, isInBestCandidates) {\n \/**\n * The reason the [candidate] was not applicable for the call (e.g., argument type mismatch, or no value for parameter).\n *\/<|endoftext|>"} {"prompt":"\/\/ test.kt:7 foo\n\/\/ test.kt:11 foo\n\/\/ test.kt:13 foo\n\/\/ test.kt:5 foo\n\/\/ test.kt:8 foo\n\/\/ test.kt:11 foo\n\/\/ test.kt:14 foo\n\/\/ test.kt:11 foo\n\/\/ test.kt:16 foo\n\/\/ test.kt:13 foo\n\/\/ test.kt:11 foo\n\/\/ test.kt:16 foo","completion":"\/\/ test.kt:6 foo\n\/\/ test.kt:11 foo\n\/\/ test.kt:12 foo\n\/\/ test.kt:5 foo\n\/\/ test.kt:7 foo\n\/\/ test.kt:5 foo\n\/\/ test.kt:8 foo\n\/\/ test.kt:11 foo\n\/\/ test.kt:14 foo\n\/\/ test.kt:11 foo\n\/\/ test.kt:16 foo\n\/\/ test.kt:7 foo<|endoftext|>"} {"prompt":"\/\/ JVM_ABI_K1_K2_DIFF: KT-63861\n\n\/\/ FILE: 1.kt\n\npackage test\n\npublic inline fun doCall(block: ()-> Long, exception: (e: Exception)-> Unit, finallyBlock: ()-> Long, res: Long = -1111.toLong()) : Long {\n try {\n block()\n } catch (e: Exception) {","completion":"exception(e)\n } finally {\n finallyBlock()\n }\n return res\n}\n\npublic inline fun doCall2(block: ()-> R, exception: (e: Exception)-> Unit, finallyBlock: ()-> R, res: R) : R {\n try {\n return block()\n } catch (e: Exception) {\n exception(e)\n } finally {<|endoftext|>"} {"prompt":"require(copyCall is FirMultiDelegatedConstructorCall)\n require(targetCall.delegatedConstructorCalls.size == copyCall.delegatedConstructorCalls.size)\n\n val newCalls = targetCall.delegatedConstructorCalls.zip(copyCall.delegatedConstructorCalls)","completion":".map { (target, copy) -> target.takeUnless { it is FirLazyDelegatedConstructorCall } ?: copy }\n\n targetCall.replaceDelegatedConstructorCalls(newCalls)\n }\n }\n}\n\nprivate fun replaceLazyInitializer(target: FirVariable, copy: FirVariable) {\n if (target.initializer is FirLazyExpression) {<|endoftext|>"} {"prompt":"private fun findInaccessibleJavaClasses(type: KotlinType, c: ResolutionContext<*>): Collection {\n val scopeOwner = c.scope.ownerDescriptor\n val inaccessibleJavaClasses = LinkedHashSet()\n findInaccessibleJavaClassesRec(type, scopeOwner, inaccessibleJavaClasses, c.languageVersionSettings)\n return inaccessibleJavaClasses","completion":"}\n\n private fun findInaccessibleJavaClassesRec(\n type: KotlinType,\n scopeOwner: DeclarationDescriptor,\n inaccessibleClasses: MutableCollection,\n languageVersionSettings: LanguageVersionSettings\n ) {\n val declarationDescriptor = type.constructor.declarationDescriptor\n\n if (declarationDescriptor is JavaClassDescriptor) {<|endoftext|>"} {"prompt":"}\n}\n\nfun ConeDefinitelyNotNullType.Companion.create(\n original: ConeKotlinType,\n typeContext: ConeTypeContext,\n \/\/ Sometimes, it might be called before type parameter bounds are initialized\n \/\/ or even before the symbols are bound to FIR\n \/\/ In such cases, we just assume it makes sense to create DNN there","completion":"\/\/ NB: `makesSenseToBeDefinitelyNotNull` is mostly an optimization, it should not affect semantics\n avoidComprehensiveCheck: Boolean = false,\n): ConeDefinitelyNotNullType? {\n return when (original) {\n is ConeDefinitelyNotNullType -> original\n is ConeFlexibleType -> create(original.lowerBound, typeContext, avoidComprehensiveCheck)<|endoftext|>"} {"prompt":"0x3d6bffb390866e47UL, 0x400921fb54441119UL, 0x400921fb54441119UL, 0x400921fb54441119UL,","completion":"0x400921fb5443f519UL, 0x400921fb54441f18UL, 0x400921fb5443bd19UL, 0x400921fb54442618UL, \n 0xc00921fb54442d18UL, 0x8000000000000000UL, 0xbff921fb54442d18UL, 0x8000000000002bfbUL,<|endoftext|>"} {"prompt":"open fun b74(): Int = 74\n open fun b75(): Int = 75\n open fun b76(): Int = 76\n open fun b77(): Int = 77\n open fun b78(): Int = 78\n open fun b79(): Int = 79\n open fun b80(): Int = 80\n open fun b81(): Int = 81\n open fun b82(): Int = 82\n open fun b83(): Int = 83","completion":"open fun b84(): Int = 84\n open fun b85(): Int = 85\n open fun b86(): Int = 86\n open fun b87(): Int = 87\n open fun b88(): Int = 88\n open fun b89(): Int = 89\n open fun b90(): Int = 90\n open fun b91(): Int = 91\n open fun b92(): Int = 92\n open fun b93(): Int = 93<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class IC1(val value: Int)\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class IC2(val value: Int)","completion":"fun foo(x: IC1, y: IC2) = (x as Any) == y\n\nfun box(): String {\n if ((IC1(1) as Any) == IC2(1)) return \"Fail 1\"\n if (foo(IC1(1), IC2(1))) return \"Fail 2\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"trace.reportDiagnosticOnce(Errors.REPEATED_ANNOTATION.on(entry))\n } else {\n trace.report(Errors.REPEATED_ANNOTATION_WARNING.on(entry))\n }\n }\n }\n }\n\n private fun checkSuperTypeAnnotations(annotated: KtClassOrObject, trace: BindingTrace) {","completion":"for (superType in annotated.superTypeListEntries.mapNotNull { it.typeReference }) {\n checkTypeReference(superType, trace, isSuperType = true)\n }\n }\n\n private fun checkTypeReference(\n reference: KtTypeReference,\n trace: BindingTrace,\n isSuperType: Boolean = false,\n shouldCheckReferenceItself: Boolean = false,<|endoftext|>"} {"prompt":"* Provides sequential consistent ordering guarantees.\n *\n * @throws [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n *\/\n public fun getAndAdd(index: Int, delta: Long): Long {\n checkBounds(index)\n return array.getAndAdd(index, delta)\n }\n\n \/**","completion":"* Atomically adds the given [delta] to the element at the given [index] and returns the new value of the element.\n *\n * Provides sequential consistent ordering guarantees.\n *\n * @throws [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n *\/\n public fun addAndGet(index: Int, delta: Long): Long {<|endoftext|>"} {"prompt":"setterDeprecated.p = 1\n\n hiddenDeprecated.p\n hiddenDeprecated.p = 1\n\n wd.p\n wd.p = 1\n\n ed.p\n ed.p = 1\n\n gd.p","completion":"gd.p = 1\n\n sd.p\n sd.p = 1\n\n sdh.p\n sdh.p = 1\n\n edh.p\n edh.p = 1\n\n ned.p\n ned.p = 1\n\n diff.p<|endoftext|>"} {"prompt":"tailrec fun foo5(x: String = withEffects(), y: String = withEffects(), z: String = withEffects()) {\n foo5(x, y, z)\n}\n\ntailrec fun foo6(x: String = withEffects(), y: EnumA = EnumA.A) {\n foo6(x, y)\n}","completion":"tailrec fun foo7(x: String = withEffects(), y: KClass = EnumA.A::class) {\n foo7(x, y)\n}<|endoftext|>"} {"prompt":"override val icLogLines: List,\n val kotlinLanguageVersion: KotlinVersion?,\n val changedFiles: SourcesChanges? = null,\n val compilerArguments: Array = emptyArray(),\n val statTags: Set = emptySet(),\n) : BuildOperationRecord {","completion":"override val isFromKotlinPlugin: Boolean = classFqName.startsWith(\"org.jetbrains.kotlin\")\n}\n\nprivate class TransformRecord(\n override val path: String,\n override val classFqName: String,\n override val isFromKotlinPlugin: Boolean,\n override val startTimeMs: Long,\n override val totalTimeMs: Long,<|endoftext|>"} {"prompt":"fun throwExceptionB(b: Boolean) = run { if (b) throw ExcB() }\n\n\nclass ExcA() : Exception()\nclass ExcB() : Exception()\n\nfun box(): String {\n\n var flag = false\n try {\n throwExceptionB(true)\n flag = true\n } catch (e: ExcA) {\n return \"NOK\"\n } catch (e: Exception) {","completion":"return if (flag)\n \"NOK\"\n else \"OK\"\n }catch (e : ExcB){\n return \"NOK\"\n }\n return \"NOK\"\n}<|endoftext|>"} {"prompt":"super<Unit>.foo()","completion":"super@B.foo()<|endoftext|>"} {"prompt":"expression: KtElement,\n context: CallCheckerContext\n ) {\n val superCall = getSuperCallExpression(call)\n if (superCall != null) {\n val thisTypeForSuperCall: KotlinType =\n context.trace.get(\n BindingContext.THIS_TYPE_FOR_SUPER_EXPRESSION,\n superCall\n ) ?: return","completion":"val descriptor = thisTypeForSuperCall.constructor.declarationDescriptor as? DeclarationDescriptorWithVisibility ?: return\n\n if (!isDefinedInInlineFunction(descriptor)) {\n context.trace.report(\n SUPER_CALL_FROM_PUBLIC_INLINE.on(\n context.languageVersionSettings, expression.parent.parent ?: superCall, callableDescriptor<|endoftext|>"} {"prompt":"is RegularKotlinClassSnapshot, is JavaClassSnapshot -> {\n \/\/ Collect ClassSymbols\n if (ClassSymbol(clazz.classId).toLookupSymbol() in lookupSymbols) {\n collector.addClass(clazz.classId)\n }\n\n \/\/ Collect ClassMembers","completion":"\/\/ We want to get the intersection of clazz.classMemberNames and lookupNamesInScope. However, we currently don't store\n \/\/ information about clazz.classMemberNames, so we'll take all of lookupNamesInScope (it's okay to over-approximate the\n \/\/ result).\n val lookupNamesInScope = lookupSymbols.getLookupNamesInScope(clazz.classId.asSingleFqName())<|endoftext|>"} {"prompt":"public inline fun kotlin.CharArray.minOf(selector: (kotlin.Char) -> kotlin.Double): kotlin.Double\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.CharArray.minOf(selector: (kotlin.Char) -> kotlin.Float): kotlin.Float\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"val result = java.util.Arrays.copyOf(this, thisSize + arraySize)\n System.arraycopy(elements, 0, result, thisSize, arraySize)\n return result\n}\n\n\/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n *\/\npublic actual operator fun ByteArray.plus(elements: ByteArray): ByteArray {","completion":"val thisSize = size\n val arraySize = elements.size\n val result = java.util.Arrays.copyOf(this, thisSize + arraySize)\n System.arraycopy(elements, 0, result, thisSize, arraySize)\n return result\n}\n\n\/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n *\/<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.jvm.diagnostics.RawSignature\n\nclass JvmMethodSignatureClashDetector(\n private val classCodegen: ClassCodegen\n) : SignatureClashDetector() {\n\n fun trackFakeOverrideMethod(irFunction: IrFunction) {\n if (irFunction.dispatchReceiverParameter != null) {","completion":"for (overriddenFunction in getOverriddenFunctions(irFunction as IrSimpleFunction)) {\n if (!overriddenFunction.isFakeOverride) trackDeclaration(irFunction, mapRawSignature(overriddenFunction))\n }\n } else {\n trackDeclaration(irFunction, mapRawSignature(irFunction))\n }\n }<|endoftext|>"} {"prompt":"@Throws(TranslationException::class)\n @JvmOverloads\n fun translate(\n reporter: JsConfig.Reporter,\n files: List,\n mainCallParameters: MainCallParameters,\n analysisResult: JsAnalysisResult? = null\n ): TranslationResult {\n val units = ArrayList()\n for (file in files) {","completion":"units.add(TranslationUnit.SourceFile(file))\n }\n return translateUnits(reporter, units, mainCallParameters, analysisResult)\n }\n\n @Throws(TranslationException::class)\n @JvmOverloads\n fun translateUnits(\n reporter: JsConfig.Reporter,\n units: List,\n mainCallParameters: MainCallParameters,<|endoftext|>"} {"prompt":"open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: String?, internal val e: Char?, public val f: Any?) {\n val x: Char? = '.'\n private val y: Unit? = kotlin.Unit\n protected val z: Int? = 12\n public val u: String? = \"...\"\n val s: Any?\n val v: Int?","completion":"val w: Number?\n val t: String? = if (u != null) this.u else null\n\n init {\n if (a != null) a.equals(null)<|endoftext|>"} {"prompt":"if (owner.companionNeedsSerializerFactory(session)) {\n val serializerFactoryClassId = ClassId(SerializationPackages.internalPackageFqName, SERIALIZER_FACTORY_INTERFACE_NAME)\n superType(serializerFactoryClassId.constructClassLikeType(emptyArray(), false))\n }\n }\n\n return companion.symbol\n }","completion":"override fun FirDeclarationPredicateRegistrar.registerPredicates() {\n register(FirSerializationPredicates.annotatedWithSerializableOrMeta, FirSerializationPredicates.hasMetaAnnotation)\n }\n\n private val FirClassSymbol<*>.isSerializer: Boolean\n get() = name == SerialEntityNames.SERIALIZER_CLASS_NAME || isExternalSerializer<|endoftext|>"} {"prompt":"* Checks if index is valid and extends the `bits` array if the index exceeds its size.\n * @throws [IndexOutOfBoundsException] if [index] < 0.\n *\/\n private fun ensureCapacity(index: Int) {\n if (index < 0) {\n throw IndexOutOfBoundsException()\n }\n if (index >= size) {\n size = index + 1","completion":"if (index.elementIndex >= bits.size) {\n \/\/ Create a new array containing the index-th bit.\n bits = bits.copyOf(bitToElementSize(index + 1))\n }\n \/\/ Set all bits after the index to 0. TODO: We can remove it.\n clearUnusedTail()\n }\n }\n\n \/** Set the bit specified to the specified value. *\/<|endoftext|>"} {"prompt":"dependencies = moduleDependencies.map { it.klibFile.toKlib().toDependency() },\n expectedArtifact = klibFile.toKlib()\n )\n\n compilation.trigger()\n\n updateModule(module, moduleDependencies)\n }\n\n private fun buildAndExecuteBinary(\n mainTestModule: TModule,\n expectedResult: String\n ) {","completion":"val latestVersion = moduleVersions.values.maxOrNull() ?: 2\n\n val (binarySourceDir, binaryOutputDir) = listOf(BINARY_SOURCE_DIR_NAME, BINARY_OUTPUT_DIR_NAME).map {\n buildDir.resolve(LAUNCHER_MODULE_NAME).resolve(it).apply { mkdirs() }\n }<|endoftext|>"} {"prompt":"val delegationCtorInTheSameClass = delegationClassDescriptor == classDescriptor\n if (!delegationCtorInTheSameClass && !classDescriptor.hasPrimaryConstructor()) {\n superCallGenerators += {\n val usageTracker = context.usageTracker()!!\n val closure = context.getClassOrConstructorClosure(classDescriptor).orEmpty().map {","completion":"usageTracker.getNameForCapturedDescriptor(it)!!.makeRef()\n }\n it += JsInvocation(Namer.getFunctionCallRef(referenceToClass), listOf(thisNameRef.deepCopy()) + closure + leadingArgs)\n .withDefaultLocation().makeStmt()\n }\n }<|endoftext|>"} {"prompt":"constructor(arg: UserKlass = UserKlass())\n}\n\nenum class EnumerationCBC {\n ENTRY1,\n ENTRY2();\n constructor(arg: UserKlass = UserKlass())\n}\n\nenum class EnumerationCBD {\n ENTRY1 { override fun abstractFunc() { TODO(\"Not yet implemented\") } },","completion":"ENTRY2() { override fun abstractFunc() { TODO(\"Not yet implemented\") } };\n constructor(arg: UserKlass = UserKlass())\n abstract fun abstractFunc()\n}\n\nenum class EnumerationCCA {\n ENTRY;\n constructor(arg1: UserKlass = UserKlass(), arg2: UserKlass = UserKlass())\n}<|endoftext|>"} {"prompt":"copyAttributesFrom(original)\n copyTypeParametersFrom(original)\n copyReturnTypeFrom(original)\n copyReceiversFrom(original)\n copyValueParametersFrom(original)\n\n if (!original.isTopLevel) {\n introduceContextParam()\n }\n }\n\n private fun IrFunction.introduceContextParam() = addValueParameter {","completion":"name = Name.identifier(\"\\$super\")\n type = parentAsClass.defaultType.makeNullable()\n origin = JsLoweredDeclarationOrigin.JS_SUPER_CONTEXT_PARAMETER\n }\n\n}<|endoftext|>"} {"prompt":"acceptSuspend(@Composable suspend fun() { })\n }\n \"\"\"\n } else {\n \/\/ In K2, the frontend forbids function types with multiple kinds, so\n \/\/ `@Composable suspend` function types get turned into error types. This is the","completion":"\/\/ reason for the additional ARGUMENT_TYPE_MISMATCH errors.\n \"\"\"\n import androidx.compose.runtime.Composable\n\n @Composable suspend fun Foo() {}\n\n fun acceptSuspend(fn: suspend () -> Unit) { print(fn) }<|endoftext|>"} {"prompt":"srcFile.copyTo(dstFile)\n }\n\n srcFile.createDirectory()\n srcFile.resolve(\"somefile\").writeText(\"some content\")\n dstFile.writeText(\"\")\n assertFailsWith(\"copy dir do not overwrite file\") {\n srcFile.copyTo(dstFile)\n }","completion":"srcFile.copyTo(dstFile, overwrite = true)\n assertTrue(dstFile.isDirectory())\n assertTrue(dstFile.listDirectoryEntries().isEmpty(), \"only directory is copied, but not its content\")\n\n assertFailsWith(\"copy dir do not overwrite dir\") {\n srcFile.copyTo(dstFile)\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.tasks\n\nimport org.gradle.api.file.FileCollection\nimport org.gradle.api.provider.ListProperty\nimport org.gradle.api.provider.Property\nimport org.gradle.api.provider.SetProperty\nimport org.gradle.api.tasks.*","completion":"import org.gradle.api.tasks.util.PatternFilterable\nimport org.gradle.work.Incremental\nimport org.gradle.work.NormalizeLineEndings\nimport org.jetbrains.kotlin.gradle.InternalKotlinGradlePluginApi\nimport java.io.File\n\n@InternalKotlinGradlePluginApi\nabstract class K2MultiplatformStructure {<|endoftext|>"} {"prompt":"contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }\n return suspendCoroutineUninterceptedOrReturn { c: Continuation ->\n val safe = SafeContinuation(c.intercepted())\n block(safe)\n safe.getOrThrow()\n }\n}\n\n\/**\n * Returns the context of the current coroutine.\n *\/","completion":"@SinceKotlin(\"1.3\")\n@Suppress(\"WRONG_MODIFIER_TARGET\")\n@InlineOnly\npublic suspend inline val coroutineContext: CoroutineContext\n get() {\n throw NotImplementedError(\"Implemented as intrinsic\")\n }<|endoftext|>"} {"prompt":"add(FirErrors.EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING) { firDiagnostic ->\n ExpectActualClassifiersAreInBetaWarningImpl(\n firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }","completion":"add(FirErrors.NOT_A_MULTIPLATFORM_COMPILATION) { firDiagnostic ->\n NotAMultiplatformCompilationImpl(\n firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }\n add(FirErrors.EXPECT_ACTUAL_OPT_IN_ANNOTATION) { firDiagnostic -><|endoftext|>"} {"prompt":"assertStaticTypeIs>(p.then { 1 })\n\n assertStaticTypeIs>(p.then({ 1 }))\n\n val f: (Int) -> Int = { 1 }\n val ft: (Throwable) -> Int = { 1 }\n\n assertStaticTypeIs>(p.then(f, ft))","completion":"assertStaticTypeIs>(\n p.then({\n 1\n }, {\n 1\n })\n )\n\n assertStaticTypeIs>(\n p.then({\n 1\n }) {\n 1\n }\n )\n\n assertStaticTypeIs>(\n p.then(onFulfilled = {\n 1<|endoftext|>"} {"prompt":"if (d != null || this.d != null) d.propNullableAny","completion":"if (d != null || this.d != null) d.funT()<|endoftext|>"} {"prompt":"KonanPrimitiveType.INT -> emptyList()\n KonanPrimitiveType.LONG -> emptyList()\n KonanPrimitiveType.FLOAT -> emptyList()\n KonanPrimitiveType.DOUBLE -> emptyList()\n KonanPrimitiveType.NON_NULL_NATIVE_PTR -> emptyList()","completion":"KonanPrimitiveType.VECTOR128 -> emptyList()\n }\n },\n ifReference = {\n return emptyList()\n },\n )\n }\n }\n}\n\nsealed class ExtendOnCalleeSideTargetAbiInfo(private val shouldZeroExtBoolean: Boolean) : TargetAbiInfo {<|endoftext|>"} {"prompt":"sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n \"\"\"\n }\n }\n\n\n val f_asList = fn(\"asList()\") {\n include(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned)\n } builder {\n doc { \"Returns a [List] that wraps the original array.\" }\n returns(\"List\")","completion":"on(Platform.JVM) {\n body { \"\"\"return ArraysUtilJVM.asList(this)\"\"\" }\n }\n on(Platform.JS) {\n body { \"\"\"return ArrayList(this.unsafeCast>())\"\"\" }\n }\n\n val objectLiteralImpl = if (primitive in PrimitiveType.floatingPointPrimitives) \"\"\"<|endoftext|>"} {"prompt":"}\n\nvar result = \"initial\"\n\nvar resumingCallback: () -> Unit = {}\n\nsuspend fun bar() {\n \/\/ Generate proper state machine\n suspendCoroutine { cont ->\n resumingCallback = {\n cont.resume(Unit)\n }\n }\n\n result = \"OK\"\n}\n\nfun box(): String {\n run(::bar)","completion":"if (result != \"initial\") return \"fail\"\n\n resumingCallback()\n\n return result\n}<|endoftext|>"} {"prompt":"\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f\",","completion":"\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u043c\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0430\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u044c\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u043d\u044b\u0439\",\n\"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u044b\u0439\",<|endoftext|>"} {"prompt":"if (-1L in 3..1 != range1.contains(-1L)) throw AssertionError()\n if (-1L !in 3..1 != !range1.contains(-1L)) throw AssertionError()\n if (!(-1L in 3..1) != !range1.contains(-1L)) throw AssertionError()","completion":"if (!(-1L !in 3..1) != range1.contains(-1L)) throw AssertionError()\n \/\/ no local optimizations\n if (element3 in 3..1 != range1.contains(element3)) throw AssertionError()\n if (element3 !in 3..1 != !range1.contains(element3)) throw AssertionError()<|endoftext|>"} {"prompt":"setParent(irClass)\n addDeclarationToParent(this, irClass)\n valueParameters = conversionData.injectedValues.mapIndexed { index, injectedValue ->\n val isMutated = injectedValue.isMutated\n\n irFactory.createValueParameter(\n UNDEFINED_OFFSET, UNDEFINED_OFFSET,","completion":"if (isMutated) IrDeclarationOrigin.SHARED_VARIABLE_IN_EVALUATOR_FRAGMENT else IrDeclarationOrigin.DEFINED,\n Name.identifier(\"p$index\"),\n injectedValue.typeRef.toIrType(typeConverter),\n isAssignable = isMutated,\n injectedValue.irParameterSymbol,\n index,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.tooling.core.toMutableExtras\n\ninternal fun IdeaKotlinSerializationContext.IdeaKotlinResolvedBinaryDependencyProto(\n dependency: IdeaKotlinResolvedBinaryDependency\n): IdeaKotlinResolvedBinaryDependencyProto {\n return ideaKotlinResolvedBinaryDependencyProto {","completion":"this.extras = IdeaExtrasProto(dependency.extras)\n this.binaryType = dependency.binaryType\n dependency.classpath.toProto()?.let { this.classpath = it }\n dependency.coordinates?.let { this.coordinates = IdeaKotlinBinaryCoordinatesProto(it) }\n }\n}<|endoftext|>"} {"prompt":") : AbstractAtomicSymbols(context, moduleFragment) {\n \/\/ kotlin.concurrent.Volatile annotation class\n override val volatileAnnotationClass: IrClass\n get() = context.referenceClass(ClassId(FqName(\"kotlin.concurrent\"), Name.identifier(\"Volatile\")))?.owner\n ?: error(\"kotlin.concurrent.Volatile class is not found\")","completion":"\/\/ kotlin.concurrent.AtomicIntArray\n override val atomicIntArrayClassSymbol: IrClassSymbol\n get() = context.referenceClass(ClassId(FqName(\"kotlin.concurrent\"), Name.identifier(\"AtomicIntArray\")))\n ?: error(\"kotlin.concurrent.AtomicIntArray is not found\")\n\n \/\/ kotlin.concurrent.AtomicLongArray<|endoftext|>"} {"prompt":"val varargElementType = parameter.varargElementType\n if (argument == null && varargElementType != null) {\n val arrayClass = parameter.type.classOrNull!!.owner\n val primaryConstructor = arrayClass.primaryConstructor!!\n val emptyArrayCall = with(builder) {\n irCall(primaryConstructor).apply {\n putValueArgument(0, irInt(0))","completion":"if (primaryConstructor.typeParameters.isNotEmpty()) {\n check(primaryConstructor.typeParameters.size == 1)\n putTypeArgument(0, parameter.varargElementType)\n }\n }\n }\n expression.putValueArgument(argumentIdx, emptyArrayCall)\n }\n }\n return expression\n }<|endoftext|>"} {"prompt":"\/\/ Here and below we need to split such paths taking this into account.\n interop.compilerOpts.addAll(args.splitQuotedArgs())\n }\n\n interop.compilerOpts.addAll(podBuildSettings.frameworkHeadersSearchPaths.map { \"-I$it\" })","completion":"interop.compilerOpts.addAll(podBuildSettings.frameworkSearchPaths.map { \"-F$it\" })\n }\n }\n }\n }\n }\n\n private fun addPodDependencyToInterop(\n project: Project,\n cocoapodsExtension: CocoapodsExtension,\n pod: CocoapodsDependency,<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.api.renderer.declarations.renderers.callables\n\nimport org.jetbrains.kotlin.analysis.api.KtAnalysisSession\nimport org.jetbrains.kotlin.analysis.api.renderer.declarations.KtDeclarationRenderer","completion":"import org.jetbrains.kotlin.analysis.api.symbols.KtBackingFieldSymbol\nimport org.jetbrains.kotlin.analysis.utils.printer.PrettyPrinter\nimport org.jetbrains.kotlin.lexer.KtTokens\n\npublic interface KtBackingFieldSymbolRenderer {\n public fun renderSymbol(\n analysisSession: KtAnalysisSession,<|endoftext|>"} {"prompt":"override val internalDisplayName: String\n get() = \"protected\/*protected static*\/\"\n\n override val externalDisplayName: String\n get() = \"protected\"\n }\n\n object ProtectedAndPackage : Visibility(\"protected_and_package\", isPublicAPI = true) {\n override fun compareTo(visibility: Visibility): Int? {\n if (this == visibility) return 0","completion":"if (visibility === Visibilities.Internal) return null\n return if (Visibilities.isPrivate(visibility)) 1 else -1\n }\n\n override fun normalize(): Visibility {\n return Visibilities.Protected\n }\n\n override fun mustCheckInImports(): Boolean = false\n\n override val internalDisplayName: String\n get() = \"protected\/*protected and package*\/\"<|endoftext|>"} {"prompt":"abstract class C2 : WithProtectedVar(), IVar\nabstract class D2 : WithInternalVar(), IVar\nabstract class E2 : WithVarInternalSet(), IVar","completion":"abstract class F2 : WithVarProtectedSet(), IVar\nabstract class G2 : WithVarPrivateSet(), IVar\n\nabstract class A3 : IVal, WithVal()\nabstract class B3 : IVal, WithVar()\nabstract class C3 : IVal, WithProtectedVar()<|endoftext|>"} {"prompt":"}\n\n\/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n *","completion":"* @sample samples.collections.Collections.Transformations.associateWithTo\n *\/\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > BooleanArray.associateWithTo(destination: M, valueSelector: (Boolean) -> V): M {\n for (element in this) {<|endoftext|>"} {"prompt":"value class IC3(val value: Int) {\n\n}\n\n@JvmInline\nvalue class IC4(val value: Int) {\n override fun equals(other: Any?) = TODO()\n}\n\n@JvmInline\nvalue class IC5(val value: Int) {\n operator fun equals(other: IC5): Nothing = TODO()\n}\n\n@JvmInline","completion":"value class IC6(val value: Int) {\n override fun equals(other: Any?): Nothing = TODO()\n}\n\ninline fun assertThrows(block: () -> Unit): Boolean {\n try {\n block.invoke()\n } catch (t: Throwable) {\n return t is T\n }\n return false\n}\n\n\nfun box() = when {<|endoftext|>"} {"prompt":"symbol = IrSimpleFunctionSymbolImpl(),\n isTailrec = false,\n isSuspend = oldFunction.isSuspend,\n isOperator = oldFunction is IrSimpleFunction && oldFunction.isOperator,\n isInfix = oldFunction is IrSimpleFunction && oldFunction.isInfix,\n isExternal = false,\n containerSource = oldFunction.containerSource,","completion":"isFakeOverride = isFakeOverride,\n ).apply {\n parent = irParent\n\n val newTypeParametersFromContext = copyAndRenameConflictingTypeParametersFrom(\n typeParametersFromContext,\n oldFunction.typeParameters\n )\n val newTypeParametersFromFunction = copyTypeParametersFrom(oldFunction)\n val typeParameterMap =\n (typeParametersFromContext + oldFunction.typeParameters)<|endoftext|>"} {"prompt":"* [Regex.escapeReplacement] can be used if [replacement] have to be treated as a literal string.\n *\n * @param input the char sequence to find matches of this regular expression in\n * @param replacement the expression to replace found matches with\n * @return the result of replacing each occurrence of this regular expression in [input] with the result of evaluating the [replacement] expression","completion":"* @throws RuntimeException if [replacement] expression is malformed, or capturing group with specified `name` or `index` does not exist\n *\/\n public actual fun replace(input: CharSequence, replacement: String): String\n = replace(input) { match -> substituteGroupRefs(match, replacement) }\n\n \/**\n * Replaces all occurrences of this regular expression in the specified [input] string with the result of<|endoftext|>"} {"prompt":"* Call stack the virtual machine stopped on.\n *\/\n val callFrames: List,\n \/**\n * Pause reason.\n *\/\n val reason: PauseReason,\n\n \/**\n * Hit breakpoints IDs\n *\/\n val hitBreakpoints: List = emptyList()\n ) : Event()\n\n \/**\n * Fired when the virtual machine resumed execution.","completion":"*\n * See [Debugger.resumed](https:\/\/chromedevtools.github.io\/devtools-protocol\/tot\/Debugger\/#event-resumed)\n *\/\n @Serializable\n object Resumed : Event()\n\n \/**\n * Fired when virtual machine fails to parse the script.\n *<|endoftext|>"} {"prompt":"abstract class KtConstructor> : KtDeclarationStub>, KtFunction {\n protected constructor(node: ASTNode) : super(node)\n protected constructor(stub: KotlinConstructorStub, nodeType: KtConstructorElementType) : super(stub, nodeType)","completion":"abstract fun getContainingClassOrObject(): KtClassOrObject\n\n override fun isLocal() = false\n\n override fun getValueParameterList() = getStubOrPsiChild(KtStubElementTypes.VALUE_PARAMETER_LIST)\n\n override fun getValueParameters() = valueParameterList?.parameters ?: emptyList()<|endoftext|>"} {"prompt":"fun T.with(f: T.() -> R) = f()\n\nfun A.extFun1() = b.length\n\n\/\/ fun A.extFun2() = c.length \/\/ TODO fix KT-9953\n\nval x1 = A(\"\").with { b.length }\n\n\/\/ val x2 = A(\"\").with { c.length } \/\/ TODO fix KT-9953","completion":"val x3 = A.with { c.length }<|endoftext|>"} {"prompt":"val linuxMainTarget = CommonizerTarget(LINUX_X64, LINUX_ARM64)\n linuxMainDependencies.forEach { dependency ->\n assertEquals(linuxMainTarget.identityString, dependency.klibExtra?.commonizerTarget)\n }\n }\n\n \/* Find posix library *\/\n run {\n nativeMainDependencies.assertMatches(","completion":"binaryCoordinates(Regex(\"org\\\\.jetbrains\\\\.kotlin\\\\.native:posix:.*\")),\n binaryCoordinates(Regex(\"org\\\\.jetbrains\\\\.kotlin\\\\.native:.*\"))\n )\n\n linuxMainDependencies.assertMatches(<|endoftext|>"} {"prompt":"object timesAssign {\n operator fun invoke(x: Int): A = A\n }\n object divAssign {\n operator fun invoke(x: Int): A = A\n }\n object remAssign {\n operator fun invoke(x: Int): A = A\n }\n object unaryPlus {\n operator fun invoke(): A = A\n }\n object unaryMinus {","completion":"operator fun invoke(): A = A\n }\n object not {\n operator fun invoke(): A = A\n }\n object plus {\n operator fun invoke(x: Int): A = A\n }\n object minus {\n operator fun invoke(x: Int): A = A\n }\n object times {\n operator fun invoke(x: Int): A = A\n }\n object div {<|endoftext|>"} {"prompt":"val elementTransformerType = type(visitors, \"IrElementTransformer\")\nval elementTransformerVoidType = type(visitors, \"IrElementTransformerVoid\", TypeKind.Class)\nval typeTransformerType = type(visitors, \"IrTypeTransformer\")\nval irTypeType = type(types, \"IrType\")\nval irFactoryType = type(declarations, \"IrFactory\")","completion":"val stageControllerType = type(declarations, \"StageController\", TypeKind.Class)\nval idSignatureType = type(util, \"IdSignature\", TypeKind.Class)\nval irImplementationDetailType = type(tree, \"IrImplementationDetail\", TypeKind.Class)\n\nval symbolType = type(symbols, \"IrSymbol\")<|endoftext|>"} {"prompt":"\/\/ FILE: 2.kt\n\nimport test.*\n\nfun box(): String {\n if (null.foo3() != null) return \"fail 1\"\n if (null.foo3() != null) return \"fail 2\"\n\n if (null.foo3() != null) return \"fail 3\"","completion":"if (null.foo3() != null) return \"fail 4\"\n\n val a = A()\n\n if (a.foo3() != a) return \"fail 5\"\n if (a.foo3() != a) return \"fail 6\"\n\n if (a.foo3() != a) return \"fail 7\"<|endoftext|>"} {"prompt":"abstract override val moduleData: FirModuleData\n abstract val origin: FirDeclarationOrigin\n abstract val attributes: FirDeclarationAttributes\n\n override fun accept(visitor: FirVisitor, data: D): R =\n visitor.visitDeclaration(this, data)\n\n @Suppress(\"UNCHECKED_CAST\")","completion":"override fun transform(transformer: FirTransformer, data: D): E =\n transformer.transformDeclaration(this, data) as E\n\n abstract override fun replaceAnnotations(newAnnotations: List)\n\n abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirDeclaration\n}<|endoftext|>"} {"prompt":"\/\/!LANGUAGE: -ProperComputationOrderOfTailrecDefaultParameters\n\nimport kotlin.reflect.KClass\n\nfun withEffects(): String = \"OK\"\n\nconst val Z = \"123\"\n\nenum class EnumA {\n A\n}","completion":"tailrec fun foo(i: Int = 1, c: Char = '2', s: String = \"1234\", b: Boolean = true, d: Double = 1.0, l: Long = 1L, y: String = withEffects()) {\n foo(i, c, s, b, d, l, y)\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.psi.KtNameReferenceExpression\nimport org.jetbrains.kotlin.psi.KtParenthesizedExpression\nimport org.jetbrains.kotlin.psi.KtSafeQualifiedExpression\nimport org.jetbrains.kotlin.resolve.calls.checkers.CallChecker","completion":"import org.jetbrains.kotlin.resolve.calls.checkers.CallCheckerContext\nimport org.jetbrains.kotlin.resolve.calls.model.ResolvedCall\nimport org.jetbrains.kotlin.resolve.calls.model.isReallySuccess\nimport org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver<|endoftext|>"} {"prompt":"\/\/ !JDK_KIND: MODIFIED_MOCK_JDK\n\/\/ !CHECK_TYPE\n\ninterface A : MutableCollection {\n \/\/ Override of deprecated function could be marked as deprecated too\n override fun nonExistingMethod(x: String) = \"\"\n}","completion":"fun foo(x: MutableCollection, y: Collection, z: A) {\n x.nonExistingMethod(1).checkType { _() }\n y.nonExistingMethod(\"\")\n z.nonExistingMethod(\"\")\n}<|endoftext|>"} {"prompt":"checkSDLError(\"GetCurrentDisplayMode\", SDL_GetCurrentDisplayMode(0, ptr.reinterpret()))\n Dimensions(w, h)\n }\n }\n }\n }\n\n override fun dispose() {\n stop()\n super.dispose()\n }\n\n fun start(videoSize: Dimensions) {\n stop() \/\/ To free resources from previous playbacks.","completion":"println(\"SDL Video: Playing output with ${videoSize.w} x ${videoSize.h} pixels\")\n window = SDLRendererWindow((displaySize - videoSize) \/ 2, videoSize)\n }\n\n fun pixelFormat(): PixelFormat = window?.pixelFormat() ?: PixelFormat.INVALID\n\n fun nextFrame(frameData: CPointer, linesize: Int) =<|endoftext|>"} {"prompt":"* Adapter interface that can be implemented by phase context, input or output\n * to enable IR validation, dumping and possibly other pre- and postprocessing.\n *\/\ninterface KotlinBackendIrHolder {\n val kotlinIr: IrElement\n}\n\nprivate fun findBackendContext(context: Context): CommonBackendContext? = when {\n context is CommonBackendContext -> context","completion":"context is BackendContextHolder<*> -> context.backendContext\n else -> null\n}\n\nprivate fun findKotlinBackendIr(context: Context, data: Data): IrElement? = when {\n data is IrElement -> data\n data is KotlinBackendIrHolder -> data.kotlinIr<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS -UNUSED_PARAMETER\nfun f1(l: List1): T {throw Exception()} \/\/ ERROR type here","completion":"fun f1(l: List2): T {throw Exception()} \/\/ ERROR type here\nfun f1(c: Collection): T{throw Exception()}\n\nfun test(l: List) {<|endoftext|>"} {"prompt":"val MINIMAL_SUPPORTED_VERSION = ApiVersion.parse(\"1.0-M1-SNAPSHOT\")!!\n val MINIMAL_VERSION_FOR_INLINE_CLASSES = ApiVersion.parse(\"1.1-M1-SNAPSHOT\")!!\n }\n\n fun currentCompilerMatchRequired(): Boolean {","completion":"val current = requireNotNull(KotlinCompilerVersion.getVersion()?.let(ApiVersion.Companion::parse))\n return requireKotlinVersion == null || requireKotlinVersion <= current\n }\n\n fun implementationVersionMatchSupported(): Boolean {\n return implementationVersion != null && implementationVersion >= MINIMAL_SUPPORTED_VERSION\n }\n}\n\nobject CommonVersionReader {<|endoftext|>"} {"prompt":"if (this.w != null) w.propNullableT\n if (this.w != null) w.propNullableAny","completion":"if (this.w != null) w.funT()\n if (this.w != null) w.funAny()<|endoftext|>"} {"prompt":"@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalPathApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun URI.toPath(): Path =\n Paths.get(this)\n\n\n\/**\n * Returns a sequence of paths for visiting this directory and all its content.\n *","completion":"* By default, only files are visited, in depth-first order, and symbolic links are not followed.\n * If encountered, symbolic links are included in the sequence as-is, and the content of the directory they point to is not visited.\n * The combination of [options] overrides the default behavior. See [PathWalkOption].\n *\n * The order in which sibling files are visited is unspecified.\n *<|endoftext|>"} {"prompt":"In this case, 510 will be the buildNumber, but there is still no associated classifierNumber.\n In order to keep the regex below simple, we fast path out here, since we know that\n dev builds never carry classifier numbers\n *\/\n if (maturity == KotlinToolingVersion.Maturity.DEV) return null\n\n \/*\n Classifiers with only a buildNumber assigned\n *\/","completion":"val buildNumberOnlyClassifierRegex = Regex(\"\\\\d+\")\n if (buildNumberOnlyClassifierRegex.matches(classifier)) {\n return null\n }\n\n\n val classifierRegex = Regex(\"\"\"(.+?)(\\d*)?(-release)?-?(\\d*)?\"\"\")<|endoftext|>"} {"prompt":"val livenessFrame = livenessFrames[suspensionCallBegin.index()]\n\n val referencesToSpill = arrayListOf()\n val primitivesToSpill = arrayListOf()\n\n \/\/ 0 - this\n \/\/ 1 - parameter\n \/\/ ...\n \/\/ k - continuation\n \/\/ k + 1 - data\n \/\/ k + 2 - exception","completion":"for (slot in 0 until localsCount) {\n if (slot == continuationIndex || slot == dataIndex) continue\n val value = frame.getLocal(slot)\n if (value.type == null || (shouldOptimiseUnusedVariables && !livenessFrame.isAlive(slot))) continue\n\n if (value === StrictBasicValue.NULL_VALUE) {\n referencesToSpill += slot to null<|endoftext|>"} {"prompt":"inline class InlineNonNullOuter(val z1: S) {\n @Suppress(\"INNER_CLASS_INSIDE_VALUE_CLASS\")\n inner class Inner(val z2: S, val z3: S?) {\n val test = \"$z1 $z2 $z3\"\n }\n}\n\ninline class InlineNullableOuter(val z1: S?) {","completion":"@Suppress(\"INNER_CLASS_INSIDE_VALUE_CLASS\")\n inner class Inner(val z2: S, val z3: S?) {\n val test = \"$z1 $z2 $z3\"\n }\n}\n\nfun box(): String {\n val z1 = S(\"1\")\n val z2 = S(\"2\")\n val z3 = S(\"3\")<|endoftext|>"} {"prompt":"explicitReceiver: DetailedReceiver?,\n classValueReceiver: Boolean,\n collectCandidates: CandidatesCollector\n): ScopeTowerProcessor {\n val withoutClassValueProcessor =\n createSimpleProcessorWithoutClassValueReceiver(scopeTower, context, explicitReceiver, collectCandidates)\n\n if (classValueReceiver && explicitReceiver is QualifierReceiver) {","completion":"val classValue = explicitReceiver.classValueReceiverWithSmartCastInfo ?: return withoutClassValueProcessor\n return PrioritizedCompositeScopeTowerProcessor(\n withoutClassValueProcessor,\n ExplicitReceiverScopeTowerProcessor(scopeTower, context, classValue, collectCandidates)\n )\n }\n return withoutClassValueProcessor\n}<|endoftext|>"} {"prompt":"0x001c, 0x1905, 0x0008, 0x0005, 0x18a6, 0x14a6, 0x0006, 0x0005, 0x18c5, 0x0005, 0x0011, 0x10a5, 0x0018, 0x0005, 0x18c8, 0x6308, 0x1085, 0x00c8,","completion":"0x0011, 0x0005,<|endoftext|>"} {"prompt":"val defaultRes = FooClass().make()\n val defaultTraitRes = FooClass().makeFromTraitImpl()\n if (explicitParam != defaultRes) return \"fail 1: ${explicitParam} != ${defaultRes}\"\n if (explicitParam != \"16\") return \"fail 2: ${explicitParam}\"","completion":"if (explicitParam != defaultTraitRes) return \"fail 3: ${explicitParam} != ${defaultTraitRes}\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"override abstract fun remove(x: String): Boolean\n override abstract fun removeAt(index: Int): String\n}\n\nabstract class A7 : MutableList\nabstract class A8 : java.util.ArrayList()\n\ninterface A9 : MutableList {}\n\nabstract class A10 : MutableList {","completion":"override fun remove(x: Int): Boolean = true\n override fun removeAt(index: Int): Int = 1\n}\n\nfun box(\n a1: A1,\n a2: A2,\n a3: A3,\n a4: A4,\n a5: A5,\n a6: A6,\n a7: A7,<|endoftext|>"} {"prompt":"get() = project.tasks.named(LockCopyTask.STORE_PACKAGE_LOCK_NAME)\n\n companion object {\n const val EXTENSION_NAME: String = \"kotlinNpm\"\n\n operator fun get(project: Project): NpmExtension {\n val rootProject = project.rootProject\n rootProject.plugins.apply(NodeJsRootPlugin::class.java)","completion":"return rootProject.extensions.getByName(EXTENSION_NAME) as NpmExtension\n }\n }\n}<|endoftext|>"} {"prompt":"ulongArrayOf(1u, ULong.MAX_VALUE, ULong.MIN_VALUE).let { arr ->\n assertTrue(arr contentEquals ULongArray(arr.size, arr::get))\n assertFalse(arr contentEquals ULongArray(arr.size - 1, arr::get))\n }","completion":"ushortArrayOf(1u, UShort.MAX_VALUE, UShort.MIN_VALUE).let { arr ->\n assertTrue(arr contentEquals UShortArray(arr.size, arr::get))\n assertFalse(arr contentEquals UShortArray(arr.size - 1, arr::get))\n }<|endoftext|>"} {"prompt":"\"I9\", \"I10\"))","completion":"process(C12(), \"C12\", setOf(\"I2\", \"I61\", \"I62\", \"I12\", \"I51\", \"I52\", \"I53\", \"I54\", \"I55\", \"I56\", \"I57\", \"I58\", \"I59\", \"I62\", \"I63\", \"I64\", \"I65\", \"I66\", \"I67\", \"I68\", \"I69\",<|endoftext|>"} {"prompt":"expectFailure(linkage(\"Constructor 'ClassToEnum.' can not be called: Private constructor declared in module can not be accessed in module \")) { getClassToEnumBazAsAny() }","completion":"expectFailure(linkage(\"Constructor 'ClassToEnum.' can not be called: Private constructor declared in module can not be accessed in module \")) { getClassToEnumBazAsAnyInline() }<|endoftext|>"} {"prompt":"return ExternalOverridabilityCondition.Result.UNKNOWN\n }\n\n private fun parameterNamesMatch(first: FunctionDescriptor, second: FunctionDescriptor): Boolean {\n \/\/ The original Objective-C method selector is represented as\n \/\/ function name and parameter names (except first).\n\n if (first.valueParameters.size != second.valueParameters.size) {\n return false\n }","completion":"first.valueParameters.forEachIndexed { index, parameter ->\n if (index > 0 && parameter.name != second.valueParameters[index].name) {\n return false\n }\n }\n\n return true\n }\n\n}<|endoftext|>"} {"prompt":"byteSeparatorLength = 0,\n bytePrefixLength = 0,\n byteSuffixLength = 0\n )\n assertEquals(Int.MAX_VALUE \/ 2 * 2, length)\n }\n assertFailsWith {\n formattedStringLength(\n numberOfBytes = Int.MAX_VALUE,\n bytesPerLine = Int.MAX_VALUE,","completion":"bytesPerGroup = Int.MAX_VALUE,\n groupSeparatorLength = Int.MAX_VALUE,\n byteSeparatorLength = Int.MAX_VALUE,\n bytePrefixLength = Int.MAX_VALUE,\n byteSuffixLength = Int.MAX_VALUE\n )\n }\n assertFailsWith {\n formattedStringLength(<|endoftext|>"} {"prompt":"fun ConeInferenceContext.commonSuperTypeOrNull(types: List): ConeKotlinType? {\n return when (types.size) {\n 0 -> null\n 1 -> types.first()\n else -> with(NewCommonSuperTypeCalculator) {\n commonSuperType(types) as ConeKotlinType\n }\n }\n}","completion":"fun ConeInferenceContext.intersectTypesOrNull(types: List): ConeKotlinType? {\n return when (types.size) {\n 0 -> null\n 1 -> types.first()\n else -> ConeTypeIntersector.intersectTypes(this, types)\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.*\nimport org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl\nimport org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl\nimport org.jetbrains.kotlin.ir.expressions.impl.IrFunctionExpressionImpl","completion":"import org.jetbrains.kotlin.ir.types.IrSimpleType\nimport org.jetbrains.kotlin.ir.types.classOrNull\nimport org.jetbrains.kotlin.ir.util.copyTo\nimport org.jetbrains.kotlin.ir.util.file\nimport org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid<|endoftext|>"} {"prompt":"override fun init(delegate: IrModuleDeserializer) {\n val fileCount = klib.fileCount()\n\n val fileDeserializationStates = mutableListOf()\n\n for (i in 0 until fileCount) {\n val fileStream = klib.file(i).codedInputStream","completion":"val fileProto = ProtoFile.parseFrom(fileStream, ExtensionRegistryLite.newInstance())\n val fileReader = IrLibraryFileFromBytes(IrKlibBytesSource(klib, i))\n val file = fileReader.createFile(moduleFragment, fileProto)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.symbols.KtCallableSymbol\nimport org.jetbrains.kotlin.analysis.api.symbols.KtReceiverParameterSymbol\nimport org.jetbrains.kotlin.analysis.api.symbols.KtSymbolOrigin","completion":"import org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer\nimport org.jetbrains.kotlin.analysis.api.types.KtType\nimport org.jetbrains.kotlin.fir.psi\nimport org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.analysis.js.checkers\n\nimport org.jetbrains.kotlin.fir.analysis.checkers.expression.*\nimport org.jetbrains.kotlin.fir.analysis.js.checkers.expression.*","completion":"import org.jetbrains.kotlin.fir.analysis.web.common.checkers.expression.FirJsCodeConstantArgumentChecker\nimport org.jetbrains.kotlin.fir.analysis.web.common.checkers.expression.FirJsQualifierChecker\n\nobject JsExpressionCheckers : ExpressionCheckers() {<|endoftext|>"} {"prompt":".map { compilation -> Scope.create(compilation) }.toSet()\n .ifEmpty { return null }\n\n val interops: Set = filteredCompilations\n .flatMap { compilation -> compilation.cinterops.ifEmpty { return null } }\n .map { cinterop -> cinterop.identifier }.toSet()","completion":"return CInteropCommonizerDependent(target, scopes, interops)\n}\n\ninternal suspend fun CInteropCommonizerDependent.Factory.from(compilation: KotlinSharedNativeCompilation): CInteropCommonizerDependent? {\n return from(\n compilation.commonizerTarget.await() as? SharedCommonizerTarget ?: return null,<|endoftext|>"} {"prompt":"private fun IrClass.hasSerializableAnnotationWithArgs(): Boolean {\n val annot = getAnnotation(SerializationAnnotations.serializableAnnotationFqName)\n return annot?.getValueArgument(0) != null\n}\n\nprivate fun IrClass.checkSerializableOrMetaAnnotationArgs(mustDoNotHaveArgs: Boolean): Boolean {","completion":"val annot = getAnnotation(SerializationAnnotations.serializableAnnotationFqName)\n if (annot != null) { \/\/ @Serializable have higher priority\n if (!mustDoNotHaveArgs) return true\n if (annot.getValueArgument(0) != null) return false\n return true\n }\n return annotations\n .map { it.constructedClass.annotations }<|endoftext|>"} {"prompt":"public abstract fun toDouble(): kotlin.Double\n\n public abstract fun toFloat(): kotlin.Float\n\n public abstract fun toInt(): kotlin.Int\n\n public abstract fun toLong(): kotlin.Long\n\n public abstract fun toShort(): kotlin.Short\n}\n\npublic open class NumberFormatException : kotlin.IllegalArgumentException {\n public constructor NumberFormatException()","completion":"public constructor NumberFormatException(message: kotlin.String?)\n}<|endoftext|>"} {"prompt":"public actual fun StringBuilder.clear(): StringBuilder = apply { setLength(0) }\n\n\/**\n * Sets the character at the specified [index] to the specified [value].\n *\n * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.\n *\/\n@kotlin.internal.InlineOnly","completion":"public actual inline operator fun StringBuilder.set(index: Int, value: Char): Unit = this.setCharAt(index, value)\n\n\/**\n * Replaces characters in the specified range of this string builder with characters in the specified string [value] and returns this instance.\n *\n * @param startIndex the beginning (inclusive) of the range to replace.\n * @param endIndex the end (exclusive) of the range to replace.<|endoftext|>"} {"prompt":"if (a is Int) {\n a = 67\n }\n }\n\n \/\/ See KT-54664\n val value3 = myBuilder {\n accept(\"\")\n a = 45","completion":"bar(::a)\n }\n\n fun baz(t: Int) {}\n\n val value4 = myBuilder {\n accept(\"\")\n a = 45\n b[0] = 123\n baz(a)\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.psi.psiUtil.getPrevSiblingIgnoringWhitespaceAndComments\nimport org.jetbrains.kotlin.psi.psiUtil.hasSuspendModifier\nimport org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes","completion":"import org.jetbrains.kotlin.resolve.PossiblyBareType.bare\nimport org.jetbrains.kotlin.resolve.PossiblyBareType.type\nimport org.jetbrains.kotlin.resolve.bindingContextUtil.recordScope\nimport org.jetbrains.kotlin.resolve.calls.checkers.checkCoroutinesFeature<|endoftext|>"} {"prompt":"expect lateinit var lateinitVar: String\n\nexpect val delegated: String by Delegate","completion":"object Delegate { operator fun getValue(x: Any?, y: Any?): String = \"\" }\n\nfun test(): String {\n expect val localVariable: String\n localVariable = \"no\"\n return localVariable\n}<|endoftext|>"} {"prompt":"private val errorTypeForCapturedTypeStub by lazy { createErrorType() }\n\n fun FirTypeRef.toIrType(typeOrigin: ConversionTypeOrigin = ConversionTypeOrigin.DEFAULT): IrType {\n capturedTypeCache.clear()\n return when (this) {\n !is FirResolvedTypeRef -> createErrorType()","completion":"!is FirImplicitBuiltinTypeRef -> type.toIrType(typeOrigin, annotations)\n is FirImplicitNothingTypeRef -> irBuiltIns.nothingType\n is FirImplicitUnitTypeRef -> irBuiltIns.unitType\n is FirImplicitBooleanTypeRef -> irBuiltIns.booleanType\n is FirImplicitStringTypeRef -> irBuiltIns.stringType<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.container.StorageComponentContainer\nimport org.jetbrains.kotlin.container.useInstance\nimport org.jetbrains.kotlin.descriptors.ModuleDescriptor\nimport org.jetbrains.kotlin.extensions.StorageComponentContainerContributor\nimport org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter","completion":"import org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.parcelize.fir.FirParcelizeExtensionRegistrar\nimport org.jetbrains.kotlin.platform.TargetPlatform\nimport org.jetbrains.kotlin.platform.jvm.isJvm<|endoftext|>"} {"prompt":"val simpleName = if (sourceName == null || sourceName.isSpecial) {\n val count = (anonymousClassesCount[enclosingName.toUpperCaseAsciiOnly()] ?: 0) + 1\n anonymousClassesCount[enclosingName.toUpperCaseAsciiOnly()] = count\n count.toString()\n } else {\n sourceName\n }","completion":"return sanitizeNameIfNeeded(\"$enclosingName$$simpleName\")\n }\n }\n}<|endoftext|>"} {"prompt":"if (!!!(x !is TypealiasNullableStringIndirect?)) else {\n if (!!(x !is TypealiasNullableStringIndirect?)) else {","completion":"x<|endoftext|>"} {"prompt":"\/\/ Dispatch receiver type must be casted when types are different.\n override val shouldCastDispatchReceiver: Boolean = true\n override fun getBridgeOrigin(bridge: IrSimpleFunction): IrDeclarationOrigin =\n IrDeclarationOrigin.BRIDGE\n\n override fun transformFlat(declaration: IrDeclaration): List? {\n if (declaration.isEffectivelyExternal()) return null","completion":"return super.transformFlat(declaration)\n }\n}<|endoftext|>"} {"prompt":"if (funWithReturnsNotNullAndInvertCondition(value_1 is String && value_2 == null) == null) {\n println(value_1.length)","completion":"println(value_2?.toByte())\n }\n if (funWithReturnsNotNull(value_1 is Float? && value_1 != null && value_2 != null) == null) {<|endoftext|>"} {"prompt":"KtFirAnnotationListForDeclaration.create(firSymbol, builder)\n }\n\n override val generatedPrimaryConstructorProperty: KtKotlinPropertySymbol? by cached {\n val propertySymbol = firSymbol.fir.correspondingProperty?.symbol ?: return@cached null","completion":"val ktPropertySymbol = builder.variableLikeBuilder.buildPropertySymbol(propertySymbol)\n check(ktPropertySymbol is KtKotlinPropertySymbol) {\n \"Unexpected symbol for primary constructor property ${ktPropertySymbol.javaClass} for fir: ${firSymbol.fir.renderWithType()}\"\n }\n\n ktPropertySymbol\n }<|endoftext|>"} {"prompt":"@file:Suppress(\"FunctionName\")\n\npackage org.jetbrains.kotlin.gradle.unitTests.compilerArgumetns\n\nimport org.jetbrains.kotlin.compilerRunner.ArgumentUtils\nimport org.jetbrains.kotlin.gradle.dsl.multiplatformExtension","completion":"import org.jetbrains.kotlin.gradle.plugin.CreateCompilerArgumentsContext\nimport org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.ArgumentType.*\nimport org.jetbrains.kotlin.gradle.plugin.KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext.Companion.default<|endoftext|>"} {"prompt":"} catch (e: IOException) {\n return null\n }\n\n return CompositeLookupsCacheAttributes(version.intValue, components)\n }\n\n override fun writeVersion(values: CompositeLookupsCacheAttributes?) {\n if (values == null) {\n versionManager.writeVersion(null)\n Files.deleteIfExists(actualComponentsFile)\n } else {","completion":"versionManager.writeVersion(CacheVersion(values.version))\n\n Files.createDirectories(actualComponentsFile.parent)\n Files.newOutputStream(actualComponentsFile).bufferedWriter().use { it.append(values.components.joinToString(\"\\n\")) }\n }\n }<|endoftext|>"} {"prompt":"contractDescriptionVisitor.visitBooleanValueParameterReference(this, data)\n}\n\nclass KtErroneousValueParameterReference(val diagnostic: Diagnostic) : KtValueParameterReference(Int.MAX_VALUE, \"ERROR\") {\n override val erroneous: Boolean\n get() = true","completion":"override fun accept(contractDescriptionVisitor: KtContractDescriptionVisitor, data: D): R =\n contractDescriptionVisitor.visitErroneousValueParameterReference(this, data)\n}<|endoftext|>"} {"prompt":"\"org.jetbrains.kotlin.test.kotlin-compiler-args-properties.gradle.plugin\",\n )\n\n @TestFactory\n fun generateArtifactTests(): Stream {\n return findActualPoms().map { actual ->\n val expectedPomPath = actual.toExpectedPath()","completion":"DynamicTest.dynamicTest(expectedPomPath.fileName.toString()) {\n if (\"${expectedPomPath.parent.fileName}\" !in excludedProjects) {\n if (\"${expectedPomPath.parent.fileName}\" !in nativeBundles) {\n val actualString = actual.toFile().readText().replace(kotlinVersion, \"ArtifactsTest.version\")<|endoftext|>"} {"prompt":"if (calleeName != \"suspend\" && variableCalleeName != \"suspend\" && descriptor.name.asString() != \"suspend\") return\n\n when (descriptor.fqNameOrNull()) {\n KOTLIN_SUSPEND_BUILT_IN_FUNCTION_FQ_NAME -> {","completion":"if (calleeName != \"suspend\" || !call.hasFormOfSuspendModifierForLambdaOrFun() || call.explicitReceiver != null) {\n context.trace.report(Errors.NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND.on(reportOn))\n }\n }\n else -> {<|endoftext|>"} {"prompt":"WRONG_ANNOTATION_TARGET!>@A1(12) @A2(\"Test\") T> T.topProp: Int get() = 12","completion":"class SomeClass {<|endoftext|>"} {"prompt":"asSucceeds(\"w as MutableIterable<*>\") { w as MutableIterable<*> }\n asSucceeds(\"w as MutableMap.MutableEntry<*, *>\") { w as MutableMap.MutableEntry<*, *> }\n\n safeAsReturnsNonNull(\"w as Iterator<*>\") { w as? Iterator<*> }","completion":"safeAsReturnsNull(\"w as? MutableIterator<*>\") { w as? MutableIterator<*> }\n safeAsReturnsNonNull(\"w as? MutableIterable<*>\") { w as? MutableIterable<*> }\n safeAsReturnsNonNull(\"w as? MutableMap.MutableEntry<*, *>\") { w as? MutableMap.MutableEntry<*, *> }<|endoftext|>"} {"prompt":"* KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (NEGATIVE)\n *\n * SECTIONS: dfa\n * NUMBER: 45\n * DESCRIPTION: Raw data flow analysis test\n * HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses\n *\/\n\n\/*\n * TESTCASE NUMBER: 1\n * ISSUES: KT-22996\n *\/","completion":"fun case_1(x: Number?): Long? {\n if (x is Long?) return x\n x<|endoftext|>"} {"prompt":"public inline fun kotlin.collections.Iterable.fold(initial: R, operation: (acc: R, T) -> R): R\n\npublic inline fun kotlin.Array.foldIndexed(initial: R, operation: (index: kotlin.Int, acc: R, T) -> R): R","completion":"public inline fun kotlin.BooleanArray.foldIndexed(initial: R, operation: (index: kotlin.Int, acc: R, kotlin.Boolean) -> R): R\n\npublic inline fun kotlin.ByteArray.foldIndexed(initial: R, operation: (index: kotlin.Int, acc: R, kotlin.Byte) -> R): R<|endoftext|>"} {"prompt":"receiverInfo,\n convertedArgument?.unknownIntegerType?.unwrap(),\n inferenceSession\n )\n\n if (!hasContradiction) {\n addResolvedKtPrimitive(resolvedAtom)\n return@runTransaction true\n }\n\n convertedTypeAfterSubtyping =\n TypeConversions.performCompositeConversionAfterSubtyping(","completion":"this@resolveKotlinArgument,\n argument,\n candidateParameter,\n candidateExpectedType\n )?.let { prepareExpectedType(it) }\n\n if (convertedTypeAfterSubtyping == null) {\n addResolvedKtPrimitive(resolvedAtom)\n return@runTransaction true\n }\n\n false\n }<|endoftext|>"} {"prompt":"origin.replaceAttributes(newAttributes).wrapEnhancement(enhancement)\n\n override fun makeNullableAsSpecified(newNullability: Boolean): UnwrappedType =\n origin.makeNullableAsSpecified(newNullability).wrapEnhancement(enhancement.unwrap().makeNullableAsSpecified(newNullability))","completion":"override fun render(renderer: DescriptorRenderer, options: DescriptorRendererOptions): String {\n if (options.enhancedTypes) {\n return renderer.renderType(enhancement)\n }\n return origin.render(renderer, options)\n }\n\n override val delegate: SimpleType get() = origin.delegate\n\n @TypeRefinement<|endoftext|>"} {"prompt":"return builder\n }\n\n fun scriptProto(script: FirScript): ProtoBuf.Class.Builder = whileAnalysing(session, script) {\n val builder = ProtoBuf.Class.newBuilder()\n\n val flags = Flags.getClassFlags(\n extension.hasAdditionalAnnotations(script),\n ProtoEnumFlags.visibility(Visibilities.Public),","completion":"ProtoEnumFlags.modality(Modality.FINAL),\n ProtoEnumFlags.classKind(ClassKind.CLASS, false),\n \/* inner = *\/ false,\n \/* isData = *\/ false,\n \/* isExternal = *\/ false,\n \/* isExpect = *\/ false,\n \/* isValue = *\/ false,\n \/* isFun = *\/ false,<|endoftext|>"} {"prompt":"}\n if (test9 != \"70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 \" +\n \"31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1\") {\n return \"test9 = $test9\"","completion":"}\n\n return \"OK\"\n }\n}\n\nfun box(): String {\n return A().test()\n}<|endoftext|>"} {"prompt":"fun testConsumeMppLibraryFromNonKotlinProject() {\n val libRepo = with(transformNativeTestProject(\"sample-lib\", gradleVersion, \"new-mpp-lib-and-app\")) {\n build(\"publish\") { assertSuccessful() }\n projectDir.resolve(\"repo\")\n }","completion":"with(transformNativeTestProject(\"sample-app-without-kotlin\", gradleVersion, \"new-mpp-lib-and-app\")) {\n setupWorkingDir()\n gradleBuildScript().appendText(\"\\nrepositories { maven { url '${libRepo.toURI()}' } }\")\n\n build(\"assemble\") {\n assertSuccessful()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter\nimport org.jetbrains.kotlin.resolve.scopes.MemberScope\n\nobject NativeObjCNameOverridesChecker : DeclarationChecker {\n\n override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {","completion":"if (descriptor !is ClassDescriptor) return\n descriptor.defaultType.memberScope\n .getContributedDescriptors(DescriptorKindFilter.ALL, MemberScope.Companion.ALL_NAME_FILTER)\n .forEach {\n if (it !is CallableMemberDescriptor || it.kind.isReal) return@forEach\n check(declaration, it, context)<|endoftext|>"} {"prompt":"fragment.imports.entries.forEach { it.setValue(rename(it.value)) }\n\n fragment.importedModules.forEach { import ->\n import.internalName = rename(import.internalName)\n import.plainReference?.let { rename(it) }\n }\n\n val classes = fragment.classes.values.map { cls ->","completion":"JsClassModel(rename(cls.name), cls.superName?.let { rename(it) }).apply {\n postDeclarationBlock.statements += rename(cls.postDeclarationBlock).statements\n cls.interfaces.mapTo(interfaces) { rename(it) }\n }\n }\n fragment.classes.clear()<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: -AbstractClassMemberNotImplementedWithIntermediateAbstractClass\n\nabstract class ALeft {\n abstract fun foo()\n}\n\ninterface IRight {\n fun foo() {}\n}\n\nclass CDerived : ALeft(), IRight\n\nabstract class CAbstract : ALeft(), IRight","completion":"class CDerivedFromAbstract : CAbstract()\n\ninterface ILeft {\n fun foo()\n}\n\nabstract class AILeft : ILeft\n\n\/\/ Should be ERROR\nclass AILeftImpl : AILeft(), IRight<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.konan.test.blackbox\n\nimport org.jetbrains.kotlin.konan.test.blackbox.support.TestName\nimport org.jetbrains.kotlin.konan.test.blackbox.support.util.GTestListing\nimport org.junit.jupiter.api.Assertions.assertEquals","completion":"import org.junit.jupiter.api.Assertions.fail\nimport org.junit.jupiter.api.Tag\nimport org.junit.jupiter.api.Test\n\n@Tag(\"infrastructure\")\nclass InfrastructureGTestListingTest {\n @Test\n fun successfullyParsed() = assertEquals(\n listOf(\n \"Foo.bar\",\n \"Foo.baz\",<|endoftext|>"} {"prompt":"StdOut[\n\ntext4\n\n] \/\/ root\/\/Test\n COMPLETED FAILURE \/\/ root\/\/Test\n COMPLETED FAILURE \/\/ root\/\nCOMPLETED FAILURE \/\/ root\n \"\"\"\n ) {\n serviceMessage(TestSuiteStarted(\"\"))\n serviceMessage(TestStarted(\"Test\", false, null))\n regularText(\"\\n\\ntext1\\n\\n\")","completion":"regularText(\"\\n\\ntext2\\n\\n\")\n serviceMessage(\n \"testFailed\",\n mapOf(\n \"name\" to \"Test\",\n \"message\" to \"Expected <7>, actual <42>\"\n )\n )\n regularText(\"\\n\\ntext3\\n\\n\")\n regularText(\"\\n\\ntext4\\n\\n\")<|endoftext|>"} {"prompt":"Arrays.copyOf(result, size)\n }\n )\n}\n\nprivate inline fun toArrayImpl(\n collection: Collection<*>,\n empty: () -> Array,\n alloc: (Int) -> Array,\n trim: (Array, Int) -> Array\n): Array {\n val size = collection.size","completion":"if (size == 0) return empty() \/\/ quick path on zero size\n val iter = collection.iterator() \/\/ allocate iterator for non-empty collection\n if (!iter.hasNext()) return empty() \/\/ size was > 0, but no actual elements\n var result = alloc(size) \/\/ use size as a guess to allocate result array\n var i = 0\n \/\/ invariant: iter.hasNext is true && i < result.size<|endoftext|>"} {"prompt":"fun normal(a: IC): T = bar(a) {\n normalInline(it)\n}\n\nfun bar(value: T, f: (T) -> R): R {\n return f(value)\n}\n\nfun box(): String {\n var res = extension(IC(40)) + 3\n if (res != 43) return \"FAIL 2: $res\"","completion":"res = dispatch(IC(40)) + 4\n if (res != 44) return \"FAIL 3: $res\"\n\n res = normal(IC(40)) + 5\n if (res != 45) return \"FAIL 4: $res\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.expressions.builder.buildFunctionCall\nimport org.jetbrains.kotlin.fir.references.FirResolvedErrorReference\nimport org.jetbrains.kotlin.fir.references.FirResolvedNamedReference\nimport org.jetbrains.kotlin.fir.references.builder.buildResolvedErrorReference","completion":"import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference\nimport org.jetbrains.kotlin.fir.resolve.ScopeSession\nimport org.jetbrains.kotlin.fir.resolve.fullyExpandedType\nimport org.jetbrains.kotlin.fir.resolve.scope<|endoftext|>"} {"prompt":"* Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n *","completion":"* @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n *\/\n@SinceKotlin(\"1.3\")\npublic expect fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n\/**<|endoftext|>"} {"prompt":"proto.base,\n setParent\n ) { symbol, _, startOffset, endOffset, origin, _ ->\n irFactory.createAnonymousInitializer(startOffset, endOffset, origin, symbol.checkSymbolType(fallbackSymbolKind = null)).apply {\n body = deserializeStatementBody(proto.body) as IrBlockBody? ?: irFactory.createBlockBody(startOffset, endOffset)","completion":"}\n }\n\n private fun deserializeIrConstructor(proto: ProtoConstructor, setParent: Boolean = true): IrConstructor =\n withDeserializedIrFunctionBase(\n proto.base,\n setParent,\n CONSTRUCTOR_SYMBOL\n ) { symbol, idSig, startOffset, endOffset, origin, fcode -><|endoftext|>"} {"prompt":"var x: Int? = 10\n x = null\n x.case_10()\n}\n\n\/\/ TESTCASE NUMBER: 11","completion":"fun String> T?.case_11() = this\nfun case_11() {\n var x: Int? = 10\n x = null\n x.case_11()\n}<|endoftext|>"} {"prompt":"data class KotlinFlexibleTypeBean(val lowerBound: KotlinTypeBean, val upperBound: KotlinTypeBean) : KotlinTypeBean, FlexibleTypeMarker {\n override val nullable: Boolean\n get() = lowerBound.nullable\n}\n\ndata class KotlinClassTypeBean(\n val classId: ClassId,","completion":"val arguments: List,\n override val nullable: Boolean,\n) : KotlinTypeBean, SimpleTypeMarker\n\ndata class KotlinTypeArgumentBean(val projectionKind: KtProjectionKind, val type: KotlinTypeBean?) : TypeArgumentMarker\n\ndata class KotlinTypeParameterTypeBean(\n val typeParameterName: String,<|endoftext|>"} {"prompt":"return typeArgument(type, projection.projectionKind)\n }\n\n private fun typeArgument(\n type: ConeKotlinType,\n projectionKind: KtProjectionKind\n ): ConeTypeProjection {\n val variance = when (projectionKind) {\n KtProjectionKind.IN -> Variance.IN_VARIANCE","completion":"KtProjectionKind.OUT -> Variance.OUT_VARIANCE\n KtProjectionKind.NONE -> Variance.INVARIANT\n KtProjectionKind.STAR -> throw AssertionError(\"* should not be here\")\n }\n return type.toTypeProjection(variance)\n }\n}\n\n\/**<|endoftext|>"} {"prompt":"if (!('3' in '3'..'1') != !range1.contains('3')) throw AssertionError()\n if (!('3' !in '3'..'1') != range1.contains('3')) throw AssertionError()\n \/\/ no local optimizations\n if (element3 in '3'..'1' != range1.contains(element3)) throw AssertionError()","completion":"if (element3 !in '3'..'1' != !range1.contains(element3)) throw AssertionError()\n if (!(element3 in '3'..'1') != !range1.contains(element3)) throw AssertionError()\n if (!(element3 !in '3'..'1') != range1.contains(element3)) throw AssertionError()\n}<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1293\npackage foo\n\ninterface Base {\n abstract fun String.foo(arg: String): String\n}\n\nopen class BaseImpl(val s: String) : Base {\n override fun String.foo(arg: String): String = \"Int.foo ${s}:${this}:${arg}\"\n}\n\nclass Derived() : Base by BaseImpl(\"test\") {","completion":"fun bar(x: String, arg: String): String = x.foo(arg)\n}\n\nfun box(): String {\n assertEquals(\"Int.foo test:A:B\", Derived().bar(\"A\", \"B\"))\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"* DESCRIPTION: Smartcasts using Returns effects with complex (conjunction\/disjunction) type checking and not-null conditions outside contract (custom condition).\n * HELPERS: contractFunctions\n *\/\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1(value_1: Any?, value_2: Any?) {\n funWithReturns(value_1 is String && value_2 is Number)","completion":"println(value_1.length)\n println(value_2.toByte())\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun case_2(value_1: Any?, value_2: Any?) {<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ LANGUAGE: -ProhibitConstructorCallOnFunctionalSupertype\n\/\/ ISSUE: KT-46344\n\nabstract class A : () -> Int()\nabstract class B : (() -> Int)()","completion":"abstract class C : Function0()\nabstract class D : suspend () -> Int()\nabstract class E : (suspend () -> Int)()<|endoftext|>"} {"prompt":"val ONE_MINUS_DST_ALPHA: Int\n val DST_COLOR: Int\n val ONE_MINUS_DST_COLOR: Int\n val SRC_ALPHA_SATURATE: Int\n val FUNC_ADD: Int\n val BLEND_EQUATION: Int\n val BLEND_EQUATION_RGB: Int","completion":"val BLEND_EQUATION_ALPHA: Int\n val FUNC_SUBTRACT: Int\n val FUNC_REVERSE_SUBTRACT: Int\n val BLEND_DST_RGB: Int\n val BLEND_SRC_RGB: Int\n val BLEND_DST_ALPHA: Int\n val BLEND_SRC_ALPHA: Int<|endoftext|>"} {"prompt":"@kotlin.internal.IntrinsicConstEvaluation\n public inline operator fun plus(other: Int): Int =\n this.toInt() + other\n\n \/** Adds the other value to this value. *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public inline operator fun plus(other: Long): Long =\n this.toLong() + other","completion":"\/** Adds the other value to this value. *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public inline operator fun plus(other: Float): Float =\n this.toFloat() + other\n\n \/** Adds the other value to this value. *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public inline operator fun plus(other: Double): Double =<|endoftext|>"} {"prompt":"}\n\n\/* Implementation *\/\n\nprivate class CurrentBuildIdentifierImpl(private val currentBuildIdentifier: BuildIdentifier) : CurrentBuildIdentifier {\n override fun contains(project: Project): Boolean {\n return project.currentBuildId() == currentBuildIdentifier\n }\n\n override fun contains(id: ComponentIdentifier): Boolean {\n return id.buildOrNull == currentBuildIdentifier\n }","completion":"override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (other !is CurrentBuildIdentifierImpl) return false\n return this.currentBuildIdentifier == other.currentBuildIdentifier\n }\n\n override fun hashCode(): Int {\n return currentBuildIdentifier.hashCode()\n }\n}<|endoftext|>"} {"prompt":"\/\/ ISSUE: KT-54920\n\nsealed interface I {\n class C : I\n}\n\nsealed interface IAbstract {\n abstract class C : IAbstract {\n class S1 : C()\n class S2 : C()\n }\n}\n\nsealed interface ISealed {\n sealed class C : ISealed {\n class S1 : C()\n class S2 : C()","completion":"}\n}\n\nfun testDoubleWhen(x: I): Int {\n val a = when (x) { is I.C -> 1 }\n val b = when (x) { is I.C -> 2 }\n return a + b\n}\n\nfun testDoubleWhen(x: IAbstract): Int {<|endoftext|>"} {"prompt":"MPP_PLATFORMS(\n CONCAT, AllowedListAnonymizer(\n listOf(\n \"common\",\n \"native\",\n \"jvm\",\n \"js\",\n \"android_x64\",\n \"android_x86\",\n \"androidJvm\",\n \"android_arm32\",\n \"android_arm64\",\n \"ios_arm64\",","completion":"\"ios_simulator_arm64\",\n \"ios_x64\",\n \"watchos_arm32\",\n \"watchos_arm64\",\n \"watchos_x64\",\n \"watchos_simulator_arm64\",\n \"watchos_device_arm64\",\n \"tvos_arm64\",\n \"tvos_x64\",\n \"tvos_simulator_arm64\",<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ MODULE: lib\n\/\/ FILE: A.java\n\nclass A {\n public A() {}\n\n public A(String x) {}\n\n public A(long l, double z) {}\n}\n\n\/\/ MODULE: main(lib)\n\/\/ FILE: 1.kt\n\nfun box(): String {\n A()\n A(\"\")","completion":"A(0.toLong(), 0.0)\n return \"OK\"\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.IrComposite\nimport org.jetbrains.kotlin.ir.expressions.IrConst\nimport org.jetbrains.kotlin.ir.expressions.IrConstKind\nimport org.jetbrains.kotlin.ir.expressions.IrConstructorCall","completion":"import org.jetbrains.kotlin.ir.expressions.IrDelegatingConstructorCall\nimport org.jetbrains.kotlin.ir.expressions.IrElseBranch\nimport org.jetbrains.kotlin.ir.expressions.IrEnumConstructorCall\nimport org.jetbrains.kotlin.ir.expressions.IrExpression<|endoftext|>"} {"prompt":"val SHOW_DOCUMENT_FRAGMENT: Int\n val SHOW_NOTATION: Int\n }\n}\n\n\/**\n * Exposes the JavaScript [DOMTokenList](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/DOMTokenList) to Kotlin\n *\/\npublic external abstract class DOMTokenList : ItemArrayLike, JsAny {\n open var value: String","completion":"fun contains(token: String): Boolean\n fun add(vararg tokens: String)\n fun remove(vararg tokens: String)\n fun toggle(token: String, force: Boolean = definedExternally): Boolean\n fun replace(token: String, newToken: String)\n fun supports(token: String): Boolean\n override fun item(index: Int): JsString?\n}<|endoftext|>"} {"prompt":"abstract val attributes: MapProperty\n\n @get:Input\n abstract val rawStatements: ListProperty\n\n @get:Nested\n abstract val dependencies: ListProperty\n\n @get:Input\n abstract val artifactType: Property\n\n @get:OutputFile","completion":"@Suppress(\"LeakingThis\") \/\/ should be inherited only by gradle machinery\n val outputFile: Provider = specName.flatMap { specName ->\n destinationDir.file(\"$specName.podspec\")\n }\n\n @TaskAction\n fun generate() {\n outputFile.get().asFile.writeText(buildString {<|endoftext|>"} {"prompt":"internal fun IrElement.getCompilerMessageLocation(containingFile: IrFile): CompilerMessageLocation? =\n createCompilerMessageLocation(containingFile, this.startOffset, this.endOffset)\n\ninternal fun IrBuilderWithScope.getCompilerMessageLocation(): CompilerMessageLocation? {\n val declaration = this.scope.scopeOwnerSymbol.owner as? IrDeclaration ?: return null","completion":"val file = declaration.getPackageFragment() as? IrFile ?: return null\n return createCompilerMessageLocation(file, startOffset, endOffset)\n}\n\nprivate fun createCompilerMessageLocation(containingFile: IrFile, startOffset: Int, endOffset: Int): CompilerMessageLocation? {\n val sourceRangeInfo = containingFile.fileEntry.getSourceRangeInfo(startOffset, endOffset)<|endoftext|>"} {"prompt":"\/\/ !CHECK_TYPE\n\nfun Array.filterNotNull(): List = throw Exception()\n\nfun test1(a: Array) {\n val list = a.filterNotNull()","completion":"list checkType { _>() }\n}\n\nfun test2(vararg a: Int?) {<|endoftext|>"} {"prompt":"Framework, FatFramework, XCFramework -> vendoredFrameworks\n }\n\n val prefix = when (artifactTypeValue) {\n StaticLibrary, DynamicLibrary -> \"lib\"\n else -> \"\"\n }\n\n val suffix = when (artifactTypeValue) {\n StaticLibrary -> \"a\"\n DynamicLibrary -> \"dylib\"\n Framework, FatFramework -> \"framework\"","completion":"XCFramework -> \"xcframework\"\n }\n\n val value = \"$prefix${specName.get()}.$suffix\"\n\n put(key, value)\n }\n }\n }\n\n private fun String.wrapInSingleQuotesIfNeeded(): String {\n return when {\n startsWith('{') ||\n startsWith('[') ||<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ IGNORE_BACKEND: JVM\n\/\/ LANGUAGE: +ValueClasses, +GenericInlineClassParameter\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class Z1(val x: T)\n\nOPTIONAL_JVM_INLINE_ANNOTATION","completion":"value class Z2>(val z: T)\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class ZN?>(val z: T)\n\nfun wrap1(x: String): Z1? = if (x.length == 0) null else Z1(x)<|endoftext|>"} {"prompt":", kotlin.Any?>\")!>g\n}\n\nfun justResolve() {\n val a = Scope.Nested::key\n val b = Scope.Nested::keyT\n val c = Scope.Nested<*>::keyT","completion":"val d = Scope.Nested::keyT\n}<|endoftext|>"} {"prompt":"\/\/ val managed = managed\n \/\/ field cleaner = createCleaner(cpp) { it ->\n \/\/ $Inner.Companion.__destroy__(it) \/\/ For general CPlusPlusClass\n \/\/ or\n \/\/ it.unref() \/\/ for SkiaRefCnt\n \/\/ }\n \/\/ }\n\n val traceCleaners = false","completion":"val cppParam = irClass.primaryConstructor!!.valueParameters.first().also {\n assert(it.name.toString() == \"cpp\")\n }\n\n val cppType = cppParam.type\n val cppClass = cppType.classOrNull!!.owner\n\n val superClassFqNames = cppClass.superTypes.map {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.BindingContext\nimport org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactoryImpl\nimport org.jetbrains.kotlin.test.Directives\nimport org.jetbrains.kotlin.test.InTextDirectivesUtils.isDirectiveDefined","completion":"import org.jetbrains.kotlin.test.KotlinBaseTest\nimport org.jetbrains.kotlin.test.util.KtTestUtil\nimport org.jetbrains.kotlin.utils.addIfNotNull\nimport org.junit.Assert\nimport java.io.File\nimport java.util.regex.Pattern\nimport kotlin.reflect.jvm.javaField<|endoftext|>"} {"prompt":"return emptyList()\n }\n val runtimeModule = LLVMModuleCreateWithNameInContext(\"runtime\", generationState.llvmContext)!!\n runtimeNativeLibraries.forEach {\n val failed = llvmLinkModules2(generationState, runtimeModule, it)\n if (failed != 0) {\n throw Error(\"Failed to link ${it.getName()}\")\n }\n }","completion":"val config = createLTOPipelineConfigForRuntime(generationState)\n\n \/\/ TODO: reconsider pipeline here. Module optimizations instead of LTO can make a lot of sense, but require testing\n MandatoryOptimizationPipeline(config, generationState).use {\n it.execute(runtimeModule)\n }\n LTOOptimizationPipeline(config, generationState).use {<|endoftext|>"} {"prompt":"* @param notRegisteredTasks An optional list of task names that should not have been registered,\n * it could contain task paths as well, but without the first semicolon.\n * @param environmentVariables environmental variables for build process\n * @throws AssertionError if any of the registered tasks do not match the expected task names,\n * or if any of the not-registered tasks were actually registered.\n *\/","completion":"@OptIn(EnvironmentalVariablesOverride::class)\nfun TestProject.buildAndAssertAllTasks(\n registeredTasks: List = emptyList(),\n notRegisteredTasks: List = emptyList(),\n buildOptions: BuildOptions = this.buildOptions,\n environmentVariables: EnvironmentalVariables = EnvironmentalVariables(),\n) {<|endoftext|>"} {"prompt":"}\n }\n\n private inline fun StringBuilder.renderWithSeparator(\n collection: Collection,\n separator: String,\n render: StringBuilder.(E) -> Unit\n ) {\n collection.forEachIndexed { index, element ->\n render(element)\n if (index != collection.size - 1) {\n append(separator)\n }\n }","completion":"}\n}<|endoftext|>"} {"prompt":"\/\/ 1 testFlattened2Flattened\\(\\)V(\\n {3}.*)*((\\n {3}.*DSTORE.*)(\\n {3}.*)*){2}\n\/\/ 0 testFlattened2Flattened\\(\\)V(\\n {3}.*)*((\\n {3}.*DSTORE.*)(\\n {3}.*)*){3}","completion":"\/\/ 0 testBoxed2Flattened\\(\\)V(\\n {3}.*)*((\\n {3}.*box-impl .*)(\\n {3}.*)*){1}\n\/\/ 1 testBoxed2Flattened\\(\\)V(\\n {3}.*)*((\\n {3}.*unbox-impl.*)(\\n {3}.*)*){2}<|endoftext|>"} {"prompt":"body = listOf(\n call(\"Text\"),\n call(\"Text\")\n )\n ),\n\n \"p4\" to Function(\n \"p4\",\n annotations = composable,\n body = listOf(\n call(\n \"Row\",\n lambda(\n call(\"Text\"),\n call(\"Text\")\n )\n )\n )\n ),","completion":"\"p5\" to Function(\n \"p5\",\n annotations = composable,\n body = listOf(\n call(\n \"Provider\",\n lambda(\n call(\n \"Row\",\n lambda(\n call(\"Text\"),\n call(\n \"Button\",\n lambda(\n call(\"Text\")\n )\n )\n )\n )\n )\n )<|endoftext|>"} {"prompt":"x.hashCode()\n }\n }\n }\n }\n}\n\n\/*\n * TESTCASE NUMBER: 47\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-28328\n *\/","completion":"fun case_47(x: TypealiasNullableString, y: TypealiasNullableString, z: Nothing?) = if (x !== z && true && true && true) \"1\"\n else if (y != z) {\n x<|endoftext|>"} {"prompt":"checkSubtype>(y)\n }\n \n companion object {\n fun main() {\n ::Nested\n val y = A::Nested\n\n checkSubtype>(y)\n }\n }\n}\n\nclass B {\n fun main() {","completion":"::Nested\n val y = A::Nested\n\n checkSubtype>(y)\n }\n}<|endoftext|>"} {"prompt":"if (!isEmpty()) {\n root?.traverse { result.add(it.key) }\n }\n return result\n }\n\n \/\/ Perform the splay operation for the given key. Moves the node with\n \/\/ the given key to the top of the tree. If no node has the given\n \/\/ key, the last node on the search path is moved to the top of the","completion":"\/\/ tree. This is the simplified top-down splaying algorithm from:\n \/\/ \"Self-adjusting Binary Search Trees\" by Sleator and Tarjan\n private fun splay(key: K) {\n if (isEmpty()) return\n \/\/ Create a dummy node. The use of the dummy node is a bit\n \/\/ counter-intuitive: The right child of the dummy node will hold<|endoftext|>"} {"prompt":"check<Long>()","completion":"}<|endoftext|>"} {"prompt":"fun @receiver:ObjCName(\"objCReceiverC\", \"swiftReceiver\") Int.kotlinFunctionC(\n @ObjCName(\"objCParam\", \"swiftParam\") kotlinParam: Int\n ): Int\n @ObjCName(\"objCFunctionD\", \"swiftFunctionD\")","completion":"fun @receiver:ObjCName(\"objCReceiver\", \"swiftReceiver\") Int.kotlinFunctionD(\n @ObjCName(\"objCParamD\", \"swiftParam\") kotlinParam: Int\n ): Int\n fun @receiver:ObjCName(\"objCFunctionE\", \"swiftFunctionE\") Int.kotlinFunctionE(<|endoftext|>"} {"prompt":"run {\n return@lambda\n }\n }\n}\n\nfun testLrmFoo1(ints: List) {\n ints.forEach lit@ {\n if (it == 0) return@lit\n print(it)\n }\n}\n\nfun testLrmFoo2(ints: List) {\n ints.forEach {","completion":"if (it == 0) return@forEach\n print(it)\n }\n}<|endoftext|>"} {"prompt":"runAndProcessInitializers(declaration.konanLibrary) {\n declaration.acceptChildrenVoid(this)\n }\n }\n }\n\n \/\/-------------------------------------------------------------------------\/\/\n\n private open inner class StackLocalsScope() : InnerScopeImpl() {\n override fun onEnter() {\n functionGenerationContext.stackLocalsManager.enterScope()\n }\n override fun onExit() {","completion":"functionGenerationContext.stackLocalsManager.exitScope()\n }\n }\n\n private inner class LoopScope(val loop: IrLoop) : StackLocalsScope() {\n val loopExit = functionGenerationContext.basicBlock(\"loop_exit\", loop.endLocation)\n val loopCheck = functionGenerationContext.basicBlock(\"loop_check\", loop.condition.startLocation)<|endoftext|>"} {"prompt":"fun storeVariable(variable: FirVariable, session: FirSession) {\n updateLastScope { storeVariable(variable, session) }\n }\n\n @OptIn(PrivateForInline::class)\n inline fun withInferenceSession(inferenceSession: S, block: S.() -> R): R {\n val oldSession = this.inferenceSession","completion":"this.inferenceSession = inferenceSession\n return try {\n inferenceSession.block()\n } finally {\n this.inferenceSession = oldSession\n }\n }\n\n @OptIn(PrivateForInline::class)\n inline fun withAnonymousFunctionTowerDataContext(symbol: FirAnonymousFunctionSymbol, f: () -> T): T {<|endoftext|>"} {"prompt":"list += \"ok\"\n list += \"element\"\n\n val subList = list.subList(0, 2)\n subList.retainAll { it.length <= 2 }\n\n assertEquals(listOf(\"ok\", \"element\"), list)\n\n assertFailsWith { list.addAll(-1, listOf()) }","completion":"compare(list.storage, list) {\n listBehavior()\n }\n }\n\n @Test\n fun abstractMutableSet() {\n val set = MutSet()\n set.addAll(listOf(\"ok\", \"test\", \"element\", \"test\"))\n set.removeAll { it.length < 4 }\n\n assertEquals(2, set.size)<|endoftext|>"} {"prompt":"contract { returns(null) implies (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) }","completion":"return if (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) null else true\n}\n\n\/\/ TESTCASE NUMBER: 7<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !LANGUAGE: +SuspendFunctionAsSupertype\n\/\/ SKIP_TXT\n\/\/ DIAGNOSTICS: -CONFLICTING_INHERITED_MEMBERS, -CONFLICTING_OVERLOADS, -ABSTRACT_MEMBER_NOT_IMPLEMENTED, -FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS","completion":"import kotlin.coroutines.*\n\nabstract class CSuper: () -> Unit\n\nclass C: CSuper(), SuspendFunction0 {\n override suspend fun invoke() {\n }\n}<|endoftext|>"} {"prompt":"@OptIn(PrivateForInline::class)\n inline fun forConstructorParameters(\n constructor: FirConstructor,\n owningClass: FirRegularClass?,\n holder: SessionHolder,\n f: () -> T\n ): T {\n \/\/ Default values of constructor can't access members of constructing class","completion":"\/\/ But, let them get resolved, then [FirFunctionParameterChecker] will detect and report an error\n \/\/ if an uninitialized parameter is accessed by a preceding parameter.\n return forConstructorParametersOrDelegatedConstructorCall(constructor, owningClass, holder, f)\n }\n\n @OptIn(PrivateForInline::class)\n inline fun forDelegatedConstructorCall(<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryDependency\nimport org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers.IdeArtifactResolutionQuerySourcesResolver\nimport org.jetbrains.kotlin.gradle.plugin.ide.kotlinIdeMultiplatformImport","completion":"import org.jetbrains.kotlin.gradle.plugin.ide.kotlinIdeMultiplatformImportStatistics\nimport org.jetbrains.kotlin.gradle.util.*\nimport org.jetbrains.kotlin.gradle.utils.androidExtension\nimport kotlin.test.BeforeTest\nimport kotlin.test.Test\nimport kotlin.test.fail\n\n\/**<|endoftext|>"} {"prompt":"@MyAnnotation\n open fun foo(@MyAnnotation a: Int) { }\n\n @MyAnnotation\n open val a : Int = 1\n\n @MyAnnotation constructor(i: Int)\n\n open var b\n @MyAnnotation get() = 10\n @MyAnnotation set(value) {}\n}","completion":"class B: Java1(1) \/\/Kotlin \u2190 Java \u2190 Kotlin\n\nclass C : Java1(1) {\n override val a: Int\n get() = 10\n\n override fun foo(a: Int) { }\n override var b: Int\n get() = 11\n set(value) {}\n}<|endoftext|>"} {"prompt":"\/\/ TESTCASE NUMBER: 6\nval value_6 = _\n\n\/\/ TESTCASE NUMBER: 7\nval value_7 = _0_\n\n\/\/ TESTCASE NUMBER: 8","completion":"val value_8 = _9_<|endoftext|>"} {"prompt":"@kotlin.Deprecated(message = \"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'any { it == element }' instead to continue using this behavior, or '.asList().contains(element: T)' to get the same search behavior as in a list.\", replaceWith = kotlin.ReplaceWith(expression = \"any { it == element }\", imports = {}))","completion":"@kotlin.DeprecatedSinceKotlin(errorSince = \"1.6\", hiddenSince = \"1.7\", warningSince = \"1.4\")\npublic operator fun kotlin.DoubleArray.contains(element: kotlin.Double): kotlin.Boolean<|endoftext|>"} {"prompt":"val irDelegatingConstructorCall = CallGenerator(statementGenerator).generateDelegatingConstructorCall(\n ktDelegatingConstructorCall.startOffsetSkippingComments, ktDelegatingConstructorCall.endOffset,\n delegatingConstructorCall\n )\n irBlockBody.statements.add(irDelegatingConstructorCall)\n }","completion":"fun createStatementGenerator() = StatementGenerator(this, scope)\n\n fun putLoop(expression: KtLoopExpression, irLoop: IrLoop) {\n loopTable[expression] = irLoop\n }\n\n override fun getLoop(expression: KtExpression): IrLoop? {\n return loopTable[expression] ?: parentLoopResolver?.getLoop(expression)\n }<|endoftext|>"} {"prompt":"class TestTypeParameterWithMultipleIdenticalUpperBoundsAA where T: UserInterfaceA, T: UserInterfaceB {\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor()\n }\n fun TestTypeParameterWithMultipleIdenticalUpperBoundsAA() where T: UserInterfaceA, T: UserInterfaceB {}","completion":"class TestTypeParameterWithMultipleIdenticalUpperBoundsAAReverse where T: UserInterfaceA, T: UserInterfaceB {\n constructor()\n }\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun TestTypeParameterWithMultipleIdenticalUpperBoundsAAReverse() where T: UserInterfaceA, T: UserInterfaceB {}<|endoftext|>"} {"prompt":"FirJsNameClashClassMembersChecker.Regular,\n FirJsNameClashClassMembersChecker.ForExpectClass,\n )\n\n override val simpleFunctionCheckers: Set\n get() = setOf(\n FirJsNativeInvokeChecker,\n FirJsNativeGetterChecker,\n FirJsNativeSetterChecker,\n )","completion":"override val propertyCheckers: Set\n get() = setOf(\n FirJsPropertyDelegationByDynamicChecker\n )\n\n override val fileCheckers: Set\n get() = setOf(\n FirJsPackageDirectiveChecker,\n FirJsNameClashFileTopLevelDeclarationsChecker\n )\n}<|endoftext|>"} {"prompt":"return ImmutableMap.copyOf(parentContext.getSliceContents(slice) + map.getSliceContents(slice))\n }\n\n override fun getProject(): Project? {\n return this@DelegatingBindingTrace.getProject()\n }\n }\n\n private val bindingContext = MyBindingContext()","completion":"protected val mutableDiagnostics: MutableDiagnosticsWithSuppression? =\n if (filter.ignoreDiagnostics) null\n else MutableDiagnosticsWithSuppression(\n customSuppressCache ?: BindingContextSuppressCache(bindingContext),\n if (withParentDiagnostics) parentContext.diagnostics else Diagnostics.EMPTY\n )\n\n constructor(\n parentContext: BindingContext,<|endoftext|>"} {"prompt":"val t = if (x === null || x == y && x === y) \"\" else {","completion":"x.equals(null)\n x.propT<|endoftext|>"} {"prompt":"visitedSupers: MutableSet = mutableSetOf()\n ): Boolean {\n visitedSupers.add(this)\n val notVisitedSupers = supers.filterNot { visitedSupers.contains(it) }\n if (notVisitedSupers.any { it == baseClass }) return true\n if (!checkDeep) return false","completion":"return notVisitedSupers.any { it.hasSuper(baseClass, true, visitedSupers) }\n }\n\n override fun getText(): String = kotlinOrigin?.text ?: \"\"\n\n override fun getLanguage(): KotlinLanguage = KotlinLanguage.INSTANCE\n\n override fun getPresentation(): ItemPresentation? = ItemPresentationProviders.getItemPresentation(this)<|endoftext|>"} {"prompt":"public fun kotlin.Char.digitToInt(radix: kotlin.Int): kotlin.Int\n\n@kotlin.SinceKotlin(version = \"1.5\")\n@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class})\npublic fun kotlin.Char.digitToIntOrNull(): kotlin.Int?","completion":"@kotlin.SinceKotlin(version = \"1.5\")\n@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class})\npublic fun kotlin.Char.digitToIntOrNull(radix: kotlin.Int): kotlin.Int?<|endoftext|>"} {"prompt":"package kotlinx.cinterop\n\n@OptIn(ExperimentalStdlibApi::class)\n@PublishedApi\ninternal inline fun t() = kotlin.reflect.typeOf()\n\ninline fun staticCFunction(noinline function: () -> R): CPointer R>> =\n staticCFunctionImpl(\n function,","completion":"t()\n )\n\ninline fun staticCFunction(noinline function: (P1) -> R): CPointer R>> =\n staticCFunctionImpl(\n function,\n t(), t()\n )<|endoftext|>"} {"prompt":"x\n x.propAny","completion":"x.funAny()\n }\n}\n\n\/\/ TESTCASE NUMBER: 19\ninline fun case_19(x: Any?) {\n if (x is T !is T) {<|endoftext|>"} {"prompt":"return scope.collectDescendantsOfType { it.name == name }\n .map { it.getSymbol() }\n .filterIsInstance()\n .singleOrNull()\n}\n\ninline fun KtAnalysisSession.getSymbolByName(scope: KtElement, name: String): S {","completion":"return getSymbolByNameSafe(scope, name)\n ?: error(\"Symbol with $name was not found in scope\")\n}<|endoftext|>"} {"prompt":"if (null.>()) return null\n if (false.()) return null\n if (!false.()) return null\n if (Any().()) return null","completion":"if (!checkFunctionName(::, \"\")) return null\n if (!checkFunctionName(Boolean::, \"\")) return null<|endoftext|>"} {"prompt":"if (classId.packageFqName !in combinedPackageNames) return null\n\n return providers.firstNotNullOfOrNull { it.getClassLikeSymbolByClassId(classId) }\n }\n\n @FirSymbolProviderInternals","completion":"override fun getTopLevelCallableSymbolsTo(destination: MutableList>, packageFqName: FqName, name: Name) {\n }\n\n @FirSymbolProviderInternals<|endoftext|>"} {"prompt":"val newArguments = type.typeArguments.map { argument ->\n if (argument == null) return@map null\n val newArgument = substituteOrSelf(argument)\n if (newArgument !== argument) {\n hasNewArguments = true\n newArgument\n } else {\n argument\n }\n }\n return runIf(hasNewArguments) {","completion":"JavaClassifierTypeStub(type, newArguments)\n }\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer.Companion.generateBinaryName\nimport org.jetbrains.kotlin.gradle.targets.js.npm.npmProject\nimport org.jetbrains.kotlin.gradle.targets.js.subtargets.createDefaultDistribution","completion":"import org.jetbrains.kotlin.gradle.targets.js.typescript.TypeScriptValidationTask\nimport org.jetbrains.kotlin.gradle.tasks.configuration.KotlinJsIrLinkConfig\nimport org.jetbrains.kotlin.gradle.tasks.dependsOn\nimport org.jetbrains.kotlin.gradle.tasks.registerTask<|endoftext|>"} {"prompt":"select3(get(), getIn())\n select3(get(), Test.foo(getIn()))","completion":"select3(Test.foo(get()), Test.foo(getIn()))\n select3(Test.foo(get()), getIn())\n \"\"\n }\n}<|endoftext|>"} {"prompt":"}\n\n fun visitValueAccess(element: IrElement, variable: IrValueDeclaration) {\n if (variable !in this.values) {\n reportError(element, \"Value ${variable.render()} not accessible\")\n }\n }\n\n fun extend(newTypeParameters: Collection, newValues: Collection): Visibles =\n Visibles(","completion":"if (newTypeParameters.isEmpty()) typeParameters else typeParameters + newTypeParameters,\n (values + newValues).toMutableSet()\n )\n }\n\n inner class Checker : IrElementVisitor {\n override fun visitElement(element: IrElement, data: Visibles) {\n element.acceptChildren(this, data)\n }<|endoftext|>"} {"prompt":"fun ScriptEngine.runAndRestoreContext(f: ScriptEngine.() -> String): String {\n return try {\n saveGlobalState()\n f()\n } finally {\n restoreGlobalState()\n }\n}\n\nabstract class AbstractNashornJsTestChecker : AbstractJsTestChecker() {\n\n private var engineUsageCnt = 0","completion":"private var engineCache: ScriptEngineNashorn? = null\n\n protected val engine: ScriptEngineNashorn\n get() = engineCache ?: createScriptEngineForTest().also {\n engineCache = it\n }\n\n protected open fun beforeRun() {}\n\n override fun run(files: List, f: ScriptEngine.() -> String): String {\n \/\/ Recreate the engine once in a while<|endoftext|>"} {"prompt":"is Fir2IrLazyClass -> {\n \/*\n * Declaration list of lazy class is lazy by itself, and it will collect and store all required members\n * automatically on the first access to Fir2IrLazyClass.declarations\n *\/\n }\n is IrClass -> irParent.declarations += declaration\n is IrFile -> irParent.declarations += declaration","completion":"is IrExternalPackageFragment -> irParent.declarations += declaration\n is IrScript -> {\n \/*\n * All declarations of the script will be added during main script conversion\n *\/\n }\n else -> error(\"Can't add declaration ${declaration.render()} to parent ${irParent.render()}\")\n }\n}\n\n@OptIn(ExperimentalContracts::class)<|endoftext|>"} {"prompt":"*\/\nfun assertFilesContentEquals(expected: Path, actual: Path) {\n assertFileExists(expected)\n assertFileExists(actual)\n assertContentEquals(\n expected.readLines().asSequence(),\n actual.readLines().asSequence(),\n \"Files content not equal\"\n )\n}\n\nclass GradleVariantAssertions(","completion":"val variantJson: JsonObject,\n) {\n fun assertAttributesEquals(expected: Map) {\n val attributesJson = variantJson.getAsJsonObject(\"attributes\")\n val actual = attributesJson.keySet().associateWith { attributesJson.get(it).asString }<|endoftext|>"} {"prompt":"override fun testGood(x: Any) { assertReifiedIs>(x, type) }","completion":"override fun testBad(x: Any) { assertReifiedIsNot>(x, type) }\n}<|endoftext|>"} {"prompt":"public constructor(message: String?, cause: Throwable?)\n public constructor(cause: Throwable?)\n}\n\npublic expect open class IllegalStateException : RuntimeException {\n public constructor()\n public constructor(message: String?)\n public constructor(message: String?, cause: Throwable?)\n public constructor(cause: Throwable?)\n}\n\npublic expect open class IndexOutOfBoundsException : RuntimeException {\n public constructor()","completion":"public constructor(message: String?)\n}\n\npublic expect open class ConcurrentModificationException : RuntimeException {\n public constructor()\n public constructor(message: String?)\n public constructor(message: String?, cause: Throwable?)\n public constructor(cause: Throwable?)\n}\n\npublic expect open class UnsupportedOperationException : RuntimeException {\n public constructor()\n public constructor(message: String?)<|endoftext|>"} {"prompt":"@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Int8Array.set(index: Int, value: Byte) { asDynamic()[index] = value }\n\n\/**","completion":"* Exposes the JavaScript [Uint8Array](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/Uint8Array) to Kotlin\n *\/\npublic external open class Uint8Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Uint8Array)\n constructor(array: Array)<|endoftext|>"} {"prompt":"override fun bar(o: Int?) { }\n}\n\nabstract class F : Java2 \/\/ Kotlin \u2190 Java1 \u2190Java2\n\nabstract class G : Java4 \/\/ Kotlin \u2190 Java \u2190 Kotlin \u2190 Java\n\nclass H : Java4 { \/\/ Kotlin \u2190 Java \u2190 Kotlin \u2190 Java with explicit override","completion":"override fun foo(): Int {\n return 1\n }\n\n override fun bar(o: Int?) { }\n}\n\ninterface KotlinInterface : Java3\n\nfun test(b: B, c: C, d: D, e: E, f: F, g: G, h: H) {\n var k: Int = b.a<|endoftext|>"} {"prompt":"fun baz(): String = \"baz\"\n}\ndata class StableClassWithEquals(val value: Int)\n\nfun referencingMemberFunctionFoo(sfh: StableFunctionsHolder): String = run(sfh::foo)\nfun referencingMemberFunctionBar(sfh: StableFunctionsHolder): String = run(sfh::bar)","completion":"fun referencingMemberFunctionBaz(sfh: StableFunctionsHolder): String = run(sfh::baz)\nfun referencingAnyEquals(any: Any): String = if ((Any::equals)(any, any)) \"OK\" else \"FAIL\"<|endoftext|>"} {"prompt":"(if (true) None() else r) checkType { _>() }\n \/\/ Works correctly\n if (true) None() else r\n }\n else r\n}\n\nfun bind2(r: Option): Option {\n return if (r is Some) {\n \/\/ Works correctly\n if (true) None() else r\n }","completion":"else r\n}\n\nfun bind3(r: Option): Option {\n return if (r is Some) {\n \/\/ Diagnoses an error correctly\n if (true) None() else r\n }\n else r\n}<|endoftext|>"} {"prompt":"* ====================================================\n *\/\n\n\/*\n * rint(x)\n * Return x rounded to integral value according to the prevailing\n * rounding mode.\n * Method:\n *\tUsing floating addition.\n * Exception:\n *\tInexact flag raised if x not equal to rint(x).\n *\/\n\npackage kotlin.math.fdlibm\n\nprivate val TWO52 = doubleArrayOf(","completion":"4.50359962737049600000e+15, \/* 0x43300000, 0x00000000 *\/\n -4.50359962737049600000e+15, \/* 0xC3300000, 0x00000000 *\/\n)\n\ninternal fun rint(_x: Double): Double {\n var x: Double = _x\n var i0: Int\n var j0: Int\n var sx: Int<|endoftext|>"} {"prompt":"val instance_WithFakeOverride_RemovedDefault_I = WithFakeOverride_RemovedDefault_I()\n val instance_WithFakeOverride_I_J_Default = WithFakeOverride_I_J_Default()\n val instance_WithFakeOverride_Default_J_I = WithFakeOverride_Default_J_I()\n val instance_WithFakeOverride_I_J_RemovedDefault = WithFakeOverride_I_J_RemovedDefault()","completion":"val instance_WithFakeOverride_RemovedDefault_J_I = WithFakeOverride_RemovedDefault_J_I()\n val instance_WithRealOverride_I_Default = WithRealOverride_I_Default()\n val instance_WithRealOverride_Default_I = WithRealOverride_Default_I()\n val instance_WithRealOverride_I_RemovedDefault = WithRealOverride_I_RemovedDefault()<|endoftext|>"} {"prompt":"if (!checkEquals(oldTypeTable.getType(old.inlineClassUnderlyingTypeId), newTypeTable.getType(new.inlineClassUnderlyingTypeId))) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID)\n }","completion":"if (!checkEqualsClassMultiFieldValueClassUnderlyingName(old, new)) result.add(ProtoBufClassKind.MULTI_FIELD_VALUE_CLASS_UNDERLYING_NAME_LIST)<|endoftext|>"} {"prompt":"CHECK_TYPE_WITH_EXACT to \"$helpersPath\/types\/checkTypeWithExact.kt\",\n INFERENCE_HELPERS to \"$helpersPath\/inference\/inferenceUtils.kt\"\n )\n\n override val directiveContainers: List =\n listOf(AdditionalFilesDirectives)\n\n @OptIn(ExperimentalStdlibApi::class)","completion":"override fun produceAdditionalFiles(globalDirectives: RegisteredDirectives, module: TestModule): List {\n return buildList {\n for ((directive, path) in directiveToFileMap) {\n if (directive in module.directives) {\n add(File(path).toTestFile())\n }\n }\n }\n }\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WITH_COROUTINES\n\nimport helpers.*\nimport kotlin.coroutines.*\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\n@Suppress(\"UNSUPPORTED_FEATURE\")\ninline class IC(val s: Int?)\n\ninterface IBar {\n suspend fun bar(): IC?\n}","completion":"fun Int?.toResultString() =\n if (this == null) \"OK\" else \"!!! $this\"\n\nclass Test() : IBar {\n override suspend fun bar(): IC = IC(null)\n\n suspend fun test1(): String {\n val b: IBar = this\n return b.bar()!!.s.toResultString()\n }\n\n suspend fun test2(): String {<|endoftext|>"} {"prompt":"isEqual(test1(::foo1), 77) ?: return \"Fail foo1\"\n isEqual(test2(::foo2), 88) ?: return \"Fail foo2\"\n isEqual(test3 { foo3() }, \"foo3 update\") ?: return \"Fail foo3\"\n }\n 7, 8 -> {","completion":"isEqual(test1(::foo1), 99) ?: return \"Fail foo1\"\n isEqual(test2(::foo2), 88) ?: return \"Fail foo2\"\n isEqual(test3 { foo3() }, \"foo3 update\") ?: return \"Fail foo3\"\n }\n 9 -> {<|endoftext|>"} {"prompt":"qualifiedAccess: FirQualifiedAccessExpression,\n explicitReceiverExpression: IrExpression?,\n ): IrExpression {\n when (this) {\n is IrMemberAccessExpression<*> -> {\n val resolvedFirSymbol = qualifiedAccess.toResolvedCallableSymbol()\n if (resolvedFirSymbol?.dispatchReceiverType != null) {","completion":"val baseDispatchReceiver = qualifiedAccess.findIrDispatchReceiver(explicitReceiverExpression)\n var firDispatchReceiver = qualifiedAccess.dispatchReceiver\n if (firDispatchReceiver is FirPropertyAccessExpression && firDispatchReceiver.calleeReference is FirSuperReference) {\n firDispatchReceiver = firDispatchReceiver.dispatchReceiver\n }<|endoftext|>"} {"prompt":"return emitCmpExchange(callSite, transformArgsForVolatile(callSite, args), CmpExchangeMode.SWAP, resultSlot)\n }\n private fun FunctionGenerationContext.emitGetAndSet(callSite: IrCall, args: List, resultSlot: LLVMValueRef?): LLVMValueRef {","completion":"return emitAtomicRMW(callSite, transformArgsForVolatile(callSite, args), LLVMAtomicRMWBinOp.LLVMAtomicRMWBinOpXchg, resultSlot)\n }\n private fun FunctionGenerationContext.emitGetAndAdd(callSite: IrCall, args: List): LLVMValueRef {<|endoftext|>"} {"prompt":"MethodBridge.ReturnValue.WithError.Success -> llvm.int8(0) \/\/ false\n\n is MethodBridge.ReturnValue.WithError.ZeroForError -> {\n if (returnType.successBridge == MethodBridge.ReturnValue.Instance.InitResult) {\n \/\/ Release init receiver, as required by convention.\n objcReleaseFromRunnableThreadState(param(0))\n }","completion":"Zero(returnType.toLlvmRetType(generationState).llvmType).llvm\n }\n }\n\n ret(returnValue)\n }\n\n continuation != null -> kotlinExceptionHandler { exception ->\n \/\/ Callee haven't suspended, so it isn't going to call the completion. Call it here:\n callFromBridge(<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\/\/ MODULE: m1-common\n\/\/ FILE: common.kt\n\nexpect class Foo1\nexpect class Foo2\n\nexpect fun foo2(): Int","completion":"expect val s: String\n\nexpect open class Foo3\n\n\/\/ MODULE: m2-jvm()()(m1-common)\n\n\/\/ FILE: jvm.kt<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.utils.addToStdlib.popLast\n\nfun KtSourceElement.getChild(type: IElementType, index: Int = 0, depth: Int = -1, reverse: Boolean = false): KtSourceElement? =\n getChild(setOf(type), index, depth, reverse)","completion":"fun KtSourceElement.getChild(types: TokenSet, index: Int = 0, depth: Int = -1, reverse: Boolean = false): KtSourceElement? =\n getChild(types.types.toSet(), index, depth, reverse)<|endoftext|>"} {"prompt":"if (a3.size != 56) return \"fail 3: ${a3.size}\"\n check56(a3)\n\n val a4 = A4()\n if (a4.size != 56) return \"fail 4: ${a4.size}\"\n check56(a4)\n\n val sized: Sized = a4","completion":"if (sized.size != 56) return \"fail 5: ${a4.size}\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"@file:OptIn(KtAnalysisApiInternals::class, KtAllowProhibitedAnalyzeFromWriteAction::class)\n\npackage org.jetbrains.kotlin.analysis.api.lifetime\n\nimport com.intellij.openapi.application.ApplicationManager\nimport com.intellij.openapi.project.Project\nimport com.intellij.openapi.util.ModificationTracker","completion":"import kotlinx.collections.immutable.PersistentList\nimport kotlinx.collections.immutable.persistentListOf\nimport org.jetbrains.kotlin.analysis.api.*\nimport kotlin.reflect.KClass\n\npublic class KtReadActionConfinementLifetimeToken(private val modificationTracker: ModificationTracker) : KtLifetimeToken() {<|endoftext|>"} {"prompt":"bar { x -> x + 1}","completion":"bar { x: Int -> x + 1}\n}<|endoftext|>"} {"prompt":"import a.O.*\n\nfun testErroneusAllUnderImportFromObject() {\n A()\n B","completion":"bar()\n}\n\n\/\/ FILE: c.kt\npackage c\n\nimport a.S.prop\nimport a.S.o\nimport a.S.ext\nimport a.S.A\nimport a.S.genericFun\nimport a.S.ext as extRenamed\n\nfun testImportFromObjectByName() {\n prop<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature as ProtoFileSignature\nimport org.jetbrains.kotlin.backend.common.serialization.proto.IdSignature as ProtoIdSignature\nimport org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature as ProtoLocalSignature","completion":"class IdSignatureDeserializer(\n private val libraryFile: IrLibraryFile,\n private val fileSignature: FileSignature?,\n private val internationService: IrInterningService\n) {\n\n private fun loadSignatureProto(index: Int): ProtoIdSignature {\n return libraryFile.signature(index)\n }\n\n private val signatureCache = HashMap()<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.abicmp.reports\n\nimport org.jetbrains.kotlin.abicmp.defects.*\nimport org.jetbrains.kotlin.abicmp.tag\nimport java.io.ByteArrayOutputStream\nimport java.io.PrintWriter","completion":"val MISSING_CLASS1_D = DefectType(\"jar.missingClass1\", \"Missing class in #1\", CLASS_A, JAR_FILE1_A)\nval MISSING_CLASS2_D = DefectType(\"jar.missingClass2\", \"Missing class in #2\", CLASS_A, JAR_FILE2_A)\n\nclass JarReport(\n private val header: String,<|endoftext|>"} {"prompt":"internal expect fun ulongToFloat(value: Long): Float\n\n@PublishedApi\ninternal expect fun floatToULong(value: Float): ULong\n\n@PublishedApi\ninternal expect fun ulongToDouble(value: Long): Double\n\n@PublishedApi\ninternal expect fun doubleToULong(value: Double): ULong\n\ninternal expect fun uintToString(value: Int): String","completion":"internal expect fun uintToString(value: Int, base: Int): String\n\ninternal expect fun ulongToString(value: Long): String\n\ninternal expect fun ulongToString(value: Long, base: Int): String<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.withFileAnalysisExceptionWrapping\n\n@OptIn(AdapterForResolveProcessor::class)\nclass FirConstantEvaluationProcessor(\n session: FirSession,\n scopeSession: ScopeSession\n) : FirTransformerBasedResolveProcessor(session, scopeSession, FirResolvePhase.CONSTANT_EVALUATION) {","completion":"override val transformer = FirConstantEvaluationTransformerAdapter(session)\n}\n\n@AdapterForResolveProcessor\nclass FirConstantEvaluationTransformerAdapter(session: FirSession) : FirTransformer() {\n private val transformer = FirConstantEvaluationBodyResolveTransformer(session)<|endoftext|>"} {"prompt":"C2901, C2902, C2903, C2904, C2905, C2906, C2907, C2908, C2909, C2910,\n C2911, C2912, C2913, C2914, C2915, C2916, C2917, C2918, C2919, C2920,","completion":"C2921, C2922, C2923, C2924, C2925, C2926, C2927, C2928, C2929, C2930,\n C2931, C2932, C2933, C2934, C2935, C2936, C2937, C2938, C2939, C2940,<|endoftext|>"} {"prompt":"open var overflowX: String\n open var overflowY: String\n open var padding: String\n open var paddingBottom: String\n open var paddingLeft: String\n open var paddingRight: String\n open var paddingTop: String\n open var pageBreakAfter: String\n open var pageBreakBefore: String\n open var pageBreakInside: String\n open var perspective: String\n open var perspectiveOrigin: String","completion":"open var phonemes: String\n open var position: String\n open var quotes: String\n open var resize: String\n open var rest: String\n open var restAfter: String\n open var restBefore: String\n open var right: String\n open var tabSize: String\n open var tableLayout: String\n open var textAlign: String\n open var textAlignLast: String<|endoftext|>"} {"prompt":"\/\/ \"∮\" to 8750,\n\/\/ \"↺\" to 8634,\n\/\/ \"⦾\" to 10686,\n\/\/ \"⦻\" to 10683,\n\/\/ \"‾\" to 8254,\n\/\/ \"⧀\" to 10688,\n\/\/ \"Ō\" to 332,\n\/\/ \"ō\" to 333,","completion":"\/\/ \"Ω\" to 937,\n\/\/ \"ω\" to 969,\n\/\/ \"Ο\" to 927,\n\/\/ \"ο\" to 959,\n\/\/ \"⦶\" to 10678,\n\/\/ \"⊖\" to 8854,\n\/\/ \"𝕆\" to 120134,\n\/\/ \"𝕠\" to 120160,<|endoftext|>"} {"prompt":"* SPEC VERSION: 0.1-268\n * MAIN LINK: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 8\n * PRIMARY LINKS: overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 9\n * overload-resolution, callables-and-invoke-convention -> paragraph 2 -> sentence 10\n * NUMBER: 1","completion":"* DESCRIPTION: A companion object of a classifier type named foo at its declaration site\n *\/\n\n\/\/ FILE: Case1.kt\npackage testPackage\n\n\/\/ TESTCASE NUMBER: 1\n\nclass Case1() {\n companion object foo {\n operator fun invoke() {}\n\n fun f() {<|endoftext|>"} {"prompt":"val mainLoopVariable: IrVariable,\n val mainLoopVariableIndex: Int,\n val loopVariableComponents: Map,\n val loopVariableComponentIndices: List\n )\n\n private class FindInitializerCallVisitor(private val mainLoopVariable: IrVariable?) : IrElementVisitorVoid {\n var initializerCall: IrCall? = null","completion":"override fun visitElement(element: IrElement) {\n element.acceptChildrenVoid(this)\n }\n\n override fun visitCall(expression: IrCall) {\n val candidateCall = when (expression.origin) {\n IrStatementOrigin.FOR_LOOP_NEXT -> expression\n is IrStatementOrigin.COMPONENT_N -><|endoftext|>"} {"prompt":"append(containingDeclarationForTypeParameter?.qualifiedNameString())\n }\n }\n }\n\n if (symbol is KtFunctionLikeSymbol && symbol.valueParameters.isNotEmpty()) {\n appendLine()\n withIndent {\n printCollection(symbol.valueParameters, separator = \"\\n\") { typeParameter ->","completion":"val containingDeclarationForValueParameter = typeParameter.getContainingSymbol()\n append(typeParameter.render(renderingOptions))\n append(\" from \")\n append(containingDeclarationForValueParameter?.qualifiedNameString())\n }\n }\n }\n }\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.codegen\n\nimport com.intellij.openapi.util.Key\nimport org.jetbrains.kotlin.codegen.CalculatedCodeFragmentCodegenInfo.CalculatedParameter\nimport org.jetbrains.kotlin.codegen.CodeFragmentCodegenInfo.IParameter","completion":"import org.jetbrains.kotlin.codegen.binding.MutableClosure\nimport org.jetbrains.kotlin.codegen.context.*\nimport org.jetbrains.kotlin.codegen.context.LocalLookup.*\nimport org.jetbrains.kotlin.codegen.state.GenerationState<|endoftext|>"} {"prompt":"}\n\n override fun replaceSetter(newSetter: FirPropertyAccessor?) {\n }\n\n override fun replaceContextReceivers(newContextReceivers: List) {\n error(\"Body cannot be replaced for FirJavaValueParameter\")\n }\n\n override fun replaceStatus(newStatus: FirDeclarationStatus) {","completion":"error(\"Status cannot be replaced for FirJavaValueParameter\")\n }\n}\n\n@FirBuilderDsl\nclass FirJavaValueParameterBuilder {\n var source: KtSourceElement? = null\n lateinit var moduleData: FirModuleData\n var attributes: FirDeclarationAttributes = FirDeclarationAttributes()\n lateinit var returnTypeRef: FirTypeRef\n lateinit var name: Name<|endoftext|>"} {"prompt":"sourceSetsDependsOnRelation = sourceSetsDependsOnRelation,\n sourceSetBinaryLayout = sourceSetBinaryLayout,\n sourceSetCInteropMetadataDirectory = sourceSetCInteropMetadataDirectory,\n sourceSetModuleDependencies = sourceSetModuleDependencies,\n hostSpecificSourceSets = hostSpecificSourceSets,\n sourceSetNames = sourceSetNames,","completion":"isPublishedAsRoot = isPublishedAsRoot\n )\n}\n\nprivate fun File.withParentDirectoriesCreated(): File = apply { parentFile.mkdirs() }<|endoftext|>"} {"prompt":"compareFlags(typeAliasContext, typeAliasA, typeAliasB, TYPE_ALIAS_FLAGS)\n compareAnnotationLists(typeAliasContext, typeAliasA.annotations, typeAliasB.annotations)\n\n compareTypeParameterLists(typeAliasContext, typeAliasA.typeParameters, typeAliasB.typeParameters)\n\n compareEntities(\n containerContext = typeAliasContext,","completion":"entityA = typeAliasA.underlyingType,\n entityB = typeAliasB.underlyingType,\n entityKind = TypeKind.UNDERLYING,\n entitiesComparator = ::compareTypes\n )\n compareEntities(\n containerContext = typeAliasContext,\n entityA = typeAliasA.expandedType,\n entityB = typeAliasB.expandedType,<|endoftext|>"} {"prompt":"fun createInOtherFile(): A = A(10)\n\n\/\/ FILE: b.kt\n\nimport a.*\n\nfun here(): A = A(10)\n\nfun box(): String {\n if (here() != createInOtherFile()) return \"Fail equals\"\n if (here().hashCode() != createInOtherFile().hashCode()) return \"Fail hashCode\"","completion":"if (here().toString() != createInOtherFile().toString()) return \"Fail toString\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.name.SpecialNames\nimport org.jetbrains.kotlin.resolve.calls.NewCommonSuperTypeCalculator.commonSuperType\nimport org.jetbrains.kotlin.types.Variance\nimport org.jetbrains.kotlin.util.OperatorNameConventions","completion":"import org.jetbrains.kotlin.utils.addToStdlib.runIf\n\nclass CallAndReferenceGenerator(\n private val c: Fir2IrComponents,\n private val visitor: Fir2IrVisitor,\n private val conversionScope: Fir2IrConversionScope,\n) : Fir2IrComponents by c {\n\n private val adapterGenerator = AdapterGenerator(c, conversionScope)<|endoftext|>"} {"prompt":"\/\/ test.kt:37 box: result:java.lang.String=\"NON_LOCAL_RETURN\":java.lang.String, localX:java.lang.String=\"OK\":java.lang.String\n\n\/\/ EXPECTATIONS JVM_IR\n\/\/ test.kt:35 box:\n\/\/ test.kt:20 compute:\n\/\/ test.kt:21 compute:","completion":"\/\/ test.kt:22 compute: y:int=42:int\n\/\/ test.kt:23 compute: y:int=42:int, i:int=0:int\n\/\/ test.kt:7 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int<|endoftext|>"} {"prompt":"KtFakeSourceElementKind.DesugaredDivAssign,\n KtFakeSourceElementKind.DesugaredRemAssign,\n KtFakeSourceElementKind.DesugaredPrefixDec,\n KtFakeSourceElementKind.DesugaredPrefixInc,\n KtFakeSourceElementKind.DesugaredPostfixDec,\n KtFakeSourceElementKind.DesugaredPostfixInc\n )","completion":"}\n\n fun report(debugFactory: DebugInfoDiagnosticFactory0, sourceElement: KtSourceElement?) {\n if (sourceElement == null || sourceElement.kind !in allowedKindsForDebugInfo) return\n\n \/\/ Lambda argument is always (?) duplicated by function literal\n \/\/ Block expression is always (?) duplicated by single block expression<|endoftext|>"} {"prompt":"js(\"var \" + valFromClass + \" = 1;\")\n }\n\n fun testValWithGetterThis() {","completion":"js(\"var ${valWithGetter} = 1;\")<|endoftext|>"} {"prompt":"val unaryBuilder = JsAstProtoBuf.UnaryOperation.newBuilder()\n unaryBuilder.operand = serialize(x.arg)\n unaryBuilder.type = map(x.operator)\n unaryBuilder.postfix = postfix\n return unaryBuilder.build()\n }\n\n protected fun map(modifier: JsFunction.Modifier) = when (modifier) {","completion":"JsFunction.Modifier.STATIC -> JsAstProtoBuf.Function.Modifier.STATIC\n JsFunction.Modifier.SET -> JsAstProtoBuf.Function.Modifier.SET\n JsFunction.Modifier.GET -> JsAstProtoBuf.Function.Modifier.GET<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.KotlinPluginLifecycle\nimport org.jetbrains.kotlin.gradle.plugin.KotlinProjectSetupCoroutine\nimport org.jetbrains.kotlin.gradle.plugin.await\nimport org.jetbrains.kotlin.gradle.plugin.sources.KotlinDependencyScope","completion":"import org.jetbrains.kotlin.gradle.plugin.sources.sourceSetDependencyConfigurationByScope\nimport org.jetbrains.kotlin.gradle.targets.metadata.dependsOnClosureWithInterCompilationDependencies\nimport org.jetbrains.kotlin.gradle.targets.metadata.getPublishedPlatformCompilations<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion\nimport org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl\nimport org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.serialization.deserialization.ClassDeserializer","completion":"import org.jetbrains.kotlin.serialization.deserialization.getClassId\n\nsealed class FileWithMetadata {\n class Incompatible(val version: BinaryVersion) : FileWithMetadata()\n\n open class Compatible(val proto: ProtoBuf.PackageFragment, val version: BinaryVersion) : FileWithMetadata() {<|endoftext|>"} {"prompt":"public inline fun CharSequence.foldRight(initial: R, operation: (Char, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n\/**","completion":"* Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each character with its index in the original char sequence and current accumulator value.\n * \n * Returns the specified [initial] value if the char sequence is empty.\n * \n * @param [operation] function that takes the index of a character, the character itself\n * and current accumulator value, and calculates the next accumulator value.\n *\/<|endoftext|>"} {"prompt":"put(ErrorsJs.WRONG_JS_QUALIFIER, \"Qualifier contains illegal characters\")\n\n put(ErrorsJs.CANNOT_CHECK_FOR_EXTERNAL_INTERFACE, \"Cannot check for external interface: {0}\", RENDER_TYPE)","completion":"put(ErrorsJs.UNCHECKED_CAST_TO_EXTERNAL_INTERFACE, \"Unchecked cast to external interface: {0} to {1}\", RENDER_TYPE, RENDER_TYPE)\n put(ErrorsJs.EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT, \"Cannot pass external interface {0} for reified type parameter\", RENDER_TYPE)<|endoftext|>"} {"prompt":"if (isEqualNullableUnboxedRight(A(0), A(1))) return \"Fail 46\"\n if (!isEqualNullableUnboxedRight(A(1), A(1))) return \"Fail 47\"\n if (isEqualNullableUnboxedLeft(A(0), null)) return \"Fail 48\"","completion":"if (isEqualNullableUnboxedRight(null, A(1))) return \"Fail 49\"\n\n if (isEqualNullableUnboxedRight(null, A(null))) return \"Fail 50\"\n if (isEqualNullableUnboxedLeft(A(null), null)) return \"Fail 51\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"@JsName(\"CharCompanionObject\")\ninternal object CharCompanionObject {\n @JsName(\"MIN_VALUE\")\n public const val MIN_VALUE: Char = '\\u0000'\n\n @JsName(\"MAX_VALUE\")\n public const val MAX_VALUE: Char = '\\uFFFF'\n\n @JsName(\"MIN_HIGH_SURROGATE\")","completion":"public const val MIN_HIGH_SURROGATE: Char = '\\uD800'\n\n @JsName(\"MAX_HIGH_SURROGATE\")\n public const val MAX_HIGH_SURROGATE: Char = '\\uDBFF'\n\n @JsName(\"MIN_LOW_SURROGATE\")<|endoftext|>"} {"prompt":"\/* @(#)e_exp.c 1.6 04\/04\/22 *\/\n\/*\n * ====================================================\n * Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.\n *\n * Permission to use, copy, modify, and distribute this\n * software is freely granted, provided that this notice \n * is preserved.\n * ====================================================\n *\/\n\n\/* __ieee754_exp(x)","completion":"* Returns the exponential of x.\n *\n * Method\n * 1. Argument reduction:\n * Reduce x to an r so that |r| <= 0.5*ln2 ~ 0.34658.\n *\tGiven x, find r and integer k such that\n *\n * x = k*ln2 + r, |r| <= 0.5*ln2. \n *<|endoftext|>"} {"prompt":"fooShort(1 + 1)\n\n fooInt(1 * 1)\n fooByte(1 * 1)\n fooLong(1 * 1)\n fooShort(1 * 1)","completion":"fooInt(1 \/ 1)\n fooByte(1 \/ 1)\n fooLong(1 \/ 1)\n fooShort(1 \/ 1)\n\n fooInt(1 % 1)<|endoftext|>"} {"prompt":"val parameter = capturedValueToParameter[valueDeclaration] ?: return null\n\n return IrGetValueImpl(startOffset, endOffset, parameter.type, parameter.symbol)\n }\n }\n\n sealed class OwnerForLoweredDeclaration(val isLocal: Boolean) {\n abstract fun addChild(declaration: IrDeclaration)\n abstract fun closestDeclarationParent(): IrDeclarationParent","completion":"\/\/ Usually, just move local functions to the nearest class or file.\n class DeclarationContainer(private val irDeclarationContainer: IrDeclarationContainer) : OwnerForLoweredDeclaration(false) {\n override fun addChild(declaration: IrDeclaration) = irDeclarationContainer.addChild(declaration)\n\n override fun closestDeclarationParent() = irDeclarationContainer\n }<|endoftext|>"} {"prompt":"val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short","completion":"val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external abstract class SVGHatchElement : SVGElement {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short<|endoftext|>"} {"prompt":"if (element11 !in 1L..<3L != !range0.contains(element11)) throw AssertionError()\n if (!(element11 in 1L..<3L) != !range0.contains(element11)) throw AssertionError()\n if (!(element11 !in 1L..<3L) != range0.contains(element11)) throw AssertionError()\n}","completion":"fun testR0xE12() {\n \/\/ with possible local optimizations\n if (2.toByte() in 1L..<3L != range0.contains(2.toByte())) throw AssertionError()\n if (2.toByte() !in 1L..<3L != !range0.contains(2.toByte())) throw AssertionError()<|endoftext|>"} {"prompt":"\/\/ 1 LOCALVARIABLE y Z (.*) 5\n\n\/\/ JVM_IR_TEMPLATES_WITH_INLINE_SCOPES\n\/\/ 1 LOCALVARIABLE x\\\\2 I (.*) 6\n\/\/ 1 LOCALVARIABLE y\\\\2 I (.*) 5\n\/\/ 1 LOCALVARIABLE x\\\\4 J (.*) 7","completion":"\/\/ 1 LOCALVARIABLE y\\\\4 J (.*) 5\n\/\/ 1 LOCALVARIABLE x\\\\6 F (.*) 6\n\/\/ 1 LOCALVARIABLE y\\\\6 F (.*) 5\n\/\/ 1 LOCALVARIABLE x\\\\8 D (.*) 7\n\/\/ 1 LOCALVARIABLE y\\\\8 D (.*) 5<|endoftext|>"} {"prompt":"interfaces: Array?,\n suspendArity: Array?,\n associatedObjectKey: Number?,\n associatedObjects: dynamic\n) {\n if (parent != null) {\n js(\"\"\"\n ctor.prototype = Object.create(parent.prototype)\n ctor.prototype.constructor = ctor;\n \"\"\")\n }","completion":"val metadata = createMetadata(kind, name, defaultConstructor, associatedObjectKey, associatedObjects, suspendArity)\n ctor.`$metadata$` = metadata\n\n if (interfaces != null) {\n val receiver = if (metadata.iid != VOID) ctor else ctor.prototype\n receiver.`$imask$` = implement(interfaces)\n }\n}<|endoftext|>"} {"prompt":"val arguments = argumentList.originalArgumentList?.arguments ?: return\n for (key in arguments) {\n if (key !is FirWrappedArgumentExpression && argumentList.mapping[key]?.name.let { it != null && it != Annotations.ParameterNames.value}) {","completion":"reporter.reportOn(key.source, FirJvmErrors.POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION, context)\n }\n }\n }\n }\n }\n}<|endoftext|>"} {"prompt":"\/\/ PROPERTY_NOT_USED: p9\n inline var p9: Int\n get() = a + 90000\n set(v) {\n a = v + 900\n }\n\n \/\/ PROPERTY_NOT_READ_FROM: p10\n var p10: Int\n inline get() = a + 100000\n set(v) {\n a = v + 1000\n }","completion":"\/\/ PROPERTY_NOT_WRITTEN_TO: p11\n var p11: Int\n get() = a + 110000\n inline set(v) {\n a = v + 1100\n }\n\n \/\/ CHECK_FUNCTION_EXISTS: get_p12_s8ev3n$ TARGET_BACKENDS=JS<|endoftext|>"} {"prompt":"val x91 = >\")!>foo9(y)\n\n val x100 = \")!>foo10(x, >\")!>Foo(Bar()))","completion":"val x101 = \")!>foo10(y, >\")!>Foo(Bar()))<|endoftext|>"} {"prompt":"val ContextFunctionTypeParams = \"ContextFunctionTypeParams\".baseId()\n val Deprecated = \"Deprecated\".baseId()\n val DeprecatedSinceKotlin = \"DeprecatedSinceKotlin\".baseId()\n val RequireKotlin = \"RequireKotlin\".internalId()\n\n val ConsistentCopyVisibility = \"ConsistentCopyVisibility\".baseId()","completion":"val ExposedCopyVisibility = \"ExposedCopyVisibility\".baseId()\n\n val HidesMembers = \"HidesMembers\".internalId()\n val DynamicExtension = \"DynamicExtension\".internalId()\n val IntrinsicConstEvaluation = \"IntrinsicConstEvaluation\".internalId()\n\n val Retention = \"Retention\".annotationId()<|endoftext|>"} {"prompt":"\/\/ FILE: 1.kt\n\npackage test\n\nenum class MyEnum {\n K;\n\n \/\/TODO: KT-4693\n inline fun doSmth(a: T) : String {\n return a.toString() + K.name\n }\n}\n\n\/\/ FILE: 2.kt\n\nimport test.*\n\nfun test1(): String {","completion":"return MyEnum.K.doSmth(\"O\")\n}\n\nfun box(): String {\n val result = test1()\n if (result != \"OK\") return \"fail1: ${result}\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"}\n\n val list3 = ArrayList()\n val range3 = MaxS..MaxS step 1\n for (i in range3) {\n list3.add(i)\n if (list3.size > 23) break\n }\n if (list3 != listOf(MaxS.toInt())) {","completion":"return \"Wrong elements for MaxS..MaxS step 1: $list3\"\n }\n\n val list4 = ArrayList()\n val range4 = MaxL..MaxL step 1\n for (i in range4) {\n list4.add(i)\n if (list4.size > 23) break\n }\n if (list4 != listOf(MaxL)) {<|endoftext|>"} {"prompt":"val test_ini = i === ni || ni === i || i !== ni ||","completion":"ni !== i<|endoftext|>"} {"prompt":"writeMissingClasses(output, jarFileName1, missingClassNames1)\n writeMissingClasses(output, jarFileName2, missingClassNames2)\n }\n\n private fun writeMissingClasses(output: PrintWriter, name: String, missing: Collection) {\n if (missing.isNotEmpty()) {","completion":"output.tag(\"p\", \"Classes missing in $name: ${missing.size}<\/b>\")\n output.tag(\"ul\") {\n for (className in missing) {\n output.tag(\"li\", className)\n }\n }\n }\n }\n}<|endoftext|>"} {"prompt":"\/\/ JVM_ABI_K1_K2_DIFF: KT-63864\n\/\/ WITH_STDLIB\n\nimport kotlin.test.*\n\nval sb = StringBuilder()\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninline fun foo(body: () -> Unit) {\n sb.appendLine(\"hello1\")\n body()\n sb.appendLine(\"hello4\")\n}","completion":"fun bar() {\n foo {\n sb.appendLine(\"hello2\")\n sb.appendLine(\"hello3\")\n }\n}\n\nfun box(): String {\n bar()\n\n assertEquals(\"\"\"\n hello1\n hello2\n hello3\n hello4\n\n \"\"\".trimIndent(), sb.toString())\n return \"OK\"\n}<|endoftext|>"} {"prompt":"expect fun Int.intFunction(): Int\nexpect fun Short.intFunction(): Int\nexpect fun Long.intFunction(): Int\nexpect fun String.intFunction(): Int\nexpect fun Planet.intFunction(): Int\n\nexpect val T.propertyWithTypeParameter1: Int\nexpect val T.propertyWithTypeParameter2: Int","completion":"expect val T.propertyWithTypeParameter4: Int\n\nexpect fun T.functionWithTypeParameter1()<|endoftext|>"} {"prompt":"fun indexOf(valueDeclaration: IrValueDeclaration) : Int {\n return contextVariablesToIndex.getOrElse(valueDeclaration) { -1 }\n }\n\n fun addressOf(index: Int): LLVMValueRef {\n return variables[index].address()\n }\n\n fun load(index: Int, resultSlot: LLVMValueRef?): LLVMValueRef {","completion":"return variables[index].load(resultSlot)\n }\n\n fun store(value: LLVMValueRef, index: Int) {\n variables[index].store(value)\n }\n}\n\ninternal data class VariableDebugLocation(val localVariable: DILocalVariableRef, val location:DILocationRef?, val file:DIFileRef, val line:Int)<|endoftext|>"} {"prompt":"private fun reportUnexpectedDescriptor(descriptor: DeclarationDescriptor) {\n error(\"unexpected descriptor $descriptor\")\n }\n\n open fun PropertyDescriptor.platformSpecificSuffix(): String? = null\n\n private val CallableDescriptor.isRealStatic: Boolean\n get() = dispatchReceiverParameter == null && containingDeclaration !is PackageFragmentDescriptor","completion":"override fun DeclarationDescriptor.asTypeParameterContainer(): DeclarationDescriptor =\n this\n\n override fun getContextReceiverTypes(function: FunctionDescriptor): List =\n function.contextReceiverParameters.map { it.type }\n\n override fun getExtensionReceiverParameterType(function: FunctionDescriptor): KotlinType? =<|endoftext|>"} {"prompt":"@Test fun longArrayInit() {\n val arr = LongArray(2) { it.toLong() }\n\n assertEquals(2, arr.size)\n assertEquals(0.toLong(), arr[0])\n assertEquals(1.toLong(), arr[1])\n\n testExceptOn(TestPlatform.Js) {","completion":"assertFailsWith { LongArray(-1) { it.toLong() } }\n }\n }\n\n @Test fun floatArray() {\n val arr = FloatArray(2)\n\n val expected: Float = 0.0F\n assertEquals(arr.size, 2)\n assertEquals(expected, arr[0])\n assertEquals(expected, arr[1])<|endoftext|>"} {"prompt":"abstract fun replaceResolvedToCompanionObject(newResolvedToCompanionObject: Boolean)\n\n abstract fun replaceCanBeValue(newCanBeValue: Boolean)\n\n abstract fun replaceTypeArguments(newTypeArguments: List)\n\n abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirResolvedQualifier","completion":"abstract fun transformTypeArguments(transformer: FirTransformer, data: D): FirResolvedQualifier\n}<|endoftext|>"} {"prompt":"\/*should be shadowed by member property with invoke*\/\ninfix fun B.barC(i: Int) = {}\n\/*should be shadowed by member property*\/\nval B.barC: C\nget() = TODO()\n\nfun case2() {\n class Case() {\n \/*should be shadowed by member property*\/\n val B.barC: C\n get() = TODO()","completion":"\/*should be shadowed by member property with invoke*\/\n infix fun B.barC(i: Int) = {}\n \/*should be shadowed by member function*\/\n infix fun B.fooC(i: Int) = {}\n fun case() {\n val b = B()<|endoftext|>"} {"prompt":"fun case_16(value_1: Int, value_2: Class, value_3: Class?, value_4: Int) {\n fun __fun_1(): () -> Unit { return fun() { } }\n\n when {\n value_1 == 1 -> funWithoutArgs()\n value_1 == 2 -> __fun_1()()\n value_1 == 3 -> value_2.fun_2(value_4)","completion":"value_1 == 4 -> value_3?.fun_2(value_4)\n value_1 == 5 -> value_3!!.fun_2(value_4)\n }\n}\n\n\/\/ TESTCASE NUMBER: 17\nfun case_17(value_1: Int, value_2: Class, value_3: Class?) {\n when {<|endoftext|>"} {"prompt":"public Iterator iterator() {\n return null;\n }\n\n @NotNull\n @Override\n public Object[] toArray() {\n return new Object[0];\n }\n\n @NotNull\n @Override\n public T[] toArray(T[] a) {\n return null;\n }\n\n @Override\n public boolean add(String s) {","completion":"return false;\n }\n\n @Override\n public boolean remove(Object o) {\n return false;\n }\n\n @Override\n public boolean containsAll(Collection c) {\n return false;\n }\n\n @Override\n public boolean addAll(Collection c) {\n return false;\n }\n\n @Override<|endoftext|>"} {"prompt":"x.length \/\/ bad\n}\n\nfun testNoinline() {\n var x: String? = \"\"\n val lambda = noinline { x = null }\n x = \"\"\n lambda()\n x.length \/\/ bad\n}\n\nfun testCrossinline() {","completion":"var x: String? = \"\"\n val lambda = crossinline { x = null }\n x = \"\"\n lambda()\n x.length \/\/ bad\n}<|endoftext|>"} {"prompt":"override fun invoke(receiver1: D, receiver2: E): V = get(receiver1, receiver2)\n\n class Getter(override val property: KProperty2Impl) : KPropertyImpl.Getter(), KProperty2.Getter {","completion":"override fun invoke(receiver1: D, receiver2: E): V = property.get(receiver1, receiver2)\n }\n}\n\ninternal class KMutableProperty2Impl : KProperty2Impl, KMutableProperty2 {<|endoftext|>"} {"prompt":"var accumulator: S = iterator.next()\n yield(accumulator)\n var index = 1\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n yield(accumulator)\n }\n }\n }\n}\n\n\/**","completion":"* Returns a sequence containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting sequence.\n * The [initial] value should also be immutable (or should not be mutated)<|endoftext|>"} {"prompt":"mappingsBuilder.append(line)\n }\n\n fun generate() {\n val mappings = mappingsBuilder.build()\n\n FileWriter(outputFile).use { writer ->\n writer.writeHeader(outputFile, \"kotlin.text\")\n writer.appendLine()\n writer.appendLine(\"\/\/ ${mappings.size} mappings totally\")","completion":"mappingsWriter.write(mappings, writer)\n }\n }\n\n\n companion object {\n fun forUppercase(outputFile: File, target: KotlinTarget, bmpUnicodeDataLines: List): OneToManyMappingsGenerator {\n val builder = OneToManyUppercaseMappingsBuilder(bmpUnicodeDataLines)<|endoftext|>"} {"prompt":"substitutor: NewTypeSubstitutor,\n context: BasicCallResolutionContext,\n ): ReceiverExpressionKotlinCallArgument? {\n val newType = substitutor.safeSubstitute(type.unwrap())\n val receiverValue = when (this) {\n is ExpressionReceiver -> ExpressionReceiver.create(expression, newType, context.trace.bindingContext)","completion":"is ExtensionReceiver -> ExtensionReceiver(declarationDescriptor, newType, original)\n else -> return null\n }\n\n return ReceiverExpressionKotlinCallArgument(\n ReceiverValueWithSmartCastInfo(receiverValue, typesFromSmartCasts = emptySet(), true)\n )\n }\n}<|endoftext|>"} {"prompt":"const val increment = inc(3)\nconst val decrement = dec(3)\n\nconst val unaryPlus = unaryPlus(3)","completion":"const val unaryMinus = unaryMinus(3)\n\nconst val rangeTo1 = rangeTo(5, 1.toByte()).last\nconst val rangeTo2 = rangeTo(5, 2.toShort()).last<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.analysis.jvm.checkers.declaration\n\nimport org.jetbrains.kotlin.KtSourceElement\nimport org.jetbrains.kotlin.config.LanguageFeature\nimport org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget","completion":"import org.jetbrains.kotlin.descriptors.annotations.KotlinTarget\nimport org.jetbrains.kotlin.diagnostics.DiagnosticReporter\nimport org.jetbrains.kotlin.diagnostics.reportOn\nimport org.jetbrains.kotlin.fir.FirSession<|endoftext|>"} {"prompt":"hierarchy.applyHierarchyTemplate(KotlinHierarchyTemplate.default, extension)\n }\n\n @ExperimentalKotlinGradlePluginApi\n override fun applyHierarchyTemplate(template: KotlinHierarchyTemplate) {\n hierarchy.applyHierarchyTemplate(template)\n }\n\n @ExperimentalKotlinGradlePluginApi","completion":"override fun applyHierarchyTemplate(template: KotlinHierarchyTemplate, extension: KotlinHierarchyBuilder.Root.() -> Unit) {\n hierarchy.applyHierarchyTemplate(template, extension)\n }\n\n @ExperimentalKotlinGradlePluginApi\n override fun applyHierarchyTemplate(template: KotlinHierarchyBuilder.Root.() -> Unit) {<|endoftext|>"} {"prompt":".single { it.name == StandardNames.FqNames.mutableMap.shortName() }\n environment.javaClassToIrClass += nodeClass to mutableMap.declarations.filterIsInstance().single()\n }\n javaClass == LinkedHashMap::class.java -> {\n val entryClass = javaClass.declaredClasses.single { it.name.contains(\"\\$Entry\") }","completion":"val mutableMap = irClass.superTypes.mapNotNull { it.classOrNull?.owner }\n .single { it.name == StandardNames.FqNames.mutableMap.shortName() }\n environment.javaClassToIrClass += entryClass to mutableMap.declarations.filterIsInstance().single()\n }<|endoftext|>"} {"prompt":"fun <@TA @TPA(3) @TPA @TA(12)","completion":"@TPA(\"Test\") T> innerFun() = 12<|endoftext|>"} {"prompt":"class C(val i : Int) {\n operator fun component1() = i + 1\n operator fun component2() = i + 2\n operator fun rangeTo(c: C) = Range(this, c)\n}\n\nfun doTest(): String {\n var s = \"\"\n for ((a, _) in C(0)..C(2)) {\n s += \"$a;\"\n }","completion":"for ((_, b) in C(1)..C(3)) {\n s += \"$b;\"\n }\n\n for ((_, `_`) in C(2)..C(4)) {\n s += \"$`_`;\"\n }\n\n return s\n}\n\nfun box(): String {\n val s = doTest()<|endoftext|>"} {"prompt":"ProtoBuf.Effect.InvocationKind.AT_MOST_ONCE -> EventOccurrencesRange.AT_MOST_ONCE\n ProtoBuf.Effect.InvocationKind.EXACTLY_ONCE -> EventOccurrencesRange.EXACTLY_ONCE\n ProtoBuf.Effect.InvocationKind.AT_LEAST_ONCE -> EventOccurrencesRange.AT_LEAST_ONCE","completion":"}\n\n private fun extractType(proto: ProtoBuf.Expression): KotlinType? {\n return typeDeserializer.type(proto.isInstanceType(typeTable) ?: return null)\n }\n\n private fun deserializeConstant(value: ProtoBuf.Expression.ConstantValue): ConstantReference? = when (value) {<|endoftext|>"} {"prompt":"addExtensionReceiver(irBuiltIns.kClassClass.starProjectedType)\n returnType = javaLangClass.starProjectedType\n }\n }.symbol\n\n val kClassJavaPropertyGetter: IrSimpleFunction =\n kClassJava.owner.getter!!","completion":"val spreadBuilder: IrClassSymbol = createClass(FqName(\"kotlin.jvm.internal.SpreadBuilder\")) { klass ->\n klass.addConstructor().apply {\n addValueParameter(\"size\", irBuiltIns.intType)\n }\n\n klass.addFunction(\"addSpread\", irBuiltIns.unitType).apply {\n addValueParameter(\"container\", irBuiltIns.anyNType)<|endoftext|>"} {"prompt":"public val kotlin.Double.seconds: kotlin.time.Duration { get; }\n\n@kotlin.SinceKotlin(version = \"1.3\")\n@kotlin.time.ExperimentalTime","completion":"@kotlin.Deprecated(message = \"Use 'Int.seconds' extension property from Duration.Companion instead.\", replaceWith = kotlin.ReplaceWith(expression = \"this.seconds\", imports = {\"kotlin.time.Duration.Companion.seconds\"}))\n@kotlin.DeprecatedSinceKotlin(errorSince = \"1.8\", hiddenSince = \"1.9\", warningSince = \"1.5\")<|endoftext|>"} {"prompt":"assertFailsWith { empty.maxOf { 0.0F } } \n\n\n }\n \n \n private inline fun expectMinMaxOfWith(min: R, max: R, elements: UShortArray, comparator: Comparator, selector: (UShort) -> R) {","completion":"assertEquals(min, elements.minOfWith(comparator, selector))\n assertEquals(min, elements.minOfWithOrNull(comparator, selector))\n assertEquals(max, elements.maxOfWith(comparator, selector))\n assertEquals(max, elements.maxOfWithOrNull(comparator, selector))\n }\n \n @Test<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.name.StandardClassIds\nimport org.jetbrains.kotlin.types.TypeApproximatorConfiguration\n\nclass FirWhenExhaustivenessTransformer(private val bodyResolveComponents: BodyResolveComponents) : FirTransformer() {\n companion object {\n private val exhaustivenessCheckers = listOf(","completion":"WhenOnBooleanExhaustivenessChecker,\n WhenOnEnumExhaustivenessChecker,\n WhenOnSealedClassExhaustivenessChecker,\n WhenOnNothingExhaustivenessChecker\n )\n\n fun computeAllMissingCases(session: FirSession, whenExpression: FirWhenExpression): List {\n val subjectType =<|endoftext|>"} {"prompt":"return \"OF_FINALLY1\"\n }\n )\n\n return \"LOCAL\";\n}\n\n\nfun test2(h: Holder, doReturn: Int): String {\n doCall (\n {\n if (doReturn < 1) {\n h.value += \"OK_NONLOCAL\"\n return \"OK_NONLOCAL\"\n }\n h.value += \"LOCAL\"","completion":"\"OK_LOCAL\"\n },\n {\n try {\n h.value += \", OF_FINALLY1\"\n return \"OF_FINALLY1\"\n } finally {\n h.value += \", OF_FINALLY1_FINALLY\"\n }\n }\n )\n\n return \"FAIL\";\n}\n\nfun box(): String {\n var h = Holder()<|endoftext|>"} {"prompt":"firDefaultVisitorType to ::VisitorPrinter.bind(true),\n firVisitorVoidType to ::VisitorVoidPrinter,\n firDefaultVisitorVoidType to ::DefaultVisitorVoidPrinter,\n firTransformerType to ::TransformerPrinter.bind(model.rootElement),\n ),\n ImplementationConfigurator,\n BuilderConfigurator,","completion":"::ImplementationPrinter,\n ::BuilderPrinter,\n )\n}<|endoftext|>"} {"prompt":"return configurations.findResolvable(SWIFT_EXPORT_CLASSPATH_RESOLVABLE)\n ?: project.configurations.createResolvable(SWIFT_EXPORT_CLASSPATH_RESOLVABLE) {\n description = \"Resolves the runtime classpath for the SwiftExport worker.\"","completion":"attributes.setAttribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))\n attributes.setAttribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))\n attributes.setAttribute(Usage.USAGE_ATTRIBUTE, usageByName(Usage.JAVA_RUNTIME))<|endoftext|>"} {"prompt":"if (insn.opcode == Opcodes.GETFIELD) {\n insn.fieldLoad()?.let { return it }\n }\n return super.unaryOperation(insn, value)\n }\n\n override fun merge(v: BasicValue?, w: BasicValue?): BasicValue? =","completion":"if (v is PossibleLambdaLoad && w is PossibleLambdaLoad && v.insn == w.insn) v else super.merge(v, w)\n}<|endoftext|>"} {"prompt":"\/\/ WITH_REFLECT\n\/\/ TARGET_BACKEND: JVM\n\/\/ IGNORE_BACKEND: JVM\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses\npackage test\n\nimport kotlin.reflect.KClass\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class ICInt(val i: Int)","completion":"OPTIONAL_JVM_INLINE_ANNOTATION\nvalue class ICIntArray(val i: IntArray)\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class ICIntN(val i: Int?)\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class ICIntNArray(val i: Array)\n\nOPTIONAL_JVM_INLINE_ANNOTATION<|endoftext|>"} {"prompt":"assert(!name.contains('.'))\n assert(!name.contains('`'))\n return Classifier(pkg, name)\n }\n }\n\n val isTopLevel: Boolean get() = this.nestedNames.isEmpty()\n\n fun nested(name: String): Classifier {\n assert(!name.contains('.'))\n assert(!name.contains('`'))","completion":"return this.copy(nestedNames = nestedNames + name)\n }\n\n fun getRelativeFqName(asSimpleName: Boolean = true): String = buildString {\n append(topLevelName.run { if (asSimpleName) asSimpleName() else this })\n nestedNames.forEach {\n append('.')<|endoftext|>"} {"prompt":"return PsiTreeUtil.findCommonParent(callElement, receiver.psiExpression) as? KtExpression? ?: callElement\n }\n\n override fun getExpectedTypeFromAsExpressionAndRecordItInTrace(resolvedAtom: ResolvedCallAtom): UnwrappedType? {","completion":"val candidateDescriptor = resolvedAtom.candidateDescriptor as? FunctionDescriptor ?: return null\n val call = (resolvedAtom.atom as? PSIKotlinCall)?.psiCall ?: return null\n\n if (call.typeArgumentList != null || !candidateDescriptor.isFunctionForExpectTypeFromCastFeature()) return null<|endoftext|>"} {"prompt":"import kotlin.math.min\nimport org.jetbrains.kotlin.backend.common.FileLoweringPass\nimport org.jetbrains.kotlin.backend.common.extensions.IrPluginContext\nimport org.jetbrains.kotlin.backend.common.lower.DeclarationIrBuilder\nimport org.jetbrains.kotlin.backend.common.pop","completion":"import org.jetbrains.kotlin.backend.common.push\nimport org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin\nimport org.jetbrains.kotlin.backend.jvm.ir.isInlineClassType\nimport org.jetbrains.kotlin.builtins.StandardNames<|endoftext|>"} {"prompt":"if (s is IrDelegatingConstructorCall && s.symbol.owner.origin === PrimaryConstructorLowering.SYNTHETIC_PRIMARY_CONSTRUCTOR) {\n superCallIndex = i\n }\n }\n\n if (callIndex != -1 && superCallIndex != -1) {\n val tmp = statements[callIndex]","completion":"statements[callIndex] = statements[superCallIndex]\n statements[superCallIndex] = tmp\n }\n }\n}<|endoftext|>"} {"prompt":"if (!(element19 in 3L until 1L) != !range1.contains(element19)) throw AssertionError()\n if (!(element19 !in 3L until 1L) != range1.contains(element19)) throw AssertionError()\n}\n\nfun testR1xE20() {\n \/\/ with possible local optimizations","completion":"if (4.toByte() in 3L until 1L != range1.contains(4.toByte())) throw AssertionError()\n if (4.toByte() !in 3L until 1L != !range1.contains(4.toByte())) throw AssertionError()<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\nimport kotlin.test.*\n\ninterface I\nclass A() : I {}\nclass B() {}\n\n\/\/-----------------------------------------------------------------------------\/\/\n\nfun isTypeOf(a: Any?) : Boolean {\n return a is A\n}\n\n\/\/-----------------------------------------------------------------------------\/\/\n\nfun isTypeNullableOf(a: Any?) : Boolean {\n return a is A?\n}\n\n\/\/-----------------------------------------------------------------------------\/\/","completion":"fun isNotTypeOf(a: Any) : Boolean {\n return a !is A\n}\n\n\/\/-----------------------------------------------------------------------------\/\/\n\nfun isTypeOfInterface(a: Any) : Boolean {\n return a is I\n}\n\n\/\/-----------------------------------------------------------------------------\/\/\n\nfun box(): String {\n if (!isTypeOf(A())) return \"FAIL !isTypeOf(A())\"<|endoftext|>"} {"prompt":"val newOffset = offset\n offset += type.size\n LocalVariableNode(newVarName, type.descriptor, null, newStart, newEnd, newOffset)\n }\n } else {\n localVariableNode.desc = unboxedType.descriptor\n }\n }\n }\n return localVariablesReplacement\n }\n\n private fun getValuesStoredOrLoadedToVariable(","completion":"localVariableNode: LocalVariableNode,\n node: MethodNode,\n frames: Array?>\n ): List {\n val values = ArrayList()\n val insnList = node.instructions\n val localVariableStart = insnList.indexOf(localVariableNode.start)<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n@file:JsModule(\"foo\")\npackage foo\n\n@JsModule(\"A\")\nexternal class A {\n class Nested\n}\n\n@JsModule(\"B\")\nexternal object B","completion":"@JsModule(\"foo\")\nexternal fun foo(): Int\n\n@JsModule(\"bar\")\nexternal val bar: Int<|endoftext|>"} {"prompt":"val daemonCompileOptions = compilationConfiguration.asDaemonCompilationOptions\n val exitCode = daemon.compile(\n sessionId,\n arguments.toTypedArray() + sources.map { it.absolutePath }, \/\/ TODO: pass the sources explicitly KT-62759\n daemonCompileOptions,\n BasicCompilerServicesWithResultsFacadeServer(loggerAdapter),\n DaemonCompilationResults(","completion":"loggerAdapter.kotlinLogger,\n compilationConfiguration.aggregatedIcConfiguration?.options?.rootProjectDir\n )\n ).get()\n\n try {\n daemon.releaseCompileSession(sessionId)\n } catch (e: RemoteException) {\n loggerAdapter.kotlinLogger.warn(\"Unable to release compile session, maybe daemon is already down: $e\")<|endoftext|>"} {"prompt":"@nativeSetter\n fun Int.set3(a: Any, b: Int, c: Any?) {}\n\n @nativeSetter","completion":"fun Any.foo(a: Double = 0.0, v: String? = null) = \"OK\"\n}<|endoftext|>"} {"prompt":"origin = SirOrigin.Unknown\n kind = SirCallableKind.INSTANCE_METHOD\n initKind = SirInitializerKind.CONVENIENCE\n visibility = SirVisibility.PUBLIC\n isFailable = false\n parameters.addAll(\n listOf(\n SirParameter(\n argumentName = \"arg1\",\n type = SirNominalType(SirSwiftModule.uint8)","completion":"),\n SirParameter(\n argumentName = \"arg2\",\n type = SirNominalType(SirSwiftModule.uint16)\n ),\n SirParameter(\n argumentName = \"arg3\",\n type = SirNominalType(SirSwiftModule.uint32)\n ),\n SirParameter(\n argumentName = \"arg4\",<|endoftext|>"} {"prompt":"data class Mapped(val bridge: TypeBridge) : MethodBridgeValueParameter()\n object ErrorOutParameter : MethodBridgeValueParameter()\n data class SuspendCompletion(val useUnitCompletion: Boolean) : MethodBridgeValueParameter()\n}\n\n@InternalKotlinNativeApi\ndata class MethodBridge(\n val returnBridge: ReturnValue,\n val receiver: MethodBridgeReceiver,","completion":"val valueParameters: List,\n) {\n\n sealed class ReturnValue {\n object Void : ReturnValue()\n object HashCode : ReturnValue()\n data class Mapped(val bridge: TypeBridge) : ReturnValue()\n sealed class Instance : ReturnValue() {\n object InitResult : Instance()\n object FactoryResult : Instance()\n }<|endoftext|>"} {"prompt":"fun matchSingleExpectTopLevelDeclarationAgainstPotentialActuals(\n expectDeclaration: DeclarationSymbolMarker,\n actualDeclarations: List,\n context: ExpectActualMatchingContext,\n ): DeclarationSymbolMarker? = with(context) {\n matchSingleExpectAgainstPotentialActuals(","completion":"expectDeclaration,\n actualDeclarations,\n substitutor = null,\n expectClassSymbol = null,\n actualClassSymbol = null,\n mismatchedMembers = null,\n ).singleOrNull()\n }\n\n fun matchClassifiers(\n expectClassSymbol: RegularClassSymbolMarker,\n actualClassLikeSymbol: ClassLikeSymbolMarker,<|endoftext|>"} {"prompt":"expectedType = expectedType\n )\n}\n\nfun LambdaWithTypeVariableAsExpectedTypeAtom.transformToResolvedLambda(\n csBuilder: ConstraintSystemBuilder,\n diagnosticsHolder: KotlinDiagnosticsHolder,\n expectedType: UnwrappedType? = null,\n returnTypeVariable: TypeVariableForLambdaReturnType? = null","completion":"): ResolvedLambdaAtom {\n val fixedExpectedType = (csBuilder.buildCurrentSubstitutor() as NewTypeSubstitutor)\n .safeSubstitute(expectedType ?: this.expectedType)\n val resolvedLambdaAtom = preprocessLambdaArgument(\n csBuilder,\n atom,\n fixedExpectedType,\n diagnosticsHolder,<|endoftext|>"} {"prompt":"package kotlin.script.experimental.util\n\ninterface LinkedSnippet {\n val previous: LinkedSnippet?\n fun get(): T\n}\n\nfun LinkedSnippet?.toList(): List = toList { it }","completion":"fun LinkedSnippet?.toList(mapper: (T) -> R): List {\n val res = ArrayList()\n var el = this\n\n while (el != null) {\n res.add(mapper(el.get()))\n el = el.previous\n }\n\n res.reverse()\n return res\n}<|endoftext|>"} {"prompt":"fun poll5(): Flow {\n return flow {","completion":"val inv = try { ::bar<|endoftext|>"} {"prompt":"\/\/ This is a placeholder that is transformed to a proper receiver for script class down below, but it is needed for\n \/\/ collecting captured script instances (see ClosureAnnotator.ClosureCollectorVisitor.processScriptCapturing)\n val type = IrSimpleTypeImpl(irScript.symbol, false, emptyList(), emptyList())","completion":"irScript.thisReceiver = irScript.createThisReceiverParameter(context, IrDeclarationOrigin.INSTANCE_RECEIVER, type)\n }\n\n val irScriptClass = irScript.targetClass!!.owner\n val typeRemapper = SimpleTypeRemapper(symbolRemapper)\n val capturingClasses = collectCapturingClasses(irScript, typeRemapper)<|endoftext|>"} {"prompt":"override val originalPsiProviderImpl: KtOriginalPsiProvider = KtFe10OriginalPsiProvider(this)\n override val inheritorsProviderImpl: KtInheritorsProvider = KtFe10InheritorsProvider(this)\n override val typesCreatorImpl: KtTypeCreator = KtFe10TypeCreator(this)","completion":"override val samResolverImpl: KtSamResolver = KtFe10SamResolver(this)\n override val importOptimizerImpl: KtImportOptimizer = KtFe10ImportOptimizer(this)\n override val jvmTypeMapperImpl: KtJvmTypeMapper = KtFe10JvmTypeMapper(this)<|endoftext|>"} {"prompt":"\/**\n * Provides enumeration values to use to set regular expression options.\n *\/\npublic actual enum class RegexOption(override val value: Int, override val mask: Int = value) : FlagEnum {\n \/\/ common\n\n \/** Enables case-insensitive matching. Case comparison is Unicode-aware. *\/\n IGNORE_CASE(Pattern.CASE_INSENSITIVE),\n\n \/** Enables multiline mode.","completion":"*\n * In multiline mode the expressions `^` and `$` match just after or just before,\n * respectively, a line terminator or the end of the input sequence. *\/\n MULTILINE(Pattern.MULTILINE),\n\n \/\/jvm-specific\n\n \/** Enables literal parsing of the pattern.\n *<|endoftext|>"} {"prompt":"this.type = ProtoBuf.Annotation.Argument.Value.Type.BOOLEAN\n this.intValue = if (value) 1 else 0\n }\n is KmAnnotationArgument.UByteValue -> {\n this.type = ProtoBuf.Annotation.Argument.Value.Type.BYTE\n this.intValue = value.toLong()","completion":"this.flags = Flags.IS_UNSIGNED.toFlags(true)\n }\n is KmAnnotationArgument.UShortValue -> {\n this.type = ProtoBuf.Annotation.Argument.Value.Type.SHORT\n this.intValue = value.toLong()\n this.flags = Flags.IS_UNSIGNED.toFlags(true)\n }<|endoftext|>"} {"prompt":"&& irCallableReference.symbol is IrSimpleFunctionSymbol) { renderCompilerError(expression) }\n\n val targetSymbol = irCallableReference.symbol\n val target = targetSymbol.owner\n val signatureTypes = target.allParameters.map { it.type } + target.returnType\n\n function.typeParameters.indices.forEach { index ->","completion":"val typeArgument = expression.getTypeArgument(index)!!.toKotlinType()\n val signatureType = signatureTypes[index].toKotlinType()\n\n require(typeArgument.constructor == signatureType.constructor &&\n typeArgument.isMarkedNullable == signatureType.isMarkedNullable) { renderCompilerError(expression) }\n }<|endoftext|>"} {"prompt":"assertEquals(min, elements.minWith(comparator))\n assertEquals(max, elements.maxWith(comparator))\n }\n\n @Test\n fun minMaxWith() {\"\"\")\n for (size in 1..3) {\n val elements = defaultElements.take(size)","completion":"writer.appendLine(\" expectMinMaxWith(${elements.first()}, ${elements.last()}, ${containerOf(elements)}, naturalOrder())\")\n }\n if (isGeneric) {\n val elements = listOf(\"a\", \"B\").map { \"\\\"$it\\\"\" }<|endoftext|>"} {"prompt":"WarningMode.All -> arguments.add(\"--warning-mode=all\")\n WarningMode.Summary -> arguments.add(\"--warning-mode=summary\")\n WarningMode.None -> arguments.add(\"--warning-mode=none\")\n }\n\n if (configurationCache != null) {\n arguments.add(\"-Dorg.gradle.unsafe.configuration-cache=$configurationCache\")","completion":"arguments.add(\"-Dorg.gradle.unsafe.configuration-cache-problems=${configurationCacheProblems.name.lowercase(Locale.getDefault())}\")\n }\n\n if (gradleVersion >= GradleVersion.version(\"7.1\")) {\n arguments.add(\"-Dorg.gradle.unsafe.isolated-projects=$projectIsolation\")\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.resolve.fullyExpandedType\nimport org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.symbols.FirBasedSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol\nimport org.jetbrains.kotlin.fir.types.*\nimport org.jetbrains.kotlin.name.CallableId<|endoftext|>"} {"prompt":"if (y != null) this.y.propAny\n if (y != null) this.y.propNullableT","completion":"if (y != null) this.y.propNullableAny\n if (y != null) this.y.funT()<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ NULLABILITY_ANNOTATIONS: @io.reactivex.rxjava3.annotations:strict\n\n\/\/ FILE: A.java\n\nimport io.reactivex.rxjava3.annotations.*;\n\npublic class A {\n @Nullable public String field = null;\n\n @Nullable","completion":"public String foo(@NonNull String x, @Nullable CharSequence y) {\n return \"\";\n }\n\n @NonNull\n public String bar() {\n return \"\";\n }\n\n @Nullable\n public T baz(@NonNull T x) { return x; }\n}\n\n\/\/ FILE: main.kt<|endoftext|>"} {"prompt":"setCause(null) \/\/ TODO check this fact\n if (irClass.name.asString() != exception::class.java.simpleName) {\n \/\/ ir class wasn't found in classpath, a stub was passed => need to save java class hierarchy\n this.exceptionFqName = exception::class.java.name\n exceptionHierarchy += this.exceptionFqName","completion":"generateSequence(exception::class.java.superclass) { it.superclass }.forEach { exceptionHierarchy += it.name }\n exceptionHierarchy.removeAt(exceptionHierarchy.lastIndex) \/\/ remove unnecessary java.lang.Object\n }\n }\n\n fun copyFieldsFrom(wrapper: Wrapper) {\n (wrapper.value as? Throwable)?.let {<|endoftext|>"} {"prompt":"\/\/ as the type of this object may be any subtype of the parameter's type. All we know is that Function\n \/\/ has to have a `invoke` that takes `Object`s and returns an `Object`; everything else needs to be figured\n \/\/ out from its contents. TODO: for > 22 arguments, the only argument is an array. `MethodInliner` can't do that.","completion":"val invokeName = if (isPropertyReference) OperatorNameConventions.GET.asString() else OperatorNameConventions.INVOKE.asString()\n val invokeNode = getMethodNode(classBytes, classType) {\n it.name == invokeName && it.returnType == AsmTypes.OBJECT_TYPE && it.argumentTypes.all { arg -> arg == AsmTypes.OBJECT_TYPE }<|endoftext|>"} {"prompt":"}\n\n val usedOuterCs: Boolean get() = system.usesOuterCs\n\n private var systemInitialized: Boolean = false\n val system: NewConstraintSystemImpl by lazy(LazyThreadSafetyMode.NONE) {\n val system = constraintSystemFactory.createConstraintSystem()\n\n val baseCSFromInferenceSession =","completion":"runUnless(baseSystem.usesOuterCs) { inferenceSession.baseConstraintStorageForCandidate(this) }\n if (baseCSFromInferenceSession != null) {\n system.setBaseSystem(baseCSFromInferenceSession)\n system.addOtherSystem(baseSystem)\n } else {\n system.setBaseSystem(baseSystem)\n }\n\n systemInitialized = true\n system<|endoftext|>"} {"prompt":"requireCapability(\"org.jetbrains.kotlin:kotlin-gradle-plugin-api-${variant.sourceSetName}\")\n }\n }\n }\n }\n\n registerValidatePluginTasks(variantSourceSet)\n\n return variantSourceSet\n}\n\n\/**\n * All additional configuration attributes in plugin variant should be the same as in the 'main' variant.","completion":"* Otherwise, Gradle <7.0 will fail to select plugin variant.\n *\/\nprivate fun Project.commonVariantAttributes(): Action = Action {\n attributes {\n attribute(\n TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,\n objects.named(TargetJvmEnvironment.STANDARD_JVM)\n )\n }\n}<|endoftext|>"} {"prompt":"val two = Z(2)\n val four = Z(4)\n val seven = Z(7)\n\n assertEquals(seven, C::foo.call(one, 2, four))\n assertEquals(seven, (I)::bar.call(1, two, four))","completion":"val unboundFoo = C::class.members.single { it.name == \"foo\" } as KFunction<*>\n assertEquals(seven, unboundFoo.call(C, one, 2, four))\n\n val unboundBar = I.Companion::class.members.single { it.name == \"bar\" } as KFunction<*><|endoftext|>"} {"prompt":"\"debug\" -> NativeBuildType.DEBUG\n \"release\" -> NativeBuildType.RELEASE\n else -> null\n }\n\n return configuration.toNativeBuildType()\n ?: System.getenv(\"KOTLIN_FRAMEWORK_BUILD_TYPE\")?.toNativeBuildType()\n }\n\n\n val targets: List\n get() {","completion":"val sdk = System.getenv(\"SDK_NAME\") ?: return emptyList()\n val archs = System.getenv(\"ARCHS\")?.split(\" \") ?: return emptyList()\n return AppleSdk.defineNativeTargets(sdk, archs)\n }\n\n val frameworkSearchDir: File?\n get() {<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: WASM\n\/\/ USE_NEW_EXCEPTION_HANDLING_PROPOSAL\n\/\/ TODO: remove the test when KT-66906 will be resolved\n\/\/ WITH_STDLIB\n\/\/ WITH_COROUTINES\n\nimport helpers.*\nimport kotlin.coroutines.*\nimport kotlin.coroutines.intrinsics.*\n\nvar globalResult = \"\"","completion":"var wasCalled = false\nclass Controller {\n val postponedActions = ArrayList<() -> Unit>()\n\n suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->\n postponedActions.add {\n x.resume(v)\n }\n\n COROUTINE_SUSPENDED\n }<|endoftext|>"} {"prompt":"forEnumEntries = scopeForEnumEntries,\n primaryConstructorPureParametersScope = primaryConstructorPureParametersScope,\n primaryConstructorAllParametersScope = primaryConstructorAllParametersScope\n )\n\n return withTowerDataContexts(newContexts) {\n f()\n }\n }\n\n @OptIn(PrivateForInline::class)\n fun withScript(","completion":"owner: FirScript,\n holder: SessionHolder,\n f: () -> T\n ): T {\n val towerElementsForScript = holder.collectTowerDataElementsForScript(owner)\n\n val base = towerDataContext.addNonLocalTowerDataElements(emptyList())\n val statics = base\n .addNonLocalScopeIfNotNull(towerElementsForScript.staticScope)<|endoftext|>"} {"prompt":"@OptIn(ExperimentalLibraryAbiReader::class)\n override fun execute() {\n val library = libraryInCurrentDir(args.libraryNameOrPath)\n\n if (!checkLibraryHasIr(library)) return\n\n val abiSignatureVersion = args.signatureVersion?.let { signatureVersion ->\n if (!signatureVersion.checkSupportedInLibrary(library)) return","completion":"val abiSignatureVersion = AbiSignatureVersion.resolveByVersionNumber(signatureVersion.number)\n if (!abiSignatureVersion.isSupportedByAbiReader) {\n output.logError(\n \"Signature version ${signatureVersion.number} is not supported by the KLIB ABI reader.\" +<|endoftext|>"} {"prompt":"val originalText = KtTestUtil.doLoadFile(File(filePath))!!\n val (text, carets) = extractCarets(originalText)\n\n setupLanguageVersionSettingsForCompilerTests(originalText, environment)\n\n val ktFile = KtPsiFactory(project).createFile(text)","completion":"val bindingContext = JvmResolveUtil.analyze(ktFile, environment).bindingContext\n\n val resolvedCallsAt = carets.map { caret -> caret to run {\n val (element, cachedCall) = buildCachedCallAtIndex(bindingContext, ktFile, caret)\n\n val resolvedCall = when {\n cachedCall !is VariableAsFunctionResolvedCall -> cachedCall<|endoftext|>"} {"prompt":"val arr = ByteArray(10) { 0 }\n assertEquals(0, arr.getIntAt(0))\n assertEquals(0, arr.getIntAt(6))\n assertFailsWith {\n arr.getIntAt(7)\n }\n assertFailsWith {\n arr.getIntAt(arr.size)","completion":"}\n assertFailsWith {\n arr.getIntAt(-1)\n }\n assertFailsWith {\n arr.getIntAt(Int.MAX_VALUE)\n }\n assertFailsWith {\n arr.getIntAt(Int.MIN_VALUE)\n }\n }<|endoftext|>"} {"prompt":"\/\/ _Arrays.kt:... box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass, $this$map\\25:java.lang.Object[]=java.lang.Integer[], $i$f$map\\25\\459:int=0:int,","completion":"$this$mapTo\\26:java.lang.Object[]=java.lang.Integer[], destination\\26:java.util.Collection=java.util.ArrayList, $i$f$mapTo\\26\\451:int=0:int<|endoftext|>"} {"prompt":"android.productFlavors.create(\"german\").dimension = \"market\"\n android.productFlavors.create(\"usa\").dimension = \"market\"\n android.productFlavors.create(\"paid\").dimension = \"price\"\n android.productFlavors.create(\"free\").dimension = \"price\"\n\n project.evaluate()\n\n fun assertKotlinSourceSetNameEquals(","completion":"androidSourceSetName: String, kotlinSourceSetName: String\n ) {\n val androidSourceSet = android.sourceSets.getByName(androidSourceSetName)\n val kotlinSourceSet = project.getKotlinSourceSetOrFail(androidSourceSet)\n assertEquals(\n kotlinSourceSetName, kotlinSourceSet.name,<|endoftext|>"} {"prompt":"\"\"\"\n @Composable\n fun Test() {\n A(a)\n A(b)\n }\n \"\"\"\n )\n\n @Test\n fun testPrivateFunctionDoNotGetMarkedAsCall(): Unit = controlFlow(\n \"\"\"\n @Composable\n private fun Test() {\n A(a)\n A(b)\n }\n \"\"\"\n )","completion":"@Test\n fun testCallingAWrapperComposable(): Unit = controlFlow(\n \"\"\"\n @Composable\n fun Test() {\n W {\n A()\n }\n }\n \"\"\"\n )\n\n @Test\n fun testCallingAnInlineWrapperComposable(): Unit = controlFlow(\n \"\"\"\n @Composable\n fun Test() {\n IW {<|endoftext|>"} {"prompt":"formatColumn(fullSet.getValue(name).second?.description ?: placeholder) +\n formatColumn(change.first.description + \" %\") +\n formatColumn(change.second.description))\n }\n } else {\n \/\/ Output all values without performance changes.\n for ((name, value) in fullSet) {\n append(formatColumn(name, true) +","completion":"formatColumn(value.first?.description ?: placeholder) +\n formatColumn(value.second?.description ?: placeholder) +\n formatColumn(placeholder) +\n formatColumn(placeholder))\n }\n }\n }\n\n private fun printTableLineSeparator(tableWidth: Int) =\n append(\"${\"-\".padEnd(tableWidth, '-')}\")<|endoftext|>"} {"prompt":"override fun getProgram(vararg statements: String): String {\n val sep = System.getProperty(\"line.separator\")\n return statements.joinToString(sep) + sep\n }\n\n override fun getParameter(key: String?): Any? =\n when (key) {\n ScriptEngine.NAME -> engineName\n ScriptEngine.LANGUAGE -> languageName","completion":"ScriptEngine.LANGUAGE_VERSION -> languageVersion\n ScriptEngine.ENGINE -> engineName\n ScriptEngine.ENGINE_VERSION -> engineVersion\n else -> null\n }\n}<|endoftext|>"} {"prompt":"fmodules = false, \/\/ with `-fmodules`, ld cannot find symbol `_assert`\n ).assertSuccess()\n val libFile = buildDir.resolve(\"$it.a\")\n runProcess(llvmAr, \"-rc\", libFile.absolutePath, obj.absolutePath) {\n timeout = Duration.parse(\"1m\")\n }\n assertTrue(libFile.exists())\n }","completion":"val defFile = buildDir.resolve(\"embedStaticLibraries.def\").also {\n it.printWriter().use {\n it.println(\n \"\"\"\n libraryPaths = ${buildDir.absolutePath.replace(\"\\\\\", \"\/\")}\n staticLibraries = 3.a 4.a\n \"\"\".trimIndent()\n )\n }\n }<|endoftext|>"} {"prompt":"assertEquals(\"java.util.Date\", java.util.Date::class.qualifiedName)\n assertEquals(\"kotlin.jvm.internal.Ref.ObjectRef\", kotlin.jvm.internal.Ref.ObjectRef::class.qualifiedName)\n\n class Local\n assertEquals(null, Local::class.qualifiedName)\n\n val o = object {}","completion":"assertEquals(null, o.javaClass.kotlin.qualifiedName)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"compilationSpawner.spawn(emptyList()) {\n fun copy(key: CompilerConfigurationKey) = putIfNotNull(key, configuration.get(key))\n fun copyNotNull(key: CompilerConfigurationKey) = put(key, configuration.getNotNull(key))\n \/\/ For the first stage, use \"-p library\" produce mode.","completion":"put(KonanConfigKeys.PRODUCE, CompilerOutputKind.LIBRARY)\n copy(KonanConfigKeys.TARGET)\n put(KonanConfigKeys.OUTPUT, intermediateKLib.absolutePath)\n copyNotNull(CLIConfigurationKeys.CONTENT_ROOTS)\n copyNotNull(KonanConfigKeys.LIBRARY_FILES)<|endoftext|>"} {"prompt":"keptMethods.sortWith(compareBy(MethodNode::name, MethodNode::desc))\n }\n\n for (field in keptFields) {\n field.accept(cv)\n }\n\n for (method in keptMethods) {\n val mv = with(method) { cv.visitMethod(access, name, desc, signature, exceptions?.toTypedArray()) }","completion":"\/\/ Mapping the line numbers should only be done *after* sorting methods, as otherwise the order\n \/\/ of inline methods may be visible in their synthetic line numbers.\n method.accept(sourceMap?.let { SourceMapCopyingMethodVisitor(it, mv) } ?: mv)\n }\n\n val sourceMapText = sourceMap?.parent?.takeIf { !it.isTrivial }<|endoftext|>"} {"prompt":"val ktClass = resultingDescriptor.constructedClass.source.getPsi() as? KtClass\n if (ktClass?.isAnnotation() == true) return ktClass.fqName?.toString()\n }\n if (resultingDescriptor is JavaClassConstructorDescriptor) {","completion":"val psiClass = resultingDescriptor.constructedClass.source.getPsi() as? PsiClass\n if (psiClass?.isAnnotationType == true) return psiClass.qualifiedName\n }\n return null\n}<|endoftext|>"} {"prompt":"}\n}\n\nfun box(): String {\n var result: Any = \"FAIL1\"\n builder {\n result = Test1().test()\n }\n c?.resume(IC(\"OK\"))\n if (result != \"OK\") return \"FAIL 1 $result\"\n\n result = \"FAIL2\"\n builder {\n result = Test2().test()\n }","completion":"c?.resume(\"OK\")\n if (result != \"OK\") return \"FAIL 2 $result\"\n\n result = \"FAIL 3\"\n builder {\n result = Test3().test()\n }\n c?.resume(IC(\"OK\"))\n return result as String\n}<|endoftext|>"} {"prompt":"if (isEqualAnyNullableRight(\"\", null)) return \"Fail 29\"\n if (isEqualAnyNullableRight(null, A(\"\"))) return \"Fail 30\"\n if (isEqualAnyNullableRight(A(\"\"), A(\"a\"))) return \"Fail 31\"\n if (isEqualNullableUnboxedLeft(A(\"\"), A(\"a\"))) return \"Fail 32\"","completion":"if (!isEqualNullableUnboxedLeft(A(\"\"), A(\"\"))) return \"Fail 33\"\n if (isEqualNullableUnboxedRight(A(\"\"), A(\"a\"))) return \"Fail 34\"\n if (!isEqualNullableUnboxedRight(A(\"a\"), A(\"a\"))) return \"Fail 35\"<|endoftext|>"} {"prompt":"public fun insert(index: Int, value: Double): StringBuilder\n\n \/**\n * Inserts the specified character [value] into this string builder at the specified [index] and returns this instance.\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n *\/\n @SinceKotlin(\"1.4\")","completion":"public fun insert(index: Int, value: Char): StringBuilder\n\n \/**\n * Inserts characters in the specified character array [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in same order as in the [value] character array, starting at [index].\n *<|endoftext|>"} {"prompt":" & InterfaceWithTwoTypeParameters<*, *> & ClassWithThreeTypeParameters<*, *, *>\")!>x.x\n }\n}\n\n\/\/ TESTCASE NUMBER: 4\nfun case_4(x: ClassWithSixTypeParameters<*, *, *, *, *, *>?) {","completion":"if (x is InterfaceWithTwoTypeParameters<*, *>) {\n ? & InterfaceWithTwoTypeParameters<*, *> & ClassWithSixTypeParameters<*, *, *, *, *, *>\")!>x<|endoftext|>"} {"prompt":"\/\/ so we don't use it for the same reasons as why we don't use it in JDK7. ThreadLocalRandom worked on\n \/\/ SDK 24, but starting SDK 25 it had bugs in seeding so that it would return the same sequence of values\n \/\/ for all application starts. That will be fixed in SDK 34. Therefore, do not use ThreadLocalRandom until\n \/\/ then.","completion":"if (sdkIsNullOrAtLeast(34)) PlatformThreadLocalRandom() else super.defaultPlatformRandom()\n\n}<|endoftext|>"} {"prompt":"--help, -h -> Usage info \n\"\"\".trimIndent()\n assertEquals(expectedOutput, helpOutput)\n }\n\n @Test\n fun testHelpMessageWithSubcommands() {\n abstract class CommonOptions(name: String, actionDescription: String): Subcommand(name, actionDescription) {","completion":"val numbers by argument(ArgType.Int, \"numbers\", description = \"Numbers\").vararg()\n }\n class Summary: CommonOptions(\"summary\", \"Calculate summary\") {\n val invert by option(ArgType.Boolean, \"invert\", \"i\", \"Invert results\")\n var result: Int = 0\n\n override fun execute() {\n result = numbers.sum()<|endoftext|>"} {"prompt":"result.add(FirTypeRefSource(returnTypeRef, returnTypeRef.source))\n }\n else -> return null\n }\n\n return result\n}\n\ndata class FirTypeRefSource(val typeRef: FirTypeRef?, val source: KtSourceElement?) {\n override fun toString(): String {","completion":"return \"FirTypeRefSource(typeRef=${typeRef?.render()}, source=${source?.kind?.javaClass?.simpleName})\"\n }\n}\n\nval FirClassLikeSymbol<*>.classKind: ClassKind?\n get() = (this as? FirClassSymbol<*>)?.classKind<|endoftext|>"} {"prompt":"override val project: Project,\n private val binaryRoots: Collection,\n) : KtModuleWithModifiableDependencies(), KtSdkModule {\n override val analyzerServices: PlatformDependentAnalyzerServices\n get() = platform.getAnalyzerServices()\n\n override fun getBinaryRoots(): Collection = binaryRoots","completion":"override val directRegularDependencies: MutableList = mutableListOf()\n override val directDependsOnDependencies: MutableList = mutableListOf()\n override val directFriendDependencies: MutableList = mutableListOf()\n}<|endoftext|>"} {"prompt":"internal var actualResources: SourceDirectorySet = createDefaultSourceDirectorySet(project, \"$name resources\")\n\n override val resources: SourceDirectorySet get() = actualResources\n\n override fun kotlin(configure: SourceDirectorySet.() -> Unit): SourceDirectorySet = kotlin.apply {\n configure(this)\n }","completion":"override fun kotlin(configure: Action): SourceDirectorySet =\n kotlin { configure.execute(this) }\n\n override fun languageSettings(configure: Action): LanguageSettingsBuilder = languageSettings {\n configure.execute(this)\n }\n\n override fun languageSettings(configure: LanguageSettingsBuilder.() -> Unit): LanguageSettingsBuilder =<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.abicmp\n\nimport org.jetbrains.org.objectweb.asm.Opcodes\n\nclass AndFlag(private val flag: Int, private val name: String) : (Int) -> String? {\n override fun invoke(p1: Int): String? {\n return if (p1 and flag != 0) name else null\n }\n}","completion":"class AndNotFlag(private val flag: Int, private val name: String) : (Int) -> String? {\n override fun invoke(p1: Int): String? {\n return if (p1 and flag == 0) name else null\n }\n}\n\nfun Int.isPrivate() =\n this and Opcodes.ACC_PRIVATE != 0\n\nfun Int.isSynthetic() =<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1283\n\/\/ CHECK_VARS_COUNT: function=test count=1 TARGET_BACKENDS=JS\n\nclass A {\n var i = 23\n}\n\nfun test(a: A): String {\n var x = ++a.i\n if (x != 24) return \"fail1: $x\"\n\n a.i++","completion":"if (a.i != 25) return \"fail2: $a.i\"\n\n \/\/ a.i++, used as expression, requires temporary variable\n\n return \"OK\"\n}\n\nfun box(): String = test(A())<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.types.FirTypeRef\nimport org.jetbrains.kotlin.name.Name","completion":"class Column(val name: Name, val type: FirTypeRef)\n\nsealed interface CallShapeData {\n class Schema(val columns: List) : CallShapeData\n\n class Scope(val token: FirClassSymbol, val columns: List) : CallShapeData\n\n class RefinedType(val scopes: List) : CallShapeData\n}<|endoftext|>"} {"prompt":"context.trace, context.missingSupertypesResolver\n )\n\n val eagerChecksAllowed = context.languageVersionSettings.getFlag(AnalysisFlags.extendedCompilerChecks)\n val unresolvedLazySupertypesByDefault = descriptor is ConstructorDescriptor || descriptor is FakeCallableDescriptorForObject","completion":"if (eagerChecksAllowed || !unresolvedLazySupertypesByDefault && !errorReported) {\n \/\/ The constructed class' own supertypes are not resolved after constructor call,\n \/\/ so its containing declaration should not be checked.\n \/\/ Dispatch receiver is checked before for case of inner class constructor call.<|endoftext|>"} {"prompt":"object ActualFunctionWithDefaultParameters :\n WeakIncompatible(\"actual function cannot have default argument values, they should be declared in the expected function\")\n\n \/\/ Properties\n\n object PropertyKind : WeakIncompatible(\"property kinds are different (val vs var)\")\n object PropertyLateinitModifier : WeakIncompatible(\"modifiers are different (lateinit)\")","completion":"object PropertyConstModifier : WeakIncompatible(\"modifiers are different (const)\")\n object PropertySetterVisibility : WeakIncompatible(\"setter visibility is different\")\n\n \/\/ Classifiers\n\n object ClassKind : WeakIncompatible(\"class kinds are different (class, interface, object, enum, annotation)\")<|endoftext|>"} {"prompt":"val block = irBlock {\n flattenExpressionTo(expression, instance)\n }\n val expressions = removeExtraSetVariablesFromExpressionList(block, variables)\n if (block.statements.isNotEmpty()) {\n +block.unwrapBlock()\n }\n return expressions\n }\n\n \/**\n * Takes not transformed expression and initialized given MfvcNodeInstance with transformed version of it","completion":"*\/\n private fun IrBlockBuilder.flattenExpressionTo(expression: IrExpression, instance: MfvcNodeInstance) {\n val rootNode = replacements.getRootMfvcNodeOrNull(\n if (expression is IrConstructorCall) expression.symbol.owner.constructedClass else expression.type.erasedUpperBound\n )<|endoftext|>"} {"prompt":"@kotlin.jvm.JvmName(name = \"sumOfShort\")\npublic fun kotlin.collections.Iterable.sum(): kotlin.Int\n\n@kotlin.jvm.JvmName(name = \"sumOfUByte\")\n@kotlin.SinceKotlin(version = \"1.5\")","completion":"@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})\npublic fun kotlin.collections.Iterable.sum(): kotlin.UInt\n\n@kotlin.jvm.JvmName(name = \"sumOfUInt\")\n@kotlin.SinceKotlin(version = \"1.5\")<|endoftext|>"} {"prompt":"* Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n *\/\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType","completion":"@kotlin.internal.InlineOnly\npublic inline fun IntArray.minOfWith(comparator: Comparator, selector: (Int) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])<|endoftext|>"} {"prompt":"\/\/ Generated function type names aren't included in the top-level classifier names set.\n emptySet()\n\n override fun getTopLevelCallableNamesInPackage(packageFqName: FqName): Set = emptySet()\n\n override fun mayHaveTopLevelClassifier(classId: ClassId): Boolean = mayHaveSyntheticFunctionType(classId)","completion":"override fun mayHaveTopLevelCallable(packageFqName: FqName, name: Name): Boolean = false\n }\n\n override fun getClassLikeSymbolByClassId(classId: ClassId): FirRegularClassSymbol? {\n val functionTypeKind = classId.getAcceptableFunctionTypeKind() ?: return null\n return cache.getValue(classId, functionTypeKind)\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.resolve.transformers.contracts\n\nimport org.jetbrains.kotlin.fir.FirSession\nimport org.jetbrains.kotlin.fir.resolve.ScopeSession\nimport org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.*\n\nclass FirContractResolveTransformer(","completion":"session: FirSession,\n scopeSession: ScopeSession,\n outerBodyResolveContext: BodyResolveContext? = null,\n) : FirAbstractContractResolveTransformerDispatcher(\n session,\n scopeSession,\n outerBodyResolveContext,\n) {\n override val contractDeclarationsTransformer: FirDeclarationsContractResolveTransformer\n get() = FirDeclarationsContractResolveTransformer()\n}<|endoftext|>"} {"prompt":"}\n\n open fun visitStringConcatenationCall(stringConcatenationCall: FirStringConcatenationCall) {\n visitElement(stringConcatenationCall)\n }\n\n final override fun visitThrowExpression(throwExpression: FirThrowExpression, data: Nothing?) {\n visitThrowExpression(throwExpression)\n }","completion":"open fun visitThrowExpression(throwExpression: FirThrowExpression) {\n visitElement(throwExpression)\n }\n\n final override fun visitVariableAssignment(variableAssignment: FirVariableAssignment, data: Nothing?) {\n visitVariableAssignment(variableAssignment)\n }\n\n open fun visitVariableAssignment(variableAssignment: FirVariableAssignment) {<|endoftext|>"} {"prompt":"this.foo() + super.foo()) :","completion":"super(x + foo() + this.foo() +<|endoftext|>"} {"prompt":"class TryWithFinallyInfo(val onExit: IrExpression) : TryInfo()\n\nclass BlockInfo(val parent: BlockInfo? = null) {\n val variables = mutableListOf()\n val infos: Stack = parent?.infos ?: Stack()\n var activeLocalGaps = 0","completion":"fun hasFinallyBlocks(): Boolean = infos.firstIsInstanceOrNull() != null\n\n internal inline fun forEachBlockUntil(tryWithFinallyInfo: TryWithFinallyInfo, onBlock: BlockInfo.() -> Unit) {\n var current: BlockInfo? = this\n while (current != null && current != tryWithFinallyInfo.blockInfo) {\n current.onBlock()<|endoftext|>"} {"prompt":"): GradleCompileStatisticsData? {\n val result = event.result\n val taskPath = event.descriptor.taskPath\n return prepareData(getTaskResult(event), taskPath, result.startTime, result.endTime - result.startTime, projectName, uuid,\n label, kotlinVersion, buildOperationRecord, onlyKotlinTask, additionalTags, metricsToShow)\n}","completion":"internal fun prepareData(\n taskResult: TaskExecutionState?,\n taskPath: String,\n startTime: Long,\n finishTime: Long,\n projectName: String,\n uuid: String,\n label: String?,\n kotlinVersion: String,\n buildOperationRecord: BuildOperationRecord,\n onlyKotlinTask: Boolean = true,<|endoftext|>"} {"prompt":"* @param bufferSize the buffer size to use when copying.\n * @return the [target] file.\n * @throws NoSuchFileException if the source file doesn't exist.\n * @throws FileAlreadyExistsException if the destination file already exists and [overwrite] argument is set to `false`.\n * @throws IOException if any errors occur while copying.\n *\/","completion":"public fun File.copyTo(target: File, overwrite: Boolean = false, bufferSize: Int = DEFAULT_BUFFER_SIZE): File {\n if (!this.exists()) {\n throw NoSuchFileException(file = this, reason = \"The source file doesn't exist.\")\n }\n\n if (target.exists()) {\n if (!overwrite)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_NATIVE_IGNORE_DISABLED_TARGETS\nimport org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_INTERNAL_DIAGNOSTICS_USE_PARSABLE_FORMATTING","completion":"import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_INTERNAL_DIAGNOSTICS_SHOW_STACKTRACE\nimport org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.PropertyNames.KOTLIN_COMPILER_ARGUMENTS_LOG_LEVEL<|endoftext|>"} {"prompt":"while (char and 0xff00ffff.toInt() == Lexer.CHAR_FLAGS) {\n lexemes.next()\n flags = (char shr 16) and flagsBitMask\n char = lexemes.currentChar\n }\n \/\/ The terminal is some kind of group: (E). Call processExpression for it.","completion":"if (char and 0x8000ffff.toInt() == Lexer.CHAR_LEFT_PARENTHESIS) {\n var newFlags = flags\n if (char and 0xff00ffff.toInt() == Lexer.CHAR_NONCAP_GROUP) {\n newFlags = (char shr 16) and flagsBitMask\n }<|endoftext|>"} {"prompt":"\/\/ Note 1: can be combined with org.jetbrains.kotlin.resolve.constants.ConstantValue but where is some questions to `AnnotationValue`.\n\/\/ Note 2: if we are not going to implement previous idea, then this class can be moved to `fir` module.\n\/\/ The problem here is that `ConstantValue` somehow must be accessible to `EvaluatedConstTracker`","completion":"\/\/ which in turn must be accessible to `CommonConfigurationKeys`.\nsealed class ConstantValue(open val value: T) {\n abstract fun accept(visitor: AnnotationArgumentVisitor, data: D): R\n\n override fun equals(other: Any?): Boolean = this === other || value == (other as? ConstantValue<*>)?.value<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.js.translate.utils.*\nimport org.jetbrains.kotlin.js.translate.utils.JsAstUtils.prototypeOf\nimport org.jetbrains.kotlin.js.translate.utils.JsAstUtils.pureFqn\nimport org.jetbrains.kotlin.resolve.DescriptorUtils","completion":"import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny\nimport org.jetbrains.kotlin.resolve.descriptorUtil.getSuperInterfaces\nimport org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal\nimport org.jetbrains.kotlin.resolve.descriptorUtil.isExtension<|endoftext|>"} {"prompt":"inline fun case_3(block: () -> Unit) {\n throw Exception()\n contract {\n callsInPlace(block, InvocationKind.UNKNOWN)\n }\n return block()\n}\n\n\/*\n * TESTCASE NUMBER: 4\n * ISSUES: KT-26191\n *\/","completion":"inline fun case_4(block: () -> Unit) {\n .0009\n return contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n}\n\n\/*\n * TESTCASE NUMBER: 5\n * ISSUES: KT-26191\n *\/<|endoftext|>"} {"prompt":"override val isPubliclyVisible: Boolean get() = original.isPubliclyVisible\n\n override val hasTopLevel: Boolean get() = true\n\n override val visibleCrossFile: Boolean\n get() = original.visibleCrossFile\n\n override fun topLevelSignature(): IdSignature = this\n\n override fun nearestPublicSig(): IdSignature = this","completion":"override fun packageFqName(): FqName = original.packageFqName()\n\n override fun equals(other: Any?): Boolean {\n return other is LoweredDeclarationSignature && original == other.original && stage == other.stage && index == other.index\n }\n\n private val hashCode = (index * 31 + stage) * 31 + original.hashCode()<|endoftext|>"} {"prompt":"while (true) {\n x.length\n break\n }\n y += \"\"\n }\n}\n\nfun test39() {\n val x: Any? = materialize()\n var y = x\n runWithoutContract {\n require(y is String)\n while (true) {\n x.length\n break\n }","completion":"y += \"\"\n }\n}\n\nfun test40() {\n val x: Any? = materialize()\n var y = x\n exactlyOnce {\n require(y is Int)\n while (true) {\n x.inc()\n break\n }\n y++\n }\n}\n\nfun test41() {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles\nimport org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment\nimport org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler\nimport org.jetbrains.kotlin.config.CompilerConfiguration","completion":"import org.jetbrains.kotlin.config.JVMConfigurationKeys\nimport org.jetbrains.kotlin.config.JvmTarget\nimport org.jetbrains.kotlin.integration.KotlinIntegrationTestBase\nimport org.jetbrains.kotlin.script.loadScriptingPlugin<|endoftext|>"} {"prompt":"val superInterfaces = this.getSuperInterfaces()\n val superInterfacesImplementedInterfaces = superInterfaces.flatMap { it.implementedInterfaces }\n return (superClassImplementedInterfaces +\n superInterfacesImplementedInterfaces +\n superInterfaces).distinct()\n }\n\ninternal val IrFunction.isTypedIntrinsic: Boolean","completion":"get() = annotations.hasAnnotation(KonanFqNames.typedIntrinsic)\n\ninternal val IrConstructor.isConstantConstructorIntrinsic: Boolean\n get() = annotations.hasAnnotation(KonanFqNames.constantConstructorIntrinsic)\n\ninternal val IrClass.isArray: Boolean<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor(arg: Invariant)\n }\n fun TestTypeParameterWithIdenticalUpperBoundsC(arg: Invariant) {}","completion":"class TestTypeParameterWithIdenticalUpperBoundsCReverse {\n constructor(arg: Invariant)\n }<|endoftext|>"} {"prompt":"\/\/ ISSUE: KT-36057\n\nfun String.foo() {}\n\nfun test_1(a: Any?) {\n when (a) {\n is String, is Any -> a.foo() \/\/ Should be Bad\n }\n}\n\nfun test_2(a: Any?) {","completion":"if (a is String || a is Any) {\n a.foo() \/\/ Should be Bad\n }\n}\n\nfun test_3(a: Any?, b: Boolean) {\n when (a) {<|endoftext|>"} {"prompt":"val notNullableArgumentType = argumentType.makeNotNullable()\n val isApplicable = argumentTypeResolver.isSubtypeOfForArgumentType(notNullableArgumentType, parameterType)\n return if (isApplicable) NULLABLE_ARGUMENT_TYPE_MISMATCH else null\n }\n\n private fun CallCandidateResolutionContext<*>.checkReceiverTypeError(): Unit = check {","completion":"val extensionReceiver = candidateDescriptor.extensionReceiverParameter\n val dispatchReceiver = candidateDescriptor.dispatchReceiverParameter\n\n \/\/ For the expressions like '42.(f)()' where f: String.() -> Unit we'd like to generate a type mismatch error on '1',\n \/\/ not to throw away the candidate, so the following check is skipped.<|endoftext|>"} {"prompt":"0x2119, 0x211e, 0x2123,","completion":"0x212a, 0x212e, 0x2130, 0x2134, 0x2135, 0x2139, 0x213d, 0x2140, 0x2145, 0x2146, 0x214a, 0x214d, 0x2150, 0x2160, 0x2183, 0x2185, 0x2189, 0x218c, 0x2190,<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.test\n\nimport com.intellij.openapi.application.PathManager.PROPERTY_CONFIG_PATH\nimport com.intellij.openapi.application.PathManager.PROPERTY_SYSTEM_PATH\nimport com.intellij.openapi.util.io.FileUtil\nimport java.io.File","completion":"\/\/ It's important that this is not created per test, but rather per process.\nobject IdeaSystemPropertiesForParallelRunConfigurator {\n private val GRADLE_WORKER = System.getProperty(\"org.gradle.test.worker\") ?: \"\"\n \/\/TODO: try to remove folder on jvm shutdown (there are some flashing test with deleteOnExit = true)<|endoftext|>"} {"prompt":"if (superQName == qualifiedName || superQName == mappedQName) return true\n\n if (deep) {\n if (checkSuperTypeByFQName(superDescriptor, qualifiedName, true)) {\n return true\n }\n }\n }\n }\n\n return false\n }\n\n private val ktTokenToPsiModifier = listOf(","completion":"KtTokens.PUBLIC_KEYWORD to PsiModifier.PUBLIC,\n KtTokens.INTERNAL_KEYWORD to PsiModifier.PUBLIC,\n KtTokens.PROTECTED_KEYWORD to PsiModifier.PROTECTED,\n )\n }\n}<|endoftext|>"} {"prompt":"@nativeSetter\n val foo = 0\n\n @nativeSetter\n object Obj2 {}\n }\n}\n\nclass C {","completion":"@nativeSetter\n fun Int.set(a: String, v: Int) {}\n\n @nativeSetter<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\ninline fun foo(x: T) {\n println(x)\n}\n\nexternal interface I\n\nexternal class C : I\n\noperator inline fun C.plus(other: T) = this\n\nfun bar() {\n foo(C())\n\n val c: I = C()","completion":"foo(c)\n foo<I>(C())\n\n C() + c\n}<|endoftext|>"} {"prompt":"private object B392 { val a = B391.a + Random.nextInt(100) }\nprivate object B393 { val a = B392.a + Random.nextInt(100) }\nprivate object B394 { val a = B393.a + Random.nextInt(100) }\nprivate object B395 { val a = B394.a + Random.nextInt(100) }","completion":"private object B396 { val a = B395.a + Random.nextInt(100) }\nprivate object B397 { val a = B396.a + Random.nextInt(100) }\nprivate object B398 { val a = B397.a + Random.nextInt(100) }\nprivate object B399 { val a = B398.a + Random.nextInt(100) }<|endoftext|>"} {"prompt":"* Exposes the JavaScript [Uint8Array](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/Uint8Array) to Kotlin\n *\/\npublic external open class Uint8Array : ArrayBufferView, JsAny {\n constructor(length: Int)\n constructor(array: Uint8Array)\n constructor(array: JsArray)","completion":"constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Uint8Array, offset: Int = definedExternally)<|endoftext|>"} {"prompt":"@NullUnmarked\n public static TargetType INSTANCE() { return new TargetType(); }\n\n }\n\n}\n\n\/\/ FILE: kotlin.kt\n\nfun accept(arg: T) {}\n\nfun test() {\n \/\/ jspecify_nullness_mismatch","completion":"accept(NullMarkedType.TargetType.INSTANCE().produce())\n}<|endoftext|>"} {"prompt":"val x14 = c.addAll14(listOf(\"\"))\n val x15 = c.addAll15(listOf(\"\"))\n val x16 = c.addAll16(listOf(\"\"), listOf(\"\"))\n val x17 = c.addAll17(listOf(\"\"), listOf(\"\"))\n val x18 = c.addAll18(listOf(\"\"), listOf(\"\"))","completion":"val x19 = c.addAll19(listOf(\"\"), listOf(\"\"))\n val x20 = c.addAll20(listOf(\"\"), listOf(\"\"))\n val x21 = c.addAll21(listOf(\"\"), listOf(\"\"))\n val x22 = c.addAll22(listOf(\"\"), listOf(\"\"))\n val x23 = c.addAll23(listOf(\"\"), listOf(\"\"))<|endoftext|>"} {"prompt":"val name = diagnostic.unresolvedName ?: return\n unresolvedNames += name\n }\n\n private fun processFunctionCall(functionCall: FirFunctionCall) {\n if (functionCall.dispatchedWithoutImport) return\n processErrorNameReference(functionCall)\n\n val referencesByName = functionCall.functionReferenceName ?: return\n saveCallable(functionCall, referencesByName)\n }","completion":"private fun processImplicitFunctionCall(implicitInvokeCall: FirImplicitInvokeCall) {\n processErrorNameReference(implicitInvokeCall)\n\n saveCallable(implicitInvokeCall, OperatorNameConventions.INVOKE)\n }\n\n private fun processPropertyAccessExpression(propertyAccessExpression: FirPropertyAccessExpression) {<|endoftext|>"} {"prompt":"suspend fun main(vararg args: String) {}\nsuspend fun main(vararg args: String) {}\n\n\/\/ FILE: invalid_array_typealias_suspend.kt\npackage invalid8\ntypealias S = String","completion":"suspend fun main(args: Array) {}\nsuspend fun main(args: Array) {}\n\n\/\/ ### VALID\n\n\/\/ FILE: valid_noargs.kt\npackage valid1\nfun main() {}\n\n\/\/ FILE: valid_noargs2.kt\npackage valid1<|endoftext|>"} {"prompt":"\"kotlin.UShortArray\" -> \"UShortArraySerializer\"\n \"kotlin.UIntArray\" -> \"UIntArraySerializer\"\n \"kotlin.ULongArray\" -> \"ULongArraySerializer\"\n \"kotlin.CharArray\" -> \"CharArraySerializer\"\n \"kotlin.FloatArray\" -> \"FloatArraySerializer\"","completion":"\"kotlin.DoubleArray\" -> \"DoubleArraySerializer\"\n \"kotlin.BooleanArray\" -> \"BooleanArraySerializer\"\n \"kotlin.time.Duration\" -> \"DurationSerializer\"\n \"java.lang.Boolean\" -> \"BooleanSerializer\"\n \"java.lang.Byte\" -> \"ByteSerializer\"\n \"java.lang.Short\" -> \"ShortSerializer\"<|endoftext|>"} {"prompt":"val hash = sha256.digest(Files.readAllBytes(fullLibraryPath))\n val defaultTempDirName = buildString {\n append(fullLibraryName)\n append('_')\n hash.forEach {\n val hex = it.toUByte().toString(16)\n if (hex.length == 1)\n append('0')\n append(hex)\n }\n }","completion":"val defaultTempDir = Paths.get(systemTmpDir, defaultTempDirName).toAbsolutePath().toString()\n val tempDir = File(createTempDirWithLibrary())\n if (tempDir.renameTo(File(defaultTempDir))) {\n File(defaultTempDir).deleteOnExit()\n File(\"$defaultTempDir\/$fullLibraryName\").deleteOnExit()\n } else {<|endoftext|>"} {"prompt":"\/\/ This file was generated automatically. See compiler\/fir\/tree\/tree-generator\/Readme.md.\n\/\/ DO NOT MODIFY IT MANUALLY.\n\n@file:Suppress(\"DuplicatedCode\")\n\npackage org.jetbrains.kotlin.fir.types.impl\n\nimport org.jetbrains.kotlin.KtSourceElement","completion":"import org.jetbrains.kotlin.fir.MutableOrEmptyList\nimport org.jetbrains.kotlin.fir.builder.toMutableOrEmpty\nimport org.jetbrains.kotlin.fir.expressions.FirAnnotation\nimport org.jetbrains.kotlin.fir.types.FirIntersectionTypeRef<|endoftext|>"} {"prompt":"fun case_4(value_1: Any?, value_2: Any?, value_3: Any?, value_4: Any?): Boolean {\n contract { returns(true) implies (value_1 is Float? && value_1 != null && value_2 != null && value_3 != null && value_4 != null) }","completion":"return value_1 is Float? && value_1 != null && value_2 != null && value_3 != null && value_4 != null\n}\n\n\/\/ FILE: main.kt\n\nimport contracts.*\n\n\/\/ TESTCASE NUMBER: 1\nclass case_1 {\n val prop_1: Int? = 10\n fun case_1(value_1: Any?, value_2: Number?) {<|endoftext|>"} {"prompt":"\/\/ library.kt:57 box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass, this_\\48:MyClass=MyClass, $i$f$f1\\48\\480:int=0:int,","completion":"$i$f$test\\49\\422:int=0:int, testVal\\49:int=1:int<|endoftext|>"} {"prompt":"it.putValueArgument(0, thisReceiver)\n it.putValueArgument(1, messageArg)\n it.putValueArgument(2, causeArg)\n }\n }\n\n return if (!context.es6mode) {\n expressionReplacement\n } else {\n JsIrBuilder.buildComposite(\n context.irBuiltIns.unitType,\n listOf(","completion":"IrDelegatingConstructorCallImpl(\n expression.startOffset,\n expression.endOffset,\n context.irBuiltIns.anyType,\n anyConstructor,\n 0,\n 0\n ),\n expressionReplacement\n )\n )\n }\n }\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.diagnostics.KotlinToolingDiagnostics\nimport org.jetbrains.kotlin.gradle.plugin.diagnostics.reportDiagnostic\nimport org.jetbrains.kotlin.gradle.plugin.mpp.Framework\nimport org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType","completion":"import org.jetbrains.kotlin.gradle.plugin.mpp.apple.FrameworkCopy.Companion.dsymFile\nimport org.jetbrains.kotlin.gradle.plugin.mpp.apple.swiftexport.registerSwiftExportTask\nimport org.jetbrains.kotlin.gradle.plugin.mpp.enabledOnCurrentHostForBinariesCompilation<|endoftext|>"} {"prompt":"assertEquals(setOf(\"A\"), resolver.resolveAssociatedIds(\"B\"))\n assertEquals(setOf(\"A\"), resolver.resolveAssociatedIds(\"C\"))\n assertEquals(setOf(\"A\"), resolver.resolveAssociatedIds(\"E\"))\n assertEquals(setOf(\"A\"), resolver.resolveAssociatedIds(\"D\"))\n }\n\n \/*","completion":"Platform A: A -> B -> C\n Platform B: A -> D -> E\n F -> G -> C\n\n Expected: A, C\n *\/\n fun `test sample 9`() {\n val resolver = createCommonClassifierIdResolver(\n createCirTreeRootFromSourceCode(\n \"\"\"\n class C\n typealias B = C\n typealias A = B<|endoftext|>"} {"prompt":"outerType = null, arguments = emptyList(), isMarkedNullable = false\n )\n }\n\n private val cOpaqueType = listOf(createType(\"kotlinx\/cinterop\/COpaque\"))\n private val objcObjectBase = listOf(createType(\"kotlinx\/cinterop\/ObjCObjectBase\"))","completion":"private val objcCObject = listOf(createType(\"kotlinx\/cinterop\/ObjCObject\"))\n\n fun CirEntityId.artificialSupertypes(): List {\n return when (packageName) {\n CNAMES_STRUCTS_PACKAGE -> cOpaqueType\n OBJCNAMES_CLASSES_PACKAGE -> objcObjectBase<|endoftext|>"} {"prompt":"\"If this happens during the update of the default language version in the project, make sure that \" +\n \"a version of kotlinx-metadata-jvm has been published that supports this version, and update \" +\n \"\\\"versions.kotlinx-metadata-jvm\\\" in `gradle\/versions.properties`.\",\n cause\n )\n }\n header\n }\n\n \/\/ Write out the stripped annotation","completion":"annotationVisitor.visitKotlinMetadata(newHeader)\n }\n\n\/**\n * Parse a KotlinClassHeader from an existing Kotlin Metadata annotation visitor.\n *\/\nprivate fun kotlinClassHeaderVisitor(body: (Metadata) -> Unit): AnnotationVisitor =\n object : AnnotationVisitor(Opcodes.API_VERSION) {\n var kind: Int = 1<|endoftext|>"} {"prompt":"visitor.visitSetValue(this, data)\n\n override fun acceptChildren(visitor: IrElementVisitor, data: D) {\n value.accept(visitor, data)\n }\n\n override fun transformChildren(transformer: IrElementTransformer, data: D) {\n value = value.transform(transformer, data)\n }","completion":"}<|endoftext|>"} {"prompt":"?: fir.specialFunctionTypeKind(context.session)\n ?: FunctionTypeKind.Function\n\n return createFunctionType(\n if (callableReferenceAdaptation == null || forceReflectionType) baseFunctionTypeKind.reflectKind() else baseFunctionTypeKind.nonReflectKind(),\n parameters,\n receiverType = receiverType.takeIf { fir.receiverParameter != null },\n rawReturnType = returnType,","completion":"contextReceivers = fir.contextReceivers.map { it.typeRef.coneType }\n ) to callableReferenceAdaptation\n }\n is FirVariable -> {\n val returnType = returnTypeRef.type\n val isMutable = fir.canBeMutableReference(candidate)\n val propertyType = when {\n isMutable && returnType.hasCapture() -><|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl\nimport org.jetbrains.kotlin.ir.expressions.impl.IrDelegatingConstructorCallImpl\nimport org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl\nimport org.jetbrains.kotlin.ir.types.defaultType","completion":"import org.jetbrains.kotlin.ir.util.*\nimport org.jetbrains.kotlin.name.JvmStandardClassIds.JVM_OVERLOADS_FQ_NAME\n\n\/\/ TODO: `IrValueParameter.defaultValue` property does not track default values in super-parameters. See KT-28637.\n@PhaseDescription(\n name = \"JvmOverloadsAnnotation\",<|endoftext|>"} {"prompt":"descriptors.add(descriptor)\n\n if (state == ComponentStorageState.Initialized)\n composeDescriptors(context, items)\n\n }\n\n fun compose(context: ComponentResolveContext) {\n if (state != ComponentStorageState.Initial)\n throw ContainerConsistencyException(\"$containerId $myId was already composed.\")\n\n state = ComponentStorageState.Initialized","completion":"composeDescriptors(context, descriptors)\n }\n\n private fun composeDescriptors(context: ComponentResolveContext, descriptors: Collection) {\n if (descriptors.isEmpty()) return\n\n registry.addAll(descriptors)\n\n val implicits = inspectDependenciesAndRegisterAdhoc(context, descriptors)<|endoftext|>"} {"prompt":"if (asInterface2(MyFinalClass2()).test != 1) return \"Fail MyFinalClass2 as Interface2 property\"\n if (MyFinalClass2().test != 1) return \"Fail MyFinalClass2 property\"\n\n if (asInterface(MyFinalClass3()).test != 1) return \"Fail MyFinalClass3 as Interface property\"","completion":"if (MyFinalClass3().test != 1) return \"Fail MyFinalClass3 property\"\n\n if (asInterface(MyFinalClassI()).test != 1) return \"Fail MyFinalClassI as Interface property\"\n if (MyFinalClassI().test != 1) return \"Fail MyFinalClassI property\"<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.java\n\nimport org.jetbrains.kotlin.KtSourceElement\nimport org.jetbrains.kotlin.fir.FirAnnotationContainer\nimport org.jetbrains.kotlin.fir.FirElement\nimport org.jetbrains.kotlin.fir.FirModuleData","completion":"import org.jetbrains.kotlin.fir.FirSession\nimport org.jetbrains.kotlin.fir.declarations.FirConstructor\nimport org.jetbrains.kotlin.fir.declarations.FirRegularClass\nimport org.jetbrains.kotlin.fir.declarations.FirValueParameter<|endoftext|>"} {"prompt":"@Test fun splitToLines() = withOneCharSequenceArg { arg1 ->\n val string = arg1(\"first line\\rsecond line\\nthird line\\r\\nlast line\")\n assertEquals(listOf(\"first line\", \"second line\", \"third line\", \"last line\"), string.lines())\n\n\n val singleLine = arg1(\"single line\")","completion":"assertEquals(listOf(singleLine.toString()), singleLine.lines())\n }\n\n @Test fun splitIllegalLimit() = withOneCharSequenceArg(\"test string\") { string ->\n assertFailsWith { string.split(*arrayOf(), limit = -1) }<|endoftext|>"} {"prompt":"x\n x.not()\n}\n\n\/\/ TESTCASE NUMBER: 22\nfun case_22(x: Boolean?) {","completion":"for (i in listOf(1, 2, 3)) {\n break && x as Boolean\n }\n\n x\n x.not()\n}<|endoftext|>"} {"prompt":"visitAnonymousFunction(anonymousFunctionExpression.anonymousFunction)\n }\n\n override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction) {\n annotationRenderer?.render(anonymousFunction)\n modifierRenderer?.renderModifiers(anonymousFunction)\n declarationRenderer?.render(anonymousFunction)\n print(\" \")","completion":"val receiverParameter = anonymousFunction.receiverParameter\n if (receiverParameter != null) {\n receiverParameter.typeRef.accept(this)\n print(\".\")\n }\n print(\"\")\n if (anonymousFunction.valueParameters.isEmpty() &&\n anonymousFunction.hasExplicitParameterList &&\n anonymousFunction.returnTypeRef is FirImplicitTypeRef\n ) {<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun > testTypeParameterWithVarianceDifferentUpperBoundsDReverse() {}\n\n@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun > testTypeParameterWithVarianceDifferentUpperBoundsE() {}","completion":"fun > testTypeParameterWithVarianceDifferentUpperBoundsE() {}\n\nfun > testTypeParameterWithVarianceDifferentUpperBoundsEReverse() {}<|endoftext|>"} {"prompt":"for (string in strings) {\n result += string\n }\n\n return result\n}\n\ninternal fun test1(): String {\n return concat()\n}\n\ninternal fun test2(): String {\n return concat(\"a\", \"b\", \"c\")\n}\n\ninternal fun test3(list: Array): String {\n return concat(*list)\n}","completion":"\/\/ CHECK_BREAKS_COUNT: function=box count=0 TARGET_BACKENDS=JS_IR\n\/\/ CHECK_LABELS_COUNT: function=box name=$l$block count=0 TARGET_BACKENDS=JS_IR\nfun box(): String {\n assertEquals(\"\", test1())\n assertEquals(\"abc\", test2())<|endoftext|>"} {"prompt":"0x3da5fd7fe1796495UL, 0x3da5fd7fe1796495UL, 0x0UL, 0x0UL, \n 0x0UL, 0x0UL, 0x3ff0000000000000UL, 0x3ff000000000afecUL,","completion":"0x3feffffffffea028UL, 0x3fe0000000000000UL, 0x4000000000000000UL, 0x3fd0000000000000UL, \n 0x4010000000000000UL, 0x3ff0000000000000UL, 0x3feffffffffea028UL, 0x3ff000000000afecUL,<|endoftext|>"} {"prompt":"open val visibilityState: JsAny?\n open val focused: Boolean\n fun focus(): Promise\n fun navigate(url: String): Promise\n}\n\n\/**\n * Exposes the JavaScript [Clients](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/Clients) to Kotlin\n *\/\npublic external abstract class Clients : JsAny {","completion":"fun get(id: String): Promise\n fun matchAll(options: ClientQueryOptions = definedExternally): Promise>\n fun openWindow(url: String): Promise\n fun claim(): Promise\n}\n\npublic external interface ClientQueryOptions : JsAny {\n var includeUncontrolled: Boolean? \/* = false *\/\n get() = definedExternally<|endoftext|>"} {"prompt":"runSuspend { require((DPoint::suspendInlineFunctionWithLambda)(dPoint, dPoint) { it.suspended() } == dPoint) }\n runSuspend { require(dPoint.suspendInlineFunctionWithLambda(dPoint) { it.suspendedInline() } == dPoint) }","completion":"runSuspend { require((dPoint::suspendInlineFunctionWithLambda)(dPoint) { it.suspendedInline() } == dPoint) }\n runSuspend { require((DPoint::suspendInlineFunctionWithLambda)(dPoint, dPoint) { it.suspendedInline() } == dPoint) }<|endoftext|>"} {"prompt":"this.propVal()\n propVar()","completion":"this.propVar()\n function()<|endoftext|>"} {"prompt":"if (argumentType !is ConeClassLikeType) return null\n var type = argumentType\n var arrayDimensions = 0\n while (true) {\n if (type.isPrimitiveArray) break\n type = type.arrayElementType() ?: break\n arrayDimensions++\n }\n val classId = type.classId ?: return null\n return KClassValue(classId, arrayDimensions)","completion":"}<|endoftext|>"} {"prompt":"public inline val DocumentReadyState.Companion.LOADING: DocumentReadyState get() = \"loading\".asDynamic().unsafeCast()\n\npublic inline val DocumentReadyState.Companion.INTERACTIVE: DocumentReadyState get() = \"interactive\".asDynamic().unsafeCast()","completion":"public inline val DocumentReadyState.Companion.COMPLETE: DocumentReadyState get() = \"complete\".asDynamic().unsafeCast()\n\n\/* please, don't implement this interface! *\/\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanPlayTypeResult {\n companion object\n}<|endoftext|>"} {"prompt":"val fileName = match.group(2)\n val sources = results.getOrPut(moduleName) { mutableListOf() }\n sources.add(it to fileName)\n }\n }\n\n val dependencyGraph = parseDependencies(testDir)\n\n DFS.topologicalOrder(dependencyGraph.keys) { m ->","completion":"(dependencyGraph[m] ?: error(\"Expected dependencies for module $m\")).map { it.moduleName }\n }.reversed().mapTo(modulesOrder) { it }\n\n for ((moduleName, fileEntries) in results) {\n val moduleDir = File(workingDir, moduleName).apply { mkdirs() }\n val moduleSrcDir = File(moduleDir, \"src\")<|endoftext|>"} {"prompt":"origFile.copyTo(resolve(\"bar\/barUseAB.kt\"))\n origFile.deleteExisting()\n }\n\n build(\"assemble\") {\n assertCompiledKotlinSources(\n getExpectedKotlinSourcesForDefaultProject(\n appSources = listOf(\"foo\/fooCallUseAB.kt\", \"bar\/barUseAB.kt\")\n ),\n output\n )","completion":"}\n }\n }\n\n @DisplayName(\"Lib project classes became final\")\n @GradleTest\n open fun testLibClassBecameFinal(gradleVersion: GradleVersion) {\n doTestLibClassBecameFinal(gradleVersion)\n }\n\n protected fun doTestLibClassBecameFinal(gradleVersion: GradleVersion, impactedClassInAppIsRecompiled: Boolean = true) {<|endoftext|>"} {"prompt":"throw IllegalArgumentException(\"Not applicable for $opToken, $leftType, $rightType\")\n else when (opToken) {\n KtTokens.EQEQ -> PrimitiveToBoxedEquality(left, right, leftType)\n KtTokens.EXCLEQ -> Invert(PrimitiveToBoxedEquality(left, right, leftType))","completion":"else -> throw AssertionError(\"Unexpected opToken: $opToken\")\n }\n\n @JvmStatic\n fun isApplicable(opToken: IElementType, leftType: Type, rightType: Type) =\n (opToken == KtTokens.EQEQ || opToken == KtTokens.EXCLEQ) &&\n AsmUtil.isIntOrLongPrimitive(leftType) &&<|endoftext|>"} {"prompt":")\n\n @Test\n fun `test multiple incorrect source set dependencies`() = checkDiagnostics {\n sourceSets.getByName(\"iosX64Test\").dependsOn(sourceSets.getByName(\"commonMain\"))\n sourceSets.getByName(\"androidInstrumentedTest\").dependsOn(sourceSets.getByName(\"commonMain\"))\n }.assertDiagnostics(","completion":"KotlinSourceSetTreeDependsOnMismatch(\n dependents = mapOf(\n \"main\" to listOf(\"androidDebug\", \"androidMain\", \"androidRelease\", \"nativeMain\"),\n \"instrumentedTest\" to listOf(\"androidInstrumentedTest\"),\n \"test\" to listOf(\"iosX64Test\")\n ),\n dependencyName = \"commonMain\"\n ),\n )<|endoftext|>"} {"prompt":"declaration.defaultValue?.expression?.unwrapLambda()?.let {\n inlineLambdaToParameter[it] = declaration\n }\n }\n }\n\n override fun visitFunctionAccess(expression: IrFunctionAccessExpression) {\n expression.acceptChildrenVoid(this)\n val function = expression.symbol.owner\n if (function.isInlineFunctionCall(context)) {","completion":"for (parameter in function.valueParameters) {\n if (parameter.isInlinedFunction()) {\n expression.getValueArgument(parameter.index)\n ?.also { inlineFunctionExpressions += it }\n ?.unwrapLambda()\n ?.let { inlineLambdaToParameter[it] = parameter }\n }\n }\n }\n }\n })\n }<|endoftext|>"} {"prompt":"import kotlin.reflect.KClass\nimport kotlin.reflect.KVisibility\nimport kotlin.reflect.full.memberProperties\nimport kotlin.reflect.jvm.javaField\nimport kotlin.test.fail\n\n\nclass CompilerArgumentsImplementationTest {\n\n @ParameterizedTest\n @MethodSource(\"implementations\")","completion":"fun `test - all properties with Argument annotation - are public`(implementation: KClass) {\n implementation.memberProperties.forEach { property ->\n if (property.javaField?.getAnnotation(Argument::class.java) != null) {\n if (property.visibility != KVisibility.PUBLIC) {\n fail(<|endoftext|>"} {"prompt":"actual fun Any.onReceiver() {}\n\nactual class OnClassSuper : I1\n\nactual class OnClassSuperDifferentOrder : @Ann I2, I1\n\nactual class OnClassSuperMoreOnActual : I1, I2\n\nactual class OnClassSuperTypeParams : I3\n\nactual fun deepInParamsTypes(arg: I3>) {}","completion":"actual fun starProjection(arg: I4<*, Any>) {}\n\nactual fun typeArgWithVariance(t: I3) {}\n\nactual fun qualifierPartsMatching(arg: WithNested.Nested<@Ann String>) {}\n\nactual fun qualifierPartsNonMatching(arg: WithNested<@Ann String>.Nested) {}<|endoftext|>"} {"prompt":"\/\/ but, as it is the only one to required to run on MacOS\n\/\/ we are running this test as a part of Native tests\n\/\/ This allows us to keep CI configuration simpler.\n@OsCondition(supportedOn = [OS.LINUX, OS.MAC, OS.WINDOWS], enabledOnCI = [OS.LINUX, OS.MAC, OS.WINDOWS])\n@NativeGradlePluginTests","completion":"class JsSetupConfigurationCacheIT : KGPBaseTest() {\n\n override val defaultBuildOptions =\n super.defaultBuildOptions.copy(\n configurationCache = true,\n configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL\n )\n\n \/\/ hack to be run on Mac m*\n @DisplayName(\"Check Node.JS setup on different platforms\")\n @GradleTest<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.FirImplementationDetail\nimport org.jetbrains.kotlin.fir.FirModuleData\nimport org.jetbrains.kotlin.fir.MutableOrEmptyList\nimport org.jetbrains.kotlin.fir.builder.toMutableOrEmpty","completion":"import org.jetbrains.kotlin.fir.contracts.FirContractDescription\nimport org.jetbrains.kotlin.fir.declarations.*\nimport org.jetbrains.kotlin.fir.expressions.FirAnnotation\nimport org.jetbrains.kotlin.fir.expressions.FirBlock<|endoftext|>"} {"prompt":"shouldNotBeEscapedFile.writeText(\"$PREAMBLE_MESSAGE\\n${SHOULD_NOT_BE_ESCAPED.joinToString(\"\\n\")}\")\n casesFile.writeText(\"$PREAMBLE_MESSAGE\\n${cases.joinToString(\"\\n\")}\")\n }\n }\n}","completion":"private fun generate(testDataDirPath: String, f: TestDataBuilder.() -> Unit) {\n val builder = TestDataBuilder()\n builder.f()\n builder.generate(testDataDirPath)\n}\n\nprivate val DEFINITION_MARKER = \"DEFINITION\"\nprivate val DECLARATION_MARKER = \"DECLARATION\"<|endoftext|>"} {"prompt":"if (c != null) c.propNullableT\n\n if (c != null) c.propNullableAny","completion":"if (c != null) c.funT()\n\n if (c != null) c.funAny()<|endoftext|>"} {"prompt":"\"ObjC spec of method `${baseMethod.selector}` for `${baseMethod.symbol}`\"\n}\n\ninternal class ObjCInitMethodForKotlinConstructor(val baseMethod: BaseMethod) : ObjCMethodSpec() {\n override fun toString(): String =","completion":"\"ObjC spec of method `${baseMethod.selector}` for `${baseMethod.symbol}`\"\n}\n\ninternal class ObjCFactoryMethodForKotlinArrayConstructor(\n val baseMethod: BaseMethod\n) : ObjCMethodSpec() {\n override fun toString(): String =<|endoftext|>"} {"prompt":"if (z != null) this.z.equals(null)\n if (z != null) this.z.propT","completion":"if (z != null) this.z.propAny\n if (z != null) this.z.propNullableT<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.execution\n\nimport org.gradle.api.Action\nimport org.jetbrains.kotlin.gradle.plugin.KotlinExecution\nimport org.jetbrains.kotlin.gradle.plugin.KotlinExecution.ExecutionSource\n\n\/**\n * An execution source that aggregates other [executionSources].\n *\/","completion":"interface KotlinAggregateExecutionSource : ExecutionSource {\n val executionSources: Iterable\n}\n\ninterface KotlinAggregatingExecution<\n AggregatedSourceType : ExecutionSource,\n AggregatingSourceType : KotlinAggregateExecutionSource,<|endoftext|>"} {"prompt":"if (xs.size != 1 && (xs[0] != 1 && xs[0] != null)) throw AssertionError()\n}\n\nfun box(): String {\n booleanVararg(*booleanArrayOf(true))\n booleanVararg(*BooleanArray(1))\n booleanVararg(*BooleanArray(1) { true })","completion":"booleanVararg(xs = *booleanArrayOf(true))\n booleanVararg(xs = *BooleanArray(1))\n booleanVararg(xs = *BooleanArray(1) { true })\n\n byteVararg(*byteArrayOf(1))\n byteVararg(*ByteArray(1))\n byteVararg(*ByteArray(1) { 1 })<|endoftext|>"} {"prompt":"fun dispatch(a: IC): T = bar(a) {\n it.dispatchInline()\n}\n\nfun normal(a: IC): T = bar(a) {\n normalInline(it)\n}\n\nfun bar(value: T, f: (T) -> R): R {\n return f(value)\n}\n\nfun box(): String {","completion":"var res = extension(IC(FooHolder(40))) + 3\n if (res != 43) return \"FAIL 2: $res\"\n\n res = dispatch(IC(FooHolder(40))) + 4\n if (res != 44) return \"FAIL 3: $res\"\n\n res = normal(IC(FooHolder(40))) + 5<|endoftext|>"} {"prompt":"private fun maxPointsToGraphSizeOf(function: DataFlowIR.FunctionSymbol) = with(DivergenceResolutionParams) {\n \/\/ A heuristic: the majority of functions have their points-to graph size linear in number of IR (or DFG) nodes,\n \/\/ there are exceptions but it's a trade-off we have to make.","completion":"\/\/ The trick with [NegligibleSize] handles functions that basically delegate their work to other functions.\n val numberOfNodes = intraproceduralAnalysisResults[function]!!.function.body.allScopes.sumOf { it.nodes.size }\n NegligibleSize + numberOfNodes * SwellingFactor\n }<|endoftext|>"} {"prompt":"* Builds a [HeaderInfo] for iteration over characters in a [CharSequence].\n *\n * Note: The value for \"last\" can NOT be cached (i.e., stored in a variable) because the size\/length can change within the loop. This means\n * that \"last\" is re-evaluated with each iteration of the loop.\n *\/\ninternal open class CharSequenceIterationHandler(\n context: CommonBackendContext,","completion":"canCacheLast: Boolean = false\n) : IndexedGetIterationHandler(context, canCacheLast) {\n override fun matchIterable(expression: IrExpression): Boolean =\n expression.type.isSubtypeOfClass(context.ir.symbols.charSequence)<|endoftext|>"} {"prompt":"assertEquals(\"uint32_t\", header.renderTypesOfSymbol(\"foo\"))\n }\n\n @Test\n fun `test - number - Long`() {\n val header = header(\"\"\"val foo: Long get() = error(\"stub\")\"\"\")\n assertEquals(\"int64_t\", header.renderTypesOfSymbol(\"foo\"))\n }\n\n @Test","completion":"fun `test - number - ULong`() {\n val header = header(\"\"\"val foo: ULong get() = error(\"stub\")\"\"\")\n assertEquals(\"uint64_t\", header.renderTypesOfSymbol(\"foo\"))\n }\n\n @Test\n fun `test - number - Float`() {\n val header = header(\"\"\"val foo: Float get() = error(\"stub\")\"\"\")<|endoftext|>"} {"prompt":"0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, \n 0x3ff0000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL,","completion":"0x7ff8000000000000UL, 0x7ff8000000000000UL, 0x7ff8000000000000UL, 0xc2826dc9d8770db4UL, \n 0x42826dc9d8764312UL, 0x404245465683a05eUL, 0xc04245465683a05eUL, 0x403245465683a05eUL,<|endoftext|>"} {"prompt":"\/\/ temporary trick with passing Any as a template and overwriting it below, TODO: fix after introducing new script definitions hierarchy\nabstract class KotlinScriptDefinitionAdapterFromNewAPIBase : KotlinScriptDefinition(Any::class) {\n\n abstract val scriptCompilationConfiguration: ScriptCompilationConfiguration\n\n abstract val hostConfiguration: ScriptingHostConfiguration","completion":"open val baseClass: KClass<*> by lazy(LazyThreadSafetyMode.PUBLICATION) {\n getScriptingClass(scriptCompilationConfiguration.getOrError(ScriptCompilationConfiguration.baseClass))\n }\n\n override val template: KClass<*> get() = baseClass\n\n override val name: String<|endoftext|>"} {"prompt":"* MAIN LINK: expressions, prefix-expressions, prefix-increment-expression -> paragraph 4 -> sentence 1\n * PRIMARY LINKS: statements, assignments -> paragraph 3 -> sentence 2\n * NUMBER: 1\n * DESCRIPTION: check unsafe prefix increment expression call for an assignable expression\n *\/\n\n\/\/ FILE: TestCase1.kt\n\/\/ TESTCASE NUMBER: 1\npackage testPackCase1\n\nclass A() {","completion":"var i = 0\n\n operator fun inc(): A {\n this.i++\n return this\n }\n}\n\nfun case1() {\n var b: Case1? = Case1()\n ++b?.a\n}\n\n\nclass Case1() {\n var a: A = A()\n}\n\n\/\/ FILE: TestCase2.kt\n\/\/ TESTCASE NUMBER: 2<|endoftext|>"} {"prompt":"assertEquals(expected, method.parameterTypes.contentToString(), \"Fail parameterTypes of $title\")\n assertEquals(expected, method.genericParameterTypes.contentToString(), \"Fail genericParameterTypes of $title\")\n}\n\nprivate fun bar(p0: Long, p1: List, p2: Map>) = true\n\nfun box(): String {","completion":"check(\"SAM-implementing lambda 1\", \"[class java.lang.Object]\", Java.getTest { Objects.nonNull(it) })\n check(\"SAM-wrapped function reference 1\", \"[class java.lang.Object]\", Java.getTest(Objects::nonNull))<|endoftext|>"} {"prompt":"private fun shouldCheckForMultiplatformRedeclaration(dependency: FirBasedSymbol<*>, dependent: FirBasedSymbol<*>): Boolean {\n if (dependency.moduleData !in dependent.moduleData.allDependsOnDependencies) return false\n\n \/*\n * If one of declarations is expect and the other is not expect, ExpectActualChecker will handle this case","completion":"* All other cases (both are expect or both are not expect) should be reported as declarations conflict\n *\/\n return !isExpectAndNonExpect(dependency, dependent)\n}\n\nprivate fun FirDeclarationCollector>.collectTopLevelConflict(\n declaration: FirBasedSymbol<*>,\n declarationPresentation: String,\n containingFile: FirFile,<|endoftext|>"} {"prompt":"is KtLightSourceElement -> lightTreeStrategy.isValid(element.lighterASTNode, element.treeStructure)\n else -> true\n }\n }\n\n private fun PositioningStrategy<*>.hackyIsValid(psi: PsiElement): Boolean {\n @Suppress(\"UNCHECKED_CAST\")","completion":"return (this as PositioningStrategy).isValid(psi)\n }\n}<|endoftext|>"} {"prompt":"val substitutedBound = substitutor.safeSubstitute(bound, Variance.INVARIANT)\n\n if (!typeChecker.isSubtypeOf(argumentType, substitutedBound)) {\n if (argumentReference != null) {\n upperBoundViolatedReporter.report(argumentReference, substitutedBound)","completion":"} else if (typeAliasUsageElement != null && !substitutedBound.containsTypeAliasParameters() && !argumentType.containsTypeAliasParameters()) {\n upperBoundViolatedReporter.reportForTypeAliasExpansion(typeAliasUsageElement, substitutedBound)\n }\n return false\n }\n\n return true\n }\n}\n\nclass UpperBoundViolatedReporter(<|endoftext|>"} {"prompt":"bar.obj.name = \"new bar.obj\"\n assertEquals(\"new bar.obj\", bar.obj.name)\n\n\n bar.num0 = 100\n assertEquals(100, bar.num0)\n\n bar.str0 = \"new str\"\n assertEquals(\"new str\", bar.str0)\n\n bar.obj.noname = \"noname value\"","completion":"assertEquals(\"noname value\", bar.obj.noname)\n\n baz.boo = \"baz\"\n assertEquals(\"baz\", baz.boo)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"assertEquals(\"I20\" in interfaces, instance is I20, \"$label is I20\")\n\n assertEquals(\"I21\" in interfaces, instance is I21, \"$label is I21\")\n assertEquals(\"I22\" in interfaces, instance is I22, \"$label is I22\")\n assertEquals(\"I23\" in interfaces, instance is I23, \"$label is I23\")","completion":"assertEquals(\"I24\" in interfaces, instance is I24, \"$label is I24\")\n assertEquals(\"I25\" in interfaces, instance is I25, \"$label is I25\")\n assertEquals(\"I26\" in interfaces, instance is I26, \"$label is I26\")\n assertEquals(\"I27\" in interfaces, instance is I27, \"$label is I27\")<|endoftext|>"} {"prompt":"name = Name.special(\"\")\n returnType = context.irBuiltIns.unitType\n }.apply {\n body = context.irFactory.createBlockBody(startOffset, endOffset)\n }\n \/\/ Should be initialized first in case some inline function call in `` also uses assertions.\n (classInitializer.body as IrBlockBody).statements.add(0, init)","completion":"return null\n }\n\n private fun generateKotlinMetadataAnnotation() {\n val facadeClassName = context.multifileFacadeForPart[irClass.attributeOwnerId]\n val metadata = irClass.metadata\n val entry = irClass.fileParent.fileEntry\n val kind = when {\n facadeClassName != null -> KotlinClassHeader.Kind.MULTIFILE_CLASS_PART<|endoftext|>"} {"prompt":"private fun findAvailableConstructors(scope: FirScope, targetClassName: Name): List> {\n val classLikeSymbol = scope.findFirstClassifierByName(targetClassName) as? FirClassLikeSymbol\n ?: return emptyList()","completion":"val constructors = (classLikeSymbol as? FirClassSymbol)?.declarationSymbols?.filterIsInstance().orEmpty()\n val samConstructor = classLikeSymbol.getSamConstructor()\n\n return constructors + listOfNotNull(samConstructor)\n }<|endoftext|>"} {"prompt":"kotlin.String?>?)>?\")!>list.get(0)","completion":"?..@Nullable() kotlin.collections.List<@Nullable() kotlin.String?>?); This will become an error in Kotlin 2.1. See<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ JVM_TARGET: 1.8\n\/\/ SAM_CONVERSIONS: INDY\n\n\/\/ CHECK_BYTECODE_TEXT\n\/\/ JVM_IR_TEMPLATES\n\/\/ 0 java\/lang\/invoke\/LambdaMetafactory\n\/\/ 1 final class CovariantOverrideWithPrimitiveKt\\$box\\$test\\$\n\nfun interface IFooAny {","completion":"fun foo(): Any\n}\n\nfun interface IFooInt : IFooAny {\n override fun foo(): Int\n}\n\nfun box(): String {\n val test = IFooInt { 42 }\n if (test.foo() != 42)\n return \"Failed\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"\"return this.asDynamic().concat(arrayOf(element))\"\n else\n \"return plus(${primitive.name.lowercase()}ArrayOf(element))\"\n }\n }\n on(Platform.Native) {\n body {\n \"\"\"\n val index = size\n val result = copyOfUninitializedElements(index + 1)\n result[index] = element\n return result","completion":"\"\"\"\n }\n }\n on(Platform.Common) {\n specialFor(InvariantArraysOfObjects) {\n suppress(\"NO_ACTUAL_FOR_EXPECT\") \/\/ TODO: KT-21937\n }\n }\n }\n }\n\n\n val f_plus_collection = fn(\"plus(elements: Collection)\") {<|endoftext|>"} {"prompt":"return typeParameterSymbol(referencedName!!) ?: computeClassifier(type.classId())\n }\n\n\n private fun typeArgument(projection: KtTypeProjection): ConeTypeProjection {\n if (projection.projectionKind == KtProjectionKind.STAR) {\n return ConeStarProjection\n }\n\n val type = type(projection.typeReference!!)","completion":"return typeArgument(type, projection.projectionKind)\n }\n\n private fun typeArgument(\n type: ConeKotlinType,\n projectionKind: KtProjectionKind\n ): ConeTypeProjection {\n val variance = when (projectionKind) {\n KtProjectionKind.IN -> Variance.IN_VARIANCE<|endoftext|>"} {"prompt":"override fun getPossibleClassifierNames(): Set = withValidityAssertion {\n return emptySet()\n }\n\n override fun getConstructors(): Sequence = withValidityAssertion {\n return scope\n .getContributedDescriptors(kindFilter = DescriptorKindFilter.FUNCTIONS)\n .asSequence()","completion":".filterIsInstance()\n .map { it.toKtConstructorSymbol(analysisContext) }\n }\n\n}\n\ninternal open class KtFe10ScopeMember(\n override val scope: MemberScope,\n private val constructors: Collection,\n override val analysisContext: Fe10AnalysisContext\n) : KtFe10ScopeResolution() {<|endoftext|>"} {"prompt":"var result = 1.0.test(b = {invokeOrder += \"1_\"; l}(), a = {invokeOrder+=\"0_\"; i}(), c = {invokeOrder += \"$captured\"; \"$captured\"})\n if (invokeOrder != expectedInvokeOrder || result != expectedResult) return \"fail 1: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult\"\n\n invokeOrder = \"\";","completion":"result = 1.0.test(b = {invokeOrder += \"1_\"; l}(), c = {invokeOrder += \"${captured}\"; \"${captured}\"}, a = {invokeOrder+=\"0_\"; i}())\n if (invokeOrder != expectedInvokeOrder || result != expectedResult) return \"fail 2: $invokeOrder != $expectedInvokeOrder or $result != $expectedResult\"<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER\n\/\/ SKIP_TXT\n\n\/*\n * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)\n *\n * SPEC VERSION: 0.1-296","completion":"* MAIN LINK: type-system, type-kinds, built-in-types, kotlin.any -> paragraph 1 -> sentence 1\n * PRIMARY LINKS: type-system, introduction-1 -> paragraph 7 -> sentence 1\n * NUMBER: 2\n * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the class.\n * HELPERS: checkType, functions\n *\/<|endoftext|>"} {"prompt":"class Pair(x : Int, y : Int) {\n companion object {\n fun copy(from : Pair, x : Int = from.x, y : Int = from.y) = Pair(x, y)\n }\n}\n\n\/\/ One can say:\nval p = Point(1, 2)\nval p1 = Point.Copy(p, x = 2)","completion":"val p2 = Point.Copy(p1, y = -1)\nval p3 = Point.Copy(p)\n\n\/\/ Such copy(...) methods can be automatically generated by the compiler\n\/\/ whenever there is a primary constructor<|endoftext|>"} {"prompt":"\/\/ with the same IR symbol for them\n findFunctions(kotlinPackage, Name.identifier(\"arrayOf\")).distinct().single()\n }\n\n override fun getNonBuiltInFunctionsByExtensionReceiver(\n name: Name,\n vararg packageNameSegments: String,\n ): Map {","completion":"return getFunctionsByKey(\n name,\n *packageNameSegments,\n mapKey = { symbol ->\n symbol.fir.receiverParameter?.typeRef?.toIrType(c)?.classifierOrNull\n },\n mapValue = { _, irSymbol -> irSymbol }\n )\n }\n\n override fun getNonBuiltinFunctionsByReturnType(<|endoftext|>"} {"prompt":"public inline fun kotlin.text.StringBuilder.appendLine(value: kotlin.CharArray): kotlin.text.StringBuilder\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun kotlin.text.StringBuilder.appendLine(value: kotlin.CharSequence?): kotlin.text.StringBuilder","completion":"@kotlin.SinceKotlin(version = \"1.9\")\n@kotlin.internal.InlineOnly\npublic inline fun kotlin.text.StringBuilder.appendLine(value: kotlin.Double): kotlin.text.StringBuilder\n\n@kotlin.SinceKotlin(version = \"1.9\")\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"for(i in 0..old.andArgumentCount - 1) {\n if (!checkEquals(old.getAndArgument(i), new.getAndArgument(i))) return false\n }\n\n return true\n }\n\n open fun checkEqualsExpressionOrArgument(old: ProtoBuf.Expression, new: ProtoBuf.Expression): Boolean {","completion":"if (old.orArgumentCount != new.orArgumentCount) return false\n\n for(i in 0..old.orArgumentCount - 1) {\n if (!checkEquals(old.getOrArgument(i), new.getOrArgument(i))) return false\n }\n\n return true\n }<|endoftext|>"} {"prompt":"fun testBasicCase() {\n fun consume(arg: UserEnumeration) {}\n val buildee = build {\n consume(materialize())\n }\n checkExactType>(buildee)\n }\n\n fun testEnumEntry() {\n fun shareTypeInfo(from: T, to: T) {}\n val buildee = build {","completion":"shareTypeInfo(UserEnumeration.ENUM_ENTRY, materialize())\n }\n checkExactType>(buildee)\n }\n\n testBasicCase()\n testEnumEntry()\n}\n\nfun box(): String {\n testYield()\n testMaterialize()\n return \"OK\"\n}<|endoftext|>"} {"prompt":"BitcodeEmbeddingMode.BITCODE -> add(\"-Xembed-bitcode\")\n else -> Unit\n }\n linkerOpts.forEach { addArg(\"-linker-option\", it) }\n binaryOptions.forEach { (name, value) -> add(\"-Xbinary=$name=$value\") }\n addKey(\"-Xstatic-framework\", isStaticFramework)","completion":"addAll(buildKotlinNativeCommonArgs(toolOptions, compilerPlugins))\n\n exportLibraries.forEach { add(\"-Xexport-library=${it.absolutePath}\") }\n includeLibraries.forEach { add(\"-Xinclude=${it.absolutePath}\") }\n\n if (friendModules.isNotEmpty()) {<|endoftext|>"} {"prompt":"irConst(bitsForSlot(0b010, meta.maskSlot))\n )\n irOrOr(\n irAndAnd(\n maskIsUnstableOrUncertain,\n irChanged(\n arg,\n compareInstanceForFunctionTypes = false,\n compareInstanceForUnstableValues = isMemoizedLambda\n )\n ),\n irEqual(","completion":"param.irIsolateBitsAtSlot(meta.maskSlot, includeStableBit = false),\n irConst(ParamState.Different.bitsForSlot(meta.maskSlot))\n )\n )\n }\n else -> irChanged(\n arg,\n compareInstanceForFunctionTypes = false,\n compareInstanceForUnstableValues = isMemoizedLambda\n )\n }\n }<|endoftext|>"} {"prompt":"\"\"\".trimIndent()\n )\n\n build(\":app:kaptDebugKotlin\") {\n assertTasksExecuted(\":app:kaptGenerateStubsDebugKotlin\")\n }\n\n javaFile.writeText(\n \/\/language=Java\n \"\"\"\n package com.example.dagger.kotlin;\n\n class Utils {\n public String oneMethod() {","completion":"return \"fake!\";\n }\n \n public void anotherMethod() {\n int one = 1;\n }\n }\n \"\"\".trimIndent()\n )\n\n build(\":app:kaptDebugKotlin\") {\n assertTasksExecuted(\":app:kaptGenerateStubsDebugKotlin\")\n assertOutputDoesNotContain(<|endoftext|>"} {"prompt":"override fun readFile(bytes: ByteArray, file: VirtualFile): KotlinMetadataStubBuilder.FileWithMetadata {\n val stream = ByteArrayInputStream(bytes)\n\n val version = JsMetadataVersion.readFrom(stream)\n if (!version.isCompatibleWithCurrentCompilerVersion()) {\n return KotlinMetadataStubBuilder.FileWithMetadata.Incompatible(version)\n }","completion":"JsProtoBuf.Header.parseDelimitedFrom(stream)\n\n val proto = ProtoBuf.PackageFragment.parseFrom(stream, JsSerializerProtocol.extensionRegistry)\n return KotlinMetadataStubBuilder.FileWithMetadata.Compatible(proto, version, JsSerializerProtocol)\n }\n}<|endoftext|>"} {"prompt":"return getTotalFramesWeight(node.instructions.first.countInsnsWithFramesUntil(null), node) < MEMORY_LIMIT_BY_METHOD_MB\n }\n\n fun canBeOptimizedUsingSourceInterpreter(node: MethodNode): Boolean {\n val methodSize = node.instructions.first.countInsnsWithFramesUntil(null)","completion":"if (node.tryCatchBlocks.size > TRY_CATCH_BLOCKS_SOFT_LIMIT) {\n if (getTotalFramesWeight(getTotalTcbSize(node) * methodSize, node) > MEMORY_LIMIT_BY_METHOD_MB)\n return false\n }<|endoftext|>"} {"prompt":"dataClassArrayMemberHashCodeSymbol = addBuiltinOperatorSymbol(\"dataClassArrayMemberHashCode\", intType, \"\" to anyType)\n dataClassArrayMemberToStringSymbol = addBuiltinOperatorSymbol(\"dataClassArrayMemberToString\", stringType, \"\" to anyNType)\n\n checkNotNullSymbol = run {\n val typeParameter: IrTypeParameter = irFactory.createTypeParameter(","completion":"startOffset = UNDEFINED_OFFSET,\n endOffset = UNDEFINED_OFFSET,\n origin = BUILTIN_OPERATOR,\n name = Name.identifier(\"T0\"),\n symbol = IrTypeParameterSymbolImpl(),\n variance = Variance.INVARIANT,\n index = 0,\n isReified = true\n ).apply {<|endoftext|>"} {"prompt":"assertEquals(\"Boston\", o.nativeFooNWrapperN?.nativeFooN?.s)\n o.nativeFooNWrapperN = NativeFooNWrapper(null)\n assertEquals(\"NativeFooNWrapper(nativeFooN=null) (object)\", describeValueOfProperty(o, \"nativeFooNWrapperN\"))","completion":"assertEquals(null, o.nativeFooNWrapperN?.nativeFooN?.s)\n o.nativeFooNWrapperN = null\n assertEquals(\"null (object)\", describeValueOfProperty(o, \"nativeFooNWrapperN\"))\n assertEquals(null, o.nativeFooNWrapperN?.nativeFooN?.s)\n}<|endoftext|>"} {"prompt":"reporter.reportOn(declaration.source, FirErrors.MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES, context)\n }\n else -> {\n reporter.reportOn(declaration.source, FirErrors.MIXING_FUNCTIONAL_KINDS_IN_SUPERTYPES, superKinds, context)\n }","completion":"}\n }\n}<|endoftext|>"} {"prompt":"if (f != null || this.f != null) this.f.funNullableT()","completion":"if (f != null || this.f != null) this.f.funNullableAny()<|endoftext|>"} {"prompt":"* Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n *\/\npublic fun Array.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }","completion":"}\n\n\/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n *\/\npublic fun ByteArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }<|endoftext|>"} {"prompt":"* The insertion point is defined as the index at which the element should be inserted,\n * so that the array (or the specified subrange of array) still remains sorted.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n *\/","completion":"public fun CharArray.binarySearch(element: Char, fromIndex: Int = 0, toIndex: Int = size): Int {\n return java.util.Arrays.binarySearch(this, fromIndex, toIndex, element)\n}\n\n\/**\n * Checks if the two specified arrays are *deeply* equal to one another.\n *<|endoftext|>"} {"prompt":"val ch = this.code\n return ch in 0x0009..0x000d\n || ch in 0x001c..0x0020\n || ch == 0x00a0\n || ch > 0x1000 && (\n ch == 0x1680\n || ch in 0x2000..0x200a\n || ch == 0x2028\n || ch == 0x2029","completion":"|| ch == 0x202f\n || ch == 0x205f\n || ch == 0x3000\n )\n}<|endoftext|>"} {"prompt":"assertEquals(listOf(\"3\", \"4\"), q)\n\n assertTrue(q.addAll(listOf(\"7\", \"8\")))\n assertEquals(listOf(\"3\", \"4\", \"7\", \"8\"), q)\n assertEquals(listOf(\"2\", \"3\", \"4\", \"7\", \"8\", \"5\"), s)","completion":"assertEquals(listOf(\"1\", \"2\", \"3\", \"4\", \"7\", \"8\", \"5\", \"6\"), a)\n }\n\n @Test fun subListRemoveAt() {\n val a = ArrayList(listOf(\"1\", \"2\", \"3\", \"4\", \"5\"))\n val s = a.subList(1, 4)<|endoftext|>"} {"prompt":"ExpectedData(0x53c1a66d0b13003UL, 0x57466046cf6896edUL, 0x8ac37e0e8b25b0c6UL, 0x3e6074b52ad3cf18UL, 0xaa491ce7b45db297UL),","completion":"ExpectedData(0xd3a2efec0f047e9UL, 0xc2dcc9758c910171UL, 0xcb5cddaeff4ddb40UL, 0x5d7cc5869baefef1UL, 0x9644c5853af9cfebUL),<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.impl.*\nimport org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol\nimport org.jetbrains.kotlin.ir.symbols.impl.IrConstructorSymbolImpl\nimport org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl","completion":"import org.jetbrains.kotlin.ir.types.IrType\nimport org.jetbrains.kotlin.ir.util.*\nimport org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid\nimport org.jetbrains.kotlin.ir.visitors.transformChildrenVoid\nimport org.jetbrains.kotlin.name.Name<|endoftext|>"} {"prompt":"KotlinTarget.classActualTargets(ClassKind.ENUM_ENTRY, annotated.isInner, isCompanionObject = false, isLocalClass = false)\n )\n is FirProperty -> {\n when {\n annotated.isLocal ->\n when {\n annotated.name == SpecialNames.DESTRUCT -> TargetLists.T_DESTRUCTURING_DECLARATION","completion":"annotated.isCatchParameter == true -> TargetLists.T_CATCH_PARAMETER\n else -> TargetLists.T_LOCAL_VARIABLE\n }\n annotated.isMember ->\n if (annotated.source?.kind == KtFakeSourceElementKind.PropertyFromParameter) {\n TargetLists.T_VALUE_PARAMETER_WITH_VAL<|endoftext|>"} {"prompt":"inline fun loop$atomicfu(refGetter: () -> KMutableProperty0, action: (T) -> Unit) {\n while (true) {\n val cur = refGetter().get()\n action(cur)\n }\n }\n *\/\n override fun atomicfuLoopBody(valueType: IrType, valueParameters: List): IrBlockBody =","completion":"irBlockBody {\n val refGetter = valueParameters[0]\n val action = valueParameters[1]\n +irWhile().apply {\n condition = irTrue()\n body = irBlock {\n val cur = createTmpVariable(\n atomicGetField(invokePropertyGetter(irGet(refGetter)), valueType),\n \"atomicfu\\$cur\", false\n )<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.library.KotlinLibraryVersioning\nimport org.jetbrains.kotlin.library.SerializedMetadata\nimport org.jetbrains.kotlin.library.impl.BuiltInsPlatform\nimport org.jetbrains.kotlin.library.impl.buildKotlinLibrary\nimport org.jetbrains.kotlin.library.metadata.KlibMetadataVersion","completion":"import java.io.File\n\nfun buildKotlinMetadataLibrary(configuration: CompilerConfiguration, serializedMetadata: SerializedMetadata, destDir: File) {\n val versions = KotlinLibraryVersioning(\n abiVersion = KotlinAbiVersion.CURRENT,\n libraryVersion = null,\n compilerVersion = KotlinCompilerVersion.getVersion(),<|endoftext|>"} {"prompt":"override val declarations: MutableList = mutableListOf()\n override val annotations: MutableList = mutableListOf()\n override lateinit var scopeProvider: FirScopeProvider\n lateinit var symbol: FirAnonymousObjectSymbol\n\n override fun build(): FirAnonymousObject {\n return FirAnonymousObjectImpl(\n source,\n resolvePhase,","completion":"moduleData,\n origin,\n attributes,\n typeParameters,\n status,\n deprecationsProvider,\n classKind,\n superTypeRefs,\n declarations,\n annotations.toMutableOrEmpty(),\n scopeProvider,\n symbol,\n )\n }\n\n}\n\n@OptIn(ExperimentalContracts::class)<|endoftext|>"} {"prompt":"* has less priority than explicitly specified enableOptimizations option in the\n * build script.\n *\n * Support for environment variables should be explicitly enabled by setting a project property:\n * konan.useEnvironmentVariables = true.\n *\/\n\ninternal interface EnvironmentVariables {\n val configurationBuildDir: File?\n val debuggingSymbols: Boolean\n val enableOptimizations: Boolean\n}","completion":"internal class EnvironmentVariablesUnused: EnvironmentVariables {\n override val configurationBuildDir: File?\n get() = null\n\n override val debuggingSymbols: Boolean\n get() = false\n\n override val enableOptimizations: Boolean\n get() = false\n}\n\ninternal class EnvironmentVariablesImpl(val project: Project): EnvironmentVariables {\n override val configurationBuildDir: File?<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION\n\nfun foo(f: () -> T): T = f()\n\nfun bar(): Unit {}\n\nobject Scope {\n fun bar(s: String = \"\"): Double = 0.0\n\n fun foo(f: () -> T): T = f()\n\n object NestedScope {","completion":"fun bar(a: Int = 0): String = \"\"\n\n fun test() {\n \/\/ Despite the fact ::bar is resolved with compatibility warning, it's important not to propagate it to the outer call\n val result = foo(::bar)<|endoftext|>"} {"prompt":"val serializationPluginClasspath = System.getProperty(\"kotlin.script.test.kotlinx.serialization.plugin.classpath\")!!\n val out = captureOut {\n val res = evalFile(\n File(\"$TEST_DATA_ROOT\/hello-kotlinx-serialization.main.kts\"),\n compilation = {\n compilerOptions(","completion":"\"-Xplugin=$serializationPluginClasspath\"\n )\n }\n )\n assertSucceeded(res)\n }.lines()\n assertEquals(\n listOf(\"\"\"{\"firstName\":\"James\",\"lastName\":\"Bond\"}\"\"\", \"User(firstName=James, lastName=Bond)\"),\n out\n )\n }\n\n @Test<|endoftext|>"} {"prompt":"var j: Int get() = i; abstract set\n var j1: Int = 0; get() = i; abstract set","completion":"var k: Int abstract set\n var k1: Int = 0; abstract set<|endoftext|>"} {"prompt":"val parameter = newFun.valueParameters[i]\n if (parameter.isVararg) continue \/\/ Handled with WasmVarargExpressionLowering\n if (newCall.getValueArgument(i) != null) continue\n newCall.putValueArgument(\n i,\n IrConstImpl.defaultValueForType(UNDEFINED_OFFSET, UNDEFINED_OFFSET, parameter.type)","completion":")\n }\n\n return newCall\n }\n }\n}\n\nprivate fun numDefaultParametersForExternalFunction(function: IrFunction): Int {\n if (function is IrSimpleFunction) {\n \/\/ Default parameters can be in overridden external functions\n val numDefaultParametersInOverrides =\n function.overriddenSymbols.maxOfOrNull {\n numDefaultParametersForExternalFunction(it.owner)<|endoftext|>"} {"prompt":"}\n\n\/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n *","completion":"* @sample samples.collections.Collections.Transformations.associateWithTo\n *\/\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > IntArray.associateWithTo(destination: M, valueSelector: (Int) -> V): M {\n for (element in this) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.scopes.processOverriddenFunctions\nimport org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag\nimport org.jetbrains.kotlin.fir.symbols.FirBasedSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.*","completion":"import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase\nimport org.jetbrains.kotlin.fir.types.*\nimport org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef\nimport org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef<|endoftext|>"} {"prompt":"if (Case31.A.e != null) Case31.A.e.propNullableAny\n if (Case31.A.e != null) Case31.A.e.funT()\n if (Case31.A.e != null) Case31.A.e.funAny()\n if (Case31.A.e != null) Case31.A.e.funNullableT()","completion":"if (Case31.A.e != null) Case31.A.e.funNullableAny()\n if (Case31.A.e != null) Case31.A.e\n if (Case31.A.f != null) Case31.A.f.equals(null)\n if (Case31.A.f != null) Case31.A.f.propT<|endoftext|>"} {"prompt":"it.body = it.factory.createBlockBody(\n startOffset,\n endOffset,\n initializeStatements.let {\n if (irScript.resultProperty == null || initializeStatements.lastOrNull()?.first?.correspondingPropertySymbol != irScript.resultProperty) it\n else it.dropLast(1)","completion":"}.memoryOptimizedMap { (field, expression) -> createIrSetField(field, expression) }\n )\n }\n\n val evaluateScriptFunction = createFunction(irScript, \"\\$evaluateScript\\$\", getReturnType(irScript)).also {\n it.body = it.factory.createBlockBody(\n startOffset,\n endOffset,<|endoftext|>"} {"prompt":"\"Unable to make PSI file from script\"\n )\n ktFile.declarations.firstIsInstanceOrNull() == null -> failure(\n script,\n messageCollector,\n \"Not a script file\"\n )\n else -> ktFile.asSuccess()\n }\n}\n\ninternal fun makeCompiledScript(\n generationState: GenerationState,","completion":"script: SourceCode,\n ktFile: KtFile,\n sourceDependencies: List,\n getScriptConfiguration: (KtFile) -> ScriptCompilationConfiguration\n): ResultWithDiagnostics {\n val scriptDependenciesStack = ArrayDeque()<|endoftext|>"} {"prompt":"ExpectedData(0xa0f10149a0e538d6UL, 0x26b6689960ccf81dUL, 0x55f23b27bb9efd94UL, 0x3a17f6166dd765dbUL, 0xc891a8a62931e782UL),","completion":"ExpectedData(0xfb8d9c70660b910bUL, 0x98ec31113e5e35d2UL, 0x5e4aeb853f1b9aa7UL, 0xbcf5c8fe4465b7c8UL, 0xb1ea3a8243996f15UL),<|endoftext|>"} {"prompt":"open fun cToBridged(expr: NativeExpression): NativeExpression = expr\n\n \/**\n * If this info is for [TypeMirror.ByValue], then this method describes how to\n * construct pointed-type from value type.\n *\/\n abstract fun constructPointedType(valueType: KotlinType): KotlinClassifierType","completion":"class Primitive(override val bridgedType: BridgedType, val varClass: Classifier) : TypeInfo() {\n\n override fun argToBridged(expr: KotlinExpression) = expr\n override fun argFromBridged(expr: KotlinExpression, scope: KotlinScope, nativeBacked: NativeBacked) = expr<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.sir.util\n\nimport org.jetbrains.kotlin.sir.*\nimport org.jetbrains.kotlin.sir.builder.buildStruct\n\n\/**\n * A module representing the swift standard library\n *\/\nobject SirSwiftModule : SirModule() {\n override val name: String get() = \"Swift\"","completion":"val bool = primitive(\"Bool\")\n\n val int8 = primitive(\"Int8\")\n val int16 = primitive(\"Int16\")\n val int32 = primitive(\"Int32\")\n val int64 = primitive(\"Int64\")\n\n val uint8 = primitive(\"UInt8\")\n val uint16 = primitive(\"UInt16\")\n val uint32 = primitive(\"UInt32\")<|endoftext|>"} {"prompt":"|#######################\n |\n \"\"\".trimMargin()\n )\n}\n\ninternal fun String.normalizeLineEndings(): String = replace(\"\\n\", System.lineSeparator())\n\n\/*\nIdeally, this would've been just KotlinTestUtils.assertEqualsToFile, throwing FileComparisonException.\nNormally this is actually desired, because IDEA and TC provide special support for those exceptions with","completion":"nice diff windows. However, due to shaded artifacts used in runtime of integration tests, actual thrown\nexception will have FQN like org.jetbrains.kotlin.com.intellij... . This not only breaks the tooling support,\nbut also rendered diff will be trimmed, making working with such failures extremely inconvenient\n*\/\ninternal fun assertEqualsToFile(expectedFile: File, actualText: String) {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.cli.common.output.writeAllTo\nimport org.jetbrains.kotlin.codegen.GeneratedClassLoader\nimport org.junit.After\nimport org.junit.AfterClass\nimport org.junit.Before\nimport org.junit.BeforeClass\nimport org.junit.Rule\nimport org.junit.rules.TemporaryFolder","completion":"private const val RUNNER_CLASS = \"RunnerKt\"\nprivate const val MAIN_METHOD = \"main\"\nprivate const val CONTENT_METHOD = \"content\"\nprivate const val TEST_CLASS = \"TestKt\"\n\nabstract class AbstractDebuggerTest(useFir: Boolean) : AbstractCodegenTest(useFir) {\n companion object {\n private lateinit var testServerProcess: Process<|endoftext|>"} {"prompt":"protected val defaultStateFacade: RemoteReplStateFacadeServer by lazy { createRemoteState() }\n\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use check(state, line) instead\")\n fun check(codeLine: ReplCodeLine): ReplCheckResult = check(defaultStateFacade.state, codeLine)\n\n @Suppress(\"DEPRECATION\", \"UNUSED_PARAMETER\")","completion":"@Deprecated(\"Use compile(state, line) instead\")\n fun compile(codeLine: ReplCodeLine, verifyHistory: List?): ReplCompileResult = compile(defaultStateFacade.state, codeLine)\n\n fun createRemoteState(port: Int = portForServers): RemoteReplStateFacadeServer = statesLock.write {<|endoftext|>"} {"prompt":"exports unannotatedpackage;\n}\n\n\/\/ FILE: null_marked_module\/nullunmarkedpackage\/package-info.java\n\n@NullUnmarked\npackage nullunmarkedpackage;\n\nimport org.jspecify.annotations.*;\n\n\/\/ FILE: null_marked_module\/nullunmarkedpackage\/UnannotatedType.java\n\npackage nullunmarkedpackage;\n\npublic interface UnannotatedType {","completion":"public String unannotatedProduce();\n public void unannotatedConsume(String arg);\n}\n\n\/\/ FILE: null_marked_module\/unannotatedpackage\/NullUnmarkedType.java\n\npackage unannotatedpackage;\n\nimport org.jspecify.annotations.*;\n\n@NullUnmarked\npublic interface NullUnmarkedType {\n public String unannotatedProduce();<|endoftext|>"} {"prompt":"const val equalsShort3 = 1.toShort().equals(\"1\")\nconst val equalsShort4 = 1.toShort() == \"1\"","completion":"const val equalsInt1 = 1.equals(2)\nconst val equalsInt2 = 2 == 2<|endoftext|>"} {"prompt":"val disableSwiftMemberNameMangling: Boolean\n get() = false\n\n val unitSuspendFunctionExport: UnitSuspendFunctionObjCExport\n val ignoreInterfaceMethodCollisions: Boolean\n get() = false\n }\n\n fun generateBase(): List\n\n fun translate(file: KtFile): List\n}\n\n@JvmOverloads","completion":"fun createObjCExportLazy(\n configuration: ObjCExportLazy.Configuration,\n problemCollector: ObjCExportProblemCollector,\n codeAnalyzer: KotlinCodeAnalyzer,\n typeResolver: TypeResolver,\n descriptorResolver: DescriptorResolver,\n fileScopeProvider: FileScopeProvider,\n builtIns: KotlinBuiltIns,<|endoftext|>"} {"prompt":"if (this.y != null) y.propAny\n if (this.y != null) y.propNullableT","completion":"if (this.y != null) y.propNullableAny\n if (this.y != null) y.funT()<|endoftext|>"} {"prompt":"\/\/ FILE: bar\/JavaClass.java\n\npackage bar;\n\npublic class JavaClass {\n protected void foo() {}\n protected static void bar1() {}\n protected static void bar2() {}\n\n protected String field = \"\";\n protected static String CONST1 = \"\";\n protected static String CONST2 = \"\";\n\n}\n\n\/\/ FILE: foo\/JavaClassSamePackage.java\npackage foo;","completion":"public class JavaClassSamePackage extends bar.JavaClass {\n protected static void bar2() {}\n protected static String CONST2 = \"\";\n}\n\n\/\/ FILE: foo\/main.kt\npackage foo\n\nimport bar.JavaClass\n\nclass KotlinClass : JavaClass() {\n fun baz() {\n foo() \/\/ OK\n }\n}\n\nclass KotlinClass2 : JavaClass() {<|endoftext|>"} {"prompt":"0xbff7dcb7c5c399ecUL, 0xbff7dcb7c5c38c03UL, 0xbff7dcb7c5c3a7d5UL, 0xbff87f17cfda0b5dUL,","completion":"0xbff69b8154baf42eUL, 0xbff8d08152eddb7aUL, 0xbff433b8a322ddd2UL, 0xbffa673ee2c4c045UL,<|endoftext|>"} {"prompt":"getModels {\n with(getModel(\":\")!!) {\n assertEquals(1L, modelVersion)\n assertEquals(\"noArgKt18668\", name)\n assertEquals(1, annotations.size)\n assertTrue(annotations.contains(\"test.NoArg\"))\n assertTrue(presets.isEmpty())\n assertFalse(isInvokeInitializers)","completion":"}\n }\n }\n }\n\n @DisplayName(\"Model is not available when plugin is not applied\")\n @GradleTest\n fun testNonNoArgProjects(gradleVersion: GradleVersion) {\n project(\"kotlinProject\", gradleVersion) {\n getModels {\n assertNull(getModel(\":\"))\n }\n }\n }\n}<|endoftext|>"} {"prompt":"body.buildConstI32Symbol(context.stringPoolSize, location)\n }\n\n wasmSymbols.wasmArrayNewData0 -> {\n val arrayGcType = WasmImmediate.GcType(\n context.referenceGcType(call.getTypeArgument(0)!!.getRuntimeClass(irBuiltIns).symbol)\n )","completion":"body.buildInstr(WasmOp.ARRAY_NEW_DATA, location, arrayGcType, WasmImmediate.DataIdx(0))\n }\n\n else -> {\n return false\n }\n }\n\n return true\n }\n\n override fun visitBlockBody(body: IrBlockBody) {\n body.statements.forEach(::generateStatement)<|endoftext|>"} {"prompt":"private object B24 { val a = B23.a + Random.nextInt(100) }\nprivate object B25 { val a = B24.a + Random.nextInt(100) }\nprivate object B26 { val a = B25.a + Random.nextInt(100) }\nprivate object B27 { val a = B26.a + Random.nextInt(100) }","completion":"private object B28 { val a = B27.a + Random.nextInt(100) }\nprivate object B29 { val a = B28.a + Random.nextInt(100) }\nprivate object B30 { val a = B29.a + Random.nextInt(100) }\nprivate object B31 { val a = B30.a + Random.nextInt(100) }<|endoftext|>"} {"prompt":"\/\/ This file was generated automatically. See compiler\/ir\/ir.tree\/tree-generator\/ReadMe.md.\n\/\/ DO NOT MODIFY IT MANUALLY.\n\n@file:Suppress(\"DuplicatedCode\")\n\npackage org.jetbrains.kotlin.ir.expressions.impl\n\nimport org.jetbrains.kotlin.ir.declarations.IrAttributeContainer","completion":"import org.jetbrains.kotlin.ir.expressions.IrConstantObject\nimport org.jetbrains.kotlin.ir.expressions.IrConstantValue\nimport org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol\nimport org.jetbrains.kotlin.ir.types.IrType<|endoftext|>"} {"prompt":"val Number.Kilograms: Mass get() = Mass(toDouble())\n\n\/\/ FILE: operators.kt\noperator fun Volume.times(density: Density): Mass = Mass(cubicMeters * density.kilogramsPerCubicMeter)\noperator fun Density.times(volume: Volume): Mass = Mass(kilogramsPerCubicMeter * volume.cubicMeters)\n\n\/\/ MODULE: constants","completion":"\/\/ FILE: main.kt\nconst val TRIVIAL_PI = 3.14\n\n\/\/ MODULE: shapes(mass,constants)\n\/\/ FILE: default.kt\nclass Ball(private val radius: Length) {\n val surfaceArea1: SurfaceArea get() = TRIVIAL_PI * radius * radius\n val surfaceArea2: SurfaceArea get() = radius * TRIVIAL_PI * radius<|endoftext|>"} {"prompt":"operator fun P.provideDelegate(host: Any?, p: Any): P =\n runLogged(\"tdf(${this.value});\") { this }\n\noperator fun V.getValue(receiver: Any?, p: Any): V =\n runLogged(\"get($this);\") { this }","completion":"val testO by runLogged(\"O;\") { MyClass(\"O\") }\nval testK by runLogged(\"K;\") { \"K\" }\nval testOK = runLogged(\"OK;\") { testO.value + testK }\n\nfun box(): String {\n assertEquals(\"O;tdf(O);K;OK;get(O);get(K);\", log)\n return testOK\n}<|endoftext|>"} {"prompt":"add(FirErrors.MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND_FUN.warningFactory) { firDiagnostic ->\n ModifierFormForNonBuiltInSuspendFunWarningImpl(\n firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }","completion":"add(FirErrors.RETURN_FOR_BUILT_IN_SUSPEND) { firDiagnostic ->\n ReturnForBuiltInSuspendImpl(\n firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }<|endoftext|>"} {"prompt":"package kotlin.reflect\n\n\/**\n * Represents a callable entity, such as a function or a property.\n *\n * @param R return type of the callable.\n *\/\npublic actual interface KCallable : KAnnotatedElement {\n \/**\n * The name of this callable as it was declared in the source code.","completion":"* If the callable has no name, a special invented name is created.\n * Nameless callables include:\n * - constructors have the name \"\",\n * - property accessors: the getter for a property named \"foo\" will have the name \"\",\n * the setter, similarly, will have the name \"\".\n *\/<|endoftext|>"} {"prompt":"}\n println(\"}\")\n }\n\n override fun visitTypeAlias(declaration: IrTypeAlias) {\n print(\"<>\")\n }\n\n override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer) {\n println(\"init {\")\n indented {\n declaration.body.print()\n }\n println()\n println(\"}\")\n }","completion":"private fun IrType.renderSrc() =\n \"${renderTypeAnnotations(annotations)}${renderTypeInner()}\"\n\n private fun IrType.renderTypeInner() =\n when (this) {\n is IrDynamicType -> \"dynamic\"\n\n is IrErrorType -> \"IrErrorType\"\n\n is IrSimpleType -> buildTrimEnd {<|endoftext|>"} {"prompt":"public fun kotlin.Double.coerceAtMost(maximumValue: kotlin.Double): kotlin.Double\n\npublic fun kotlin.Float.coerceAtMost(maximumValue: kotlin.Float): kotlin.Float\n\npublic fun kotlin.Int.coerceAtMost(maximumValue: kotlin.Int): kotlin.Int","completion":"public fun kotlin.Long.coerceAtMost(maximumValue: kotlin.Long): kotlin.Long\n\npublic fun kotlin.Short.coerceAtMost(maximumValue: kotlin.Short): kotlin.Short\n\n@kotlin.SinceKotlin(version = \"1.5\")<|endoftext|>"} {"prompt":"interface Test4 : JFooWithUpperBound, IFoo\n\ninterface Test5 : JFooWithUpperBoundDerived, IFooDerived\n\nclass Test6 : JCFooWithUpperBound(), IFoo","completion":"class Test7 : JCFooWithUpperBoundDerived(), IFooDerived<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.codegen.range.comparison\n\nimport org.jetbrains.org.objectweb.asm.Label\nimport org.jetbrains.org.objectweb.asm.Type\nimport org.jetbrains.org.objectweb.asm.commons.InstructionAdapter\n\nobject LongComparisonGenerator : SignedIntegerComparisonGenerator {","completion":"override val comparedType: Type = Type.LONG_TYPE\n\n override fun jumpIfGreaterOrEqual(v: InstructionAdapter, label: Label) {\n v.lcmp()\n v.ifge(label)\n }\n\n override fun jumpIfLessOrEqual(v: InstructionAdapter, label: Label) {\n v.lcmp()\n v.ifle(label)\n }<|endoftext|>"} {"prompt":"@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOfWith(comparator: Comparator, selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()","completion":"var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n\/**\n * Returns the largest value according to the provided [comparator]<|endoftext|>"} {"prompt":"interface InnerClassOfGenericThrowableSubclass : KtFirDiagnostic {\n override val diagnosticClass get() = InnerClassOfGenericThrowableSubclass::class\n }\n\n interface KclassWithNullableTypeParameterInSignature : KtFirDiagnostic {","completion":"override val diagnosticClass get() = KclassWithNullableTypeParameterInSignature::class\n val typeParameter: KtTypeParameterSymbol\n }\n\n interface TypeParameterAsReified : KtFirDiagnostic {\n override val diagnosticClass get() = TypeParameterAsReified::class\n val typeParameter: KtTypeParameterSymbol\n }<|endoftext|>"} {"prompt":"p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A,","completion":"p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A\n) {}\n\nfun bar(x: Any) {}\n\nfun test(<|endoftext|>"} {"prompt":"if (c != null || this.c != null) c.propAny","completion":"if (c != null || this.c != null) c.propNullableT<|endoftext|>"} {"prompt":"val result2 = sequenceOf(1, 2, 4).flatMap { if (it == 2) emptyList() else it - 1..it }\n val expected = listOf(0, 1, 3, 4)\n assertEquals(expected, result1.toList())\n assertEquals(expected, result2.toList())\n }\n\n @Test fun flatMapIndexed() {","completion":"val result1 = sequenceOf(1, 2).flatMapIndexed { index, v -> (0..v + index).asSequence() }\n val result2 = sequenceOf(1, 2).flatMapIndexed { index, v -> 0..v + index }\n val expected = listOf(0, 1, 0, 1, 2, 3)\n assertEquals(expected, result1.toList())<|endoftext|>"} {"prompt":"KtTokens.MINUSEQ -> KtCompoundAccess.CompoundAssign.Kind.MINUS_ASSIGN\n KtTokens.MULTEQ -> KtCompoundAccess.CompoundAssign.Kind.TIMES_ASSIGN\n KtTokens.PERCEQ -> KtCompoundAccess.CompoundAssign.Kind.REM_ASSIGN","completion":"KtTokens.DIVEQ -> KtCompoundAccess.CompoundAssign.Kind.DIV_ASSIGN\n else -> error(\"unexpected operator $operationToken\")\n }\n return compoundAssignKind\n }\n\n protected fun KtUnaryExpression.getInOrDecOperationKind(): KtCompoundAccess.IncOrDecOperation.Kind {\n val incOrDecOperationKind = when (operationToken) {<|endoftext|>"} {"prompt":"assertEquals(null, notNullToNotNull(f), \"F as? B\")\n assertEquals(null, notNullToNotNull(an), \"Any as? B\")\n assertEquals(null, dtoB(dyn), \"dynamic as? B\")\n\n assertEquals(null, notNullToNotNull(func), \"Function is II\")","completion":"assertEquals(null, notNullToNotNull(bool), \"Boolean is II\")\n assertEquals(null, notNullToNotNull(num), \"Number is II\")\n assertEquals(null, notNullToNotNull(str), \"String is II\")\n\n return \"OK\"\n}\n\nfun testClassCast() {\n assertEquals(\"OK\", testClassCastN2N())<|endoftext|>"} {"prompt":"branch.startOffset, branch.endOffset,\n branch.condition.transform(),\n branch.result.transform()\n )\n\n private val transformedLoops = HashMap()\n\n private fun getTransformedLoop(irLoop: IrLoop): IrLoop =\n transformedLoops.getOrDefault(irLoop, irLoop)","completion":"override fun visitWhileLoop(loop: IrWhileLoop): IrWhileLoop =\n IrWhileLoopImpl(loop.startOffset, loop.endOffset, loop.type.remapType(), mapStatementOrigin(loop.origin)).also { newLoop ->\n transformedLoops[loop] = newLoop\n newLoop.label = loop.label\n newLoop.condition = loop.condition.transform()<|endoftext|>"} {"prompt":"private fun createClass(descriptor: FunctionClassDescriptor, declarator: SymbolTable.((IrClassSymbol) -> IrClass) -> IrClass): IrClass =\n symbolTable.declarator { createIrClass(it, descriptor) }","completion":"private fun buildClass(descriptor: FunctionClassDescriptor, declarator: SymbolTable.((IrClassSymbol) -> IrClass) -> IrClass): IrClass =\n builtClassesMap.getOrPut(descriptor) {\n createClass(descriptor, declarator).apply {\n val functionClass = this\n typeParameters += descriptor.declaredTypeParameters.map { typeParameterDescriptor -><|endoftext|>"} {"prompt":"val butterknifeJavaClassesDir = \"app\/build\/intermediates\/javac\/debug\/classes\/org\/example\/kotlin\/butterknife\/\"\n assertFileInProjectExists(butterknifeJavaClassesDir + \"SimpleActivity\\$\\$ViewBinder.class\")","completion":"assertFileInProjectExists(\"app\/build\/tmp\/kotlin-classes\/debug\/org\/example\/kotlin\/butterknife\/SimpleAdapter\\$ViewHolder.class\")\n }\n\n build(\"assembleDebug\") {\n assertTasksUpToDate(\":app:compileDebugKotlin\", \":app:compileDebugJavaWithJavac\")\n }\n }\n }<|endoftext|>"} {"prompt":"inv()\n }\n}\n\nfun poll56(): Flow {\n return flow {\n val inv = try { ::Foo7 } catch (e: Exception) { foo7() } finally { foo7() }\n inv\n }","completion":"}\n\nfun poll6(): Flow {\n return flow {\n val inv = ::bar\n inv\n }\n}\n\nfun poll61(): Flow {\n return flow {\n val inv = ::bar2\n inv\n }\n}\n\nfun poll62(): Flow {\n return flow {\n val inv = ::bar3\n inv\n }\n}<|endoftext|>"} {"prompt":"* Splits this char sequence to a sequence of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more characters to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return.\n *\/","completion":"public fun CharSequence.splitToSequence(vararg delimiters: Char, ignoreCase: Boolean = false, limit: Int = 0): Sequence =\n rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).map { substring(it) }\n\n\/**\n * Splits this char sequence to a list of strings around occurrences of the specified [delimiters].\n *<|endoftext|>"} {"prompt":"actual interface Interface\n\nactual object Object\n\nactual annotation class Annotation","completion":"actual enum class Enum\n\nactual typealias ActualTypealias = ActualTypealiasImpl\n\nclass ActualTypealiasImpl\n\nactual fun function() {}\n\nactual val property: Clazz = null!!<|endoftext|>"} {"prompt":"w.test(D(C(100)), C(1))\n\n val q = D::class.members.single { it.name == \"q\" } as KMutableProperty2\n q.test({ getExtensionDelegate(D(C(100))) as KMutableProperty1 }, { get(100) }, { set(100, it) })\n\n return \"OK\"","completion":"}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.codegen.GenerationUtils\nimport org.jetbrains.kotlin.config.CommonConfigurationKeys\nimport org.jetbrains.kotlin.config.JVMConfigurationKeys\nimport org.jetbrains.kotlin.jvm.compiler.AbstractLoadJavaTest\nimport org.jetbrains.kotlin.kotlinp.Settings","completion":"import org.jetbrains.kotlin.kotlinp.jvm.JvmKotlinp\nimport org.jetbrains.kotlin.kotlinp.jvm.readClassFile\nimport org.jetbrains.kotlin.kotlinp.jvm.readModuleFile\nimport org.jetbrains.kotlin.test.ConfigurationKind<|endoftext|>"} {"prompt":"val b = A().B().test()\n if (b != \"A.amf,A.ef,A.amp,A.ep,B.mf,B.mp,B.ef,B.ep,\") return \"Fail $b\"\n\n result = \"\"\n with(A()) {\n (::memberFunction).let { it() }\n (::aExtensionFunction).let { it() }","completion":"(::memberProperty).let { it() }\n (::aExtensionProperty).let { it() }\n }\n if (result != \"A.mf,A.ef,A.mp,A.ep,\") return \"Fail $result\"\n\n result = \"\"\n with(A()) {\n with(B()) {\n (::aMemberFunction).let { it() }<|endoftext|>"} {"prompt":"takeFnToAny(fun() { return Unit })\n takeFnToAny(fun(): Unit {})\n takeFnToAny(fun(): Unit { return })\n takeFnToAny(fun(): Unit { return Unit })\n takeFnToAny(fun() { if (true) return })\n takeFnToAny(fun() { if (true) return Unit })","completion":"takeFnToAny(fun() = unresolved())\n takeFnToAny(fun() { unresolved() })\n takeFnToAny(fun(): Unit { unresolved() })<|endoftext|>"} {"prompt":"}\n\n private fun processToolchain(\n bundleDir: File,\n project: Project,\n reinstallFlag: Boolean,\n kotlinNativeVersion: String,\n kotlinNativeBundleConfiguration: ConfigurableFileCollection,\n ) {\n val lock =","completion":"NativeDistributionCommonizerLock(bundleDir) { message -> project.logger.info(\"Kotlin Native Bundle: $message\") }\n\n lock.withLock {\n val needToReinstall = KotlinToolingVersion(project.konanVersion).maturity == KotlinToolingVersion.Maturity.SNAPSHOT\n if (needToReinstall) {<|endoftext|>"} {"prompt":"get() = table.irFactory\n\n private val nameProvider: NameProvider\n get() = table.nameProvider\n\n private val signatureComposer: IdSignatureComposer\n get() = table.signaturer!!","completion":"private val externalPackageFragmentSlice: SymbolTableSlice = SymbolTableSlice.Flat(lock)\n\n private val valueParameterSlice: SymbolTableSlice.Scoped by threadLocal {\n SymbolTableSlice.Scoped(lock)<|endoftext|>"} {"prompt":"return (1..lines).fold(FragmentedText()) { frag, line ->\n frag.generateFragment(line)\n }\n }\n\n private fun runValidations(originalText: String, mergedText: String, includedFragments: List) {\n \/\/ Check that line count is the same","completion":"assertEquals(\"Line count differ.\", originalText.lines().count(), mergedText.lines().count())\n \/\/ Check that char count is the same\n assertEquals(\"Char count differ.\", originalText.length, mergedText.length)\n includedFragments.forEach {\n \/\/ Check that every included fragment is included in correct position\n assertEquals(\n \"Incorrect fragment in position.\",\n it.text,<|endoftext|>"} {"prompt":"super.visitReturnExpression(returnExpression)\n }\n\n override fun visitBreakExpression(breakExpression: FirBreakExpression) {\n if (breakExpression.target.labeledElement !in firLoopStatements) {\n firBreakExpressions.add(breakExpression)\n firLoopJumpTargets.add(breakExpression.target.labeledElement)\n }","completion":"super.visitBreakExpression(breakExpression)\n }\n\n override fun visitContinueExpression(continueExpression: FirContinueExpression) {\n if (continueExpression.target.labeledElement !in firLoopStatements) {\n firContinueExpressions.add(continueExpression)\n firLoopJumpTargets.add(continueExpression.target.labeledElement)\n }<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ MODULE: m1\n\/\/ FILE: a.kt\n\npackage p\n\npublic class A\npublic class B {\n public val a: A = A()\n}\n\n\/\/ MODULE: m2(m1)\n\/\/ FILE: b.kt\n\npackage p\n\nclass A {\n fun foo() {}\n}\n\nfun test() {\n val a: A = B().a","completion":"a.foo()\n}<|endoftext|>"} {"prompt":"): FirBlock {\n return buildBlock {\n source = multiDeclaration.toKtPsiSourceElement()\n addDestructuringVariables(\n statements,\n c,\n moduleData,\n multiDeclaration,\n container,\n tmpVariable,\n forceLocal = false,\n )\n }\n}\n\ninternal fun AbstractRawFirBuilder<*>.addDestructuringVariables(","completion":"destination: MutableList,\n c: DestructuringContext,\n moduleData: FirModuleData,\n multiDeclaration: KtDestructuringDeclaration,\n container: FirVariable,\n tmpVariable: Boolean,\n forceLocal: Boolean,\n configure: (FirVariable) -> Unit = {}\n) {<|endoftext|>"} {"prompt":"result.add(toStringContributedFunction)\n val toStringFunction = createSyntheticIrFunction(\n TO_STRING,\n toStringContributedFunction,\n c.irBuiltIns.stringType,\n )\n declarationStorage.cacheGeneratedFunction(toStringContributedFunction, toStringFunction)\n }","completion":"val hashcodeNameContributedFunction = contributedSyntheticFunctions[HASHCODE_NAME]\n if (hashcodeNameContributedFunction != null) {\n result.add(hashcodeNameContributedFunction)\n val hashCodeFunction = createSyntheticIrFunction(\n HASHCODE_NAME,\n hashcodeNameContributedFunction,\n c.irBuiltIns.intType,\n )<|endoftext|>"} {"prompt":"}\n return -(low + 1) \/\/ key not found\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes","completion":"@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UIntArray.max(): UInt? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")<|endoftext|>"} {"prompt":"}\n\n override val staticCacheForDistributionLibrariesRootDir: File = File(distribution.klib)\n .resolve(\"cache\")\n .resolve(\n computeDistroCacheDirName(\n testTarget = kotlinNativeTargets.testTarget,\n cacheKind = CACHE_KIND,\n debuggable = optimizationMode == OptimizationMode.DEBUG\n )","completion":").apply {\n assertTrue(exists()) { \"The distribution libraries cache directory is not found: $this\" }\n assertTrue(isDirectory) { \"The distribution libraries cache directory is not a directory: $this\" }\n assertTrue(list().orEmpty().isNotEmpty()) { \"The distribution libraries cache directory is empty: $this\" }\n }\n\n companion object {<|endoftext|>"} {"prompt":"private val defaultParameterInjectorPhase = makeIrModulePhase(\n { context -> DefaultParameterInjector(context, MaskedDefaultArgumentFunctionFactory(context), skipExternalMethods = true) },\n name = \"DefaultParameterInjector\",\n description = \"Replace call site with default parameters with corresponding stub function\",\n prerequisite = setOf(innerClassesLoweringPhase)\n)","completion":"private val defaultParameterCleanerPhase = makeIrModulePhase(\n ::DefaultParameterCleaner,\n name = \"DefaultParameterCleaner\",\n description = \"Clean default parameters up\"\n)\n\nprivate val propertiesLoweringPhase = makeIrModulePhase(\n { PropertiesLowering() },\n name = \"PropertiesLowering\",\n description = \"Move fields and accessors out from its property\"\n)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.backend.common.lower.createIrBuilder\nimport org.jetbrains.kotlin.backend.wasm.WasmBackendContext\nimport org.jetbrains.kotlin.config.AnalysisFlags\nimport org.jetbrains.kotlin.config.languageVersionSettings\nimport org.jetbrains.kotlin.descriptors.ClassKind","completion":"import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET\nimport org.jetbrains.kotlin.ir.backend.js.lower.calls.EnumIntrinsicsUtils\nimport org.jetbrains.kotlin.ir.backend.js.utils.erasedUpperBound<|endoftext|>"} {"prompt":"inline fun findViewById6(): T = null as T\nfun test6(): I = findViewById6()\n\nfun findViewById7(): T = null as T\nfun test7(): I = findViewById7()\n\ninline fun findViewById8(): T = null as T\nfun test8(): I = findViewById8()","completion":"fun findViewById9(): T where T: View3, T: View5 = null as T\nfun test9(): I = findViewById9()\n\ninline fun findViewById10(): T where T: View3, T: View5 = null as T\nfun test10(): I = findViewById10()\n\nfun findViewById11(): T = null as T<|endoftext|>"} {"prompt":"trace.report(INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER.on(languageVersionSettings, klass, classDescriptor, abstractInvisibleSuper))\n }\n\n conflictingInterfaceMembers.removeAll(conflictingReturnTypes)\n multipleImplementations.removeAll(conflictingReturnTypes)\n if (conflictingInterfaceMembers.isNotEmpty()) {","completion":"trace.report(MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED.on(klass, klass, conflictingInterfaceMembers.first()))\n } else if (multipleImplementations.isNotEmpty()) {\n trace.report(MANY_IMPL_MEMBER_NOT_IMPLEMENTED.on(klass, klass, multipleImplementations.first()))\n }\n }<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +InlineClasses\n\ninline class UInt(val value: Int)\ninline class ULong(val value: Long)\n\nfun foo(u: UInt, f: (UInt) -> ULong): ULong = f(u)\n\nfun takeUInt(u: UInt) {}\n\nfun test() {\n val u = UInt(0)","completion":"val l = foo(u) { \/\/ box unbox UInt\n takeUInt(it)\n\n ULong(0) \/\/ box ULong\n } \/\/ unbox ULong\n}\n\n\/\/ @TestKt.class:\n\/\/ 1 INVOKESTATIC UInt\\.box\n\/\/ 2 INVOKEVIRTUAL UInt.unbox\n\n\/\/ 1 INVOKESTATIC ULong\\.box<|endoftext|>"} {"prompt":"object KLIB : SourceSetMetadataLayout(\"klib\", \"klib\")\n\n override fun toString(): String = name\n\n companion object {\n private val values get() = listOf(METADATA, KLIB)\n\n fun byName(name: String): SourceSetMetadataLayout? = values.firstOrNull { it.name == name }\n\n fun chooseForProducingProject() =","completion":"\/** A producing project will now only generate Granular source sets metadata as a KLIB *\/\n KLIB\n }\n}\n\n\/**\n * Represents the structure of \"shared\" source sets within a Kotlin Project.\n * Note: This entity is designed to only list \"shared\" source sets.\n * No \"platform\" source sets will be listed.\n *\/\ndata class KotlinProjectStructureMetadata(\n @Input<|endoftext|>"} {"prompt":"typeTable: TypeTable = this.typeTable,\n protoContainer: ProtoContainer.Class? = this.protoContainer\n): ClsStubBuilderContext = ClsStubBuilderContext(\n this.components,\n nameResolver,\n if (name != null) this.containerFqName.child(name) else this.containerFqName,","completion":"this.typeParameters.child(nameResolver, typeParameterList),\n typeTable,\n protoContainer\n)<|endoftext|>"} {"prompt":"public inline fun > UIntArray.mapTo(destination: C, transform: (UInt) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n\/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n *\/","completion":"@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.mapTo(destination: C, transform: (ULong) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n\/**<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.api.descriptors.components\n\nimport org.jetbrains.kotlin.analysis.api.components.KtTypeInfoProvider\nimport org.jetbrains.kotlin.analysis.api.descriptors.KtFe10AnalysisSession","completion":"import org.jetbrains.kotlin.analysis.api.descriptors.components.base.Fe10KtAnalysisSessionComponent\nimport org.jetbrains.kotlin.analysis.api.descriptors.types.base.KtFe10Type\nimport org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeToken<|endoftext|>"} {"prompt":"is ExportedType.ImplicitlyExportedType -> {\n val typeString = type.toTypeScript(\"\", true)\n if (isInCommentContext) {\n typeString\n } else {\n val superTypeString = exportedSupertype.toTypeScript(indent)","completion":"superTypeString.let { if (exportedSupertype is ExportedType.IntersectionType) \"($it)\" else it } + \"\/* $typeString *\/\"\n }\n }\n\n is ExportedType.PropertyType -> \"${container.toTypeScript(indent, isInCommentContext)}[${\n propertyName.toTypeScript(\n indent,\n isInCommentContext\n )\n }]\"<|endoftext|>"} {"prompt":"val structPointerFromPosix = getStructPointerFromPosix()\n\n object MyStruct {\n val struct = getMyStructPointer()?.pointed ?: error(\"Missing my struct\")\n val posixProperty: stat = struct.posixProperty\n val longProperty: Long = struct.longProperty\n val doubleProperty: Double = struct.doubleProperty","completion":"val int32tProperty: Int = struct.int32tProperty\n val int64TProperty: Long = struct.int64tProperty\n val windowsOnly: Boolean = struct.windowsOnlyProperty\n }\n\n val simple = simpleInterop()\n val p1 = WindowsMain.structFromPosix\n}<|endoftext|>"} {"prompt":"\/\/ test.kt:19 box\n\n\/\/ EXPECTATIONS JS_IR\n\/\/ test.kt:16 box\n\/\/ test.kt:9 foo\n\/\/ test.kt:6 cond\n\/\/ EXPECTATIONS FIR JS_IR\n\/\/ test.kt:12 foo\n\/\/ EXPECTATIONS JS_IR\n\/\/ test.kt:13 foo\n\/\/ test.kt:17 box\n\/\/ test.kt:18 box\n\/\/ test.kt:9 foo","completion":"\/\/ test.kt:6 cond\n\/\/ test.kt:10 foo\n\/\/ test.kt:6 cond\n\/\/ EXPECTATIONS FIR JS_IR\n\/\/ test.kt:12 foo\n\/\/ EXPECTATIONS JS_IR\n\/\/ test.kt:13 foo\n\/\/ test.kt:19 box\n\n\/\/ EXPECTATIONS WASM\n\/\/ test.kt:16 $box\n\/\/ test.kt:9 $foo (8, 8)<|endoftext|>"} {"prompt":"candidateCall: MutableResolvedCall,\n receiverParameter: ReceiverParameterDescriptor?,\n receiverArgument: ReceiverValue?,\n isExplicitReceiver: Boolean,\n implicitInvokeCheck: Boolean,\n isDispatchReceiver: Boolean\n ): ResolutionStatus {\n if (receiverParameter == null || receiverArgument == null) return SUCCESS","completion":"val candidateDescriptor = candidateCall.candidateDescriptor\n if (TypeUtils.dependsOnTypeParameters(receiverParameter.type, candidateDescriptor.typeParameters)) return SUCCESS\n\n \/\/ Here we know that receiver is OK ignoring nullability and check that nullability is OK too\n \/\/ Doing it simply as full subtyping check (receiverValueType <: receiverParameterType)<|endoftext|>"} {"prompt":"import org.gradle.api.tasks.*\nimport org.gradle.process.ExecOperations\nimport org.gradle.work.DisableCachingByDefault\nimport org.jetbrains.kotlin.gradle.dsl.KotlinNativeBinaryContainer\nimport org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.Companion.kotlinPropertiesProvider","completion":"import org.jetbrains.kotlin.gradle.plugin.diagnostics.KotlinToolingDiagnostics\nimport org.jetbrains.kotlin.gradle.plugin.diagnostics.reportDiagnostic\nimport org.jetbrains.kotlin.gradle.plugin.mpp.Framework\nimport org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType<|endoftext|>"} {"prompt":"if (element12 in 1L..<3L != range0.contains(element12)) throw AssertionError()\n if (element12 !in 1L..<3L != !range0.contains(element12)) throw AssertionError()\n if (!(element12 in 1L..<3L) != !range0.contains(element12)) throw AssertionError()","completion":"if (!(element12 !in 1L..<3L) != range0.contains(element12)) throw AssertionError()\n}\n\nfun testR0xE13() {\n \/\/ with possible local optimizations\n if (2.toShort() in 1L..<3L != range0.contains(2.toShort())) throw AssertionError()<|endoftext|>"} {"prompt":"return (elements as Collection<*>).all { it is UInt && storage.contains(it.toInt()) }\n }\n\n override fun isEmpty(): Boolean = this.storage.size == 0\n}\n\n\/**\n * Creates a new array of the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *","completion":"* The function [init] is called for each array element sequentially starting from the first one.\n * It should return the value for an array element given its index.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray(size: Int, init: (Int) -> UInt): UIntArray {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.constants.StringValue\nimport org.jetbrains.kotlin.storage.getValue\nimport org.jetbrains.kotlin.types.error.ErrorTypeKind\nimport org.jetbrains.kotlin.types.error.ErrorUtils\nimport org.jetbrains.kotlin.types.SimpleType\nimport java.util.*","completion":"object JavaAnnotationMapper {\n internal val DEPRECATED_ANNOTATION_MESSAGE = Name.identifier(\"message\")\n internal val TARGET_ANNOTATION_ALLOWED_TARGETS = Name.identifier(\"allowedTargets\")\n internal val RETENTION_ANNOTATION_VALUE = Name.identifier(\"value\")\n\n fun mapOrResolveJavaAnnotation(<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.IrBranch\nimport org.jetbrains.kotlin.ir.expressions.IrStatementOrigin\nimport org.jetbrains.kotlin.ir.expressions.IrWhen\nimport org.jetbrains.kotlin.ir.types.IrType\nimport org.jetbrains.kotlin.ir.util.IrElementConstructorIndicator","completion":"class IrWhenImpl internal constructor(\n @Suppress(\"UNUSED_PARAMETER\")\n constructorIndicator: IrElementConstructorIndicator?,\n override val startOffset: Int,\n override val endOffset: Int,\n override var type: IrType,\n override var origin: IrStatementOrigin?,\n) : IrWhen() {\n override var attributeOwnerId: IrAttributeContainer = this<|endoftext|>"} {"prompt":"x.toByte()\n x.length","completion":"x.get(0)\n }\n }\n }\n}<|endoftext|>"} {"prompt":"fun Bar.parameterizedExt() {}\n\nfun test_2_1(x: Any) {\n x as Bar\n x as Bar\n\n x.parameterizedExt()\n x.parameterizedExt()\n}\n\nfun test_2_2(x: Any) {\n x as Bar","completion":"x as Bar\n\n x.parameterizedExt()\n x.parameterizedExt()\n}<|endoftext|>"} {"prompt":"\/\/ NI_EXPECTED_FILE\n\n\/\/ FILE: a.kt\npackage a\n val foo = bar()\n\n fun bar() = foo\n\n\/\/ FILE: b.kt\npackage b\n fun foo() = bar()","completion":"fun bar() = foo()\n\n\/\/ FILE: c.kt\npackage c\n fun bazz() = bar()<|endoftext|>"} {"prompt":"specificFeatures.any { (feature, state) ->\n state == LanguageFeature.State.ENABLED && feature.forcesPreReleaseBinariesIfEnabled()\n }\n\n companion object {\n @JvmField\n val DEFAULT = LanguageVersionSettingsImpl(LanguageVersion.LATEST_STABLE, ApiVersion.LATEST_STABLE)\n }\n}","completion":"fun LanguageVersion.isPreRelease(): Boolean {\n if (!isStable) return true\n\n return KotlinCompilerVersion.isPreRelease() && this == LanguageVersion.LATEST_STABLE\n}\n\nfun LanguageFeature.forcesPreReleaseBinariesIfEnabled(): Boolean {\n val isFeatureNotReleasedYet = sinceVersion?.isStable != true<|endoftext|>"} {"prompt":"val sourceSetBOutputDirectory = temporaryFolder.newFolder()\n val sourceSetBInteropMetadataFiles = sourceSetB.cinteropMetadataBinaries.map { cinteropLibrary ->\n sourceSetBOutputDirectory.resolve(\"${cinteropLibrary.cinteropLibraryName}.klib\").also { file ->\n cinteropLibrary.copyTo(file)\n }\n }","completion":"assertEquals(1, sourceSetBInteropMetadataFiles.size, \"Expected only one cinterop in sourceSetB\")\n val interopB0MetadataFile = sourceSetBInteropMetadataFiles.firstOrNull { it.name == \"interopB0.klib\" }\n ?: fail(\"Failed to find 'interopB0.klib'\")\n assertZipContentEquals(<|endoftext|>"} {"prompt":"val isExact: Boolean,\n)\n\ncontext(KtAnalysisSession)\ninternal fun KtAnnotatedSymbol.resolveObjCNameAnnotation(): KtResolvedObjCNameAnnotation? {\n val annotation = annotationsList.annotations.find { it.classId?.asSingleFqName() == KonanFqNames.objCName } ?: return null","completion":"return KtResolvedObjCNameAnnotation(\n objCName = annotation.findArgument(\"name\")?.resolveStringConstantValue(),\n swiftName = annotation.findArgument(\"swiftName\")?.resolveStringConstantValue(),\n isExact = annotation.findArgument(\"exact\")?.resolveBooleanConstantValue() ?: false\n )\n}<|endoftext|>"} {"prompt":"CXType_FunctionProto(111),\n CXType_ConstantArray(112),\n CXType_Vector(113),\n CXType_IncompleteArray(114),\n CXType_VariableArray(115),\n CXType_DependentSizedArray(116),\n CXType_MemberPointer(117),\n CXType_Auto(118),","completion":"CXType_Elaborated(119),\n CXType_Pipe(120),\n CXType_OCLImage1dRO(121),\n CXType_OCLImage1dArrayRO(122),\n CXType_OCLImage1dBufferRO(123),\n CXType_OCLImage2dRO(124),<|endoftext|>"} {"prompt":"gradleVersion: GradleVersion,\n withIC: Boolean,\n ) {\n project(\n \"scriptingCustomExtension\",\n gradleVersion,\n buildOptions = defaultBuildOptions.copy(\n incremental = withIC,\n logLevel = if (withIC) LogLevel.DEBUG else defaultBuildOptions.logLevel\n )\n ) {\n val appSubproject = subProject(\"app\")","completion":"appSubproject.disableLightTreeIfNeeded()\n val bobGreetSource = appSubproject.kotlinSourcesDir().resolve(\"bob.greet\")\n val bobGreet = bobGreetSource.relativeTo(projectPath)\n val aliceGreet = appSubproject.kotlinSourcesDir().resolve(\"alice.greet\").relativeTo(projectPath)<|endoftext|>"} {"prompt":"private fun checkInlineTargetVersion(\n callableSymbol: FirCallableSymbol<*>,\n context: CheckerContext,\n reporter: DiagnosticReporter,\n element: FirElement,\n ) {\n val currentJvmTarget = context.session.jvmTargetProvider?.jvmTarget ?: return\n\n val containingClass = callableSymbol.containingClassLookupTag()","completion":"val binaryClass = if (containingClass != null) {\n val containingClassSymbol = containingClass.toFirRegularClassSymbol(context.session) ?: return\n\n @OptIn(SymbolInternals::class)\n val sourceElement = containingClassSymbol.fir.sourceElement as? KotlinJvmBinarySourceElement ?: return\n sourceElement.binaryClass\n } else {<|endoftext|>"} {"prompt":"assertEquals(2, _x.getAndIncrement())\n assertEquals(3, x)\n assertEquals(3, _x.getAndDecrement())\n assertEquals(2, x)\n assertEquals(2, _x.getAndAdd(2))\n assertEquals(4, x)\n assertEquals(7, _x.addAndGet(3))","completion":"assertEquals(7, x)\n assertEquals(8, _x.incrementAndGet())\n assertEquals(8, x)\n assertEquals(7, _x.decrementAndGet())\n assertEquals(7, x)\n assertTrue(_x.compareAndSet(7, 10))\n }\n\n fun test() {\n testGetValue()<|endoftext|>"} {"prompt":"version: Int\n ) {\n val module = testModule.toLightDependencyWithVersion(version)\n val moduleDependencies = collectDependencies(\n testModule.dependenciesSymbols,\n withVersion = version\n )\n val klibFile = module.klibFile","completion":"val testCase = makeTestCase(module.name, module.module, COMPILER_ARGS_FOR_KLIB)\n\n val compilation = LibraryCompilation(\n settings = testRunSettings,\n freeCompilerArgs = testCase.freeCompilerArgs,\n sourceModules = testCase.modules,<|endoftext|>"} {"prompt":"\/\/ KNM_K2_IGNORE\n\npackage test\n\nimport kotlin.reflect.KClass\n\nclass PropertyInitializer {\n annotation class Anno(\n val arrayWithDefault: Array = [\"a\", \"b\", \"c\"],\n val enumWithDefault: E = E.B,\n val klassWithDefault: KClass = E::class,","completion":"\/\/val klassWithDefaultDim: KClass> = Array::class,\n val annotationWithDefault: A1 = A1(E.A, E.B),\n val annotationArrayWithDefault: Array = [A1(E.A, E.B), A1(E.B, E.A)],\n val bool: Boolean = true,\n val byte: Byte = 1,<|endoftext|>"} {"prompt":"descriptorSerializerContext\n )\n )\n\n if (!usesK2) {\n registerNativeExtensions(project, descriptorSerializerContext!!)\n }\n }\n }\n\n companion object {\n fun checkCompilerVersion(configuration: CompilerConfiguration): Boolean {","completion":"val msgCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY)\n val suppressKotlinVersionCheck = configuration.get(ComposeConfiguration.SUPPRESS_KOTLIN_VERSION_COMPATIBILITY_CHECK)\n if (suppressKotlinVersionCheck != null) {\n msgCollector?.report(\n CompilerMessageSeverity.WARNING,<|endoftext|>"} {"prompt":"data class A(val x: Array, val y: IntArray)\n\nfun foo(x: Array, y: IntArray) = A(x, y)\n\nfun box(): String {\n val a = Array(0, {0})\n val b = IntArray(0)\n val (x, y) = foo(a, b)","completion":"return if (a == x && b == y) \"OK\" else \"Fail\"\n}<|endoftext|>"} {"prompt":"val future = worker.execute(TransferMode.SAFE, {}) {\n global3.value.a\n }\n\n val value = future.result\n assertEquals(3, value)\n worker.requestTermination().result\n }\n\n @Test\n fun globalOnWorkerFrozenBeforePassing() {\n assertEquals(3, global4.value.a)","completion":"global4.value.freeze()\n\n val worker = Worker.start()\n val future = worker.execute(TransferMode.SAFE, {}) {\n global4.value.a\n }\n\n val value = future.result\n assertEquals(3, value)\n worker.requestTermination().result\n }\n\n @Test\n fun globalOnWorkerFrozenBeforeAccess() {<|endoftext|>"} {"prompt":"internal fun FirCallableSymbol<*>.computeImportableName(useSiteSession: FirSession): FqName? {\n if (callableId.isLocal) return null\n\n \/\/ SAM constructors are synthetic, but can be imported\n if (origin is FirDeclarationOrigin.SamConstructor) return callableId.asSingleFqName()\n\n \/\/ if classId == null, callable is topLevel","completion":"val containingClassId = callableId.classId\n ?: return callableId.asSingleFqName()\n\n if (this is FirConstructorSymbol) return containingClassId.asSingleFqName()\n\n val containingClass = getContainingClassSymbol(useSiteSession) ?: return null\n\n \/\/ Java static members, enums, and object members can be imported<|endoftext|>"} {"prompt":"componentType == Class::class.java -> for (element in value as Array<*>) {\n v.visitClassLiteral((element as Class<*>).classLiteralValue())\n }\n Annotation::class.java.isAssignableFrom(componentType) -> for (element in value as Array<*>) {","completion":"val vv = v.visitAnnotation(componentType.classId) ?: continue\n processAnnotationArguments(vv, element as Annotation, componentType)\n }\n else -> for (element in value as Array<*>) {\n v.visit(element)\n }\n }\n v.visitEnd()\n }\n else -> {<|endoftext|>"} {"prompt":"class SamWrapperTransformer(transformationInfo: SamWrapperTransformationInfo, private val inliningContext: InliningContext) :\n ObjectTransformer(transformationInfo, inliningContext.state) {\n\n override fun doTransform(parentRemapper: FieldRemapper): InlineResult {\n val classReader = createClassReader()","completion":"val classBuilder = createRemappingClassBuilderViaFactory(inliningContext)\n\n classReader.accept(object : ClassVisitor(Opcodes.API_VERSION, classBuilder.visitor) {\n override fun visit(version: Int, access: Int, name: String, signature: String?, superName: String, interfaces: Array) {\n classBuilder.defineClass(<|endoftext|>"} {"prompt":"\"aptMode\", \"\",\n \"Annotation processing mode: only apt, only stub generation, both, or with the subsequent compilation\",\n cliToolOption = CliToolOption(\"-Kapt-mode\", VALUE)\n ),\n\n @Deprecated(\"Do not use in CLI\")","completion":"CONFIGURATION(\"configuration\", \"\", \"Encoded configuration\"),\n\n SOURCE_OUTPUT_DIR_OPTION(\n \"sources\",\n \"\",\n \"Output path for generated sources\",\n cliToolOption = CliToolOption(\"-Kapt-sources\", VALUE)\n ),\n\n CLASS_OUTPUT_DIR_OPTION(\n \"classes\",<|endoftext|>"} {"prompt":"@JvmName(\"plus\\$Int\")\npublic inline operator fun > CPointer?.plus(index: Int): CPointer? =\n this + index.toLong()\n\n@ExperimentalForeignApi\n@JvmName(\"get\\$Int\")","completion":"public inline operator fun CPointer>.get(index: Int): T =\n (this + index)!!.pointed.value\n\n@ExperimentalForeignApi\n@JvmName(\"set\\$Int\")\npublic inline operator fun CPointer>.set(index: Int, value: T) {<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses\n\/\/ FILE: a.kt\nfun box() = A(0).f()\n\n\/\/ FILE: b.kt\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class A(val i: Int)","completion":"fun A.f(xs: Array = Array(1) { \"OK\" }) = xs[i]<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.inline.InlineUtil\n\nclass LiteralFunctionTranslator(context: TranslationContext) : AbstractTranslator(context) {\n fun translate(declaration: KtDeclarationWithBody): JsExpression {\n val finalElement = declaration.finalElement\n val invokingContext = context()","completion":"val descriptor = getFunctionDescriptor(invokingContext.bindingContext(), declaration)\n\n val lambda = invokingContext.getFunctionObject(descriptor)\n\n val functionContext = invokingContext\n .newFunctionBodyWithUsageTracker(lambda, descriptor)\n .translateAndAliasParameters(descriptor, lambda.parameters)\n\n descriptor.valueParameters.forEach {<|endoftext|>"} {"prompt":"* .\/gradlew jvmRun -DmainClass=\"BarKt\"\n * ^\n * Will execute the 'src\/jvmMain\/kotlin\/Bar' main method.\n * ```\n *\/\n @ExperimentalKotlinGradlePluginApi\n fun mainRun(configure: KotlinJvmRunDsl.() -> Unit) = project.launch {","completion":"mainRun.await()?.configure()\n }\n\n var withJavaEnabled = false\n private set\n\n @Suppress(\"unused\") \/\/ user DSL\n fun withJava() {\n if (withJavaEnabled)\n return\n\n project.multiplatformExtension.targets.find { it is KotlinJvmTarget && it.withJavaEnabled }\n ?.let { existingJavaTarget -><|endoftext|>"} {"prompt":"@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun kotlin.UShortArray.reverse(): kotlin.Unit\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.UShortArray.reverse(fromIndex: kotlin.Int, toIndex: kotlin.Int): kotlin.Unit\n\npublic fun kotlin.collections.MutableList.reverse(): kotlin.Unit\n\npublic fun kotlin.Array.reversed(): kotlin.collections.List<|endoftext|>"} {"prompt":"}\n}\n\nfun equalConstants() {\n contract {\n returns() implies (null == null)\n }\n}\n\nfun get(): Int? = null\nfun equalNullWithCall() {\n contract {","completion":"returns() implies (get() == null)\n }\n}<|endoftext|>"} {"prompt":"* HELPERS: classes, objects, typealiases, enumClasses, interfaces, sealedClasses\n *\/\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1(x: Any?) {\n if (x is Int || false) {\n x","completion":"x.inv()\n }\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun case_2(x: Any) {\n if (x is Unit || false || false || false || false || false) {<|endoftext|>"} {"prompt":"}\n\n fun done() = noMoreFrames && (video?.isQueueEmpty() ?: true) && (audio?.isQueueEmpty() ?: true)\n\n fun dispose() {\n video?.dispose()\n audio?.dispose()\n }\n\n private fun needMoreFrames(): Boolean =","completion":"(video?.needMoreFrames() ?: false) || (audio?.needMoreFrames() ?: false)\n\n fun decodeIfNeeded() {\n if (!needMoreFrames()) return\n if (video?.isQueueAlmostFull() == true) return\n if (audio?.isQueueAlmostFull() == true) return\n memScoped {\n val packet = alloc()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.types.KtType\nimport org.jetbrains.kotlin.descriptors.TypeParameterDescriptor\nimport org.jetbrains.kotlin.lexer.KtTokens\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.psi.KtTypeParameter","completion":"import org.jetbrains.kotlin.resolve.BindingContext\nimport org.jetbrains.kotlin.types.Variance\nimport org.jetbrains.kotlin.types.typeUtil.isNullableAny\n\ninternal class KtFe10PsiTypeParameterSymbol(\n override val psi: KtTypeParameter,\n override val analysisContext: Fe10AnalysisContext<|endoftext|>"} {"prompt":"createNonSyntheticValue(expression, MagicKind.UNSUPPORTED_ELEMENT, left)\n }\n }\n\n private fun generateJumpsToCatchAndFinally() {\n if (catchFinallyStack.isNotEmpty()) {\n with(catchFinallyStack.peek()) {\n if (tryExpression != null) {\n onException?.let {","completion":"builder.nondeterministicJump(it, tryExpression, null)\n }\n toFinally?.let {\n builder.nondeterministicJump(it, tryExpression, null)\n }\n }\n }\n }\n }\n\n override fun visitThrowExpression(expression: KtThrowExpression) {\n mark(expression)<|endoftext|>"} {"prompt":"\"lib1\/lib1.file1.1.kt\" copyTo \"lib1.file1.kt\"\n \"lib1\/lib1.file2.kt\" copyTo \"lib1.file2.kt\"\n }\n val lib21 = compileLibrary(\"lib2\", lib11) { \"lib2\/lib2.kt\" copyTo \"lib2.kt\" }","completion":"val main1 = compileToExecutable(\"main\", lib11, lib21) { \"main\/main.kt\" copyTo \"main.kt\" }\n assertTrue(main1.executableFile.exists())\n assertTrue(lib1File1KtCacheDir.exists())\n assertTrue(lib1File2KtCacheDir.exists())\n assertTrue(lib2KtCacheDir.exists())<|endoftext|>"} {"prompt":"p00: Int, p01: Int, p02: Int, p03: Int, p04: Int, p05: Int, p06: Int, p07: Int, p08: Int, p09: Int,","completion":"p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int,<|endoftext|>"} {"prompt":"override fun conflict(first: FunctionDescriptor, second: FunctionDescriptor): Boolean =\n !mapper.canHaveSameSelector(first, second, configuration.ignoreInterfaceMethodCollisions)\n }\n\n private val methodSwiftNames = object : Mapping() {\n override fun conflict(first: FunctionDescriptor, second: FunctionDescriptor): Boolean {","completion":"if (configuration.disableSwiftMemberNameMangling) return false \/\/ Ignore all conflicts.\n return !mapper.canHaveSameSelector(first, second, configuration.ignoreInterfaceMethodCollisions)\n }\n \/\/ Note: this condition is correct but can be too strict.\n }\n\n private inner class PropertyNameMapping(val forSwift: Boolean) : Mapping() {<|endoftext|>"} {"prompt":"buildAndFail(\"assemble\", \"--continue\", buildOptions = buildOptions.copy(parallel = false)) {\n assertEqualsToFile(expectedOutputFile(\"root-with-continue\"), extractProjectsAndTheirDiagnostics())\n }\n }\n }\n\n @GradleTest\n fun testEarlyTasksMaterializationDoesntBreakReports(gradleVersion: GradleVersion) {","completion":"project(\"earlyTasksMaterializationDoesntBreakReports\", gradleVersion) {\n buildAndFail(\"assemble\") {\n assertEqualsToFile(expectedOutputFile(), extractProjectsAndTheirDiagnostics())\n }\n }\n }\n\n @GradleTest\n fun testDiagnosticsRenderingWithStacktraceOption(gradleVersion: GradleVersion) {<|endoftext|>"} {"prompt":"private inline fun convertAnyArray(classifier: KClassifier?, args: Sequence): Any? =\n if (classifier == T::class) args.toList().toTypedArray() \/\/ simple case\n else convertAnyArrayImpl(classifier, args)\n\nprivate fun convertAnyArrayImpl(classifier: KClassifier?, args: Sequence): Any? {","completion":"val elementClass = (classifier as? KClass<*>) ?: return null\n\n val argsList = args.toList()\n val result = java.lang.reflect.Array.newInstance(elementClass.java, argsList.size)\n argsList.forEachIndexed { idx, arg ->\n try {\n java.lang.reflect.Array.set(result, idx, arg)<|endoftext|>"} {"prompt":"private inner class NativeBridge(val kotlinLines: List, val nativeLines: List)\n\n override fun kotlinToNative(\n nativeBacked: NativeBacked,\n returnType: BridgedType,\n kotlinValues: List,\n independent: Boolean,","completion":"block: NativeCodeBuilder.(nativeValues: List) -> NativeExpression\n ): KotlinExpression {\n\n val kotlinLines = mutableListOf()\n val nativeLines = mutableListOf()\n\n val kotlinFunctionName = \"kniBridge${nextUniqueId++}\"<|endoftext|>"} {"prompt":"defaultFalse(\"isVar\", withGetter = true)\n defaultNull(\"receiverParameter\", \"delegate\", \"getter\", \"setter\", withGetter = true)\n }\n\n impl(namedArgumentExpression) {\n default(\"coneTypeOrNull\") {\n delegate = \"expression\"\n }\n }\n\n impl(spreadArgumentExpression) {\n default(\"isSpread\") {","completion":"value = \"true\"\n withGetter = true\n }\n default(\"coneTypeOrNull\") {\n delegate = \"expression\"\n }\n }\n\n impl(comparisonExpression) {\n default(\"coneTypeOrNull\", \"StandardClassIds.Boolean.constructClassLikeType()\")\n additionalImports(standardClassIdsType, constructClassLikeTypeImport)\n }<|endoftext|>"} {"prompt":"const val equalsWithNull2 = null == null\nconst val equalsWithNull3 = TRUE == null","completion":"const val equalsWithNull4 = STR == null<|endoftext|>"} {"prompt":"val varargElementType = valueParameter.varargElementType\n if (varargElementType != null) {\n append(\"vararg \", valueParameter.name, \": \").appendType(varargElementType)\n append(\" \/* \").appendType(valueParameter.type).append(\" *\/\")\n } else {\n append(valueParameter.name, \": \").appendType(valueParameter.type)\n }","completion":"if (valueParameter.declaresDefaultValue) {\n append(\" \/* = ... *\/\")\n }\n }\n\n private fun Printer.appendValueParameters(valueParameters: List) {\n appendCollection(valueParameters, prefix = \"(\", postfix = \")\") { renderValueParameter(it, this) }\n }<|endoftext|>"} {"prompt":" & ClassWithSixTypeParameters<*, kotlin.Nothing, *, *, kotlin.Nothing, *>\")!>x!!.ip2test()","completion":"? & InterfaceWithTwoTypeParameters<*, *> & ClassWithSixTypeParameters<*, *, *, *, *, *>\")!>x<|endoftext|>"} {"prompt":"}\n if (expression != null) {\n @Suppress(\"USELESS_IS_CHECK\") \/\/ K2 warning suppression, TODO: KT-62472\n if (expression.isNull() && expression is KtConstantExpression) {\n val factory = when (diagnostic) {\n is ArgumentNullabilityErrorDiagnostic -> NULL_FOR_NONNULL_TYPE","completion":"is ArgumentNullabilityWarningDiagnostic -> NULL_FOR_NONNULL_TYPE_WARNING\n }\n trace.reportDiagnosticOnce(factory.on(expression, diagnostic.expectedType))\n } else {\n val factory = when (diagnostic) {\n is ArgumentNullabilityErrorDiagnostic -> TYPE_MISMATCH\n is ArgumentNullabilityWarningDiagnostic -> TYPE_MISMATCH_WARNING\n }<|endoftext|>"} {"prompt":") : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.NoReflectionInClassPath\n\ninternal class SyntheticPropertyWithoutJavaOriginImpl(\n override val originalSymbol: KtFunctionLikeSymbol,\n override val functionName: Name,\n firDiagnostic: KtPsiDiagnostic,","completion":"token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.SyntheticPropertyWithoutJavaOrigin\n\ninternal class ImplementingFunctionInterfaceImpl(\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,<|endoftext|>"} {"prompt":"require(!symbol.isCopyCreatedInScope) {\n \"callableCopySubstitution was not calculated for callable copy: \" +\n \"$symbol with origin ${declaration.origin} and return type ${declaration.returnTypeRef}\"\n }\n\n return resolveDeclaration(declaration)\n }\n\n @OptIn(PrivateForInline::class)","completion":"protected open fun resolveDeclaration(declaration: FirCallableDeclaration): FirResolvedTypeRef {\n \/\/ To properly transform and resolve declaration's type, we need to use its module's session\n val session = declaration.moduleData.session\n val symbol = declaration.symbol\n\n val (designation, outerBodyResolveContext) = if (declaration in designationMapForLocalClasses) {<|endoftext|>"} {"prompt":"\/\/ FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC\n\n\/\/ TESTED_OBJECT_KIND: function\n\/\/ TESTED_OBJECTS: MyClass, testProtected$default\n\/\/ FLAGS: ACC_PUBLIC, ACC_STATIC, ACC_SYNTHETIC\n\n\/\/ TESTED_OBJECT_KIND: function","completion":"\/\/ TESTED_OBJECTS: MyClass, testPrivate$default\n\/\/ FLAGS: ACC_STATIC, ACC_SYNTHETIC<|endoftext|>"} {"prompt":"if (shouldGenerateReceiverAsSingletonReference(receiverClassDescriptor))\n generateSingletonReference(receiverClassDescriptor, defaultStartOffset, defaultEndOffset, receiver.type)\n else\n IrGetValueImpl(\n defaultStartOffset, defaultEndOffset, irReceiverType,","completion":"context.symbolTable.descriptorExtension.referenceValueParameter(receiverClassDescriptor.thisAsReceiverParameter)\n )\n }\n is ContextClassReceiver -> loadContextReceiver(receiver, defaultStartOffset, defaultEndOffset)\n is ThisClassReceiver ->\n generateThisOrSuperReceiver(receiver, receiver.classDescriptor)\n is SuperCallReceiverValue -><|endoftext|>"} {"prompt":"annotations += annotation\n }\n\n override fun visitFile(file: KlibSourceFile) {\n this.file = file\n }\n\n fun accept(visitor: KmFunctionExtension) {\n require(visitor is KlibFunctionExtensionVisitor)\n annotations.forEach(visitor::visitAnnotation)\n uniqId?.let(visitor::visitUniqId)","completion":"file?.let(visitor::visitFile)\n }\n}\n\ninternal class KlibClassExtension : KlibClassExtensionVisitor(), KmClassExtension {\n\n val annotations: MutableList = mutableListOf()\n val enumEntries: MutableList = mutableListOf()\n var uniqId: UniqId? = null<|endoftext|>"} {"prompt":"}\n\n override fun visitRegularClass(regularClass: FirRegularClass, data: CheckerContext) {\n checkers.allRegularClassCheckers.check(regularClass, data)\n }\n\n override fun visitSimpleFunction(simpleFunction: FirSimpleFunction, data: CheckerContext) {\n checkers.allSimpleFunctionCheckers.check(simpleFunction, data)\n }","completion":"override fun visitTypeAlias(typeAlias: FirTypeAlias, data: CheckerContext) {\n checkers.allTypeAliasCheckers.check(typeAlias, data)\n }\n\n override fun visitConstructor(constructor: FirConstructor, data: CheckerContext) {\n checkers.allConstructorCheckers.check(constructor, data)\n }<|endoftext|>"} {"prompt":"object Unknown : EffectiveVisibility(\"unknown\") {\n override fun relation(other: EffectiveVisibility, typeCheckerContextProvider: TypeCheckerProviderContext): Permissiveness =\n if (other == Unknown)\n Permissiveness.SAME\n else\n Permissiveness.UNKNOWN\n\n override fun toVisibility(): Visibility = Visibilities.Unknown\n }\n\n \/\/ Private with File container","completion":"object PrivateInFile : EffectiveVisibility(\"private-in-file\", privateApi = true) {\n override fun relation(other: EffectiveVisibility, typeCheckerContextProvider: TypeCheckerProviderContext): Permissiveness =\n when (other) {\n this -> Permissiveness.SAME\n PrivateInClass, Local -> Permissiveness.MORE\n else -> Permissiveness.LESS\n }<|endoftext|>"} {"prompt":"assertFalse(eqByteQChar(0.toByte(), 1.toChar()))\n assertFalse(eqByteQChar(1.toByte(), 0.toChar()))\n assertFalse(eqByteQChar(1.toByte(), 1.toChar()))\n assertFalse(eqByteQChar(null, 0.toChar()))\n assertFalse(eqByteQChar(null, 1.toChar()))","completion":"assertFalse(eqByteQChar(undefined, 0.toChar()))\n assertFalse(eqByteQChar(undefined, 1.toChar()))\n assertFalse(eqByteQCharQ(0.toByte(), 0.toChar()))\n assertFalse(eqByteQCharQ(0.toByte(), 1.toChar()))\n assertFalse(eqByteQCharQ(0.toByte(), null))<|endoftext|>"} {"prompt":"@Suppress(\"UNCHECKED_CAST\")\n override val compilations: NamedDomainObjectContainer\n get() = super.compilations as NamedDomainObjectContainer\n\n @ExperimentalKotlinGradlePluginApi\n override val compilerOptions: KotlinJvmCompilerOptions\n get() = super.compilerOptions as KotlinJvmCompilerOptions\n}","completion":"fun ExternalKotlinTargetDescriptorBuilder.defaults() {\n targetName = \"fake\"\n platformType = KotlinPlatformType.jvm\n targetFactory = TargetFactory(::FakeTarget)\n}\n\nfun ExternalKotlinCompilationDescriptorBuilder.defaults(\n kotlin: KotlinMultiplatformExtension,<|endoftext|>"} {"prompt":"private val autoCacheDir: File get() = buildDir.resolve(\"__auto_cache__\")\n private val icCacheDir: File get() = buildDir.resolve(\"__ic_cache__\")\n private val cacheFlavor: String\n get() = CacheMode.computeCacheDirName(\n testRunSettings.get().testTarget,\n \"STATIC\",","completion":"testRunSettings.get() == OptimizationMode.DEBUG,\n partialLinkageEnabled = false\n )\n\n private fun getLibraryFileCache(libName: String, libFileRelativePath: String, fqName: String): File {\n val libCacheDir = icCacheDir.resolve(cacheFlavor).resolve(\"$libName-per-file-cache\")<|endoftext|>"} {"prompt":"\/\/ library.kt:24 box: mainVar:int=1:int, $i$f$flaf:int=0:int, flafVar$iv:int=1:int, fooParam\\1$iv:int=1:int, $i$f$foo\\1\\40:int=0:int, fooVar\\1$iv:int=1:int,","completion":"bazParam\\2$iv:int=1:int, $i$f$baz\\2\\97:int=0:int, bazVar\\2$iv:int=3:int, baz1Param\\3$iv:int=1:int, $i$f$baz1\\3\\108:int=0:int, baz1Var\\3$iv:int=3:int,<|endoftext|>"} {"prompt":"@Suppress(\"UNCHECKED_CAST\")\n override fun transform(transformer: FirTransformer, data: D): E =\n transformer.transformElvisExpression(this, data) as E\n\n abstract override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?)","completion":"abstract override fun replaceAnnotations(newAnnotations: List)\n\n abstract override fun replaceCalleeReference(newCalleeReference: FirReference)\n\n abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirElvisExpression<|endoftext|>"} {"prompt":"val f: () -> Unit = {\n require(b)\n x.value.length\n require(c)\n x.value.length\n }\n b = true\n f()\n}\n\nfun testRequireNotNullViaVariableLambda(x: String?) {","completion":"val a = x != null\n var b = a\n val c = b\n callLambdaWithoutContract { b = true }\n require(b)\n x.length\n require(c)\n x.length\n}<|endoftext|>"} {"prompt":"private object B252 { val a = B251.a + Random.nextInt(100) }\nprivate object B253 { val a = B252.a + Random.nextInt(100) }\nprivate object B254 { val a = B253.a + Random.nextInt(100) }\nprivate object B255 { val a = B254.a + Random.nextInt(100) }","completion":"private object B256 { val a = B255.a + Random.nextInt(100) }\nprivate object B257 { val a = B256.a + Random.nextInt(100) }\nprivate object B258 { val a = B257.a + Random.nextInt(100) }\nprivate object B259 { val a = B258.a + Random.nextInt(100) }<|endoftext|>"} {"prompt":"if (a.e !== null) a.e.equals(null)\n if (a.e !== null) a.e.propT","completion":"if (a.e !== null) a.e.propAny\n if (a.e !== null) a.e.propNullableT<|endoftext|>"} {"prompt":"use(a, b, c, d, e, f, g, r)\n}\n\nfun use(vararg a: Any?) = a\n\ninterface Inv\n\nfun exactBound(t: T, l: Inv): T = throw Exception(\"$t $l\")","completion":"fun testExactBound(invS: Inv, invI: Inv, invB: Inv) {\n exactBound(1, invS)\n exactBound(1, invI)\n\n val b = exactBound(1, invB)\n b checkType { _() }\n}\n\ninterface Cov<|endoftext|>"} {"prompt":"const val NOENDORSEDLIBS = \"no-endorsed-libs\"\nconst val PURGE_USER_LIBS = \"Xpurge-user-libs\"\nconst val TEMP_DIR = \"Xtemporary-files-dir\"\nconst val PROJECT_DIR = \"Xproject-dir\"\nconst val NOPACK = \"nopack\"","completion":"const val COMPILE_SOURCES = \"Xcompile-source\"\nconst val SHORT_MODULE_NAME = \"Xshort-module-name\"\nconst val FOREIGN_EXCEPTION_MODE = \"Xforeign-exception-mode\"\nconst val DUMP_BRIDGES = \"Xdump-bridges\"<|endoftext|>"} {"prompt":")\n\n private val unstableFeaturesHint = \"The dependent $unitName must enable all unstable language features that its dependency has.\"\n\n private val unstableFeaturesCheck = ConsistencyCheck?>(\n name = \"unstable language feature set\",\n getValue = { unit ->\n unit.languageSettings().getValueIfExists {\n enabledLanguageFeatures","completion":".mapNotNull { parseLanguageFeature(it) }\n .filterTo(mutableSetOf()) { it.kind == LanguageFeature.Kind.UNSTABLE_FEATURE }\n }\n },\n leftExtendsRightConsistently = { left, right ->\n if (left == null || right == null) true else left.containsAll(right)\n },<|endoftext|>"} {"prompt":"* Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.\n * The shift distance actually used is therefore always in the range `0..31`.\n *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public infix fun shr(bitCount: Int): Int\n\n \/**","completion":"* Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros.\n *\n * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.\n * The shift distance actually used is therefore always in the range `0..31`.\n *\/\n @kotlin.internal.IntrinsicConstEvaluation<|endoftext|>"} {"prompt":"fun test(notRange1: NotRange1, notRange2: NotRange2, notRange3: NotRange3, notRange4: NotRange4, notRange5: NotRange5, notRange6: NotRange6, notRange7: NotRange7, notRange8: NotRange8, range0: Range0, range1: Range1) {","completion":"for (i in notRange1);\n for (i in notRange2);\n for (i in notRange3);<|endoftext|>"} {"prompt":"\/\/ Add the abstract function symbol to stub function for bridge lowering\n overriddenSymbols = listOf(function.symbol)\n parent = irClass\n dispatchReceiverParameter = function.dispatchReceiverParameter?.copyWithSubstitution(this, substitutionMap)\n extensionReceiverParameter = function.extensionReceiverParameter?.copyWithSubstitution(this, substitutionMap)","completion":"valueParameters = function.valueParameters.map { it.copyWithSubstitution(this, substitutionMap) }\n body = createThrowingStubBody(context, this)\n }\n }\n\n private fun liftStubMethodReturnType(function: IrSimpleFunction): IrType {\n val klass = when (function.name.asString()) {\n \"iterator\" -> context.ir.symbols.iterator<|endoftext|>"} {"prompt":"$i$f$baz1\\18\\108:int=0:int, baz1Var\\18:int=3:int, baz1BlockParam\\20:int=1:int, $i$a$-baz1-LibraryKt$inlineCall$1\\20\\111\\17:int=0:int, baz1LambdaVar\\20:int=1:int,","completion":"baz1Param\\21:int=2:int, $i$f$baz1\\21\\118:int=0:int, baz1Var\\21:int=3:int, baz2Param\\22:int=1:int, $i$f$baz2\\22\\129:int=0:int<|endoftext|>"} {"prompt":"it.patchDeclarationParents(ownerFn.parent)\n it.copyAttributes(property)\n }\n }\n }\n } else if (ownerFn.needsComposableRemapping()) {\n if (symbolRemapper.getReferencedSimpleFunction(ownerFn.symbol) == ownerFn.symbol) {\n \/\/ Not remapped yet, so remap now.","completion":"\/\/ Remap only once to avoid IdSignature clash (on k\/js 1.7.20).\n symbolRemapper.visitSimpleFunction(ownerFn)\n visitSimpleFunction(ownerFn).also {\n it.correspondingPropertySymbol = null\n it.patchDeclarationParents(ownerFn.parent)\n }\n }\n }<|endoftext|>"} {"prompt":"elementType,\n get(elementType, scope, parcelizeType, strict())\n )\n )\n }\n\n in supportedByListSerializer -> {\n val elementType = (irType as IrSimpleType).arguments.single().upperBound(irBuiltIns)\n if (!scope.hasCustomSerializer(elementType) &&\n classifierFqName in supportedBySimpleListSerializer\n ) {","completion":"val elementTypeAsString = elementType.erasedUpperBound.fqNameWhenAvailable?.asString()\n val simpleSerializer =\n if (classifierFqName in BuiltinParcelableTypes.IMMUTABLE_LIST_FQNAMES) {\n when (elementTypeAsString) {\n \"android.os.IBinder\" -> iBinderPersistentListSerializer<|endoftext|>"} {"prompt":"directLibs.mapNotNull { SearchRoot.lookUpByAbsolutePath(File(it)) }.flatMap { libraryComponentBuilder(it, false) }\n }\n\n override val searchRoots: List by lazy {\n val searchRoots = mutableListOf()\n\n \/\/ Current working dir:","completion":"searchRoots += currentDirHead?.let { SearchRoot(searchRootPath = it, allowLookupByRelativePath = true) }\n\n \/\/ Custom repositories (deprecated, to be removed):\n \/\/ TODO: remove after 2.0, KT-61098<|endoftext|>"} {"prompt":"fun foo21(x: K?): Foo>> = materialize()\nfun foo22(x: K?): Foo>> = materialize()\nfun foo23(x: K?): Foo>> = materialize()","completion":"fun foo24(x: K?): Foo>> = materialize()\n\nfun foo25(x: K?): Bar = materialize()\nfun foo26(x: K?): Foo>> = materialize()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.symbols.KtFunctionSymbol\nimport org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest\nimport org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider\nimport org.jetbrains.kotlin.analysis.utils.printer.prettyPrint","completion":"import org.jetbrains.kotlin.psi.KtClassOrObject\nimport org.jetbrains.kotlin.test.services.TestServices\nimport org.jetbrains.kotlin.test.services.assertions\nimport org.jetbrains.kotlin.types.Variance\nimport kotlin.collections.single<|endoftext|>"} {"prompt":"override fun isNewPlaceForBodyGeneration(classProto: ProtoBuf.Class): Boolean =\n JvmFlags.IS_COMPILED_IN_JVM_DEFAULT_MODE.get(classProto.getExtension(JvmProtoBuf.jvmClassFlags))\n\n override fun getPackage(fqName: FqName): FqName? =","completion":"javaFacade.getPackage(fqName)\n\n private fun loadAnnotationsFromClassFile(\n kotlinClass: KotlinClassFinder.Result.KotlinClass,\n symbol: FirRegularClassSymbol\n ) {\n val annotations = mutableListOf()\n var hasPublishedApi = false<|endoftext|>"} {"prompt":"override fun getTargetDescriptors(context: BindingContext): Collection {\n return listOfNotNull(\n context[BindingContext.VARIABLE, element],\n context[BindingContext.COMPONENT_RESOLVED_CALL, element]?.candidateDescriptor\n )\n }","completion":"override fun getRangeInElement() = TextRange(0, element.textLength)\n\n override fun isReferenceToImportAlias(alias: KtImportAlias): Boolean {\n return super.isReferenceToImportAlias(alias)\n }\n\n override fun canRename(): Boolean {<|endoftext|>"} {"prompt":"override val reason: String get() = \"Unresolved name: $prettyReference\"\n\n private val prettyReference: String\n get() = when (val token = operatorToken) {\n null -> name.toString()\n else -> \"$name ($token)\"\n }\n}\n\nclass ConeFunctionCallExpectedError(\n val name: Name,\n val hasValueParameters: Boolean,","completion":"override val candidates: Collection\n) : ConeDiagnosticWithCandidates {\n override val reason: String get() = \"Function call expected: $name(${if (hasValueParameters) \"...\" else \"\"})\"\n}\n\nclass ConeFunctionExpectedError(val expression: String, val type: ConeKotlinType) : ConeDiagnostic {<|endoftext|>"} {"prompt":"\/\/ Run Kotlin compiler benchmarks (https:\/\/github.com\/Kotlin\/kotlin-benchmarks)\n\/\/ with compiler built from your changes if you are not sure.\n\nfun box(): String {\n for ((index, x) in \"\".withIndex()) {\n return \"Loop over empty String should not be executed\"\n }\n return \"OK\"\n}\n\n\/\/ 0 withIndex\n\/\/ 0 iterator\n\/\/ 0 hasNext","completion":"\/\/ 0 next\n\/\/ 0 component1\n\/\/ 0 component2\n\/\/ 1 length\n\/\/ 1 charAt\n\n\/\/ The ICONST_0 is for initializing the index in the lowered for-loop.\n\/\/ 1 ICONST_0\n\n\/\/ JVM_IR_TEMPLATES\n\/\/ 4 ILOAD\n\/\/ 4 ISTORE\n\/\/ 0 IADD\n\/\/ 0 ISUB\n\/\/ 0 IINC<|endoftext|>"} {"prompt":"@PublishedApi\ninternal class KMutableProperty0Impl(override val name: String, override val getter: KFunction0, val setter: (R) -> Unit)\n : KProperty0ImplBase(), KMutableProperty0 {\n override fun set(value: R): Unit {\n setter(value)\n }","completion":"override fun equals(other: Any?): Boolean {\n val otherKProperty = other as? KMutableProperty0Impl<*>\n if (otherKProperty == null) return false\n return name == otherKProperty.name && getter == otherKProperty.getter && setter == otherKProperty.setter\n }\n\n override fun hashCode(): Int {<|endoftext|>"} {"prompt":"BlockOrBody.Body(this).makeBodyWithAddedVariables(context, variables, symbol) as IrBody\n\n\/**\n * Adds declarations of the variables to the most narrow possible block or body.\n * It adds them before the first usage within the block and inlines initialization of them when possible.\n *\/","completion":"private fun BlockOrBody.makeBodyWithAddedVariables(context: JvmBackendContext, variables: Set, symbol: IrSymbol): IrElement {\n if (variables.isEmpty()) return element\n extractVariablesSettersToOuterPossibleBlock(variables)\n val nearestBlocks = findNearestBlocksForVariables(variables, this)<|endoftext|>"} {"prompt":"@file:Suppress(\"NO_EXPLICIT_VISIBILITY_IN_API_MODE\", \"NO_EXPLICIT_RETURN_TYPE_IN_API_MODE\") \/\/ TODO: Fix in dukat: https:\/\/github.com\/Kotlin\/dukat\/issues\/124\n\npackage org.w3c.dom\n\nimport kotlin.js.*\nimport org.khronos.webgl.*","completion":"import org.w3c.dom.clipboard.*\nimport org.w3c.dom.css.*\nimport org.w3c.dom.encryptedmedia.*\nimport org.w3c.dom.events.*\nimport org.w3c.dom.mediacapture.*\nimport org.w3c.dom.mediasource.*\nimport org.w3c.dom.pointerevents.*<|endoftext|>"} {"prompt":"x.equals(10)\n }\n}\n\n\/*\n * TESTCASE NUMBER: 16\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-28430\n *\/","completion":"fun case_16(x: Nothing?) {\n x\n x?.equals(10)<|endoftext|>"} {"prompt":"}\n\n val historyFiles = when (historyFilesEither) {\n is Either.Success> -> historyFilesEither.value\n is Either.Error -> {\n reporter.info { \"Could not find history files: ${historyFilesEither.reason}\" }\n return ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_HISTORY_IS_NOT_FOUND)\n }\n }","completion":"fun analyzeHistoryFiles(): ChangesEither {\n for (historyFile in historyFiles) {\n val allBuilds = BuildDiffsStorage.readDiffsFromFile(historyFile, reporter = reporter)\n ?: return run {\n reporter.info { \"Could not read diffs from $historyFile\" }\n ChangesEither.Unknown(BuildAttribute.DEP_CHANGE_HISTORY_CANNOT_BE_READ)\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers\n\nimport org.gradle.api.Project\nimport org.jetbrains.kotlin.commonizer.CommonizerOutputFileLayout.resolveCommonizedDirectory\nimport org.jetbrains.kotlin.commonizer.SharedCommonizerTarget","completion":"import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinDependency\nimport org.jetbrains.kotlin.gradle.idea.tcs.extras.isCommonized\nimport org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet<|endoftext|>"} {"prompt":"public actual inline fun String.toByte(radix: Int): Byte = java.lang.Byte.parseByte(this, checkRadix(radix))\n\n\n\/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n *\/\n@kotlin.internal.InlineOnly","completion":"public actual inline fun String.toShort(): Short = java.lang.Short.parseShort(this)\n\n\/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n *\/<|endoftext|>"} {"prompt":"fun report(name: String, infos: List, allModules: Collection): Nothing {\n val message = \"$name does not know how to resolve\"\n val error = when {\n name.contains(ResolverForProject.resolverForSdkName) -> errorInSdkResolver(message)","completion":"name.contains(ResolverForProject.resolverForLibrariesName) -> errorInLibrariesResolver(message)\n name.contains(ResolverForProject.resolverForModulesName) -> {\n when {\n infos.isEmpty() -> errorInModulesResolverWithEmptyInfos(message)\n infos.size == 1 -> {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.psi.KtFile\nimport org.jetbrains.kotlin.resolve.CliSealedClassInheritorsProvider\nimport org.jetbrains.kotlin.resolve.CompilerEnvironment\nimport org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices","completion":"import org.jetbrains.kotlin.resolve.constants.EnumValue\nimport org.jetbrains.kotlin.resolve.descriptorUtil.annotationClass\nimport org.jetbrains.kotlin.resolve.descriptorUtil.module\nimport org.jetbrains.kotlin.resolve.jvm.JvmPlatformParameters<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.resolve.dfa\n\nimport kotlinx.collections.immutable.*\nimport org.jetbrains.kotlin.fir.FirSession\nimport org.jetbrains.kotlin.fir.types.*\nimport org.jetbrains.kotlin.types.AbstractTypeChecker\nimport java.util.*","completion":"import kotlin.math.max\n\nabstract class LogicSystem(private val context: ConeInferenceContext) {\n val session: FirSession get() = context.session\n private val nullableNothingType = session.builtinTypes.nullableNothingType.type\n private val anyType = session.builtinTypes.anyType.type\n\n abstract val variableStorage: VariableStorageImpl<|endoftext|>"} {"prompt":"? & T\")!>x.toByte()\n }\n}\n\n\/*\n * TESTCASE NUMBER: 9\n * ISSUES: KT-1982\n *\/","completion":"inline fun case_9(x: T) {\n if (x is Int? || x is Float?) {\n & T\")!>x<|endoftext|>"} {"prompt":"trace.report(Errors.ANNOTATION_ARGUMENT_KCLASS_LITERAL_OF_TYPE_PARAMETER.on(argumentExpression))\n }\n }\n }\n }\n\n private fun reportDeprecationWarningOnNonConst(expression: KtExpression, trace: BindingTrace) {","completion":"trace.report(Errors.ANNOTATION_ARGUMENT_IS_NON_CONST.on(expression))\n }\n\n private fun getArgumentExpressionsForArrayCall(\n expression: KtCallExpression,\n trace: BindingTrace\n ): List? {\n val resolvedCall = expression.getResolvedCall(trace.bindingContext) ?: return null<|endoftext|>"} {"prompt":"fun T.case_5_4(): Boolean? {\n contract { returns(null) implies (this@case_5_4 !is Int || this@case_5_4 == null) }","completion":"return if (this@case_5_4 !is Int || this@case_5_4 == null) null else true\n}\n\n\/\/ TESTCASE NUMBER: 6\ninline fun T?.case_6_1(): Boolean {<|endoftext|>"} {"prompt":"graphBuilder.exitTypeOperatorCall(typeOperatorCall).mergeIncomingFlow { _, flow ->\n if (typeOperatorCall.operation !in FirOperation.TYPES) return@mergeIncomingFlow\n addTypeOperatorStatements(flow, typeOperatorCall)\n }\n }","completion":"private fun addTypeOperatorStatements(flow: MutableFlow, typeOperatorCall: FirTypeOperatorCall) {\n val type = typeOperatorCall.conversionTypeRef.coneType\n val operandVariable = getOrCreateVariableIfRealAndStable(flow, typeOperatorCall.argument) ?: return\n when (val operation = typeOperatorCall.operation) {<|endoftext|>"} {"prompt":"override fun createDelegatingTestReportProcessor(origin: TestResultProcessor, targetName: String) =\n object : TestResultProcessor by origin {\n override fun started(test: TestDescriptorInternal, event: TestStartEvent) {\n val myTest = object : TestDescriptorInternal by test {\n override fun getDisplayName(): String = \"${test.displayName}[$targetName]\"","completion":"override fun getClassName(): String? = test.className?.replace('$', '.')\n override fun getClassDisplayName(): String? = test.classDisplayName?.replace('$', '.')\n }\n origin.started(myTest, event)\n }\n }\n}<|endoftext|>"} {"prompt":"abstract override fun replaceContextReceivers(newContextReceivers: List)\n\n abstract override fun replaceControlFlowGraphReference(newControlFlowGraphReference: FirControlFlowGraphReference?)\n\n abstract override fun replaceValueParameters(newValueParameters: List)\n\n abstract override fun replaceContractDescription(newContractDescription: FirContractDescription?)","completion":"abstract override fun replaceAnnotations(newAnnotations: List)\n\n abstract fun replaceDelegatedConstructor(newDelegatedConstructor: FirDelegatedConstructorCall?)\n\n abstract override fun replaceBody(newBody: FirBlock?)\n\n abstract override fun transformTypeParameters(transformer: FirTransformer, data: D): FirConstructor<|endoftext|>"} {"prompt":"y\n y.length\n }\n }\n init { }\n}\n\n\/*\n * TESTCASE NUMBER: 4","completion":"* UNEXPECTED BEHAVIOUR\n * ISSUES: KT-17694\n *\/\nclass Case4 {\n init {\n var y: String? = \"xyz\"\n if (y != null) {\n y<|endoftext|>"} {"prompt":"}\n\n is NullForNotNullType -> FirErrors.NULL_FOR_NONNULL_TYPE.createOn(\n rootCause.argument.source ?: source, rootCause.expectedType.removeTypeVariableTypes(typeContext)\n )","completion":"is NonVarargSpread -> FirErrors.NON_VARARG_SPREAD.createOn(rootCause.argument.source?.getChild(KtTokens.MUL, depth = 1)!!)\n is ArgumentPassedTwice -> FirErrors.ARGUMENT_PASSED_TWICE.createOn(rootCause.argument.source)<|endoftext|>"} {"prompt":"expressionType: KotlinType,\n dataFlowExtras: DataFlowExtras\n ): RuntimeAssertionInfo? {\n fun assertNotNull(): Boolean {\n if (expectedType.isError || expressionType.isError) return false\n\n \/\/ T : Any, T! = T..T?\n \/\/ Let T$ will be copy of T! with enhanced nullability.","completion":"\/\/ Cases when nullability assertion needed: T! -> T, T$ -> T\n\n \/\/ Expected type either T?, T! or T$\n if (TypeUtils.isNullableType(expectedType) ||\n expectedType.hasEnhancedNullability() ||\n expectedType.isNullableUnderlyingType()\n ) {\n return false\n }<|endoftext|>"} {"prompt":"* This function tries to find the solution (set of constraints) that is consistent with some branch of each fork\n * And those constraints are being immediately applied to the system\n *\/\n override fun resolveForkPointsConstraints() {\n if (constraintsFromAllForkPoints.isEmpty()) return\n val allForkPointsData = constraintsFromAllForkPoints.toList()","completion":"constraintsFromAllForkPoints.clear()\n\n \/\/ There may be multiple fork points:\n \/\/ - One from subtyping A & A <: A\n \/\/ - Another one from B & B <: B\n \/\/ Each of them defines two sets of constraints, e.g. for the first for point:<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ ISSUE: KT-38667\n\ninterface PropKey\nabstract class AnimationBuilder\nclass TransitionSpec {\n fun tween(init: AnimationBuilder.() -> Unit): AnimationBuilder = TODO()\n fun PropKey.using(builder: AnimationBuilder) {}\n}","completion":"class TransitionDefinition {\n fun transition(fromState: X, init: TransitionSpec.() -> Unit) {}\n}\n\nfun transitionDefinition(init: TransitionDefinition.() -> Unit) {}\n\nfun main(intProp: PropKey, w: Int) {\n transitionDefinition {\n transition(w) {\n intProp.using(tween {})<|endoftext|>"} {"prompt":"val dependents = allCinteropCommonizerDependents()\n\n val allScopeSets = dependents.map { it.scopes }.toSet()\n val rootScopeSets = allScopeSets.filter { scopeSet ->\n allScopeSets.none { otherScopeSet -> otherScopeSet != scopeSet && otherScopeSet.containsAll(scopeSet) }\n }","completion":"return rootScopeSets.map { scopeSet ->\n val dependentsForScopes = dependents.filter { dependent ->\n scopeSet.containsAll(dependent.scopes)\n }\n\n CInteropCommonizerGroup(\n targets = dependentsForScopes.map { it.target }.toSet(),<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType\nimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation\nimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinTargetWithBinaries\nimport org.jetbrains.kotlin.gradle.plugin.mpp.isMain","completion":"import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode\nimport org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode.DEVELOPMENT<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.commonizer.hierarchical\n\nimport org.jetbrains.kotlin.commonizer.AbstractInlineSourcesCommonizationTest\nimport org.jetbrains.kotlin.commonizer.parseCommonizerTarget\nimport org.jetbrains.kotlin.commonizer.utils.InlineSourceBuilder","completion":"import org.jetbrains.kotlin.commonizer.withAllLeaves\n\ninternal fun AbstractInlineSourcesCommonizationTest.ParametersBuilder.registerFakeStdlibIntegersDependency(vararg outputTarget: String) {\n val allTargets = outputTarget.map { parseCommonizerTarget(it) }.withAllLeaves()\n registerDependency(*allTargets.toTypedArray()) {<|endoftext|>"} {"prompt":"val newDeclaration = super.lowerDictionaryDeclaration(declaration, owner)\n return newDeclaration.copy(\n parents = declaration.parents.mapNotNull { resolveInheritance(it) }\n )\n }\n\n override fun lowerFileDeclaration(fileDeclaration: IDLFileDeclaration): IDLFileDeclaration {\n currentFile = fileDeclaration","completion":"var newFileDeclaration = super.lowerFileDeclaration(fileDeclaration)\n newFileDeclaration = newFileDeclaration.copy(\n declarations = newFileDeclaration.declarations + anonymousDeclarationsToAdd\n )\n anonymousDeclarationsToAdd.clear()\n return newFileDeclaration\n }<|endoftext|>"} {"prompt":"todo() ?: \"\"\n}\n\nfun testElvis2(s: String?) {\n s ?: todo()\n\n bar()\n}\n\nfun testAnd1(b: Boolean) {\n b && todo()\n\n bar()\n}","completion":"fun testAnd2(b: Boolean) {\n todo() && b\n}\n\nfun returnInBinary1(): Boolean {\n (return true) && (return false)\n}\n\nfun returnInBinary2(): Boolean {<|endoftext|>"} {"prompt":"basedir.visitFileTree(visitor, followLinks = true)\n assertTrue(didFollowLinks)\n }\n\n @Test\n fun copyRecursively() {\n val srcRoot = createTestFiles().cleanupRecursively()\n val dstRoot = createTempDirectory().cleanupRecursively()\n\n srcRoot.resolve(\"1\/2\/.dir\").createDirectory()","completion":"srcRoot.resolve(\"1\/3\/.file\").createFile()\n\n srcRoot.visitFileTree {\n onPreVisitDirectory { directory, _ ->\n if (directory.name.startsWith(\".\")) {\n FileVisitResult.SKIP_SUBTREE\n } else {\n if (directory != srcRoot) {<|endoftext|>"} {"prompt":"?: (System.getProperty(\"user.home\") + File.separator + \".konan\")\n )\n }\n\n fun getDependenciesRoot(konanDataDir: String? = null): File {\n return getLocalKonanDir(konanDataDir).resolve(DEPENDENCIES_FOLDER_NAME)\n }","completion":"fun getDependencyCacheDir(konanDataDir: String? = null): File {\n return getLocalKonanDir(konanDataDir).resolve(CACHE_FOLDER_NAME)\n }\n}<|endoftext|>"} {"prompt":"if (checkedTypes.contains(typeWithIsNegation)) {\n trace.report(Errors.DUPLICATE_LABEL_IN_WHEN.on(typeReference))\n } else {\n checkedTypes.add(typeWithIsNegation)\n }\n }\n else -> {\n }\n }\n }\n }\n }","completion":"private fun CompileTimeConstant<*>.isTrivial(\n expression: KtExpression,\n languageVersionSettings: LanguageVersionSettings\n ): Boolean {\n if (usesVariableAsConstant) return false\n if (!languageVersionSettings.supportsFeature(LanguageFeature.ProhibitSimplificationOfNonTrivialConstBooleanExpressions)) {<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1294\n\/*\n * Copy of JVM-backend test\n * Found at: compiler\/testData\/codegen\/boxInline\/simple\/simpleDouble.1.kt\n *\/\n\npackage foo\n\nclass InlineDouble(val res : Double) {\n\n inline fun foo(s : () -> Double) : Double {\n val f = \"fooStart\"","completion":"val z = s()\n return z\n }\n\n inline fun foo11(s : (l: Double) -> Double) : Double {\n return s(11.0)\n }\n\n inline fun fooRes(s : (l: Double) -> Double) : Double {\n val z = s(res)\n return z\n }<|endoftext|>"} {"prompt":"assertTrue(set3.isEmpty(), \"Array doesn't have contains, equality contains is used instead\")\n }\n\n @Test fun flatMap() {\n val data = listOf(\"\", \"foo\", \"bar\", \"x\", \"\")\n val characters = data.flatMap { it.toList() }\n println(\"Got list of characters ${characters}\")\n assertEquals(7, characters.size)","completion":"val text = characters.joinToString(\"\")\n assertEquals(\"foobarx\", text)\n }\n\n\n @Test fun filterIntoLinkedList() {\n val data = listOf(\"foo\", \"bar\")\n val foo = data.filterTo(LinkedList()) { it.startsWith(\"f\") }\n\n assertTrue {<|endoftext|>"} {"prompt":"\"must\": [ ${it(featureValue)} ]\n }\n }, \"\"\"\n } }\n ${filteredBuilds.str { builds ->\n \"\"\"\n \"aggs\" : {\n \"builds\": {\n \"filters\" : { \n \"filters\": {","completion":"${builds.map { \"\\\"${it.second}\\\": { \\\"match\\\" : { \\\"buildNumber\\\" : \\\"${it.second}\\\" }}\" }\n .joinToString(\",\\n\")}\n }\n },\"\"\"\n } }\n \"aggs\" : {\n \"metric_build\" : {\n \"nested\" : {\n \"path\" : \"benchmarks\"\n },<|endoftext|>"} {"prompt":"args.classpathAsList, changedFiles, lastBuildInfo, modulesApiHistory, reporter, abiSnapshots, withAbiSnapshot,\n caches.platformCache, scopes\n )\n }\n is NotAvailableForJSCompiler -> error(\"Unexpected type for this code path: ${classpathChanges.javaClass.name}.\")\n }\n\n when (changedAndImpactedSymbols) {","completion":"is ChangesEither.Unknown -> {\n reporter.info { \"Could not get classpath changes: ${changedAndImpactedSymbols.reason}\" }\n return CompilationMode.Rebuild(changedAndImpactedSymbols.reason)\n }\n is ChangesEither.Known -> {\n dirtyFiles.addByDirtySymbols(changedAndImpactedSymbols.lookupSymbols)<|endoftext|>"} {"prompt":"enum class JvmTarget(val target: String) {\n JVM_1_8(\"1.8\"),\n JVM_9(\"9\"),\n JVM_10(\"10\"),\n JVM_11(\"11\"),\n JVM_12(\"12\"),\n JVM_13(\"13\"),\n JVM_14(\"14\"),\n JVM_15(\"15\"),\n JVM_16(\"16\"),","completion":"JVM_17(\"17\"),\n JVM_18(\"18\"),\n JVM_19(\"19\"),\n JVM_20(\"20\"),\n JVM_21(\"21\"),\n JVM_22(\"22\"),\n ;\n\n companion object {\n @JvmStatic\n fun fromTarget(target: String): JvmTarget =<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.load.java.lazy.LazyJavaResolverContext\nimport org.jetbrains.kotlin.lombok.config.AccessLevel\nimport org.jetbrains.kotlin.lombok.config.LombokAnnotations.With\nimport org.jetbrains.kotlin.lombok.config.toDescriptorVisibility","completion":"import org.jetbrains.kotlin.lombok.utils.*\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.types.typeUtil.isBoolean\n\nclass WithProcessor : Processor {\n override fun contribute(classDescriptor: ClassDescriptor, partsBuilder: SyntheticPartsBuilder, c: LazyJavaResolverContext) {<|endoftext|>"} {"prompt":"is DebugInfoDiagnosticFactory1 -> DiagnosticWithParameters1Renderer(\n \"{0}\",\n Renderers.TO_STRING\n ) as DiagnosticRenderer\n else -> DefaultErrorMessages.getRendererForDiagnostic(codeMetaInfo.diagnostic)\n }\n if (renderer is AbstractDiagnosticWithParametersRenderer) {","completion":"renderer.renderParameters(codeMetaInfo.diagnostic).mapTo(params) {\n it.toString().replace(\"\\\"\", \"\\\\\\\"\")\n }\n }\n if (renderSeverity)\n params.add(\"severity='${codeMetaInfo.diagnostic.severity}'\")\n\n params.add(getAdditionalParams(codeMetaInfo))<|endoftext|>"} {"prompt":"val dir = createTestFiles().cleanupRecursively()\n val link = createTempDirectory().cleanupRecursively().resolve(\"link\").tryCreateSymbolicLinkTo(dir) ?: return\n\n link.deleteRecursively()\n assertFalse(link.exists(LinkOption.NOFOLLOW_LINKS))","completion":"testVisitedFiles(listOf(\"\") + referenceFilenames, dir.walkIncludeDirectories(), dir)\n }\n\n @Test\n fun deleteSymlinkToFile() {\n val file = createTempFile().cleanup()\n val dir = createTestFiles().cleanupRecursively().also { it.resolve(\"8\/link\").tryCreateSymbolicLinkTo(file) ?: return }<|endoftext|>"} {"prompt":"assertFailsWith {\n \"[a-z](? !\\\\d)\".toRegex(RegexOption.COMMENTS) \/\/ (?!X) - ?! shouldn't be separated\n }\n }\n\n @Test fun matchNamedGroupInCommentsMode() {\n assertFailsWith {","completion":"\"(? \\\\d+)\".toRegex(RegexOption.COMMENTS) \/\/ (?X) - ?< shouldn't be separated\n }\n \"( ?< first > \\\\d + ) - (?< se c ond >\\\\d+)\".toRegex(RegexOption.COMMENTS).let { regex ->\n val match = regex.find(\"123-456\")!!<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.generators.impl\n\nimport org.jetbrains.kotlin.generators.MethodGenerator\nimport org.jetbrains.kotlin.generators.model.MethodModel\nimport org.jetbrains.kotlin.generators.model.RunTestMethodModel\nimport org.jetbrains.kotlin.generators.model.SimpleTestMethodModel","completion":"import org.jetbrains.kotlin.test.util.KtTestUtil\nimport org.jetbrains.kotlin.utils.Printer\n\nobject SimpleTestMethodGenerator : MethodGenerator() {\n override val kind: MethodModel.Kind\n get() = SimpleTestMethodModel.Kind<|endoftext|>"} {"prompt":"b.funNullableT()\n b.funNullableAny()\n }\n }\n}\n\n\/\/ TESTCASE NUMBER: 2","completion":"class Case2_1 : Interface3, InterfaceWithTypeParameter1\nclass Case2_2 : Interface3, InterfaceWithTypeParameter1\n\nfun case_2() {\n val x = select(Case2_1(), Case2_2(), null)\n\n if (x != null) {<|endoftext|>"} {"prompt":"class MyClass() {\n @Suppress(\"INVISIBLE_MEMBER\", \"INVISIBLE_REFERENCE\")\n @kotlin.internal.InlineOnly\n inline fun test(s: String = \"\") {\n }\n}\n\n\/\/ TESTED_OBJECT_KIND: function\n\/\/ TESTED_OBJECTS: MyClass, test$default","completion":"\/\/ FLAGS: ACC_STATIC, ACC_SYNTHETIC<|endoftext|>"} {"prompt":"instructionElement, valueElement, currentScope, inputValues, kind, valueFactory\n )\n add(instruction)\n return instruction\n }\n\n override fun merge(expression: KtExpression, inputValues: List): MergeInstruction {\n val instruction = MergeInstruction(expression, currentScope, inputValues, valueFactory)\n add(instruction)\n return instruction\n }","completion":"override fun readVariable(\n expression: KtExpression,\n resolvedCall: ResolvedCall<*>,\n receiverValues: Map\n ) = read(expression, resolvedCall, receiverValues)\n\n override fun call(\n valueElement: KtElement,\n resolvedCall: ResolvedCall<*>,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.js.test.handlers.JsIrRecompiledArtifactsIdentityHandler\nimport org.jetbrains.kotlin.js.test.handlers.JsWrongModuleHandler\nimport org.jetbrains.kotlin.js.test.handlers.createFirJsLineNumberHandler","completion":"import org.jetbrains.kotlin.js.test.handlers.createIrJsLineNumberHandler\nimport org.jetbrains.kotlin.js.test.ir.AbstractJsIrES6Test\nimport org.jetbrains.kotlin.js.test.ir.AbstractJsIrTest\nimport org.jetbrains.kotlin.js.test.utils.configureJsTypeScriptExportTest<|endoftext|>"} {"prompt":"return context.symbolTable.descriptorExtension.declareProperty(startOffset, endOffset, IrDeclarationOrigin.FAKE_OVERRIDE, propertyDescriptor, propertyDescriptor.isDelegated).apply {\n this.getter = propertyDescriptor.getter?.let {\n FunctionGenerator(declarationGenerator).generateFakeOverrideFunction(it, ktElement)\n }","completion":"this.setter = propertyDescriptor.setter?.let {\n FunctionGenerator(declarationGenerator).generateFakeOverrideFunction(it, ktElement)\n }\n this.linkCorrespondingPropertySymbol()\n this.generateOverrides(propertyDescriptor)\n }\n }<|endoftext|>"} {"prompt":"\/\/ SKIP_TXT\n\/\/ ISSUE: KT-56138\n\nfun takeLambda1(f: String.() -> String) {}\nfun takeLambda2(f: String.(String) -> String) {}\n\nfun test_1() {","completion":"val x1: String.(String) -> String = { str, str2 -> \"this\" }\n val x2: String.() -> String = { it }<|endoftext|>"} {"prompt":"path.mapTo(filtersMap.getValue(binaryModuleData.regular)) { Paths.get(it) }\n }\n\n @JvmName(\"dependenciesString\")\n fun dependencies(paths: Collection) {\n paths.mapTo(filtersMap.getValue(binaryModuleData.regular)) { Paths.get(it) }\n }","completion":"@JvmName(\"dependenciesString\")\n fun dependencies(moduleData: FirModuleData, paths: Collection) {\n paths.mapTo(\n filtersMap.getOrPut(moduleData) {\n allRegularDependencies.add(moduleData)\n mutableSetOf()\n }\n ) {\n Paths.get(it)\n }\n }<|endoftext|>"} {"prompt":"inv\n}\n\nfun poll35(flag: Boolean) {\n val inv = when (flag) { true -> ::Foo6 false -> ::Foo6 }\n inv\n}\n\nfun poll36(flag: Boolean) {","completion":"val inv = when (flag) { true -> ::Foo7 false -> foo7() }\n inv\n}\n\nfun poll4() {<|endoftext|>"} {"prompt":"class DataFrameLikeReturnTypeInjector(session: FirSession) : FirExpressionResolutionExtension(session) {\n companion object {\n val DF_CLASS_ID: ClassId = ClassId.topLevel(FqName.fromSegments(listOf(\"DataFrame\")))\n }\n\n @OptIn(SymbolInternals::class)","completion":"override fun addNewImplicitReceivers(functionCall: FirFunctionCall): List {\n val callReturnType = functionCall.resolvedType\n if (callReturnType.classId != DF_CLASS_ID) return emptyList()\n val rootMarker = callReturnType.typeArguments[0]\n if (rootMarker !is ConeClassLikeType) {<|endoftext|>"} {"prompt":"\/\/ We've already had errors in source mode, so it's relevant only for binaries for now\n\/\/ INCLUDE_JAVA_AS_BINARY\n\nimport org.jetbrains.annotations.*;\n\npublic class ValueParameterWithWarnings {\n public interface A {}\n\n public void foo1(A<@Nullable String, @Nullable T> x) { }","completion":"public void foo2(A<@Nullable String, @NotNull T> x) { }\n public void foo3(A<@NotNull String, @NotNull T> x) { }\n public void foo4(@NotNull T [] x) { }\n public void foo41(@Nullable String x) { }\n public void foo411(T x) { }<|endoftext|>"} {"prompt":"}\n\n private var generateDeclaredClassFilter: GenerateClassFilter = GenerateClassFilter.GENERATE_ALL\n fun generateDeclaredClassFilter(v: GenerateClassFilter) =\n apply { generateDeclaredClassFilter = v }\n\n private var targetId: TargetId? = null\n fun targetId(v: TargetId?) =\n apply { targetId = v }","completion":"private var moduleName: String? = configuration[CommonConfigurationKeys.MODULE_NAME]\n fun moduleName(v: String?) =\n apply { moduleName = v }\n\n \/\/ 'outDirectory' is a hack to correctly determine if a compiled class is from the same module as the callee during\n \/\/ partial compilation. Module chunks are treated as a single module.\n \/\/ TODO: get rid of it with the proper module infrastructure<|endoftext|>"} {"prompt":"assertTrue(eqBooleanBooleanQ(false, false))\n assertFalse(eqBooleanBooleanQ(false, true))\n assertFalse(eqBooleanBooleanQ(false, null))\n assertFalse(eqBooleanBooleanQ(false, undefined))\n assertFalse(eqBooleanBooleanQ(true, false))\n assertTrue(eqBooleanBooleanQ(true, true))","completion":"assertFalse(eqBooleanBooleanQ(true, null))\n assertFalse(eqBooleanBooleanQ(true, undefined))\n assertTrue(eqBooleanQBoolean(false, false))\n assertFalse(eqBooleanQBoolean(false, true))\n assertFalse(eqBooleanQBoolean(true, false))\n assertTrue(eqBooleanQBoolean(true, true))<|endoftext|>"} {"prompt":"abstract class KtSimpleNameReference(expression: KtSimpleNameExpression) : KtSimpleReference(expression) {\n \/\/ Extension point used by deprecated android extensions.\n abstract fun isReferenceToViaExtension(element: PsiElement): Boolean\n\n override fun isReferenceTo(candidateTarget: PsiElement): Boolean {\n if (!canBeReferenceTo(candidateTarget)) return false","completion":"if (isReferenceToViaExtension(candidateTarget)) return true\n return super.isReferenceTo(candidateTarget)\n }\n\n override fun getRangeInElement(): TextRange {\n val element = element.getReferencedNameElement()\n val startOffset = getElement().startOffset\n return element.textRange.shiftRight(-startOffset)\n }<|endoftext|>"} {"prompt":"testDependencyTransformations(\"p2\") { reports ->\n val report = reports.singleOrNull {\n it.sourceSetName == \"iosArm64Test\" &&\n it.scope == \"implementation\" &&\n it.groupAndModule.endsWith(\":p1\")\n }\n assertNotNull(report, \"No single report for 'iosArm64' and implementation scope\")","completion":"assertEquals(setOf(\"commonMain\", \"iosMain\"), report.allVisibleSourceSets)\n assertTrue(report.groupAndModule.endsWith(\":p1\"))\n }\n }\n }\n\n @GradleTest\n @DisplayName(\"KT-52216: [TYPE_MISMATCH] Caused by unexpected metadata dependencies of leaf source sets\")<|endoftext|>"} {"prompt":"v.invokespecial(\"java\/lang\/StringBuilder\", \"\", \"(Ljava\/lang\/String;)V\", false)\n } else {\n generator.invokeAppend(JAVA_STRING_TYPE)\n }\n }\n\n override fun invokeIntrinsic(v: InstructionAdapter) {","completion":"\/\/ String::plus has type String.(Any?) -> String, thus we have no argument type information\n \/\/ in case of callable reference passed to a generic function, e.g.:\n \/\/ charArrayOf('O', 'K').fold(\"\", String::plus)\n \/\/ TODO Make String::plus generic, and invoke proper StringBuilder#append.\n generator.invokeAppend(AsmTypes.OBJECT_TYPE)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlinx.atomicfu.AbstractAtomicfuJvmIrTest\n\n\nprivate class ExcludePattern {\n companion object {\n private const val MEMBER_ALIAS = \"(^removeMemberTypeAlias)|(^addMemberTypeAlias)\"\n\n private const val ALL_EXPECT = \"(^.*Expect.*)\"\n\n internal val forK2 = listOf(","completion":"ALL_EXPECT, \/\/ KT-63125 - Partially related to single-module expect-actual tests, but regexp is really wide\n MEMBER_ALIAS, \/\/ KT-55195 - Invalid for K2\n ).joinToString(\"|\")\n }\n}\n\nfun main(args: Array) {\n System.setProperty(\"java.awt.headless\", \"true\")<|endoftext|>"} {"prompt":"fun testR0xE14() {\n \/\/ with possible local optimizations\n if (2 in 1L..3L != range0.contains(2)) throw AssertionError()\n if (2 !in 1L..3L != !range0.contains(2)) throw AssertionError()\n if (!(2 in 1L..3L) != !range0.contains(2)) throw AssertionError()","completion":"if (!(2 !in 1L..3L) != range0.contains(2)) throw AssertionError()\n \/\/ no local optimizations\n if (element14 in 1L..3L != range0.contains(element14)) throw AssertionError()\n if (element14 !in 1L..3L != !range0.contains(element14)) throw AssertionError()<|endoftext|>"} {"prompt":"private data class ComputedMangledName(\n val computedBy: ComputedBy,\n val compatibleMode: Boolean,\n val value: String,\n)\n\n\/**\n * For each pair in the list, pads its first element with a number of spaces and concatenates it with the second element in such a way\n * that the second elements of each pair are vertically aligned in concatenated strings.\n *","completion":"* In other words, transforms this list:\n *\n * ```kotlin\n * listOf(\n * Pair(\"Capacity: \", \"normal\"),\n * Pair(\"Usability: \", \"very good\"),\n * Pair(\"Magic: \", \"minimal\"),\n * )\n * ```\n *\n * to this:\n *\n * ```kotlin\n * listOf(<|endoftext|>"} {"prompt":"interface InterfaceWithTypeParameter2 {\n fun ip1test2(): T? = null as T?\n}\n\ninterface InterfaceWithTypeParameter3 {\n fun ip1test3(): T? = null as T?\n}\n\ninterface InterfaceWithFiveTypeParameters1 {\n fun itest() {}\n fun itest1() {}\n}","completion":"interface InterfaceWithFiveTypeParameters2 {\n fun itest() {}\n fun itest2() {}\n}\n\ninterface InterfaceWithFiveTypeParameters3 {\n fun itest() {}\n fun itest3() {}\n}\n\ninterface InterfaceWithTwoTypeParameters {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.js.translate.intrinsic.functions.basic.FunctionIntrinsic\nimport org.jetbrains.kotlin.js.translate.utils.JsAstUtils\nimport org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe\nimport org.jetbrains.kotlin.types.TypeUtils","completion":"object StringPlusCharFIF : FunctionIntrinsicFactory {\n private class StringPlusAnyIntrinsic(private val leftTypeNullable: Boolean) : FunctionIntrinsic() {\n override fun apply(callInfo: CallInfo, arguments: List, context: TranslationContext): JsExpression {\n val receiver = callInfo.dispatchReceiver ?: callInfo.extensionReceiver!!<|endoftext|>"} {"prompt":"b.set(0, 71, true)\n assertNotContainsOnly(b, setOf(), 71)\n b.set(0, 3, false)\n assertNotContainsOnly(b, setOf(0, 1, 2), 71)\n b.set(63, 66, false)\n assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65), 71)","completion":"b.set(68, 71, false)\n assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65, 68, 69, 70), 71)\n b.set(68, 73, false)\n assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65, 68, 69, 70, 71, 72), 73)<|endoftext|>"} {"prompt":"checkExactType>(buildee)\n}\n\n\n\n\nclass TargetType\nclass DifferentType\n\nfun consume(value: Any) {}\nfun consume(value: DifferentType) {}\n\nclass Buildee {\n fun setTypeVariable(value: TV) { storage = value }\n fun getTypeVariable(): TV = storage\n private var storage: TV = null!!\n}","completion":"fun build(instructions: Buildee.() -> Unit): Buildee {\n return Buildee().apply(instructions)\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.interpreter.proxy.reflection.*\nimport org.jetbrains.kotlin.ir.types.classOrNull\nimport kotlin.reflect.KCallable\nimport kotlin.reflect.KFunction\nimport kotlin.reflect.KType\nimport kotlin.reflect.KTypeParameter","completion":"internal class KClassState(val classReference: IrClass, override val irClass: IrClass) : ReflectionState() {\n private var _members: Collection>? = null\n private var _constructors: Collection>? = null\n private var _typeParameters: List? = null\n private var _supertypes: List? = null<|endoftext|>"} {"prompt":"class Nested {\n fun fromNested() {\n bar() \/\/ Ok\n gav() \/\/ Ok\n }\n }\n }\n}\n\nclass Derived : Base() {\n fun test() {\n foo() \/\/ Ok\n gav() \/\/ Ok","completion":"bar()\n baz()<|endoftext|>"} {"prompt":"\/*\n * KOTLIN PSI SPEC TEST (POSITIVE)\n *\n * SPEC VERSION: 0.1-100\n * MAIN LINK: expressions, constant-literals, real-literals -> paragraph 1 -> sentence 1\n * NUMBER: 1\n * DESCRIPTION: Simple real literals with a different whole-number part and fraction part.\n *\/\n\nval value = 0.0\nval value = 0.00","completion":"val value = 0.000\nval value = 0.0000\n\nval value = 00.0\nval value = 000.00\nval value = 0000.000\n\nval value = 1.0\nval value = 22.00\nval value = 333.000\nval value = 4444.0000\nval value = 55555.0\nval value = 666666.00\nval value = 7777777.000<|endoftext|>"} {"prompt":"fun testAllModulePathAndNamedModule() {\n try {\n module(\"main\", addModules = listOf(\"ALL-MODULE-PATH\"))\n } catch (e: JavaCompilationError) {\n \/\/ Java compilation should fail, it's expected\n }\n }\n\n fun testJdkModulesFromNamed() {\n module(\"main\")\n }","completion":"fun testJdkModulesFromUnnamed() {\n module(\"main\")\n }\n\n fun testUnnamedDoesNotReadNotAdded() {\n \/\/ Test that although we have moduleA in the module path, it's not in the module graph\n \/\/ because we did not provide -Xadd-modules=moduleA\n module(\"moduleB\", listOf(module(\"moduleA\")), addModules = emptyList())\n }<|endoftext|>"} {"prompt":"if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n\/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n *\/","completion":"public inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}<|endoftext|>"} {"prompt":"fun interface Base {\n fun doStuff(): String\n}\n\nfun interface I : Base\n\nfun interface Proxy : I {\n\n override fun doStuff(): String = doStuffInt().toString()\n\n fun doStuffInt(): Int\n}\n\nfun runBase(b: Base) = b.doStuff()\n\nfun runI(i: I) = i.doStuff()","completion":"fun runProxy(p: Proxy) = p.doStuff()\n\nfun box(): String {\n\n if (runI { \"i\" } != \"i\") return \"fail1\"\n\n if (runProxy { 10 } != \"10\") return \"fail2\"\n\n return runBase { \"OK\" }\n}<|endoftext|>"} {"prompt":"assertTrue(\n \"Compile only dependencies count should be less than compile + runtime\\n\" +\n \"${compileOnlyFiles.joinToString(prefix = \"Compile dependencies:\\n\\t\", separator = \"\\n\\t\")}\\n\" +\n compileRuntimeFiles.joinToString(prefix = \"Compile + Runtime dependencies:\\n\\t\", separator = \"\\n\\t\"),","completion":"compileOnlyFiles.count() < compileRuntimeFiles.count()\n )\n }\n\n fun testTransitiveOption() {\n val dependency = \"junit:junit:4.11\"\n\n var transitiveFiles: Iterable\n\n resolveAndCheck(dependency, options = parseOptions(\"transitive=true\")) { files ->\n transitiveFiles = files\n true\n }<|endoftext|>"} {"prompt":"isConst = clang_isConstQualifiedType(clang_getCursorType(cursor)) != 0,\n parentName = receiverType.decl.spelling)\n )\n }\n\n else -> {\n }\n }\n }\n CXChildVisitResult.CXChildVisit_Continue\n }\n return CxxMembers(methods, staticFields)\n }","completion":"private fun createStructDef(cursor: CValue, structType: CValue, structDecl: StructDecl? = null): StructDefImpl {\n assert(clang_isCursorDefinition(cursor) != 0)\n val type = clang_getCursorType(cursor)\n val size = clang_Type_getSizeOf(type)<|endoftext|>"} {"prompt":"val reassignedNames = context.preliminaryLoopVisitor.enterCapturingStatement(statement)\n if (reassignedNames.isEmpty()) return\n \/\/ TODO: only choose the innermost variable for each name, KT-59688\n val possiblyChangedVariables = variableStorage.realVariables.values.filter {\n val identifier = it.identifier\n val symbol = identifier.symbol","completion":"\/\/ Non-local vars can never produce stable smart casts anyway.\n identifier.dispatchReceiver == null && identifier.extensionReceiver == null &&\n symbol is FirPropertySymbol && symbol.isVar && symbol.name in reassignedNames\n }\n for (variable in possiblyChangedVariables) {\n logicSystem.recordNewAssignment(flow, variable, context.newAssignmentIndex())\n }<|endoftext|>"} {"prompt":"\/\/ test.kt:14 box: $completion:kotlin.coroutines.Continuation=Generated_Box_MainKt$main$1, $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null, $i$f$baz\\1\\22:int=0:int,","completion":"$i$f$bar\\2\\74:int=0:int<|endoftext|>"} {"prompt":"@JvmStatic fun preserveEvaluationOrder(statement: JsStatement, canBeExtractedByInliner: (JsNode) -> Boolean): List {\n val decomposer = with (statement) {\n val extractable = match(canBeExtractedByInliner)\n val containsExtractable = withParentsOfNodes(extractable)\n val nodesWithSideEffect = match {","completion":"!(it is JsLiteral.JsValueLiteral || (it is JsExpression && it.sideEffects == SideEffectKind.PURE))\n }\n val containsNodeWithSideEffect = withParentsOfNodes(nodesWithSideEffect)\n\n ExpressionDecomposer(containsExtractable, containsNodeWithSideEffect)\n }\n\n decomposer.accept(statement)<|endoftext|>"} {"prompt":"println(value_1.dec())\n println(value_2?.toByte())\n println(o.prop_1.plus(3))\n }\n}\n\n\/\/ TESTCASE NUMBER: 6","completion":"fun case_6(value_1: Any?, value_2: Any) {\n if (funWithReturnsTrue(value_1 !is String || value_2 !is Number)) {\n println(value_1.length)<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.jps.build\n\nimport org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments\nimport org.jetbrains.kotlin.config.LanguageVersion\nimport org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder","completion":"abstract class AbstractIncrementalK2FirICLightTreeJvmJpsTest(\n allowNoFilesWithSuffixInTestData: Boolean = false\n) : AbstractIncrementalJpsTest(allowNoFilesWithSuffixInTestData = allowNoFilesWithSuffixInTestData) {\n override fun updateCommandLineArguments(arguments: CommonCompilerArguments) {<|endoftext|>"} {"prompt":"assertFalse(eqByteQByte(1.toByte(), 0.toByte()))\n assertTrue(eqByteQByte(1.toByte(), 1.toByte()))\n assertFalse(eqByteQByte(null, 0.toByte()))\n assertFalse(eqByteQByte(null, 1.toByte()))\n assertFalse(eqByteQByte(undefined, 0.toByte()))","completion":"assertFalse(eqByteQByte(undefined, 1.toByte()))\n assertTrue(eqByteQByteQ(0.toByte(), 0.toByte()))\n assertFalse(eqByteQByteQ(0.toByte(), 1.toByte()))\n assertFalse(eqByteQByteQ(0.toByte(), null))\n assertFalse(eqByteQByteQ(0.toByte(), undefined))<|endoftext|>"} {"prompt":"if (s != 12345) throw AssertionError(\"$s\")\n}\n\nfun testEmptyULongLoop2() {\n var s = 0\n for (i in M+6UL until M+1UL) {\n s = s*10 + (i-M).toInt()\n }\n if (s != 0) throw AssertionError(\"$s\")\n}","completion":"fun testMaxUItoMinUI() {\n val xs = ArrayList()\n for (i in MaxUI until MinUI) {\n xs.add(i)\n if (xs.size > 23) break\n }\n if (xs.size > 0) {\n throw AssertionError(\"Wrong elements for MaxUI..MinUI: $xs\")\n }\n}<|endoftext|>"} {"prompt":"val dependencyProjectKotlinExtension = dependencyProject.multiplatformExtensionOrNull\n ?: return@associate noMapping\n\n \/\/ Non-default publication layouts are not supported for pom rewriting\n if (!dependencyProject.kotlinPropertiesProvider.createDefaultMultiplatformPublications)\n return@associate noMapping","completion":"val resolved = resolvedDependencies[Triple(dependency.group!!, dependency.name, dependency.version!!)]\n ?: return@associate noMapping\n\n val resolvedToConfiguration = resolved.configuration\n val dependencyTargetComponent: KotlinTargetComponent = run {\n dependencyProjectKotlinExtension.targets.forEach { target -><|endoftext|>"} {"prompt":"* the call receiver is the old receiver of the extension.\n *\n * The call is replaced with atomic intrinsic call and the new receiver is\n * the invoked getter of the property reference that is the first parameter of the parent function:\n *","completion":"* fun AtomicInt.foo(new: Int) { fun foo$atomicfu(crossinline refGetter: () -> KMutableProperty0, new: Int) {\n * this.compareAndSet(value, new) ---> refGetter().compareAndSetField(refGetter().get(), new)\n * } }\n *\/<|endoftext|>"} {"prompt":"private fun Project.reportTestDiagnostic(severity: Severity = WARNING) {\n kotlinToolingDiagnosticsCollector.report(\n project,\n ToolingDiagnostic(\"TEST_DIAGNOSTIC\", \"This is a test diagnostic\\n\\nIt has multiple lines of text\", severity)\n )\n}","completion":"private fun Project.reportOnePerProjectTestDiagnostic(severity: Severity = WARNING) {\n kotlinToolingDiagnosticsCollector.reportOncePerGradleProject(\n project,\n ToolingDiagnostic(\n \"TEST_DIAGNOSTIC_ONE_PER_PROJECT\",<|endoftext|>"} {"prompt":"* Implements `kotlin.test` assertions by delegating them to `org.junit.jupiter.api.Assertions` class.\n *\/\npublic object JUnit5Asserter : Asserter {\n override fun assertEquals(message: String?, expected: Any?, actual: Any?) {\n Assertions.assertEquals(expected, actual, message)\n }","completion":"override fun assertNotEquals(message: String?, illegal: Any?, actual: Any?) {\n Assertions.assertNotEquals(illegal, actual, message)\n }\n\n override fun assertSame(message: String?, expected: Any?, actual: Any?) {\n Assertions.assertSame(expected, actual, message)\n }<|endoftext|>"} {"prompt":"\/**\n * The minimum value of a supplementary code point, `\\u0x10000`.\n *\n * Note that this constant is experimental.\n * In the future it could be deprecated in favour of another constant of a `CodePoint` type.\n *\/\n @ExperimentalNativeApi\n public const val MIN_SUPPLEMENTARY_CODE_POINT: Int = 0x10000\n\n \/**","completion":"* The minimum value of a Unicode code point.\n *\n * Note that this constant is experimental.\n * In the future it could be deprecated in favour of another constant of a `CodePoint` type.\n *\/\n @ExperimentalNativeApi\n public const val MIN_CODE_POINT: Int = 0x000000\n\n \/**\n * The maximum value of a Unicode code point.\n *<|endoftext|>"} {"prompt":"elements.copyInto(result, thisSize)\n return result\n}\n\n\/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n *\/\npublic actual operator fun CharArray.plus(elements: CharArray): CharArray {\n val thisSize = size\n val arraySize = elements.size","completion":"val result = copyOfUninitializedElements(thisSize + arraySize)\n elements.copyInto(result, thisSize)\n return result\n}\n\n\/**\n * Returns an array containing all elements of the original array and then the given [element].\n *\/\n@kotlin.internal.InlineOnly\npublic actual inline fun Array.plusElement(element: T): Array {<|endoftext|>"} {"prompt":"name.asString() == INVOKE_SUSPEND_METHOD_NAME && parentAsClass.origin == JvmLoweredDeclarationOrigin.CONTINUATION_CLASS\n\nprivate fun IrFunction.isInvokeOfSuspendCallableReference(): Boolean =\n isSuspend && name.asString().let { name -> name == \"invoke\" || name.startsWith(\"invoke-\") }","completion":"&& parentAsClass.origin == JvmLoweredDeclarationOrigin.FUNCTION_REFERENCE_IMPL\n \/\/ References to inline functions don't count since they're not really *references* - the contents\n \/\/ of the inline function are copy-pasted into the `invoke` method, and may require a continuation.\n \/\/ (TODO: maybe the reference itself should be the continuation, just like lambdas?)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.builders.declarations.*\nimport org.jetbrains.kotlin.ir.declarations.*\nimport org.jetbrains.kotlin.ir.expressions.*\nimport org.jetbrains.kotlin.ir.expressions.impl.*\nimport org.jetbrains.kotlin.ir.symbols.*","completion":"import org.jetbrains.kotlin.ir.types.*\nimport org.jetbrains.kotlin.ir.util.*\nimport org.jetbrains.kotlin.name.*\nimport org.jetbrains.kotlinx.atomicfu.compiler.backend.common.AbstractAtomicSymbols\n\nclass JvmAtomicSymbols(\n context: IrPluginContext,<|endoftext|>"} {"prompt":"private fun computeAllExcludedDirectories(project: Project, excludedProjects: List): List {\n val javaExcludedDirectories = project.plugins.findPlugin(IdeaPlugin::class.java)\n ?.model?.module?.excludeDirs?.toList().orEmpty()","completion":"val excludedProjectDirectories = if (project == project.rootProject) excludedProjects.map { it.buildDir } else emptyList()\n\n return globalExcludedDirectories + javaExcludedDirectories + project.buildDir + excludedProjectDirectories\n }\n\n private fun parseSourceSets(project: Project): List {\n if (!project.plugins.hasPlugin(JavaPlugin::class.java)) {<|endoftext|>"} {"prompt":"&& DescriptorUtils.isStaticNestedClass(candidateDescriptor.containingDeclaration)\n ) {\n nestedClass = candidateDescriptor.containingDeclaration\n } else if (candidateDescriptor is FakeCallableDescriptorForObject) {\n nestedClass = candidateDescriptor.getReferencedObject()\n }\n if (nestedClass != null) {","completion":"tracing.nestedClassAccessViaInstanceReference(trace, nestedClass, candidateCall.explicitReceiverKind)\n return@checkAndReport OTHER_ERROR\n }\n }\n\n assert((dispatchReceiver != null) == (candidateCall.resultingDescriptor.dispatchReceiverParameter != null)) {\n \"Shouldn't happen because of TaskPrioritizer: $candidateDescriptor\"\n }<|endoftext|>"} {"prompt":"if (isEmpty()) -1 else (31 * (31 * (first xor (first shr 32)).toInt() + (last xor (last shr 32)).toInt()) + (step xor (step ushr 32)).toInt())\n\n override fun toString(): String = if (step > 0) \"$first..$last step $step\" else \"$first downTo $last step ${-step}\"\n\n public companion object {","completion":"\/**\n * Creates ULongProgression within the specified bounds of a closed range.\n\n * The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].\n * In order to go backwards the [step] must be negative.\n *\n * [step] must be greater than `Long.MIN_VALUE` and not equal to zero.\n *\/<|endoftext|>"} {"prompt":"private inline fun List>.filterToBeDeleted() = filter { prop ->\n prop.findAnnotation()\n ?.let { it.removeAfter >= LanguageVersion.LATEST_STABLE }\n ?: true\n}","completion":"private inline fun gradleOptions(): List> =\n T::class\n .declaredMemberProperties\n .filter {\n it.findAnnotation() != null\n }\n .filterToBeDeleted()\n .sortedBy { it.name }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.codegen.intrinsics\n\nimport org.jetbrains.kotlin.codegen.Callable\nimport org.jetbrains.kotlin.codegen.CallableMethod\nimport org.jetbrains.kotlin.codegen.ExpressionCodegen\nimport org.jetbrains.kotlin.codegen.StackValue","completion":"import org.jetbrains.kotlin.psi.KtPrefixExpression\nimport org.jetbrains.kotlin.resolve.calls.model.ResolvedCall\n\nclass Not : IntrinsicMethod() {\n override fun toCallable(method: CallableMethod): Callable =\n object : IntrinsicCallable(method) {\n override fun invokeMethodWithArguments(<|endoftext|>"} {"prompt":"\/\/ FILE: 1.kt\npackage a\n\nopen class A {\n protected val v = \"O\"\n protected var w = \"\"\n}\n\n\/\/ FILE: 2.kt\nimport a.*\n\nclass B : A() {\n fun foo(): String {\n B::w.set(this, \"K\")\n return ::v.get() + B::w.get(this)\n }\n}","completion":"fun box() = B().foo()<|endoftext|>"} {"prompt":"fun String?.orEmpty(): String = \"my local extension for $this\"\n fun String?.funWithTrailingLambda( x : Any? = null, body : ()-> String = {\"\"} ): String = body()\n\n fun case1(s: String?) {","completion":"s.orEmpty()\n \/\/trailing lambda\n s.funWithTrailingLambda { \"ss\" }<|endoftext|>"} {"prompt":"@Retention(AnnotationRetention.RUNTIME)\nannotation class DependsOnTwo(val unused: String = \"\", val path1: String = \"\", val path2: String = \"\")\n\nprivate class NullOutputStream : OutputStream() {\n override fun write(b: Int) {}\n override fun write(b: ByteArray) {}","completion":"override fun write(b: ByteArray, off: Int, len: Int) {}\n}\n\ninternal fun URL.toFile() =\n try {\n File(toURI().schemeSpecificPart)\n } catch (e: java.net.URISyntaxException) {\n if (protocol != \"file\") null\n else File(file)\n }<|endoftext|>"} {"prompt":"receiver?.let {\n generateContextReceiverForDelegatingConstructorCall(\n ktDefaultElement.startOffsetSkippingComments,\n ktDefaultElement.endOffset,\n receiver\n )\n }\n\nprivate fun StatementGenerator.generateContextReceiverForDelegatingConstructorCall(\n defaultStartOffset: Int,\n defaultEndOffset: Int,","completion":"receiver: ContextClassReceiver\n): IntermediateValue {\n val irReceiverType = receiver.type.toIrType()\n val contextReceivers = receiver.classDescriptor.contextReceivers\n val receiverParameter = contextReceivers.single { it.value == receiver }\n return object : ExpressionValue(irReceiverType) {\n override fun load(): IrExpression = IrGetValueImpl(<|endoftext|>"} {"prompt":"superTypeRefs.forEach { it.accept(visitor, data) }\n declarations.forEach { it.accept(visitor, data) }\n annotations.forEach { it.accept(visitor, data) }\n }\n\n override fun transformChildren(transformer: FirTransformer, data: D): FirAnonymousObjectImpl {\n transformTypeParameters(transformer, data)","completion":"transformStatus(transformer, data)\n controlFlowGraphReference = controlFlowGraphReference?.transform(transformer, data)\n transformSuperTypeRefs(transformer, data)\n transformDeclarations(transformer, data)\n transformAnnotations(transformer, data)\n return this\n }<|endoftext|>"} {"prompt":"res = \"\";\n call = Z(\"Z\").test(a = {res += \"K\"; \"K\"}(), c = {res += \"L\"; \"L\"}, b = {res+=\"O\"; \"O\"}())\n if (res != \"KOL\" || call != \"KOLZ\") return \"fail 2: $res != KOL or $call != KOLZ\"\n\n\n res = \"\";","completion":"call = Z(\"Z\").test(c = {res += \"L\"; \"L\"}, a = {res += \"K\"; \"K\"}(), b = {res+=\"O\"; \"O\"}())\n if (res != \"KOL\" || call != \"KOLZ\") return \"fail 3: $res != KOL or $call != KOLZ\"\n\n return \"OK\"\n\n}<|endoftext|>"} {"prompt":"variantCheckRequests[resolvedVariantRequest] = \"jvmLibApiElements$variantNamePublishedSuffix\"\n }\n\n try {\n ResolvedVariantChecker().assertResolvedSingleVariantsBatch(consumerProject, variantCheckRequests, consumerBuildOptions)\n } catch (e: AssertionError) {","completion":"collector.addError(AssertionError(\"Failure with Kotlin version=${withKotlinVersion}\", e))\n }\n }\n}\n\nclass ResolvedVariantChecker {\n data class ResolvedVariantRequest(val subproject: String, val configuration: String, val dependencyFilter: String)\n\n data class ModuleVariantResult(val moduleName: String, val variantString: String)<|endoftext|>"} {"prompt":"nullableIntProperty.funNullableAny()\n nullableIntProperty\n}\n\n\/*","completion":"* TESTCASE NUMBER: 18\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-28328\n *\/\nfun case_18(a: DeepObject.A.B.C.D.E.F.G.J?, b: Nothing?) {<|endoftext|>"} {"prompt":"val profilerProcess = profilerProcessBuilder.start()\n \/\/ Stop profiler on script stop\n Runtime.getRuntime().addShutdownHook(Thread {\n profilerProcess.destroy()\n })\n profilerProcess.waitFor()\n\n if (profilerProcess.exitValue() != 0) {\n throw BenchmarkFailedException(profilerProcess.exitValue())\n }","completion":"println(\"Benchmark $projectName has ended\")\n return BenchmarkResult(\n projectName,\n benchmarkOutputDir.resolve(\"benchmark.csv\")\n )\n }\n\n \/\/ Not working as intended due to this bug: https:\/\/github.com\/gradle\/gradle-profiler\/issues\/317\n fun aggregateBenchmarkResults(benchmarkResult: BenchmarkResult) {<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: -SafeCallsAreAlwaysNullable\n\/\/ http:\/\/youtrack.jetbrains.net\/issue\/KT-418\n\nfun ff() {\n val i: Int = 1\n val a: Int = i?.plus(2)","completion":"}<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE\n\/\/ FILE: A.java\n\npublic class A {\n public A(T x, java.util.List y) {}\n}\n\n\/\/ FILE: main.kt\n\nfun test(x: List, y: List) {","completion":"var z: A = A(\"\", x) \/\/ E inferred from expected type\n z = A(\"\", y)\n\n z = A(\"\", x)\n\n z = A(\"\", x)\n z = A(\"\", y)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.types.coneType\nimport org.jetbrains.kotlin.name.StandardClassIds\n\nabstract class AbstractDiagnosticCollector(\n override val session: FirSession,\n override val scopeSession: ScopeSession = ScopeSession(),\n protected val createComponents: (DiagnosticReporter) -> DiagnosticCollectorComponents,","completion":") : SessionHolder {\n\n fun collectDiagnosticsInSettings(reporter: DiagnosticReporter) {\n val visitor = createVisitor(createComponents(reporter))\n visitor.checkSettings()\n }\n\n fun collectDiagnostics(firDeclaration: FirDeclaration, reporter: DiagnosticReporter) {\n val visitor = createVisitor(createComponents(reporter))<|endoftext|>"} {"prompt":"recorder = FileStructureElement.recorderFor(firElement),\n )\n\n fun getElement(ktElement: KtElement): FirElement? {\n return mapping[ktElement]\n }\n\n fun getFir(element: KtElement): FirElement? {\n var current: PsiElement? = element\n while (\n current == element ||\n current is KtUserType ||","completion":"current is KtTypeReference ||\n current is KtDotQualifiedExpression ||\n current is KtNullableType\n ) {\n \/\/ We are still referring to the same element with possible type parameter\/name qualification\/nullability,\n \/\/ hence it is always correct to return a corresponding element if present\n if (current is KtElement) getElement(current)?.let { return it }\n current = current.parent<|endoftext|>"} {"prompt":"grisuRound(buffer, len, delta, p2, one_frc, wp_w_frc * unit)\n return len\n }\n }\n}\n\nprivate fun grisuRound(buffer: WasmCharArray, len: Int, delta: Long, restInp: Long, ten_kappa: Long, wp_w: Long) {\n var rest = restInp","completion":"val lastp = len - 1\n var digit = buffer.get(lastp)\n while (\n rest < wp_w &&\n delta - rest >= ten_kappa && (\n rest + ten_kappa < wp_w ||\n wp_w - rest > rest + ten_kappa - wp_w\n )\n ) {\n --digit\n rest += ten_kappa;<|endoftext|>"} {"prompt":"* @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.","completion":"* @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"\/\/ Check whether a fake override will resolve to an implementation in class, not an interface.\nprivate fun IrSimpleFunction.resolvesToClass(): Boolean {\n val overriddenFromClass = overriddenFromClass() ?: return false\n return overriddenFromClass.modality != Modality.ABSTRACT\n}\n\nprivate fun IrSimpleFunction.overriddenFromClass(): IrSimpleFunction? =","completion":"overriddenSymbols.singleOrNull { !it.owner.parentAsClass.isJvmInterface }?.owner<|endoftext|>"} {"prompt":"* KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE)\n *\n * SECTIONS: dfa\n * NUMBER: 67\n * DESCRIPTION: Raw data flow analysis test\n * HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses\n *\/\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1(x: Any?) {","completion":"when (x) {\n is Any -> {\n x\n x.equals(10)\n }\n else -> return<|endoftext|>"} {"prompt":"const val I32_REM_U = \"I32_REM_U\"\n const val I32_AND = \"I32_AND\"\n const val I32_OR = \"I32_OR\"\n const val I32_XOR = \"I32_XOR\"\n const val I32_SHL = \"I32_SHL\"","completion":"const val I32_SHR_S = \"I32_SHR_S\"\n const val I32_SHR_U = \"I32_SHR_U\"\n const val I32_ROTL = \"I32_ROTL\"\n const val I32_ROTR = \"I32_ROTR\"\n const val I64_ADD = \"I64_ADD\"<|endoftext|>"} {"prompt":"when (compatibility) {\n ExpectActualCheckingCompatibility.Compatible -> return\n is ExpectActualCheckingCompatibility.Incompatible<*> -> incompatibilityMap.getOrPut(compatibility) { SmartList() }.add(actualMember)\n }\n\n incompatibleMembers?.add(expectMember to incompatibilityMap)","completion":"onIncompatibleMembersFromClassScope(expectMember, incompatibilityMap, expectClassSymbol, actualClassSymbol)\n }\n\n private fun ExpectActualMatchingContext<*>.getCallablesCompatibility(\n expectDeclaration: CallableSymbolMarker,\n actualDeclaration: CallableSymbolMarker,\n parentSubstitutor: TypeSubstitutorMarker?,<|endoftext|>"} {"prompt":"module = module,\n version = version,\n sourceSetName = sourceSetName,\n capabilities = capabilities,\n attributes = attributes,\n )\n }\n\n fun copy(\n group: String = this.group,\n module: String = this.module,\n version: String? = this.version,\n sourceSetName: String? = this.sourceSetName,","completion":"capabilities: Set = this.capabilities,\n attributes: IdeaKotlinBinaryAttributes = this.attributes,\n ): IdeaKotlinBinaryCoordinates {\n return IdeaKotlinBinaryCoordinates(\n group = group,\n module = module,\n version = version,\n sourceSetName = sourceSetName,<|endoftext|>"} {"prompt":"typeEnhancementImprovementsInStrictMode = languageVersionSettings.supportsFeature(LanguageFeature.TypeEnhancementImprovementsInStrictMode),\n ignoreNullabilityForErasedValueParameters = languageVersionSettings.supportsFeature(LanguageFeature.IgnoreNullabilityForErasedValueParameters),\n enhancePrimitiveArrays = languageVersionSettings.supportsFeature(LanguageFeature.EnhanceNullabilityOfPrimitiveArrays),\n )","completion":")\n useInstance(JavaModuleResolver.getInstance(moduleContext.project))\n\n useImpl()\n useImpl()\n}\n\nfun ComponentProvider.initJvmBuiltInsForTopDownAnalysis() {\n get().initialize(get(), get())<|endoftext|>"} {"prompt":"* https:\/\/kotlinlang.org\/spec\/type-system.html#type-kinds for more details.\n *\/\n public val KtType.isDenotable: Boolean\n get() = withValidityAssertion { analysisSession.typeInfoProvider.isDenotable(this) }\n\n \/**","completion":"* Returns true if this type is a functional interface type, a.k.a. SAM type, e.g., Runnable.\n *\/\n public val KtType.isFunctionalInterfaceType: Boolean\n get() = withValidityAssertion { analysisSession.typeInfoProvider.isFunctionalInterfaceType(this) }\n\n \/**\n * Returns [FunctionTypeKind] of the given [KtType]<|endoftext|>"} {"prompt":"metadataKlib: TaskProvider, compilation: KotlinSharedNativeCompilation\n) {\n metadataKlib.configure { jar ->\n launch { includeCommonizedCInteropMetadata(jar, compilation) }\n }\n}\n\ninternal suspend fun Project.includeCommonizedCInteropMetadata(metadataKlib: Zip, compilation: KotlinSharedNativeCompilation) {","completion":"val commonizerTask = commonizeCInteropTask()?.get() ?: return\n val commonizerDependencyToken = CInteropCommonizerDependent.from(compilation) ?: return\n val outputDirectory = commonizerTask.commonizedOutputDirectory(commonizerDependencyToken) ?: return\n\n metadataKlib.from(outputDirectory) { spec -><|endoftext|>"} {"prompt":"package test.ranges\n\nimport kotlin.test.*\n\npublic class RangeTest {\n @Test fun intRange() {\n val range = -5..9\n assertFalse(-1000 in range)\n assertFalse(-6 in range)\n\n assertTrue(-5 in range)\n assertTrue(-4 in range)\n assertTrue(0 in range)\n assertTrue(3 in range)","completion":"assertTrue(8 in range)\n assertTrue(9 in range)\n\n assertFalse(10 in range)\n assertFalse(9000 in range)\n\n assertFalse(range.isEmpty())\n\n assertTrue(9 in (range as ClosedRange))\n assertFalse((range as ClosedRange).isEmpty())\n\n assertTrue(1.toShort() in range)<|endoftext|>"} {"prompt":"\/\/ ISSUE: KT-41215, KT-43551\n\n\/\/ FILE: Base.java\npublic sealed class Base permits A, B {}\n\n\/\/ FILE: A.java\npublic final class A extends Base {}\n\n\/\/ FILE: B.java\npublic sealed class B extends Base permits B.C, B.D {\n public static final class C extends B {}\n\n public static non-sealed class D extends B {}\n}","completion":"\/\/ FILE: main.kt\nfun test_1(base: Base): String {\n return when (base) {\n is A -> \"O\"\n is B -> \"Fail\"\n }\n}\n\nfun test_2(base: Base): String {\n return when (base) {\n is A -> \"Fail A\"\n is B.C -> \"K\"<|endoftext|>"} {"prompt":"* TESTCASE NUMBER: 11\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-30376\n *\/\nfun case_11(x: Any?) {\n if ((x as Boolean?)!!) {","completion":"x.not()<|endoftext|>"} {"prompt":"wasCalled = true\n suspendWithValue(\"OK\")\n }\n )\n }\n\n builder {\n tryCatchFinally(\n {\n suspendWithValue(\"\")\n wasCalled = true\n suspendWithValue(\"OK\")\n },\n {\n suspendWithValue(\"fail 1\")\n },\n {\n suspendWithValue(\"ignored 1\")","completion":"wasCalled = true\n }\n )\n }\n\n builder {\n tryCatchFinally(\n {\n suspendWithException(RuntimeException(\"M\"))\n },\n { e ->\n if (e.message != \"M\") throw RuntimeException(\"fail 2\")\n suspendWithValue(\"OK\")\n },\n {\n suspendWithValue(\"ignored 2\")<|endoftext|>"} {"prompt":"\/*\n * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)\n *\n * SPEC VERSION: 0.1-300\n * MAIN LINK: expressions, constant-literals, boolean-literals -> paragraph 1 -> sentence 2\n * NUMBER: 15\n * DESCRIPTION: The use of Boolean literals as the identifier (with backtick) in the parameter.","completion":"* NOTE: this test data is generated by FeatureInteractionTestDataGenerator. DO NOT MODIFY CODE MANUALLY!\n * HELPERS: reflect\n *\/\n\nfun f1(`true`: Boolean) = !!!`true`\nfun f2(`false`: Boolean, `true`: Boolean) = `false` && `true`<|endoftext|>"} {"prompt":"private fun IrClass.shouldNotBeImplemented(): Boolean {\n return isInterface && !isExternal || isJsImplicitExport()\n }\n\n private fun IrValueParameter.shouldBeExported(): Boolean {\n return origin != JsLoweredDeclarationOrigin.JS_SUPER_CONTEXT_PARAMETER && origin != ES6_BOX_PARAMETER\n }","completion":"private fun IrClass.shouldContainImplementationOfMagicProperty(superTypes: Iterable): Boolean {\n return !isExternal && superTypes.any {\n val superClass = it.classOrNull?.owner ?: return@any false\n superClass.isInterface && it.shouldAddMagicPropertyOfSuper() || superClass.isJsImplicitExport()\n }\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.backend.wasm.lower\n\nimport org.jetbrains.kotlin.backend.common.FileLoweringPass\nimport org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext\nimport org.jetbrains.kotlin.backend.common.ir.createArrayOfExpression","completion":"import org.jetbrains.kotlin.backend.common.lower.createIrBuilder\nimport org.jetbrains.kotlin.backend.common.lower.irBlock\nimport org.jetbrains.kotlin.backend.wasm.WasmBackendContext\nimport org.jetbrains.kotlin.backend.wasm.lower.WasmPropertyReferenceLowering.KTypeGeneratorInterface<|endoftext|>"} {"prompt":"for (classFqName in fqNames) {\n assert(!classFqName.isRoot) { \"$classFqName is root when processing $change\" }\n\n val scope = classFqName.parent().asString()\n val name = classFqName.shortName().identifier\n dirtyLookupSymbols.add(LookupSymbol(name, scope))\n }","completion":"} else if (change is ChangeInfo.MembersChanged) {\n val fqNames = withSubtypes(change.fqName, caches)\n \/\/ need to recompile subtypes because changed member might break override\n dirtyClassesFqNames.addAll(fqNames)\n\n for (name in change.names) {<|endoftext|>"} {"prompt":"into: org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions,\n ) {\n org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptionsHelper.syncOptionsAsConvention(from, into)\n into.javaParameters.convention(from.javaParameters)","completion":"into.jvmTarget.convention(from.jvmTarget)\n into.moduleName.convention(from.moduleName)\n into.noJdk.convention(from.noJdk)\n }\n}<|endoftext|>"} {"prompt":"\/\/ DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS, -MISPLACED_TYPE_PARAMETER_CONSTRAINTS\n\npackage pkg\n\n\nclass TestBasic {\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor()\n constructor()\n}\n\n\nclass TestIdenticalPrimaryAndSecondaryConstructorsA constructor() {","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor() : this()\n}\n\nclass TestIdenticalPrimaryAndSecondaryConstructorsB() {\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor() : this()\n}\n\n\nclass TestIdenticalDelegatedPrimaryConstructorCalls constructor(placeholder: UserKlass) {<|endoftext|>"} {"prompt":"fun bar2(): MutableList\n\n fun foo3(a: MutableList<*>)\n fun bar3(): MutableList<*>\n}\n\ninterface KotlinInterface2 {\n fun foo(a: List)\n fun bar(): List\n}","completion":"fun test(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H){\n a.foo(null)\n a.foo(mutableListOf(1))\n a.foo(listOf(1))\n a.bar()\n a.foo2(null)\n a.foo2(mutableListOf(null))<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.backend.js.FirJsKotlinMangler\nimport org.jetbrains.kotlin.fir.pipeline.Fir2IrActualizedResult\nimport org.jetbrains.kotlin.fir.pipeline.Fir2KlibMetadataSerializer","completion":"import org.jetbrains.kotlin.ir.backend.js.JsFactories\nimport org.jetbrains.kotlin.ir.backend.js.getSerializedData\nimport org.jetbrains.kotlin.ir.backend.js.incrementalDataProvider\nimport org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerIr<|endoftext|>"} {"prompt":"get() = getter.hasImplementation && (isVal || setter.hasImplementation)\n\nprivate fun FirProperty.getEffectiveModality(containingClass: FirClass?): Modality? =\n when (status.modality == Modality.OPEN && containingClass?.status?.modality == Modality.FINAL) {\n true -> Modality.FINAL\n false -> status.modality\n }","completion":"private fun FirProperty.getEffectiveModality(containingClass: FirClass?, languageVersionSettings: LanguageVersionSettings): Modality? =\n when (languageVersionSettings.supportsFeature(LanguageFeature.TakeIntoAccountEffectivelyFinalInMustBeInitializedCheck)) {\n true -> getEffectiveModality(containingClass)\n false -> status.modality\n }<|endoftext|>"} {"prompt":"* @param invokeBuiltinExtensionMode is true only when the original call has a form \"x.f()\" and invokeReceiverInfo is \"f\"\n * @param runResolutionForInvokeReceiverVariable runs the process of looking for the receiver (\"x.f\" or \"f\") on the given FirTowerResolveTask\n *\/\n private inline fun enqueueInvokeReceiverTask(\n info: CallInfo,","completion":"invokeReceiverInfo: CallInfo,\n towerDataElementsForName: TowerDataElementsForName = TowerDataElementsForName(invokeReceiverInfo.name, components.towerDataContext),\n invokeBuiltinExtensionMode: Boolean,\n crossinline runResolutionForInvokeReceiverVariable: suspend (FirTowerResolveTask) -> Unit\n ) {<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun testTypeParameterWithMultipleTypeAliasedUpperBoundsAAB(arg: T) where T: UserInterfaceA, T: UserInterfaceB {}","completion":"fun testTypeParameterWithMultipleTypeAliasedUpperBoundsAAB(arg: T) where T: UserInterfaceA, T: SameUserInterfaceB {}<|endoftext|>"} {"prompt":"val e4: InlineNullableReference2? = e \/\/ box\n}\n\nfun box(): String {\n val a = InlineNotNullPrimitive(1)\n val b = InlineNullablePrimitive(1)\n val c = InlineNotNullReference(\"some\")\n val d = InlineNullableReference(\"other\")\n val e = InlineNullableReference2(\"other2\")","completion":"test1(a)\n test2(b)\n test3(c)\n test4(d)\n test5(e)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_EXPRESSION\n\nimport kotlin.reflect.KProperty\n\nclass UsefulClass(val param: Int = 2) {\n operator fun getValue(instance: Any, property: KProperty<*>) : Int = 1\n operator fun setValue(instance: Any, property: KProperty<*>, value: Int) {}","completion":"@Deprecated(\"message\")\n fun member() {}\n}\n\n@Deprecated(\"message\")\nfun Obsolete(param: Int = 1): UsefulClass = UsefulClass(param)\n\nclass Invocable {\n @Deprecated(\"message\")\n operator fun invoke() {}\n}\n\nobject InvocableHolder {\n val invocable = Invocable()\n}\n\nfun invoker() {<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !LANGUAGE: +ContextReceivers\n\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\ninterface NumberOperations {\n fun Number.plus(other: Number): Number\n}\n\nclass Matrix\n\ncontext(NumberOperations) fun Matrix.plus(other: Matrix): Matrix = TODO()","completion":"fun NumberOperations.plusMatrix(m1: Matrix, m2: Matrix) {\n m1.plus(m2)\n m2.plus(m1)\n}<|endoftext|>"} {"prompt":"val classNode = parseClassNode(jarFile2.getInputStream(entry2))\n if (!classNode.shouldBeIgnored()) {\n report.addMissingClassName1(\"$name2 ${classNode.access.classFlags()}\")\n ++totalDiffs\n }\n }\n }\n }\n\n private fun writeReportIfRequired() {\n if (report.isNotEmpty()) {","completion":"PrintWriter(outputFile).use { out ->\n out.tag(\"html\") {\n out.tag(\"head\") {\n out.printCss()\n }\n out.tag(\"body\") {\n report.writeAsHtml(out)\n }\n }\n }\n }\n }\n\n private fun PrintWriter.printCss() {\n tag(\"style\", REPORT_CSS)<|endoftext|>"} {"prompt":"val receiver = if (this is IrConstructor) parentAsClass.thisReceiver else dispatchReceiverParameter\n receiver?.let {\n frameMap.enter(it, classCodegen.typeMapper.mapTypeAsDeclaration(it.type))\n }\n val contextReceivers = valueParameters.subList(0, contextReceiverParametersCount)\n for (contextReceiver in contextReceivers) {","completion":"frameMap.enter(contextReceiver, classCodegen.typeMapper.mapType(contextReceiver.type))\n }\n extensionReceiverParameter?.let {\n frameMap.enter(it, classCodegen.typeMapper.mapType(it))\n }\n val regularParameters = valueParameters.subList(contextReceiverParametersCount, valueParameters.size)<|endoftext|>"} {"prompt":"* temp = computeValueAsync() \/\/ suspension point and resumption point, value NOT restored as it is dead\n * load temp\n * goto L3\n * L2: (value alive here)\n * load value\n * L3: (merge point, cannot extend `value` local across as it is not defined on one of the paths)\n * load \"K\"\n * add strings\n * return\n *","completion":"* @return true if the range has been extended\n *\/\nprivate fun LocalVariableNode.extendRecordIfPossible(\n method: MethodNode,\n suspensionPoints: List,\n endLabel: LabelNode,\n liveness: List,\n nextSuspensionPointIndex: Int\n): Boolean {\n val nextSuspensionPointLabel =<|endoftext|>"} {"prompt":"public inline fun DoubleArray.onEach(action: (Double) -> Unit): DoubleArray {\n return apply { for (element in this) action(element) }\n}\n\n\/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n *\/\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly","completion":"public inline fun BooleanArray.onEach(action: (Boolean) -> Unit): BooleanArray {\n return apply { for (element in this) action(element) }\n}\n\n\/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n *\/\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"testClass(\"IrBlackBoxModernJdkCodegenTestGenerated\") {\n model(\"codegen\/boxModernJdk\")\n }\n\n testClass {\n model(\"codegen\/box\/compileKotlinAgainstKotlin\")\n }\n\n testClass {","completion":"model(\"codegen\/box\/compileKotlinAgainstKotlin\")\n }\n\n testClass {\n model(\n \"ir\/irText\",\n excludeDirs = listOf(\"declarations\/multiplatform\/k2\")\n )\n }\n\n testClass {<|endoftext|>"} {"prompt":"expectSuccess(\"OpenClassNarrowedVisibilityTATypeParameterHolder(t=OpenClassNarrowedVisibilityTAImpl(x=-4))\") { getOpenClassNarrowedVisibilityTATypeParameterHolder2(4).toString() }","completion":"expectSuccess(\"setOpenClassNarrowedVisibilityTATypeParameterHolder1\") { setOpenClassNarrowedVisibilityTATypeParameterHolder1(null) }\n expectSuccess(\"setOpenClassNarrowedVisibilityTATypeParameterHolder2\") { setOpenClassNarrowedVisibilityTATypeParameterHolder2(null) }<|endoftext|>"} {"prompt":"public fun deleteRange(startIndex: Int, endIndex: Int): StringBuilder {\n checkReplaceRange(startIndex, endIndex, length)\n\n string = string.substring(0, startIndex) + string.substring(endIndex)\n return this\n }\n\n \/**\n * Copies characters from this string builder into the [destination] character array.\n *","completion":"* @param destination the array to copy to.\n * @param destinationOffset the position in the array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the range to copy, 0 by default.\n * @param endIndex the end (exclusive) of the range to copy, length of this string builder by default.\n *<|endoftext|>"} {"prompt":"?: k1Directive.takeIf { configurator.frontendKind == FrontendKind.Fe10 && it in this }\n ?: k2Directive.takeIf { configurator.frontendKind == FrontendKind.Fir && it in this }\n\n private fun compareResults(\n data: SymbolPointersData,\n testServices: TestServices,\n ) {","completion":"val actual = data.pointers.renderDeclarations()\n testServices.assertions.assertEqualsToTestDataFileSibling(actual)\n\n val actualPretty = data.pointersForPrettyRendering.renderDeclarations()\n testServices.assertions.assertEqualsToTestDataFileSibling(actualPretty, extension = \".pretty.txt\")\n }<|endoftext|>"} {"prompt":"assertEquals(\"NativeFoo('hello') (object)\", o.describeNativeFooWrapper(NativeFooWrapper(NativeFoo(\"hello\"))))\n assertEquals(\"NativeFoo('goodbye') (object)\", o.describeNativeFooWrapperN(NativeFooWrapper(NativeFoo(\"goodbye\"))))","completion":"assertEquals(\"null (object)\", o.describeNativeFooWrapperN(null))\n\n assertEquals(\"NativeFoo('hello') (object)\", o.describeNativeFooNWrapper(NativeFooNWrapper(NativeFoo(\"hello\"))))\n assertEquals(\"null (object)\", o.describeNativeFooNWrapper(NativeFooNWrapper(null)))<|endoftext|>"} {"prompt":"private inline fun buildFictitiousFunctionClass(prefix: String, arity: Int, consumer: (CirEntityId, CirProvided.RegularClass) -> Unit) {\n val typeParameters = List(arity + 1) { index ->\n CirProvided.TypeParameter(\n index = index,","completion":"variance = if (index == arity) Variance.OUT_VARIANCE else Variance.IN_VARIANCE\n )\n }\n\n val classId = CirEntityId.create(PACKAGE_NAME, CirName.create(\"$prefix$arity\"))\n val clazz = CirProvided.RegularClass(typeParameters, emptyList(), Visibilities.Public, ClassKind.INTERFACE)<|endoftext|>"} {"prompt":"@Suppress(\"UNCHECKED_CAST\")\n override fun transform(transformer: FirTransformer, data: D): E =\n transformer.transformField(this, data) as E\n\n abstract override fun replaceStatus(newStatus: FirDeclarationStatus)\n\n abstract override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef)","completion":"abstract override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?)\n\n abstract override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider)\n\n abstract override fun replaceContextReceivers(newContextReceivers: List)\n\n abstract override fun replaceInitializer(newInitializer: FirExpression?)<|endoftext|>"} {"prompt":"interface SomeInterface {\n fun foo(x: Int, y: String): String\n\n val bar: Boolean\n}\n\nclass SomeClass : SomeInterface {\n private val baz = 42\n\n override fun foo(x: Int, y: String): String {\n return y + x + baz\n }\n\n override var bar: Boolean\n get() = true\n set(value) {}","completion":"lateinit var fau: Double\n}\n\ninline class InlineClass<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.backend.common.serialization.proto.IrComposite as ProtoComposite\nimport org.jetbrains.kotlin.backend.common.serialization.proto.IrConst as ProtoConst\nimport org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall as ProtoConstructorCall","completion":"import org.jetbrains.kotlin.backend.common.serialization.proto.IrContinue as ProtoContinue\nimport org.jetbrains.kotlin.backend.common.serialization.proto.IrDelegatingConstructorCall as ProtoDelegatingConstructorCall\nimport org.jetbrains.kotlin.backend.common.serialization.proto.IrDoWhile as ProtoDoWhile<|endoftext|>"} {"prompt":"type: ConeKotlinType = field.returnTypeRef.coneType,\n origin: IrDeclarationOrigin = IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB\n ): IrField = convertCatching(field) {\n val irType = type.toIrType(c)\n\n val parentIsExternal = irParent.isExternalParent()","completion":"if (field is FirJavaField && field.isStatic && field.isFinal && parentIsExternal) {\n \/\/ We are going to create IR for Java static final fields lazily because they can refer to some Kotlin const.\n \/\/ This way we delay const evaluation of Java fields until IR tree is fully built, and we can run IR interpreter.<|endoftext|>"} {"prompt":"fun main2() = if (true) Foo::minus else","completion":"Foo::times<|endoftext|>"} {"prompt":"return this.zipFileSystem(create).use(action)\n}\n\nfun File.withZipFileSystem(action: (FileSystem) -> T): T = this.withZipFileSystem(false, action)\n\nprivate fun File.recursiveCopyTo(destination: File, resetTimeAttributes: Boolean = false) {\n val sourcePath = javaPath\n val destPath = destination.javaPath","completion":"val destFs = destPath.fileSystem\n val normalizedDestPath = destPath.normalize()\n Files.walk(sourcePath).forEach next@{ oldPath ->\n\n val relative = sourcePath.relativize(oldPath)\n\n \/\/ We are copying files between file systems,\n \/\/ so pass the relative path through the String.<|endoftext|>"} {"prompt":"val commonMainApi = project.configurations.sourceSetDependencyConfigurationByScope(\n commonMain,\n KotlinDependencyScope.API_SCOPE\n )\n val commonMainDependencies = commonMainApi.allDependencies\n commonMainDependencies.map { ModuleCoordinates(it.group, it.name, it.version) }.toSet()\n }\n }","completion":"internal fun Configuration.configureSourcesPublicationAttributes(target: KotlinTarget) {\n val project = target.project\n\n \/\/ In order to be consistent with Java Gradle Plugin, set usage attribute for sources variant\n \/\/ to be either JAVA_RUNTIME (for jvm) or KOTLIN_RUNTIME (for other targets)<|endoftext|>"} {"prompt":"val lookupTag = annotationClassId.toLookupTag()\n\n return object : AnnotationsLoaderVisitorImpl() {\n private val argumentMap = mutableMapOf()\n\n override fun visitExpression(name: Name?, expr: FirExpression) {\n if (name != null) argumentMap[name] = expr\n }\n\n override val visitNullNames: Boolean = false","completion":"override fun visitEnd() {\n \/\/ Do not load the @java.lang.annotation.Repeatable annotation instance generated automatically by the compiler for\n \/\/ Kotlin-repeatable annotation classes. Otherwise the reference to the implicit nested \"Container\" class cannot be\n \/\/ resolved, since that class is only generated in the backend, and is not visible to the frontend.<|endoftext|>"} {"prompt":"?\")!>select(Test.foo(this@build.getInv()), getInv())\n select(id(this@build.get()), id(get()))\n \"\"\n }\n \"\"\n }","completion":"val ret2 = build {\n emit(\"1\")\n select(get(), null)<|endoftext|>"} {"prompt":"arguments.add(\"-Pkotlin.internal.diagnostics.showStacktrace=$showDiagnosticsStacktrace\")\n }\n\n if (stacktraceMode != null) {\n arguments.add(\"--$stacktraceMode\")\n }\n\n konanDataDir?.let {","completion":"arguments.add(\"-Pkonan.data.dir=${konanDataDir.toAbsolutePath().normalize()}\")\n }\n\n if (kotlinUserHome != null) {\n arguments.add(\"-Pkotlin.user.home=${kotlinUserHome.absolutePathString()}\")\n }\n\n if (compilerArgumentsLogLevel != null) {<|endoftext|>"} {"prompt":") : KtCollectionLiteralReference(expression), KtFe10Reference {\n override fun getTargetDescriptors(context: BindingContext): Collection {\n val resolvedCall = context[BindingContext.COLLECTION_LITERAL_CALL, element]\n return listOfNotNull(resolvedCall?.resultingDescriptor)\n }","completion":"override fun isReferenceToImportAlias(alias: KtImportAlias): Boolean {\n return super.isReferenceToImportAlias(alias)\n }\n}<|endoftext|>"} {"prompt":"return copyOfUninitializedElements(fromIndex, toIndex)\n}\n\n\/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n *","completion":"* @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n *\/\npublic actual fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray {\n checkCopyOfRangeArguments(fromIndex, toIndex, size)<|endoftext|>"} {"prompt":"val a : (cnames.structs.FwdStruct) -> Unit = ::inlineF\n val b : (objcnames.classes.FwdObjcClass) -> Unit = ::inlineF","completion":"val c : (objcnames.protocols.FwdProtocol) -> Unit = ::inlineF\n}\n\nfun testCheckedAs1(x : lib.FwdStruct) = x as cnames.structs.FwdStruct<|endoftext|>"} {"prompt":"inner.forEach { it.generateMethods(thisDescriptor, name, result, c) }\n }\n\n override fun getStaticFunctionNames(thisDescriptor: ClassDescriptor, c: LazyJavaResolverContext): List =\n inner.flatMap { it.getStaticFunctionNames(thisDescriptor, c) }\n\n override fun generateStaticFunctions(","completion":"thisDescriptor: ClassDescriptor,\n name: Name,\n result: MutableCollection,\n c: LazyJavaResolverContext,\n ) {\n inner.forEach { it.generateStaticFunctions(thisDescriptor, name, result, c) }\n }\n\n override fun generateConstructors(\n thisDescriptor: ClassDescriptor,<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.targets.js.internal\n\nimport org.gradle.api.Project\nimport org.gradle.api.Task\nimport org.gradle.api.provider.Property\nimport org.gradle.api.provider.Provider\nimport org.gradle.api.services.BuildService\nimport org.gradle.api.services.BuildServiceParameters","completion":"import org.gradle.api.tasks.Internal\nimport org.jetbrains.kotlin.gradle.tasks.withType\nimport org.jetbrains.kotlin.gradle.utils.SingleActionPerProject\nimport java.io.File\nimport java.util.concurrent.ConcurrentHashMap\n\ninternal interface UsesLibraryFilterCachingService : Task {\n @get:Internal<|endoftext|>"} {"prompt":"val idSigIndex = reversedSignatureIndex[idSig] ?: error(\"Not found Idx for $idSig\")\n return libraryFile.declaration(idSigIndex)\n }\n\n fun deserializeFileImplicitDataIfFirstUse() {\n annotations?.let {\n file.annotations += declarationDeserializer.deserializeAnnotations(it)\n annotations = null","completion":"}\n }\n}\n\nclass FileDeserializationState(\n val linker: KotlinIrLinker,\n val fileIndex: Int,\n val file: IrFile,\n val fileReader: IrLibraryFileFromBytes,\n fileProto: ProtoFile,\n deserializeBodies: Boolean,\n allowErrorNodes: Boolean,\n deserializeInlineFunctions: Boolean,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorImpl\nimport org.jetbrains.kotlin.descriptors.impl.EmptyPackageFragmentDescriptor\nimport org.jetbrains.kotlin.descriptors.runtime.components.ReflectKotlinClass\nimport org.jetbrains.kotlin.descriptors.runtime.components.RuntimeModuleData","completion":"import org.jetbrains.kotlin.descriptors.runtime.structure.functionClassArity\nimport org.jetbrains.kotlin.descriptors.runtime.structure.wrapperByPrimitive\nimport org.jetbrains.kotlin.incremental.components.NoLookupLocation\nimport org.jetbrains.kotlin.load.java.JvmAbi<|endoftext|>"} {"prompt":"override val history: IReplStageHistory> = AggregatedReplStateHistory(state1.history, state2.history, lock)\n\n override fun > asState(target: Class): StateT =\n @Suppress(\"UNCHECKED_CAST\")\n when {","completion":"target.isAssignableFrom(state1::class.java) -> state1 as StateT\n target.isAssignableFrom(state2::class.java) -> state2 as StateT\n else -> super.asState(target)\n }\n\n override fun getNextLineNo() = state1.getNextLineNo()\n\n override val currentGeneration: Int get() = state1.currentGeneration<|endoftext|>"} {"prompt":"fun symlinkToDirectory() {\n val basedir = createTestFiles().cleanupRecursively()\n val original = basedir.resolve(\"8\")\n basedir.resolve(\"1\/3\/link\").tryCreateSymbolicLinkTo(original) ?: return\n\n \/\/ directory \"8\" contains \"9.txt\" file","completion":"val followWalk = basedir.walk(PathWalkOption.INCLUDE_DIRECTORIES, PathWalkOption.FOLLOW_LINKS)\n testVisitedFiles(referenceFilenames + listOf(\"\", \"1\/3\/link\", \"1\/3\/link\/9.txt\"), followWalk, basedir)<|endoftext|>"} {"prompt":"private val JUNIT_GENERATED_TEST_CLASS_BYTES by lazy { constructSyntheticTestClass() }\n private const val JUNIT_GENERATED_TEST_CLASS_PACKAGE = \"test\"\n private const val JUNIT_GENERATED_TEST_CLASS_NAME = \"JunitTest.class\"","completion":"const val JUNIT_GENERATED_TEST_CLASS_FQNAME = \"test.JunitTest\"\n\n private fun constructSyntheticTestClass(): ByteArray {\n return with(ClassWriter(ClassWriter.COMPUTE_MAXS or ClassWriter.COMPUTE_FRAMES)) {<|endoftext|>"} {"prompt":"if (irValue !is IrVariable || !irValue.isLateinit) {\n return expression\n }\n\n return backendContext.createIrBuilder(\n (irValue.parent as IrSymbolOwner).symbol,\n expression.startOffset,\n expression.endOffset\n ).run {\n irIfThenElse(\n expression.type,\n irEqualsNull(irGet(irValue)),","completion":"backendContext.throwUninitializedPropertyAccessException(this, irValue.name.asString()),\n irGet(irValue)\n )\n }\n }\n\n override fun visitGetField(expression: IrGetField): IrExpression {\n expression.transformChildrenVoid(this)\n val irField = expression.symbol.owner\n if (irField.isLateinitBackingField()) {<|endoftext|>"} {"prompt":"propertyReturnType: FirTypeRef,\n isVar: Boolean,\n annotationsFromProperty: List,\n property: LighterASTNode,\n ): FirBackingField {\n var modifiers: Modifier? = null\n val fieldAnnotations = mutableListOf()\n var returnType: FirTypeRef = implicitType","completion":"var backingFieldInitializer: FirExpression? = null\n this?.forEachChildren {\n when {\n it.tokenType == MODIFIER_LIST -> {\n modifiers = convertModifierList(it)\n fieldAnnotations += convertAnnotationList(it)\n }\n it.tokenType == TYPE_REFERENCE -> returnType = convertType(it)\n it.isExpression() -> {<|endoftext|>"} {"prompt":"internal class HighSurrogateCharSet(high: Char) : CharSet(high) {\n\n override fun accepts(startIndex: Int, testString: CharSequence): Int {\n val result = super.accepts(startIndex, testString)\n if (result < 0 || testString.isLowSurrogate(startIndex + 1)) {\n return -1\n }\n return result\n }","completion":"private fun CharSequence.isLowSurrogate(index: Int, leftBound: Int = 0, rightBound: Int = length)\n = (index in leftBound until rightBound && this[index].isLowSurrogate())\n\n \/\/ TODO: We have a similar code here, in LowSurrogateCharSet and in CharSet. Reuse it somehow.<|endoftext|>"} {"prompt":"@Test\n fun testNativeCrash() {\n treatFailedTestOutputAsStacktrace = true\n\n var e: Throwable? = null\n try {\n assertEvents(\n \"\"\"\nSTARTED SUITE root \/\/ root\n STARTED SUITE \/\/ root\/\n STARTED TEST displayName: Test, classDisplayName: , className: , name: Test \/\/ root\/\/Test","completion":"StdOut[Crash info] \/\/ root\/\/Test\n FAILURE \/\/ root\/\/Test\n COMPLETED FAILURE \/\/ root\/\/Test\n COMPLETED FAILURE \/\/ root\/\nCOMPLETED FAILURE \/\/ root \n \"\"\".trimIndent()\n ) {\n serviceMessage(TestSuiteStarted(\"\"))\n serviceMessage(TestStarted(\"Test\", false, null))\n regularText(<|endoftext|>"} {"prompt":"\/\/ MODULE: context\n\n\/\/ FILE: context.kt\nfun test() {\n call(\"foo\")\n}\n\nfun call(text: String) {}\n\n\n\/\/ MODULE: main\n\/\/ MODULE_KIND: CodeFragment\n\/\/ CONTEXT_MODULE: context\n\n\/\/ FILE: fragment.kt\n\/\/ CODE_FRAGMENT_KIND: EXPRESSION","completion":"\/\/ CODE_FRAGMENT_FOREIGN_VALUE: foo_DebugLabel(Ljava\/lang\/String;)\nfoo_DebugLabel<|endoftext|>"} {"prompt":"*\/ = undefined, facingMode: JsAny? \/* String|JsArray|ConstrainDOMStringParameters *\/ = undefined, resizeMode: JsAny? \/* String|JsArray|ConstrainDOMStringParameters *\/ = undefined, volume: JsAny? \/* Double|ConstrainDoubleRange *\/ = undefined, sampleRate: JsAny? \/* Int|ConstrainULongRange *\/ = undefined, sampleSize:","completion":"JsAny? \/* Int|ConstrainULongRange *\/ = undefined, echoCancellation: JsAny? \/* Boolean|ConstrainBooleanParameters *\/ = undefined, autoGainControl: JsAny? \/* Boolean|ConstrainBooleanParameters *\/ = undefined, noiseSuppression: JsAny? \/* Boolean|ConstrainBooleanParameters *\/ = undefined, latency: JsAny? \/* Double|ConstrainDoubleRange *\/ =<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.cli.js.dce\n\nimport org.jetbrains.kotlin.cli.common.CLITool\nimport org.jetbrains.kotlin.cli.common.ExitCode\nimport org.jetbrains.kotlin.cli.common.arguments.DevModeOverwritingStrategies","completion":"import org.jetbrains.kotlin.cli.common.arguments.K2JSDceArguments\nimport org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity\nimport org.jetbrains.kotlin.cli.common.messages.MessageCollector\nimport org.jetbrains.kotlin.config.Services<|endoftext|>"} {"prompt":"}\n return res\n}\n\n\/\/ FILE: 2.kt\n\nimport test.*\n\nclass Holder {\n var value: String = \"\"\n}\n\nfun test0(h: Holder): Int {\n val localResult = doCall2 (\n {\n h.value += \"OK_NONLOCAL\"\n if (true) {\n throw RuntimeException()\n }\n return 1\n },","completion":"{\n h.value += \", OK_EXCEPTION\"\n return 2\n },\n {\n h.value += \", OK_FINALLY\"\n \"OK_FINALLY\"\n }, \"FAILT\")\n\n return -1;\n}\n\nfun test1(h: Holder): Int {\n val localResult = doCall2 (\n {<|endoftext|>"} {"prompt":"a.foo(null, \"\").length","completion":"a.baz(\"\", null).length<|endoftext|>"} {"prompt":"assertEquals(true, notNullToNull(B()), \"B is B?\")\n assertEquals(false, notNullToNull(C()), \"C is B?\")\n assertEquals(true, notNullToNull(D()), \"D is B?\")\n assertEquals(true, notNullToNull(E()), \"E is B?\")","completion":"assertEquals(false, notNullToNull(F()), \"F is B?\")\n assertEquals(false, notNullToNull(Any()), \"Any is B?\")\n assertEquals(false, dtoNB(dyn), \"dynamic is B?\")\n\n assertEquals(false, notNullToNull({}), \"Function is B?\")<|endoftext|>"} {"prompt":"nameRef.name!!.specialFunction = specialFunction\n }\n })\n }\n\n private fun markDefaultParams(function: JsFunction) {\n val paramsByNames = function.parameters.associate { it.name to it }\n for (ifStatement in function.body.statements) {\n if (ifStatement !is JsIf || ifStatement.elseStatement != null) break","completion":"val thenStatement = ifStatement.thenStatement as? JsExpressionStatement ?: break\n val testExpression = ifStatement.ifExpression as? JsBinaryOperation ?: break\n\n if (testExpression.operator != JsBinaryOperator.REF_EQ) break\n val testLhs = testExpression.arg1 as? JsNameRef ?: break<|endoftext|>"} {"prompt":"u?.b?.foo()!! \/\/ was UNNECESSARY_SAFE_CALL everywhere, because result type (of 'foo()') wasn't made nullable","completion":"u!!.b?.foo()!!\n x?.b!!.foo()!!<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\n\/*\n * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)\n *\n * SPEC VERSION: 0.1-218\n * MAIN LINK: expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 2 -> sentence 1","completion":"* PRIMARY LINKS: expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 1 -> sentence 2\n * expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 1 -> sentence 1\n * expressions, type-checking-and-containment-checking-expressions, containment-checking-expression -> paragraph 3 -> sentence 1\n *<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.IrConst\nimport org.jetbrains.kotlin.ir.expressions.IrConstantPrimitive\nimport org.jetbrains.kotlin.ir.types.IrType\nimport org.jetbrains.kotlin.ir.util.IrElementConstructorIndicator\n\nclass IrConstantPrimitiveImpl internal constructor(","completion":"@Suppress(\"UNUSED_PARAMETER\")\n constructorIndicator: IrElementConstructorIndicator?,\n override val startOffset: Int,\n override val endOffset: Int,\n override var type: IrType,\n override var value: IrConst<*>,\n) : IrConstantPrimitive() {\n override var attributeOwnerId: IrAttributeContainer = this<|endoftext|>"} {"prompt":"override fun equals(other: Any?) = true\n}\n\n@JvmInline\nvalue class D(val t: T) {\n override fun equals(other: Any?) = true\n}\n\n@JvmInline\nvalue class E(val d: Double) {\n override fun equals(other: Any?) = true\n}\n\n@JvmInline","completion":"value class F(val e: E) {\n override fun equals(other: Any?) = true\n}\n\n@JvmInline\nvalue class G(val e: Int?) {\n override fun equals(other: Any?) = true\n}\n\n@JvmInline\nvalue class H(val e: Any?) {\n override fun equals(other: Any?) = true\n}\n\n@JvmInline<|endoftext|>"} {"prompt":"val smap = it.value.sortedByDescending(CommonSMAPTestUtil.SMAPAndFile::outputFile).mapNotNull(CommonSMAPTestUtil.SMAPAndFile::smap).joinToString(\"\\n\")\n CommonSMAPTestUtil.SMAPAndFile(if (smap.isNotEmpty()) smap else null, it.key, \"NOT_SORTED\")","completion":"}.associateBy { it.sourceFile }\n\n dumper.builderForModule(module).apply {\n for (source in compiledData.values) {\n appendLine(\"\/\/ FILE: ${File(source.sourceFile).name}\")\n appendLine(source.smap ?: \"\")\n }\n }\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DONT_SORT_DECLARATIONS\nimport org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_IR\nimport org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_ANNOTATIONS","completion":"import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.WITH_SIGNATURES\nimport org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.FIR_DUMP\nimport org.jetbrains.kotlin.test.directives.model.DirectivesContainer\nimport org.jetbrains.kotlin.test.model.BinaryArtifacts<|endoftext|>"} {"prompt":"* Returns a list containing elements at indices in the specified [indices] range.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}","completion":"\/**\n * Returns a list containing elements at indices in the specified [indices] range.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}<|endoftext|>"} {"prompt":"\/\/ test.kt:23 box: p:MyPair=MyPair\n\/\/ EXPECTATIONS FIR JVM_IR\n\/\/ test.kt:18 box: p:MyPair=MyPair\n\/\/ EXPECTATIONS JVM_IR\n\/\/ test.kt:6 component1:\n\/\/ test.kt:18 box: p:MyPair=MyPair\n\/\/ EXPECTATIONS FIR JVM_IR","completion":"\/\/ test.kt:20 box: p:MyPair=MyPair, o:java.lang.String=\"O\":java.lang.String\n\/\/ EXPECTATIONS JVM_IR\n\/\/ test.kt:10 component2:\n\/\/ test.kt:20 box: p:MyPair=MyPair, o:java.lang.String=\"O\":java.lang.String<|endoftext|>"} {"prompt":"output.addSourceMappingURL(outputFile)\n }\n val code = output.toString()\n\n val prefix = outputPrefixFile?.readText() ?: \"\"\n val postfix = outputPostfixFile?.readText() ?: \"\"\n\n val jsFile = SimpleOutputFile(sourceFiles, outputFile.name, prefix + code + postfix)","completion":"val outputFiles = arrayListOf(jsFile)\n\n outputFiles += metadataFiles(outputFile)\n\n if (sourceMapBuilderConsumer != null) {\n sourceMapBuilder.skipLinesAtBeginning(StringUtil.getLineBreakCount(prefix))\n val sourceMapFile = SimpleOutputFile(sourceFiles, sourceMapBuilder.outFile.name, sourceMapBuilder.build())<|endoftext|>"} {"prompt":"}.apply(::addModule)\n }\n\n buildKtSourceModule {\n configLanguageVersionSettings?.let { this.languageVersionSettings = it }\n this.platform = platform\n this.moduleName = compilerConfig.get(CommonConfigurationKeys.MODULE_NAME) ?: \"\"\n\n addModuleDependencies(moduleName)","completion":"addSourceRoots(compilerConfig.javaSourceRoots.map { Paths.get(it) })\n }.apply(::addModule)\n\n\n this.platform = platform\n}<|endoftext|>"} {"prompt":"* despite no modifier being present. This is considered a 'special Kotlin Native' class in the context of this function.\n *\/\ncontext(KtAnalysisSession)\nprivate fun KtNamedClassOrObjectSymbol.isInlineIncludingKotlinNativeSpecialClasses(): Boolean {\n if (this.isInline) return true\n val classId = classIdIfNonLocal ?: return false","completion":"\/* Top Level symbols can be special K\/N types *\/\n if (getContainingSymbol() is KtClassOrObjectSymbol) return false\n\n if (classId.packageFqName == KonanFqNames.internalPackageName && classId.shortClassName == KonanFqNames.nativePtr.shortName()) {\n return true\n }<|endoftext|>"} {"prompt":"return expression.branches.all { it.accept(this, data) }\n }\n\n override fun visitBranch(branch: IrBranch, data: IrInterpreterCheckerData): Boolean {\n return branch.condition.accept(this, data) && branch.result.accept(this, data)\n }","completion":"override fun visitWhileLoop(loop: IrWhileLoop, data: IrInterpreterCheckerData): Boolean {\n return loop.asVisited {\n loop.condition.accept(this, data) && (loop.body?.accept(this, data) ?: true)\n }\n }<|endoftext|>"} {"prompt":"if (x is Int) { if (x is Int) { if (x is Int) { if (x is Int) { if (x is Int) {","completion":"if (x is Int) { if (x is Int) { if (x is Int) { if (x is Int) { if (x is Int) {<|endoftext|>"} {"prompt":"b.equals(null)\n b.propT\n b.propAny","completion":"b.propNullableT\n b.propNullableAny\n b.funT()<|endoftext|>"} {"prompt":"import kotlin.script.experimental.host.ScriptingHostConfiguration\nimport kotlin.script.experimental.host.withDefaultsFrom\nimport kotlin.script.experimental.impl.internalScriptingRunSuspend\nimport kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration\nimport kotlin.script.experimental.jvm.util.isIncomplete\n\n\/**","completion":"* REPL Compilation wrapper for \"legacy\" REPL APIs defined in the org.jetbrains.kotlin.cli.common.repl package\n *\/\nclass JvmReplCompiler(\n val scriptCompilationConfiguration: ScriptCompilationConfiguration,\n val hostConfiguration: ScriptingHostConfiguration = defaultJvmScriptingHostConfiguration\n) : ReplCompilerWithoutCheck {<|endoftext|>"} {"prompt":"resumeResult = irBlock(startOffset, endOffset) {\n +irCall(restoreCoroutineState)\n +irGetOrThrow(irGet(resultArgument))\n })\n val expressionResult = when {\n suspendCall.type.isUnit() -> irImplicitCoercionToUnit(suspensionPoint)\n else -> irAs(suspensionPoint, suspendCall.type)\n }","completion":"return irBlock(expression) {\n tempStatements.forEach { +it }\n +expressionResult\n }\n }\n\n }\n }\n\n private fun IrBuilderWithScope.irWrap(expression: IrExpression, tempStatements: List)\n = if (tempStatements.isEmpty())\n expression<|endoftext|>"} {"prompt":"private fun genInstanceOfImpl(obj: LLVMValueRef, dstClass: IrClass) = with(functionGenerationContext) {\n if (dstClass.defaultType.isObjCObjectType()) {\n genInstanceOfObjC(obj, dstClass)\n } else with(VirtualTablesLookup) {\n checkIsSubtype(","completion":"objTypeInfo = loadTypeInfo(bitcast(codegen.kObjHeaderPtr, obj)),\n dstClass\n )\n }\n }\n\n private fun genInstanceOfObjC(obj: LLVMValueRef, dstClass: IrClass): LLVMValueRef {\n val objCObject = callDirect(\n context.ir.symbols.interopObjCObjectRawValueGetter.owner,<|endoftext|>"} {"prompt":"fun builder(c: suspend Controller.() -> Unit) {\n c.startCoroutine(Controller(), EmptyContinuation)\n}\n\ninline fun run(block: () -> Unit) {\n block()\n}\n\nfun box(): String {\n var result = \"\"\n run {\n builder {\n try {\n result += suspendHere(\"O\")\n } finally {\n result += suspendHere(\"K\")\n }","completion":"}\n }\n\n return result\n}<|endoftext|>"} {"prompt":"typeArgument.type.mapToReferenceTypeIgnoringNullability()\n }\n }\n }\n}\n\n\n\/**\n * Types to be \"hidden\" during mapping, i.e., represented as `id`.\n *\n * Currently, it contains super types of classes handled by custom type mappers.\n * Note: It can be generated programmatically, but requires stdlib in this case.\n *\/","completion":"private val hiddenClassIds: Set = listOf(\n \"kotlin.Any\",\n \"kotlin.CharSequence\",\n \"kotlin.Comparable\",\n \"kotlin.Function\",\n \"kotlin.Number\",\n \"kotlin.collections.Collection\",\n \"kotlin.collections.Iterable\",<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.konan.test.blackbox\n\nimport org.jetbrains.kotlin.konan.test.blackbox.support.TestName\nimport org.jetbrains.kotlin.konan.test.blackbox.support.util.TCTestOutputFilter","completion":"import org.jetbrains.kotlin.konan.test.blackbox.support.util.TestOutputFilter\nimport org.junit.jupiter.api.Assertions.assertEquals\nimport org.junit.jupiter.api.Assertions.assertTrue\nimport org.junit.jupiter.api.Tag\nimport org.junit.jupiter.api.Test\n\n@Tag(\"infrastructure\")<|endoftext|>"} {"prompt":"processControlFlowEdge(current, insnNode, label.indexOf())\n }\n }\n\n private fun visitLookupSwitchInsnNode(insnNode: LookupSwitchInsnNode, current: F) {\n processControlFlowEdge(current, insnNode, insnNode.dflt.indexOf())\n for (label in insnNode.labels) {","completion":"processControlFlowEdge(current, insnNode, label.indexOf())\n }\n }\n\n private fun visitJumpInsnNode(insnNode: JumpInsnNode, current: F, insn: Int, insnOpcode: Int) {\n if (insnOpcode != Opcodes.GOTO) {\n processControlFlowEdge(current, insnNode, insn + 1)\n }<|endoftext|>"} {"prompt":"@JvmName(\"mapDirectoryToFile\") \/\/ avoids jvm signature clash\ninternal fun Provider.mapToFile(): Provider = map { it.asFile }\n\ninternal fun Provider.getFile(): File = get().asFile\n\n@JvmName(\"getDirectoryAsFile\") \/\/ avoids jvm signature clash\ninternal fun Provider.getFile(): File = get().asFile\n\n\/**","completion":"* Checks if the file exists, taking into account compatibility with different versions of Gradle.\n * It should be used instead of [File.exists] in checking UPD inputs. See KT-54232 for more info.\n *\n * @return `true` if the file exists, `false` otherwise.\n *\n * NOTE: You can remove this method and all its usages since the minimal supported version of gradle become 8.0\n *\/<|endoftext|>"} {"prompt":"if (!(value_1 !is Int)) throw Exception()\n}\n\n\/\/ TESTCASE NUMBER: 5\nfun case_5_1(value_1: Int?): Boolean {\n contract { returns(true) implies (value_1 == null) }\n return value_1 == null\n}\nfun case_5_2(value_1: Int?): Boolean {","completion":"contract { returns(true) implies (value_1 != null) }\n return value_1 != null\n}\nfun case_5_3(value_1: Int?): Boolean {\n contract { returns(false) implies (value_1 == null) }\n return !(value_1 == null)\n}\nfun case_5_4(value_1: Int?): Boolean {<|endoftext|>"} {"prompt":"package test\n\nclass ClassWithPrivateVarAdded {\n private var x: Int = 100\n public fun unchangedFun() {}\n}\n\nclass ClassWithPrivateVarRemoved {\n public fun unchangedFun() {}\n}\n\nclass ClassWithPrivateVarSignatureChanged {\n private var x: String = \"X\"\n public fun unchangedFun() {}\n}\n\nclass ClassWithGetterAndSetterForPrivateVarChanged {","completion":"private var x: Int\n get() = 200\n set(value) {}\n public fun unchangedFun() {}\n}<|endoftext|>"} {"prompt":"?: throw IncorrectOperationException(\"Class was not created. Method name: $name; return type: $canonicalText\")\n\n return klass.methods.singleOrNull()\n ?: throw IncorrectOperationException(\"Method was not created. Method name: $name; return type: $canonicalText\")\n }","completion":"fun createDummyClass(project: Project): PsiClass = PsiElementFactory.getInstance(project).createClass(\"dummy\")\n\n private fun createDummyJavaFile(project: Project, text: String): PsiJavaFile {\n return PsiFileFactory.getInstance(project).createFileFromText(\n DUMMY_FILE_NAME,\n JavaFileType.INSTANCE,\n text<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.objcexport.analysisApiUtils.objCErrorType\nimport org.jetbrains.kotlin.objcexport.extras.objCTypeExtras\nimport org.jetbrains.kotlin.objcexport.extras.originClassId\nimport org.jetbrains.kotlin.objcexport.extras.requiresForwardDeclaration","completion":"\/**\n * [org.jetbrains.kotlin.backend.konan.objcexport.ObjCExportTranslatorImpl.mapType]\n *\/\ncontext(KtAnalysisSession, KtObjCExportSession)\ninternal fun KtType.translateToObjCType(typeBridge: TypeBridge): ObjCType {\n return when (typeBridge) {<|endoftext|>"} {"prompt":") {}\n \"\"\".trimIndent()\n }\n\n result.assertCommonized(\n \"(${WATCHOS_ARM64.name}, ${IOS_ARM64.name})\", \"\"\"\n typealias OtherAlias = PlatformUInt\n \n expect class Box()\n\n expect fun fn(","completion":"arg1: Box>, \n arg2: Box>\n )\n \"\"\".trimIndent()\n )\n }\n}<|endoftext|>"} {"prompt":"(0 until irAnnotation.typeArgumentsCount).joinTo(this, \", \", \"<\", \">\") { i ->\n irAnnotation.getTypeArgument(i)?.renderTypeWithRenderer(renderer, options) ?: \"null\"\n }\n }\n\n if (irAnnotation.valueArgumentsCount == 0) return","completion":"val valueParameterNames = irAnnotation.getValueParameterNamesForDebug()\n\n appendIterableWith(0 until irAnnotation.valueArgumentsCount, separator = \", \", prefix = \"(\", postfix = \")\") {\n append(valueParameterNames[it])\n append(\" = \")\n renderAsAnnotationArgument(irAnnotation.getValueArgument(it), renderer, options)\n }\n}<|endoftext|>"} {"prompt":"override val receiverParameter: KtReceiverParameterSymbol?\n get() = withValidityAssertion { propertyDescriptor.extensionReceiverParameter?.toKtReceiverParameterSymbol(analysisContext) }\n\n override val modality: Modality\n get() = withValidityAssertion { propertyDescriptor.ktModality }\n\n override val visibility: Visibility","completion":"get() = withValidityAssertion { propertyDescriptor.ktVisibility }\n\n override val annotationsList: KtAnnotationsList\n get() = withValidityAssertion { KtEmptyAnnotationsList(token) }\n\n override fun createPointer(): KtSymbolPointer = withValidityAssertion {<|endoftext|>"} {"prompt":"\/\/ Implicitly checking none of string constants starts with \"kotlin\/\" prefix, just in case.\n assertFalse(\"$constant found at ${entry.name}\", constant.startsWith(\"kotlin\/\"))\n }\n }\n }\n\n companion object {\n private val INTERNAL_COMPANIONS =","completion":"listOf(\"Char\", \"Byte\", \"Short\", \"Int\", \"Float\", \"Long\", \"Double\", \"String\", \"Enum\")\n .map { \"kotlin\/jvm\/internal\/${it}CompanionObject\" }\n val PREDEFINED_STRINGS =<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses, +GenericInlineClassParameter\n\n\/\/ FILE: test.kt\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class R(private val r: T) {\n\n companion object {\n val ok","completion":"@JvmStatic get() = \"OK\"\n }\n}\n\nfun box() = J.test()\n\n\/\/ FILE: J.java\npublic class J {\n public static String test() {\n return R.getOk();\n }\n}<|endoftext|>"} {"prompt":"val initializer = it.expression as IrCall\n when {\n initializer.isAtomicFieldGetter() -> {\n \/\/ val _a = atomic(0)\n \/\/ var a: Int by _a\n \/\/ Accessors of the delegated property `a` are implemented via the generated property `a$delegate`,\n \/\/ that is the copy of the original `_a`.","completion":"\/\/ They should be delegated to the value of the original field `_a` instead of `a$delegate`.\n\n \/\/ fun () = a$delegate.value -> _a.value\n \/\/ fun (value: Int) = { a$delegate.value = value } -> { _a.value = value }\n val originalField = initializer.getBackingField()<|endoftext|>"} {"prompt":"val newArgumentsList = arguments.mapIndexed { index, oldArgument -> newArguments[index] ?: oldArgument }\n return type.replace(newArgumentsList)\n }\n}\n\nobject EmptySubstitutor : NewTypeSubstitutor {\n override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? = null","completion":"override val isEmpty: Boolean get() = true\n}\n\nclass NewTypeSubstitutorByConstructorMap(val map: Map) : NewTypeSubstitutor {\n override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? = map[constructor]\n\n override val isEmpty: Boolean get() = map.isEmpty()<|endoftext|>"} {"prompt":"@Test\n fun testEvalWithIfResult() {\n checkEvaluateInRepl(\n sequenceOf(\n \"val x = 5\",\n \"x + 6\",\n \"if (x < 10) res1 * 2 else x\"\n ),\n sequenceOf(null, 11, 22)\n )\n }\n\n @Test\n fun testImplicitReceiver() {","completion":"val receiver = TestReceiver()\n checkEvaluateInRepl(\n sequenceOf(\n \"val x = 4\",\n \"x + prop1\",\n \"res1 * 3\"\n ),\n sequenceOf(null, 7, 21),\n simpleScriptCompilationConfiguration.with {\n implicitReceivers(TestReceiver::class)\n },\n simpleScriptEvaluationConfiguration.with {<|endoftext|>"} {"prompt":"*\/\npublic external abstract class NodeList : ItemArrayLike {\n override fun item(index: Int): Node?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun NodeList.get(index: Int): Node? = asDynamic()[index]\n\n\/**","completion":"* Exposes the JavaScript [HTMLCollection](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/HTMLCollection) to Kotlin\n *\/\npublic external abstract class HTMLCollection : ItemArrayLike, UnionElementOrHTMLCollection {\n override fun item(index: Int): Element?\n fun namedItem(name: String): Element?\n}<|endoftext|>"} {"prompt":"@kotlin.SinceKotlin(version = \"1.3\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun kotlin.UShortArray.first(): kotlin.UShort\n\n@kotlin.SinceKotlin(version = \"1.3\")\n@kotlin.ExperimentalUnsignedTypes","completion":"@kotlin.internal.InlineOnly\npublic inline fun kotlin.UShortArray.first(predicate: (kotlin.UShort) -> kotlin.Boolean): kotlin.UShort\n\npublic fun kotlin.collections.Iterable.first(): T<|endoftext|>"} {"prompt":"\/\/ library.kt:20 box: mainVar:int=1:int, fooParam\\13:int=1:int, $i$f$foo\\13\\54:int=0:int, fooVar\\13:int=1:int, bazParam\\14:int=1:int, $i$f$baz\\14\\196:int=0:int, bazVar\\14:int=3:int,","completion":"baz1Param\\15:int=1:int, $i$f$baz1\\15\\207:int=0:int, baz1Var\\15:int=3:int, baz1BlockParam\\17:int=1:int, $i$a$-baz1-LibraryKt$baz$1\\17\\210\\14:int=0:int,<|endoftext|>"} {"prompt":"public inline val ResponseType.Companion.DEFAULT: ResponseType get() = \"default\".toJsString().unsafeCast()\n\npublic inline val ResponseType.Companion.ERROR: ResponseType get() = \"error\".toJsString().unsafeCast()","completion":"public inline val ResponseType.Companion.OPAQUE: ResponseType get() = \"opaque\".toJsString().unsafeCast()\n\npublic inline val ResponseType.Companion.OPAQUEREDIRECT: ResponseType get() = \"opaqueredirect\".toJsString().unsafeCast()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.objcexport.testUtils.getClassOrFail\nimport org.jetbrains.kotlin.objcexport.testUtils.getFunctionOrFail\nimport org.junit.jupiter.api.Test\nimport kotlin.test.assertFalse\nimport kotlin.test.assertTrue\n\nclass IsVisibleInObjCTest(","completion":"private val inlineSourceCodeAnalysis: InlineSourceCodeAnalysis,\n) {\n @Test\n fun `test - simple public function`() {\n val file = inlineSourceCodeAnalysis.createKtFile(\"fun foo() = Unit\")\n analyze(file) {\n val fooSymbol = file.getFunctionOrFail(\"foo\")\n assertTrue(fooSymbol.isVisibleInObjC())\n }<|endoftext|>"} {"prompt":"\/\/ !OPT_IN: kotlin.ExperimentalStdlibApi\n\/\/ IGNORE_BACKEND: JVM\n\n\/\/ IMPORTANT!\n\/\/ Please, when your changes cause failures in bytecodeText tests for 'for' loops,\n\/\/ examine the resulting bytecode shape carefully.\n\/\/ Range and progression-based loops generated with Kotlin compiler should be","completion":"\/\/ as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').\n\/\/ Otherwise it may result in performance regression due to missing HotSpot optimizations.\n\/\/ Run Kotlin compiler benchmarks (https:\/\/github.com\/Kotlin\/kotlin-benchmarks)\n\/\/ with compiler built from your changes if you are not sure.\n\nconst val M = Char.MIN_VALUE<|endoftext|>"} {"prompt":"abstract override val annotations: List\n abstract val statements: List\n\n override fun accept(visitor: FirVisitor, data: D): R =\n visitor.visitBlock(this, data)\n\n @Suppress(\"UNCHECKED_CAST\")","completion":"override fun transform(transformer: FirTransformer, data: D): E =\n transformer.transformBlock(this, data) as E\n\n abstract override fun replaceConeTypeOrNull(newConeTypeOrNull: ConeKotlinType?)\n\n abstract override fun replaceAnnotations(newAnnotations: List)<|endoftext|>"} {"prompt":") {\n\n \/** The current time period, which starts from 0 and will increment by 1 whenever [newTimePeriod] is called. *\/\n private val currentTimePeriod = AtomicInteger(0)\n\n private val cache = ConcurrentHashMap>()\n\n fun newTimePeriod() {\n currentTimePeriod.incrementAndGet()\n }","completion":"fun computeIfAbsent(key: KEY, valueProvider: (KEY) -> VALUE): VALUE {\n return readLock { \/\/ Read lock so that this method can be called concurrently\n val cacheEntryValue = cache.computeIfAbsent(key) { \/\/ `cache` is thread-safe\n CacheEntryValue(value = valueProvider(key), currentTimePeriod = currentTimePeriod.get())\n }<|endoftext|>"} {"prompt":"executable = \"ssh\"\n val remoteExecutable = this@RunKotlinNativeTask.executable.split(\"\/\").last()\n args (remoteHost, \"$remoteHostFolder\/$remoteExecutable\")\n }\n else -> executable = this@RunKotlinNativeTask.executable\n }\n\n args(argumentsList)\n args(\"-f\", benchmark)","completion":"\/\/ Logging with application should be done only in case it controls running benchmarks itself.\n \/\/ Although it's a responsibility of gradle task.\n if (verbose && repeatingType == BenchmarkRepeatingType.INTERNAL) {\n args(\"-v\")\n }\n args(\"-w\", warmupCount.toString())\n args(\"-r\", repeatCount.toString())\n standardOutput = output\n }<|endoftext|>"} {"prompt":"\/\/ FILE: TestCase3.kt\n\/\/ TESTCASE NUMBER: 3\npackage testsCase3\nimport libCase3.format\nimport kotlin.text.*\n\nfun case3() {\n val y1 =(String)::format","completion":"\")!>y1\n\n val y2 =\"\"::format\n \")!>y2\n}<|endoftext|>"} {"prompt":"public inline fun Array.reduce(operation: (acc: S, T) -> S): S {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator: S = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }","completion":"return accumulator\n}\n\n\/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n *<|endoftext|>"} {"prompt":"project(\"customSrcDir\", gradleVersion) {\n build(\"build\")\n }\n }\n\n @GradleTest\n @DisplayName(\"Plugin should correctly handle additional java source directories\")\n fun testKotlinExtraJavaSrc(gradleVersion: GradleVersion) {\n project(\"additionalJavaSrc\", gradleVersion) {\n build(\"build\")\n }\n }","completion":"@GradleTest\n @DisplayName(\"Using newer language features with older api level should fail the build\")\n fun testLanguageVersion(gradleVersion: GradleVersion) {\n project(\"languageVersion\", gradleVersion) {\n buildAndFail(\"build\") {\n assertOutputContains(\"Suspend function type is allowed as a supertype only since version 1.6\")\n }\n }\n }<|endoftext|>"} {"prompt":"open class FirImplicitAwareBodyResolveTransformer(\n session: FirSession,\n scopeSession: ScopeSession,\n private val implicitBodyResolveComputationSession: ImplicitBodyResolveComputationSession,\n phase: FirResolvePhase,\n implicitTypeOnly: Boolean,\n returnTypeCalculator: ReturnTypeCalculatorWithJump,","completion":"outerBodyResolveContext: BodyResolveContext? = null,\n) : FirBodyResolveTransformer(\n session,\n phase,\n implicitTypeOnly,\n scopeSession,\n returnTypeCalculator,\n outerBodyResolveContext,\n) {\n override fun transformForeignAnnotationCall(symbol: FirBasedSymbol<*>, annotationCall: FirAnnotationCall): FirAnnotationCall {<|endoftext|>"} {"prompt":"override fun clashingMethodWithObjCNameInBoth(): Any = \"five\"\n}\n\nclass InterfaceNameManglingC1 {\n val clashingProperty: String = \"one\"\n\n fun clashingMethod(): String = \"two\"\n}\n\nfinal class InterfaceNameManglingC2 {\n val clashingProperty: Int = 1\n\n fun clashingMethod(): Int = 2\n}","completion":"fun o1() = InterfaceNameManglingC1()\n\nfun o2() = InterfaceNameManglingC2()<|endoftext|>"} {"prompt":"put(JVMConfigurationKeys.NO_KOTLIN_NOTHING_VALUE_EXCEPTION, arguments.noKotlinNothingValueException)\n put(JVMConfigurationKeys.NO_RESET_JAR_TIMESTAMPS, arguments.noResetJarTimestamps)\n put(JVMConfigurationKeys.NO_UNIFIED_NULL_CHECKS, arguments.noUnifiedNullChecks)","completion":"put(JVMConfigurationKeys.NO_SOURCE_DEBUG_EXTENSION, arguments.noSourceDebugExtension)\n\n put(JVMConfigurationKeys.SERIALIZE_IR, JvmSerializeIrMode.fromString(arguments.serializeIr))\n\n put(JVMConfigurationKeys.VALIDATE_IR, arguments.validateIr)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.visitors.FirVisitor\nimport org.jetbrains.kotlin.fir.visitors.transformInplace\n\n@OptIn(FirImplementationDetail::class, ResolveStateAccess::class)\ninternal class FirCodeFragmentImpl(\n override val source: KtSourceElement?,\n resolvePhase: FirResolvePhase,","completion":"override var annotations: MutableOrEmptyList,\n override val moduleData: FirModuleData,\n override val origin: FirDeclarationOrigin,\n override val attributes: FirDeclarationAttributes,\n override val symbol: FirCodeFragmentSymbol,\n override var block: FirBlock,\n) : FirCodeFragment() {\n\n init {<|endoftext|>"} {"prompt":"- TEST_METHOD_IMPL(directExt);\n\n@end\n\n@implementation CallingConventionsHeir\n\n@end\n\n\n\/\/ MODULE: main(cinterop)\n\/\/ FILE: main.kt\n@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)\nimport direct.*\nimport kotlinx.cinterop.*\nimport kotlin.test.*","completion":"class CallingConventionsNativeHeir() : CallingConventions() {\n \/\/ nothing\n}\n\ntypealias CC = CallingConventions\ntypealias CCH = CallingConventionsHeir\ntypealias CCN = CallingConventionsNativeHeir\n\n\/\/ KT-54610\nfun box(): String {\n autoreleasepool {\n val cc = CC()\n val cch = CCH()\n val ccn = CCN()<|endoftext|>"} {"prompt":"fun addClassExpectation(name: String, jvmSignature: String?, genericSignature: String) {\n classExpectations.add(SignatureExpectation(\"class: $name\", name, jvmSignature, genericSignature))\n }\n\n fun addFieldExpectation(className: String, memberName: String, jvmSignature: String?, genericSignature: String) {","completion":"fieldExpectations.add(SignatureExpectation(\"field: $className::$memberName\", memberName, jvmSignature, genericSignature))\n }\n\n fun addMethodExpectation(className: String, memberName: String, jvmSignature: String?, genericSignature: String) {<|endoftext|>"} {"prompt":"\/\/ UNEXPECTED BEHAVIOUR\n\/\/ Issue: KT-37056\nclass A()\n\n\/\/ TESTCASE NUMBER: 1\nfun case1(a: A?) {\n val test = a?.let {\n\n Case1.invoke(it) \/\/resolved to private constructor\n\n Case1(it) \/\/resolved to private constructor\n\n Case1(A()) \/\/resolved to private constructor\n }","completion":"Case1(A()) \/\/resolved to private constructor\n Case1(a = A()) \/\/resolved to private constructor\n}\n\nclass Case1 private constructor(val a: String) {\n companion object {\n operator fun invoke(a: A) = \"\"\n }\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun case2(a: A){\n Case2(a)<|endoftext|>"} {"prompt":"assertFailsWith { HexFormat { bytes.bytesPerLine = Int.MIN_VALUE } }\n }\n\n @Test\n fun nonPositiveBytesPerGroup() {\n assertFailsWith { HexFormat { bytes.bytesPerGroup = 0 } }","completion":"assertFailsWith { HexFormat { bytes.bytesPerGroup = -1 } }\n assertFailsWith { HexFormat { bytes.bytesPerGroup = Int.MIN_VALUE } }\n }\n\n @Test\n fun byteSeparatorWithNewLine() {<|endoftext|>"} {"prompt":"* The capacity is the maximum length this string builder can have before an allocation occurs.\n *\n * In Kotlin\/JS implementation of StringBuilder the value returned from this method may not indicate the actual size of the backing storage.\n *\/\n @SinceKotlin(\"1.3\")\n public fun capacity(): Int\n\n \/**","completion":"* Ensures that the capacity of this string builder is at least equal to the specified [minimumCapacity].\n *\n * If the current capacity is less than the [minimumCapacity], a new backing storage is allocated with greater capacity.\n * Otherwise, this method takes no action and simply returns.\n *\/\n @SinceKotlin(\"1.4\")\n public fun ensureCapacity(minimumCapacity: Int)\n\n \/**<|endoftext|>"} {"prompt":"if (descriptor.kind == CallableMemberDescriptor.Kind.SYNTHESIZED) {\n return true\n }\n if (descriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {\n return descriptor.overriddenDescriptors.all(::isOrOverridesSynthesized)\n }\n return false\n}","completion":"fun isBinaryRemOperator(call: Call): Boolean {\n val callElement = call.callElement as? KtBinaryExpression ?: return false\n val operator = callElement.operationToken\n if (operator !is KtToken) return false\n\n val name = OperatorConventions.getNameForOperationSymbol(operator, true, true) ?: return false<|endoftext|>"} {"prompt":"var outerClass = findClass(outerClassId, scope) ?: return null\n\n pathSegments.drop(1).forEach {\n outerClass = outerClass.findInnerClass(Name.identifier(it)) ?: return null\n }\n\n return outerClass\n }\n\n treeBasedJavaClasses[classId]?.let { javaClass ->","completion":"javaClass.virtualFile?.let { if (it in scope) return javaClass }\n }\n\n val javaClass = symbolBasedClassesCache[classId]\n if (javaClass != null) {\n javaClass.virtualFile?.let { file ->\n if (file in scope) return javaClass\n }\n }<|endoftext|>"} {"prompt":"element.accept(IrValidator(backendContext, validatorConfig), null)\n element.checkDeclarationParents()\n } catch (t: Throwable) {\n \/\/ TODO: Add reference to source.\n if (validatorConfig.abortOnError)\n throw IllegalStateException(\"Failed IR validation ${state.beforeOrAfter} ${state.phase}\", t)","completion":"else context.reportCompilationWarning(\"[IR VALIDATION] ${state.beforeOrAfter} ${state.phase}: ${t.message}\")\n }\n }\n\nprivate fun getIrDumper(): Action =\n fun(state: ActionState, data: Data, context: Context) {\n if (!state.isDumpNeeded()) return<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.javac.resolve\n\nimport com.sun.source.tree.CompilationUnitTree\nimport com.sun.tools.javac.code.TypeTag\nimport com.sun.tools.javac.tree.JCTree\nimport org.jetbrains.kotlin.javac.JavacWrapper","completion":"import org.jetbrains.kotlin.load.java.structure.JavaClass\nimport kotlin.experimental.inv\n\nclass ConstantEvaluator(private val containingClass: JavaClass,\n private val javac: JavacWrapper,\n private val compilationUnit: CompilationUnitTree) {\n fun getValue(expr: JCTree.JCExpression): Any? {<|endoftext|>"} {"prompt":"}\n\n @Fun\n fun localMember(): @FunType Int {\n @Anno1 val a = @Anno2 1\n val b = @AnonymousFunction fun(@AnonymousParameter a: @AnonymousParameterType Int) {\n @Anno foo()\n }\n\n @Anno\n fun boo(@Anno a: @Anno Int): @Anno Int {\n @Anno","completion":"fun boo(@Anno a: @Anno Int): @Anno Int {\n @Anno\n fun boo(@Anno a: @Anno Int): @Anno Int {\n\n }\n }\n }\n\n @Anno<|endoftext|>"} {"prompt":"path.startsWith(PROJECT_DIR_PLACEHOLDER) -> {\n val basePath = baseDirPath ?: error(\"Could not get project root dir\")\n File(basePath + path.substring(PROJECT_DIR_PLACEHOLDER.length))\n }\n else -> File(path)\n }\n\n private companion object {","completion":"private const val PROJECT_DIR_PLACEHOLDER = \"${'$'}PROJECT_DIR$\"\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolKind\nimport org.jetbrains.kotlin.analysis.api.symbols.pointers.KtPsiBasedSymbolPointer\nimport org.jetbrains.kotlin.analysis.api.symbols.pointers.KtSymbolPointer","completion":"import org.jetbrains.kotlin.analysis.api.types.KtType\nimport org.jetbrains.kotlin.descriptors.TypeAliasDescriptor\nimport org.jetbrains.kotlin.descriptors.Visibility\nimport org.jetbrains.kotlin.name.ClassId\nimport org.jetbrains.kotlin.name.Name<|endoftext|>"} {"prompt":"declarationToRender.render()\n } else {\n declaration.getOrBuildFirOfType(firSession)\n declarationToRender.render()\n }\n\n val firDeclarationAfter = declaration.getOrBuildFirOfType(firSession)\n testServices.assertions.assertEquals(firDeclarationBefore, firDeclarationAfter) {","completion":"\"The declaration before and after must be the same\"\n }\n\n testServices.assertions.assertEquals(textBefore, textAfter) {\n \"The declaration must have the same in the resolved state\"\n }\n\n return \"BEFORE MODIFICATION:\\n$textBefore\\nAFTER MODIFICATION:\\n$textAfterModification\"\n}\n\n\/**<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +InlineClasses -MangleClassMembersReturningInlineClasses\n\/\/ WITH_STDLIB\n\/\/ TARGET_BACKEND: JVM\n\n\/\/ FILE: 1.kt\n\npackage test\n\ninline class S(val string: String)\n\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@JvmName(\"foo\")\ninline fun foo() = S(\"OK\")","completion":"\/\/ FILE: 2.kt\n\nimport test.*\n\nfun box() : String =\n foo().string<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.jvm.shouldHideConstructorDueToValueClassTypeValueParameters\n\nclass LocalFunInlineChecker : DeclarationChecker {\n override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {\n if (InlineUtil.isInline(descriptor) &&","completion":"declaration is KtNamedFunction &&\n descriptor is FunctionDescriptor &&\n descriptor.visibility == DescriptorVisibilities.LOCAL\n ) {\n context.trace.report(Errors.NOT_YET_SUPPORTED_IN_INLINE.on(declaration, \"Local inline functions\"))\n }\n }\n}<|endoftext|>"} {"prompt":"if (d != null) this.d.equals(null)\n if (d != null) this.d.propT","completion":"if (d != null) this.d.propAny\n if (d != null) this.d.propNullableT<|endoftext|>"} {"prompt":"if (!AbstractTypeChecker.RUN_SLOW_ASSERTIONS) return\n checkState(*arrayOf(a, b, c, d))\n }\n\n private fun checkState(vararg allowedState: State) {\n if (!AbstractTypeChecker.RUN_SLOW_ASSERTIONS) return\n assert(state in allowedState) {","completion":"\"State $state is not allowed. AllowedStates: ${allowedState.joinToString()}\"\n }\n }\n\n override val errors: List\n get() = storage.errors\n\n override fun getBuilder() = apply { checkState(State.BUILDING, State.COMPLETION, State.TRANSACTION) }<|endoftext|>"} {"prompt":"origin = JvmLoweredDeclarationOrigin.LAMBDA_IMPL\n name = SpecialNames.NO_NAME_PROVIDED\n }.apply {\n parent = currentDeclarationParent\n superTypes = listOfNotNull(superType)\n createImplicitParameterDeclarationWithWrappedDescriptor()\n copyAttributes(irFunctionExpression)\n metadata = irFunctionExpression.function.metadata\n }","completion":"fun build(): IrExpression = DeclarationIrBuilder(\n generatorContext,\n currentScopeOwnerSymbol\n ).run {\n irBlock(irFunctionExpression.startOffset, irFunctionExpression.endOffset) {\n val constructor = createConstructor()\n createInvokeMethod()\n functionReferenceClass.addFakeOverrides(irTypeSystemContext)\n +functionReferenceClass<|endoftext|>"} {"prompt":"synchronized(lock) {\n b()\n }\n }\n}\n\nfun test() {\n builder {\n synchronized(lock) {\n suspensionPoint()\n }\n }\n\n builder {\n inlineMe {\n suspensionPoint()\n }\n }\n\n builder {\n monitorInFinally(\n {},\n { suspensionPoint() }\n )","completion":"}\n\n synchronized(lock) {\n builder {\n suspensionPoint()\n }\n }\n\n synchronized(lock) {\n object : SuspendRunnable {\n override suspend fun run() {\n suspensionPoint()\n }\n }\n }\n\n object : SuspendRunnable {\n override suspend fun run() {<|endoftext|>"} {"prompt":"x.bar().foo() checkType { _() } \/\/ See KT-10448","completion":"x.bar().foo() checkType { _() } \/\/ Inference change in K2\n}<|endoftext|>"} {"prompt":"get.set(1)\n if (get.get() != 1) return \"Fail get: ${get.get()}\"\n\n val set = Host::set as KMutableProperty0\n set.set(1)\n if (set.get() != 1) return \"Fail set: ${set.get()}\"\n\n val both = Host::both as KMutableProperty0","completion":"both.set(1)\n if (both.get() != 1) return \"Fail both: ${both.get()}\"\n\n val property = Host::property as KMutableProperty0\n property.set(1)\n if (property.get() != 1) return \"Fail property: ${property.get()}\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.multiplatform\n\nimport org.jetbrains.kotlin.cli.AbstractCliTest\nimport org.jetbrains.kotlin.cli.common.CLICompiler\nimport org.jetbrains.kotlin.cli.js.K2JSCompiler\nimport org.jetbrains.kotlin.cli.jvm.K2JVMCompiler","completion":"import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler\nimport org.jetbrains.kotlin.test.InTextDirectivesUtils\nimport org.jetbrains.kotlin.test.KotlinTestUtils\nimport org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase<|endoftext|>"} {"prompt":"sourceRoot.kotlinSourceSetName to testDataDir.resolve(sourceRoot.directoryName).walkTopDown()\n .filter { it.extension == \"kt\" }\n .map { CodeWithErrorInfo.parse(it.readText()) }.toList()\n .flatMap { it.errorInfo }\n }\n\n \/\/ put sources into project dir:","completion":"sourceRoots.forEach { sourceRoot ->\n val sourceSetDir = projectPath.resolve(sourceRoot.gradleSrcDir).toFile()\n testDataDir.resolve(sourceRoot.directoryName).copyRecursively(sourceSetDir)\n sourceSetDir.walkTopDown().filter { it.isFile }.forEach { file -><|endoftext|>"} {"prompt":"val projStepId = projStep.id\n val moduleTestDir = File(testDir, module)\n val moduleSourceDir = File(sourceDir, module)\n val moduleInfo = moduleInfos[module] ?: error(\"No module info found for $module\")\n val moduleStep = moduleInfo.steps.getValue(projStepId)\n for (modification in moduleStep.modifications) {","completion":"modification.execute(moduleTestDir, moduleSourceDir) {}\n }\n\n val outputKlibFile = resolveModuleArtifact(module, buildDir)\n\n val friends = mutableListOf()\n if (moduleStep.rebuildKlib) {\n val dependencies = mutableListOf(File(STDLIB_KLIB), File(KOTLIN_TEST_KLIB))<|endoftext|>"} {"prompt":"* Gets the latest version of a published library.\n *\n * Note that the library must have been locally published to locate its latest version, this\n * can be done in test by adding :publish as a test dependency, for example:\n * ```\n * tasks.findByPath(\"test\")\n * .dependsOn(tasks.findByPath(\":room:room-compiler:publish\")","completion":"* ```\n *\n * @param path - The library m2 path e.g. \"androidx\/room\/room-compiler\"\n *\/\n fun getLibraryLatestVersionInLocalRepo(path: String): String {\n val metadataFile = File(props.tipOfTreeMavenRepoPath)\n .resolve(path)\n .resolve(\"maven-metadata.xml\")<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.psi2ir.intermediate\n\nimport org.jetbrains.kotlin.ir.builders.irBlock\nimport org.jetbrains.kotlin.ir.builders.irIfNull\nimport org.jetbrains.kotlin.ir.builders.irNull\nimport org.jetbrains.kotlin.ir.expressions.IrExpression","completion":"import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin\nimport org.jetbrains.kotlin.ir.types.makeNullable\nimport org.jetbrains.kotlin.psi2ir.generators.GeneratorWithScope\n\ninternal class SafeExtensionInvokeCallReceiver(\n val generator: GeneratorWithScope,\n val startOffset: Int,<|endoftext|>"} {"prompt":"val (stdout, stderr) = runModule(\"usage\/some.module.withsome.packages.UsageKt\", listOf(usage))\n assertEquals(\"\", stderr)\n assertEquals(\"usage\/some.module.withsome.packages.Test\", stdout)\n }\n\n fun testReflection() {\n val reflect = ForTestCompileRuntime.reflectJarForTests()","completion":"val usage = module(\"usage\", listOf(reflect))\n val (stdout, stderr) = runModule(\"usage\/usage.test.UsageKt\", listOf(usage, reflect))\n assertEquals(\"\", stderr)\n assertEquals(\"OK\", stdout)\n }\n\n fun testDoNotLoadIrrelevantJarsFromUnnamed() {<|endoftext|>"} {"prompt":"}\n\n open fun checkEqualsFunctionVersionRequirement(old: ProtoBuf.Function, new: ProtoBuf.Function): Boolean {\n if (old.versionRequirementCount != new.versionRequirementCount) return false\n\n for(i in 0..old.versionRequirementCount - 1) {\n if (old.getVersionRequirement(i) != new.getVersionRequirement(i)) return false","completion":"}\n\n return true\n }\n\n open fun checkEqualsPropertyTypeParameter(old: ProtoBuf.Property, new: ProtoBuf.Property): Boolean {\n if (old.typeParameterCount != new.typeParameterCount) return false\n\n for(i in 0..old.typeParameterCount - 1) {<|endoftext|>"} {"prompt":"assert(innerClass.isInner) { \"Class is not inner: $innerClass\" }\n\n return originalInnerClassPrimaryConstructorByClass[innerClass]\n }\n\n private fun createInnerClassConstructorWithOuterThisParameter(oldConstructor: IrConstructor): IrConstructor =\n irFactory.buildConstructor {\n updateFrom(oldConstructor)","completion":"returnType = oldConstructor.returnType\n }.apply {\n parent = oldConstructor.parent\n returnType = oldConstructor.returnType\n copyAnnotationsFrom(oldConstructor)\n copyTypeParametersFrom(oldConstructor)\n\n val outerThisValueParameter = buildValueParameter(this) {\n origin = JvmLoweredDeclarationOrigin.FIELD_FOR_OUTER_THIS<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\nimport kotlin.test.assertEquals\n\nfun stringMultiArray(): Array> = Array(3) {\n i -> Array(3) { j -> \"$i-$j\" }\n}\n\nfun stringNullableMultiArray(): Array> = Array(3) {","completion":"i -> if (i == 1) Array(3) { j -> \"$i-$j\" } as Array else arrayOfNulls(3)\n}\n\nfun box(): String {\n val matrix = stringMultiArray()\n\n for (i in 0..2) {\n for (j in 0..2) {<|endoftext|>"} {"prompt":"\/*\n* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license\/LICENSE.txt file.\n *\/\n\npackage org.jetbrains.kotlin.cli.common.arguments\n\nimport org.jetbrains.annotations.TestOnly\nimport java.io.File","completion":"import java.io.FileNotFoundException\nimport java.io.IOException\nimport java.io.Reader\n\nconst val ARGFILE_ARGUMENT = \"@\"\nprivate const val EXPERIMENTAL_ARGFILE_ARGUMENT = \"-Xargfile=\"\n\nprivate const val SINGLE_QUOTE = '\\''\nprivate const val DOUBLE_QUOTE = '\"'<|endoftext|>"} {"prompt":"private fun Printer.printlnIfWithComparison(field: Descriptors.FieldDescriptor, expr: String, statement: String = \"return false\") {\n this.println(ifWithComparison(field, expr, statement))\n }\n\n fun Printer.printlnIfWithComparisonIndent(field: Descriptors.FieldDescriptor, expr: String, statement: String = \"return false\") {","completion":"pushIndent()\n printlnIfWithComparison(field, expr, statement)\n popIndent()\n }\n\n private fun fieldToHashCode(field: Descriptors.FieldDescriptor, expr: String): String =\n when {\n field.options.getExtension(DebugExtOptionsProtoBuf.typeIdInTable) -><|endoftext|>"} {"prompt":"interface Intf {\n fun run()\n}\n\nabstract class Ordinary\n\nannotation class Anno\n\n@Anno\nclass Generic : Ordinary(), Intf {\n override fun run() {}\n}\n\nenum class Direction {\n NORTH, SOUTH, WEST, EAST\n}\n\nsealed class Operation {","completion":"class Add(val firstValue: Int, val secondValue: Int) : Operation()\n class Subtract(val minuend: Int, val subtrahend: Int) : Operation()\n class Negate(val value: Int) : Operation()\n}<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS:-USELESS_CAST\n\/\/ !MARK_DYNAMIC_CALLS\n\nfun test(d: dynamic) {\n d.onAny()\n d?.onAny()\n run {","completion":"d!!.onAny()\n }\n\n d.onAny(1)\n\n d.onNullableAny()\n d.onString()<|endoftext|>"} {"prompt":"assertEquals(null, TestObject.fooWrapperN?.foo?.s)\n\n assertEquals(\"null (object)\", describeValueOfProperty(TestObject, \"fooNWrapper\"))\n TestObject.fooNWrapper = FooNWrapper(Foo(\"mouse\"))\n assertEquals(\"Foo(s=mouse) (object)\", describeValueOfProperty(TestObject, \"fooNWrapper\"))","completion":"assertEquals(\"mouse\", TestObject.fooNWrapper.fooN?.s)\n TestObject.fooNWrapper = FooNWrapper(null)\n assertEquals(\"null (object)\", describeValueOfProperty(TestObject, \"fooNWrapper\"))\n assertEquals(null, TestObject.fooNWrapper.fooN?.s)<|endoftext|>"} {"prompt":"\/\/ It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.\n\n\/\/ FILE: box.kt\nimport kotlin.test.*\n\nfun box(): String {\n \/\/ Sanity check to make sure there IS an exception even when not in a for-loop\n try {\n val i = J.listOfNotNull()[0]\n return \"Fail: should throw on get()\"","completion":"} catch (e: NullPointerException) {}\n\n try {\n for (i in J.listOfNotNull()) {\n return \"Fail: should throw on get() in loop header\"\n }\n }\n catch (e: NullPointerException) {}\n return \"OK\"\n}\n\n\/\/ FILE: J.java\nimport java.util.*;\nimport org.jetbrains.annotations.*;<|endoftext|>"} {"prompt":"x.not()\n}\n\n\/*\n * TESTCASE NUMBER: 26\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-30867\n *\/\nfun case_26(x: Boolean?) {\n while (true) {","completion":"for (i in listOf(break, x as Boolean, x!!)) {\n\n }\n }<|endoftext|>"} {"prompt":"public inline fun kotlin.UIntArray.runningFold(initial: R, operation: (acc: R, kotlin.UInt) -> R): kotlin.collections.List\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.ULongArray.runningFold(initial: R, operation: (acc: R, kotlin.ULong) -> R): kotlin.collections.List\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"fun eqDoubleQLongQ(a: A, b: B) = a == b\nfun eqLongByte(a: A, b: B) = a == b\nfun eqLongByteQ(a: A, b: B) = a == b","completion":"fun eqLongQByte(a: A, b: B) = a == b\nfun eqLongQByteQ(a: A, b: B) = a == b\nfun eqLongBoolean(a: A, b: B) = a == b<|endoftext|>"} {"prompt":"\"\"\"\n class Modifier\n fun Modifier.pointerInput(key1: Any?, block: () -> Unit) = this\n fun detectTapGestures(block: () -> Unit) {}\n @Composable fun someComposableValue(): Int = 1\n \"\"\",\n \"\"\"\n @Composable\n fun Test(a: Boolean, visible: Boolean, onDismiss: () -> Unit) {","completion":"if (a) {\n val a = someComposableValue()\n used(a)\n val m = Modifier()\n val dismissModifier = if (visible) {\n m.pointerInput(Unit) { detectTapGestures { onDismiss() } }\n } else {\n m\n }\n used(dismissModifier)\n }\n }\n \"\"\"\n )<|endoftext|>"} {"prompt":"| url = \"https:\/\/nodejs.org\/dist\"\n | patternLayout {\n | artifact(\"v[revision]\/[artifact](-v[revision]-[classifier]).[ext]\")\n | }\n | metadataSources { \n | artifact() \n | }\n | content {","completion":"| includeModule(\"org.nodejs\", \"node\") \n | }\n | }\n | ivy {\n | url = uri(\"https:\/\/nodejs.org\/download\/v8-canary\")\n | patternLayout {\n | artifact(\"v[revision]\/[artifact](-v[revision]-[classifier]).[ext]\")\n | }<|endoftext|>"} {"prompt":"var shadowBlur: Double\n var shadowColor: String\n}\n\npublic external interface CanvasFilters {\n var filter: String\n}\n\npublic external interface CanvasRect {\n fun clearRect(x: Double, y: Double, w: Double, h: Double)\n fun fillRect(x: Double, y: Double, w: Double, h: Double)","completion":"fun strokeRect(x: Double, y: Double, w: Double, h: Double)\n}\n\npublic external interface CanvasDrawPath {\n fun beginPath()\n fun fill(fillRule: CanvasFillRule = definedExternally)\n fun fill(path: Path2D, fillRule: CanvasFillRule = definedExternally)\n fun stroke()\n fun stroke(path: Path2D)<|endoftext|>"} {"prompt":"val res = repl.compileAndEval(ReplCodeLine(evals + 1, 0, \"x$evals\"))\n assertEquals(res.second.toString(), evals, (res.second as? ReplEvalResult.ValueResult)?.value)\n }\n }\n}\n\n\/\/ Artificial split into several testsuites, to speed up parallel testing\nclass LegacyReplTestLong2 : TestCase() {","completion":"fun testReplSlowdownKt22740() {\n LegacyTestRepl().use { repl ->\n repl.compileAndEval(ReplCodeLine(0, 0, \"class Test(val x: T) { fun map(f: (T) -> R): R = f(x) }\".trimIndent()))\n\n \/\/ We expect that analysis time is not exponential<|endoftext|>"} {"prompt":"final override fun visitPackageFragment(declaration: IrPackageFragment, data: Nothing?): IrElement =\n visitPackageFragment(declaration)\n\n open fun visitExternalPackageFragment(declaration: IrExternalPackageFragment): IrExternalPackageFragment =\n visitPackageFragment(declaration) as IrExternalPackageFragment","completion":"final override fun visitExternalPackageFragment(declaration: IrExternalPackageFragment, data: Nothing?): IrExternalPackageFragment =\n visitExternalPackageFragment(declaration)\n\n open fun visitFile(declaration: IrFile): IrFile =\n visitPackageFragment(declaration) as IrFile\n\n final override fun visitFile(declaration: IrFile, data: Nothing?): IrFile =<|endoftext|>"} {"prompt":"val linuxMain = kotlin.sourceSets.getByName(\"linuxMain\")\n val macosMain = kotlin.sourceSets.getByName(\"macosMain\")\n val linuxTest = kotlin.sourceSets.getByName(\"linuxTest\")\n val macosTest = kotlin.sourceSets.getByName(\"macosTest\")","completion":"val iosX64Main = kotlin.sourceSets.getByName(\"iosX64Main\")\n val iosX64Test = kotlin.sourceSets.getByName(\"iosX64Test\")\n val iosArm64Main = kotlin.sourceSets.getByName(\"iosArm64Main\")<|endoftext|>"} {"prompt":"expectMinMaxOf(\"_\" + 'a', \"_\" + 'a', charArrayOf('a'), { \"_$it\" })\n expectMinMaxOf(\"_\" + 'a', \"_\" + 'b', charArrayOf('a', 'b'), { \"_$it\" })","completion":"expectMinMaxOf(\"_\" + 'a', \"_\" + Char.MAX_VALUE, charArrayOf('a', 'b', Char.MAX_VALUE), { \"_$it\" })\n\n }\n \n @Test\n fun minMaxOfDouble() {\n val middle = 'b'\n val items = charArrayOf('a', 'b', Char.MAX_VALUE).apply { shuffle() }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.util.trimTrailingWhitespacesAndAddNewlineAtEOF\nimport java.io.File\nimport kotlin.test.assertEquals\nimport kotlin.test.fail\n\ninternal fun BuildResult.printBuildOutput() {\n println(\n \"\"\"\n |Failed assertion build output:\n |#######################\n |$output","completion":"|#######################\n |\n \"\"\".trimMargin()\n )\n}\n\ninternal fun String.normalizeLineEndings(): String = replace(\"\\n\", System.lineSeparator())\n\n\/*\nIdeally, this would've been just KotlinTestUtils.assertEqualsToFile, throwing FileComparisonException.\nNormally this is actually desired, because IDEA and TC provide special support for those exceptions with<|endoftext|>"} {"prompt":"val compilation = ExecutableCompilation(\n testRunSettings,\n freeCompilerArgs = testCase.freeCompilerArgs,\n sourceModules = testCase.modules,\n extras = testCase.extras,\n dependencies = emptyList(),\n expectedArtifact = expectedArtifact,\n )\n val compilationResult = compilation.result","completion":"val goldenData = rootDir.resolve(\"logging_invalid_error.txt\")\n\n KotlinTestUtils.assertEqualsToFile(goldenData, compilationResult.toOutput())\n }\n\n private fun doBuildObjCFrameworkWithNameCollisions(rootDir: File, additionalOptions: List): TestCompilationResult {<|endoftext|>"} {"prompt":"const val nonConstInitializer1 = foo()\nconst val nonConstInitializer2 = 1 as String","completion":"const val nonConstInitializer3 = 1.0 as String\nconst val nonConstInitializer4 = 1 as Double<|endoftext|>"} {"prompt":"val z : Int\n doSmth(z)\n }\n}\n\nval g = { ->\n val x: Int\n doSmth(x)\n}\n\nclass A {\n val a : Int = 1\n get() {","completion":"val x : Int\n doSmth(x)\n return field\n }\n}\n\nfun doSmth(i: Int) = i<|endoftext|>"} {"prompt":"assertFailsWith {\n val longProgression = 7L downTo 1L\n for (i in longProgression step 0L) {\n }\n }\n\n assertFailsWith {\n val charProgression = 'g' downTo 'a'\n for (i in charProgression step 0) {\n }\n }","completion":"return \"OK\"\n}<|endoftext|>"} {"prompt":"getOrPut(key) { TestClass(key) }\n\n override fun visitElement(element: IrElement) {\n element.acceptChildrenVoid(this)\n }\n\n fun IrFunctionSymbol.hasAnnotation(fqName: FqName) = owner.hasAnnotation(fqName)\n\n \/**","completion":"* Checks if [this] or any of its parent functions has the annotation with the given [testAnnotation].\n * If [this] contains the given annotation, returns [this].\n * If one of the parent functions contains the given annotation, returns the [IrFunctionSymbol] for it.\n * If the annotation isn't found or found only in interface methods, returns null.\n *\/<|endoftext|>"} {"prompt":".appendHashCode(relativeNameSegments).also { hashCode -> _hashCode = hashCode }\n\n override fun hashCode(): Int = _hashCode\n\n override fun toString(): String = buildString {\n packageName.segments.joinTo(this, \"\/\")\n append('\/')\n relativeNameSegments.joinTo(this, \".\")\n }","completion":"fun toQualifiedNameString(): String = buildString {\n packageName.segments.joinTo(this, \".\")\n if (packageName.segments.isNotEmpty()) append(\".\")\n relativeNameSegments.joinTo(this, \".\")\n }\n\n val isNestedEntity: Boolean get() = relativeNameSegments.size > 1<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.utils.getByType\nimport org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName\nimport org.jetbrains.kotlin.gradle.utils.property\nimport org.jetbrains.kotlin.tooling.core.UnsafeApi\n\n\/**\n * Run task for executing Kotlin\/Jvm code.","completion":"* Shall be configured using the [KotlinJvmRunDsl]\n *\n * ### IDE carrier task:\n * This task can act as 'carrier' task for IDE run gutters:\n * It accepts configurable 'mainClass' when a Gradle property is provided as\n * `.mainClass=...`\n *\n * e.g.\n * ```<|endoftext|>"} {"prompt":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with","completion":"* the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<|endoftext|>"} {"prompt":"fun generatedPlusExtensionAny(maybeStr: String?, maybeAny: Any?): String {\n return \"$maybeStr$maybeAny\"\n}\n\n\/\/ CHECK-LABEL: define %struct.ObjHeader* @\"kfun:codegen.stringConcatenationTypeNarrowing.kt53119_plus_extension#generatedPlusExtensionString","completion":"\/\/ CHECK-OPT-NOT: kfun:kotlin.String#plus(kotlin.Any?)\n\n\/\/ CHECK-OPT: call %struct.ObjHeader* @Kotlin_String_plusImpl\n\/\/ CHECK-OPT-NOT: call %struct.ObjHeader* @Kotlin_String_plusImpl<|endoftext|>"} {"prompt":"testGroup(\"native\/native.tests\/tests-gen\", \"native\/native.tests\/testData\") {\n testClass(\n suiteTestClassName = \"NativeGCTestGenerated\",\n annotations = listOf(\n *gc(),\n provider(),\n )\n ) {\n model(\"gc\")\n }","completion":"testClass(\n suiteTestClassName = \"FirNativeGCTestGenerated\",\n annotations = listOf(\n *gc(),\n provider(),\n *frontendFir(),\n )\n ) {\n model(\"gc\")\n }\n }\n }\n}<|endoftext|>"} {"prompt":"override fun referenceSimpleFunctionByLocalSignature(file: IrFile, idSignature: IdSignature) : IrSimpleFunctionSymbol =\n delegate.referenceSimpleFunctionByLocalSignature(file, idSignature)\n\n override fun referencePropertyByLocalSignature(file: IrFile, idSignature: IdSignature): IrPropertySymbol =","completion":"delegate.referencePropertyByLocalSignature(file, idSignature)\n\n override fun deserializeReachableDeclarations() {\n delegate.deserializeReachableDeclarations()\n }\n\n private fun computeFunctionClass(className: String): IrClass {\n val isK = className[0] == 'K'<|endoftext|>"} {"prompt":"\/\/ companion object\n \/\/ }\n \/\/\n \/\/ val companionOfA = A \/\/ This standalone class reference `A` here should resolve to the companion object.\n \/\/ ```\n \/\/\n \/\/ If this `FirResolvedQualifier` is a receiver expression of some other qualified access, the value is updated in\n \/\/ `FirCallResolver` according to the resolution result.","completion":"default(\"resolvedToCompanionObject\", \"(symbol?.fir as? FirRegularClass)?.companionObjectSymbol != null\")\n additionalImports(regularClass)\n }\n\n impl(errorResolvedQualifier) {\n defaultFalse(\"resolvedToCompanionObject\", withGetter = true)\n defaultClassIdFromRelativeClassName()\n }\n\n noImpl(userTypeRef)<|endoftext|>"} {"prompt":"super.setupCompilerArgs(args, defaultsOnly, ignoreClasspathResolutionErrors)\n }\n\n override fun createCompilerArguments(\n context: KotlinCompilerArgumentsProducer.CreateCompilerArgumentsContext\n ): K2JVMCompilerArguments = context.create {\n primitive { args ->","completion":"args.multiPlatform = multiPlatformEnabled.get()\n\n args.pluginOptions = (pluginOptions.toSingleCompilerPluginOptions() + kotlinPluginData?.orNull?.options)\n .arguments.toTypedArray()\n\n args.destinationAsFile = destinationDirectory.get().asFile\n\n args.javaPackagePrefix = javaPackagePrefix<|endoftext|>"} {"prompt":"Annotations.create(this + BuiltInAnnotationDescriptor(builtIns, StandardNames.FqNames.extensionFunctionType, emptyMap()))\n }\n\nfun Annotations.withContextReceiversFunctionAnnotation(builtIns: KotlinBuiltIns, contextReceiversCount: Int) =\n if (hasAnnotation(StandardNames.FqNames.contextFunctionTypeParams)) {\n this\n } else {","completion":"Annotations.create(\n this + BuiltInAnnotationDescriptor(\n builtIns, StandardNames.FqNames.contextFunctionTypeParams, mapOf(\n StandardNames.CONTEXT_FUNCTION_TYPE_PARAMETER_COUNT_NAME to IntValue(contextReceiversCount)\n )\n )\n )\n }<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\/\/ MODULE: m1-common\n\/\/ FILE: common.kt\nimport kotlin.reflect.KProperty\n\nfun lazy(initializer: () -> T): Lazy = TODO()\n\ninterface Lazy {","completion":"operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO()\n}\n\nexpect class OuterClass {\n class NestedClass {\n class DeepNested {\n class Another {\n fun f(s: String)\n val p: Int\n val c: Int = 1<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.declarations.builder.*\nimport org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl\nimport org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl","completion":"import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty\nimport org.jetbrains.kotlin.fir.declarations.synthetic.buildSyntheticProperty\nimport org.jetbrains.kotlin.fir.declarations.utils.*\nimport org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic<|endoftext|>"} {"prompt":"override val directFriendDependencies: List = emptyList(),\n override val platform: TargetPlatform = JvmPlatforms.defaultJvmPlatform,\n override val file: PsiFile? = null,\n override val moduleDescription: String,\n override val project: Project,\n) : KtNotUnderContentRootModule, KtModuleWithPlatform {","completion":"override val transitiveDependsOnDependencies: List by lazy { computeTransitiveDependsOnDependencies(directDependsOnDependencies) }\n override val analyzerServices: PlatformDependentAnalyzerServices = super.analyzerServices\n\n override val contentScope: GlobalSearchScope =<|endoftext|>"} {"prompt":"@kotlin.internal.InlineOnly\n public final inline fun floorDiv(other: kotlin.UByte): kotlin.UInt\n\n @kotlin.internal.InlineOnly\n public final inline fun floorDiv(other: kotlin.UInt): kotlin.UInt\n\n @kotlin.internal.InlineOnly","completion":"public final inline fun floorDiv(other: kotlin.ULong): kotlin.ULong\n\n @kotlin.internal.InlineOnly\n public final inline fun floorDiv(other: kotlin.UShort): kotlin.UInt\n\n public open override fun hashCode(): kotlin.Int\n\n @kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"fun foo(a : Int = 1, b : String = \"abc\") {\n}\n\nfun bar(x : Int = 1, y : Int = 1, z : String) {\n}\n\nfun test() {\n foo()\n foo(2)\n foo(\"\")\n foo(b = \"\")\n foo(1, \"\")\n foo(a = 2)","completion":"foo(1, \"\", \"\")\n\n bar(z = \"\")\n bar()\n bar(\"\")\n bar(1, 1, \"\")<|endoftext|>"} {"prompt":"override fun invoke() = cif()\n }\n }\n return factory()\n}\n\/\/ FILE: 2.kt\n\nimport test.*\n\nfun box(): String {\n val simpleName = inf {\n javaClass.simpleName\n }()\n\n if (simpleName != \"\" ) return \"fail 1: $simpleName\"\n\n val name = inf {\n javaClass.name\n }()","completion":"if (name != \"_2Kt\\$box$\\$inlined\\$inf$2$1\" ) return \"fail 2: $name\"\n\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"ExpectedData(0x392058251cf22accUL, 0x54bc9bee7cbe1767UL, 0x485820bdbe442431UL, 0x54d6120ea2972e90UL, 0xf437a0341f29b72aUL),","completion":"ExpectedData(0xadf5c1e5d6419947UL, 0x80973ea532b0f310UL, 0xa471829aa9c17dd9UL, 0xc2ff3479394804abUL, 0x6bf44f8606753636UL),<|endoftext|>"} {"prompt":"final override fun visitCallableReferenceAccess(callableReferenceAccess: FirCallableReferenceAccess, data: Nothing?) {\n visitCallableReferenceAccess(callableReferenceAccess)\n }\n\n open fun visitCallableReferenceAccess(callableReferenceAccess: FirCallableReferenceAccess) {\n visitElement(callableReferenceAccess)\n }","completion":"final override fun visitThisReceiverExpression(thisReceiverExpression: FirThisReceiverExpression, data: Nothing?) {\n visitThisReceiverExpression(thisReceiverExpression)\n }\n\n open fun visitThisReceiverExpression(thisReceiverExpression: FirThisReceiverExpression) {\n visitElement(thisReceiverExpression)\n }<|endoftext|>"} {"prompt":"object O1 : SI2\n interface I1 : SI2\n\/\/ object Added : SI2\n class C2 : SI2\n object O2 : SI2\n interface I2 : SI2\n}\n\nsealed interface SI3 {\n class C1 : SI3\n object O1 : SI3\n interface I1 : SI3\n\/\/ interface Added : SI3\n class C2 : SI3","completion":"object O2 : SI3\n interface I2 : SI3\n}<|endoftext|>"} {"prompt":"if (C().suspendInlineReturnsVCAnyNullable_Null() != null) throw IllegalStateException(\"C().suspendInlineReturnsVCAnyNullable_Null\")\n\n if (C().suspendInlineReturnsVCInt_Null() != null) throw IllegalStateException(\"C().suspendInlineReturnsVCInt_Null\")","completion":"if (C().suspendInlineReturnsVCIntNullable_Null() != null) throw IllegalStateException(\"C().suspendInlineReturnsVCIntNullable_Null\")\n\n C().suspendInlineAcceptsVCString(1, VCString(\"OK\"))\n if (result != VCString(\"OK\")) throw IllegalStateException(\"C().suspendInlineAcceptsVCString\")<|endoftext|>"} {"prompt":"contract { returns(false) implies (this@case_4_2 != null && this@case_4_2 is String) }\n return !(this@case_4_2 != null && this@case_4_2 is String)\n}\nfun T?.case_4_3(): Boolean? {","completion":"contract { returnsNotNull() implies (this@case_4_3 != null && this@case_4_3 is String) }\n return if (this@case_4_3 != null && this@case_4_3 is String) true else null\n}\nfun T?.case_4_4(): Boolean? {<|endoftext|>"} {"prompt":"if (a.x != null) a.x.funAny()\n if (a.x != null) a.x.funNullableT()","completion":"if (a.x != null) a.x.funNullableAny()\n if (a.x != null) a.x<|endoftext|>"} {"prompt":"* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n *\/\n @SinceKotlin(\"1.4\")\n public fun insert(index: Int, value: Boolean): StringBuilder\n\n \/**\n * Inserts the string representation of the specified int [value] into this string builder at the specified [index] and returns this instance.\n *","completion":"* The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was inserted into this string builder at the specified [index].\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n *\/\n @SinceKotlin(\"1.9\")<|endoftext|>"} {"prompt":"x.inv()\n }\n}\n\n\/*\n * TESTCASE NUMBER: 5\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-28265\n *\/\nfun case_5(x: Int?) {","completion":"val y = object {\n val z = null\n }\n\n if (x == y.z == true) {\n x<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.analysis.collectors.components\n\nimport org.jetbrains.kotlin.diagnostics.DiagnosticReporter\nimport org.jetbrains.kotlin.fir.FirElement\nimport org.jetbrains.kotlin.fir.FirSession","completion":"import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext\nimport org.jetbrains.kotlin.fir.declarations.FirFile\n\nclass ReportCommitterDiagnosticComponent(\n session: FirSession,\n reporter: DiagnosticReporter\n) : AbstractDiagnosticCollectorComponent(session, reporter) {<|endoftext|>"} {"prompt":"val indices = (instance as MfvcNodeWithSubnodes).subnodeIndices[it.node]!!\n Setter(it, values.slice(indices))\n }\n }\n }\n\n private val possibleExtraBoxUsageGenerated = mutableSetOf()\n\n private val irCurrentScope\n get() = currentScope!!.irElement as IrDeclaration","completion":"private val irCurrentClass\n get() = currentClass!!.irElement as IrClass\n\n private fun registerPossibleExtraBoxUsage() {\n possibleExtraBoxUsageGenerated.add(irCurrentScope)\n }\n\n \/**\n * The class is used to get replacing expression and MFVC instance if present for the given old value declaration.\n *\/\n private inner class ValueDeclarationRemapper {<|endoftext|>"} {"prompt":"\/\/ !DUMP_CFG\nimport kotlin.contracts.*\n\nfun bar(x: () -> Unit) {\n\n}\n\n@ExperimentalContracts\nfun foo(x: () -> Unit, y: () -> Unit, z: () -> Unit) {\n contract {","completion":"callsInPlace(x, InvocationKind.AT_MOST_ONCE)\n callsInPlace(y, InvocationKind.AT_MOST_ONCE)<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ WITH_STDLIB\n\/\/ ISSUE: KT-57543\n\n\/\/ FILE: JavaClass.java\nimport kotlin.jvm.functions.Function0;\n\npublic class JavaClass {\n\n public static class Val {\n private final Function0 initializer;\n public Val(Function0 initializer) {\n this.initializer = initializer;","completion":"}\n public final T getValue(Object instance, Object metadata) {\n return initializer.invoke();\n }\n }\n\n public static Val lazySoft(Function0 initializer) {\n return new Val(initializer);\n }\n}\n\n\/\/ FILE: main.kt\n\nclass A(\n val c: Int? = 0,<|endoftext|>"} {"prompt":"return this\n }\n\n override fun transformTypeParameters(transformer: FirTransformer, data: D): FirAnonymousFunctionImpl {\n typeParameters.transformInplace(transformer, data)\n return this\n }\n\n override fun replaceAnnotations(newAnnotations: List) {\n annotations = newAnnotations.toMutableOrEmpty()\n }","completion":"override fun replaceStatus(newStatus: FirDeclarationStatus) {\n status = newStatus\n }\n\n override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) {\n returnTypeRef = newReturnTypeRef\n }\n\n override fun replaceReceiverParameter(newReceiverParameter: FirReceiverParameter?) {\n receiverParameter = newReceiverParameter\n }<|endoftext|>"} {"prompt":"\/\/ See The Java Virtual Machine Specification, section 4.7.9.1 https:\/\/docs.oracle.com\/javase\/specs\/jvms\/se8\/html\/jvms-4.html#jvms-4.7.9.1\n val INVALID_CHARS = setOf('.', ';', '[', ']', '\/', '<', '>', ':', '\\\\')","completion":"\/\/ These characters can cause problems on Windows. '?*\"|' are not allowed in file names, and % leads to unexpected env var expansion.\n private val DANGEROUS_CHARS = setOf('?', '*', '\"', '|', '%')\n\n override fun checkIdentifier(simpleNameExpression: KtSimpleNameExpression, diagnosticHolder: DiagnosticSink) {<|endoftext|>"} {"prompt":"}\n\n\nfun box(): String {\n val b = A().B()\n if (b.test1() != \"A.bar\") return \"test1 ${b.test1()}\"\n if (b.test2() != \"B.bar\") return \"test2 ${b.test2()}\"\n if (b.test3() != \"B.bar\") return \"test3 ${b.test3()}\"","completion":"if (b.test4() != \"A.bar\") return \"test4 ${b.test4()}\"\n if (b.test5() != \"B.bar\") return \"test5 ${b.test5()}\"\n if (b.test6() != \"B.bar\") return \"test6 ${b.test6()}\"\n \n return \"OK\"\n}<|endoftext|>"} {"prompt":"{ it.name },\n { it.valueParameters.size },\n { KonanManglerDesc.run { it.signatureString(false) } }\n )\n )\n\ninternal fun List.makePackagesOrderStable() =\n this.sortedBy { it.fqName.asString() }\n\n\/**","completion":"* Sort order of files. Order of declarations will be stabilized in the corresponding functions later.\n *\/\ninternal fun Map>.makeFilesOrderStable() =\n this.entries.sortedBy { it.key.name }\n\n\/**\n * Sort order of categories. Order of extensions will be stabilized in the corresponding functions later.\n *\/<|endoftext|>"} {"prompt":"\"\"\"\n }\n\n body(ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) {\n \"\"\"\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n \"\"\"\n }\n }","completion":"val f_take = fn(\"take(n: Int)\") {\n includeDefault()\n include(CharSequences, Strings, ArraysOfUnsigned)\n } builder {\n val n = \"\\$n\"\n doc {\n \"\"\"\n Returns a list containing first [n] elements.\n \"\"\"\n }\n throws(\"IllegalArgumentException\", \"if [n] is negative.\")<|endoftext|>"} {"prompt":"a.prop_4.funNullableT()\n a.prop_4.funNullableAny()\n }\n }\n}\n\n\/\/ TESTCASE NUMBER: 11","completion":"fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndirect) {\n val t: TypealiasNullableStringIndirect = null\n\n if (x == null is Boolean) {<|endoftext|>"} {"prompt":"if (maybeCharVar != null) return \"Fail (maybeCharVar initial value)\"\n maybeCharVar = 'a'\n if (js(\"typeof maybeCharVar\") != \"number\") return \"Fail (typeof maybeCharVar after 1st modification)\"\n if (maybeCharVar != 'a') return \"Fail (maybeCharVar after 1st modification)\"\n maybeCharVar = null","completion":"if (js(\"typeof maybeCharVar\") != \"object\") return \"Fail (typeof maybeCharVar after 2nd modification)\"\n if (maybeCharVar != null) return \"Fail (maybeCharVar after 2nd modification)\"\n\n val a = A('b')\n if (a.foo() != 'b') return \"Fail (a.foo())\"<|endoftext|>"} {"prompt":"val result7 = (1L..100L).map { x -> 2 * x }.count { x -> x % 2 == 0L }\n val result8 = (1L..100L).map { x -> 2 * x }.filter { x -> x % 2 == 0L }.size\n assertEquals(result7, 100)\n assertEquals(result8, 100)","completion":"val result9 = (0..10).reduce { total, next -> total + next }\n val result10 = (0L..10L).reduce { total, next -> total + next }\n assertEquals(result9, 55)\n assertEquals(result10, 55L)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"@Anno1(s = arrayOf(elements = \"foo\"))","completion":"@Anno2(i = intArrayOf(elements = *intArrayOf(1)))\nfun f3() {}\n\nfun foo(vararg ints: Int) {}\n\nfun test() {<|endoftext|>"} {"prompt":"if (w != null || this.w != null) this.w.funNullableT()","completion":"if (w != null || this.w != null) this.w.funNullableAny()<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect +ContractsOnCallsWithImplicitReceiver\n\/\/ !OPT_IN: kotlin.contracts.ExperimentalContracts\n\/\/ !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER\n\/\/\n\/\/ ISSUE: KT-28672\n\nimport kotlin.contracts.*","completion":"fun CharSequence?.isNullOrEmpty(): Boolean {\n contract {\n returns(false) implies (this@isNullOrEmpty != null)\n }\n\n return this == null || this.length == 0\n}\n\nfun smartcastOnReceiver(s: String?) {\n with(s) {\n if (isNullOrEmpty()) {<|endoftext|>"} {"prompt":"FirTypeSpecificityComparatorProvider(JsTypeSpecificityComparatorWithoutDelegate(typeContext))\n )\n register(FirPlatformDiagnosticSuppressor::class, FirJsPlatformDiagnosticSuppressor())\n\n if (moduleKind != null) {\n register(FirJsModuleKind::class, FirJsModuleKind(moduleKind))\n }","completion":"register(FirDefaultImportProviderHolder::class, FirDefaultImportProviderHolder(JsPlatformAnalyzerServices))\n }\n}<|endoftext|>"} {"prompt":"if (skipMinification) +JsEnvironmentConfigurationDirectives.SKIP_MINIFICATION\n if (getBoolean(\"kotlin.js.ir.skipRegularMode\")) +JsEnvironmentConfigurationDirectives.SKIP_REGULAR_MODE\n }\n\n useAdditionalSourceProviders(\n ::JsAdditionalSourceProvider,\n ::CoroutineHelpersSourceFilesProvider,\n )","completion":"forTestsNotMatching(\"compiler\/testData\/codegen\/box\/diagnostics\/functions\/tailRecursion\/*\") {\n defaultDirectives {\n DIAGNOSTICS with \"-warnings\"\n }\n }\n\n enableMetaInfoHandler()\n\n configureIrHandlersStep {\n useHandlers(::IrMangledNameAndSignatureDumpHandler)\n }<|endoftext|>"} {"prompt":"x.equals(10)\n }\n}\n\n\/*\n * TESTCASE NUMBER: 30\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-30369\n *\/\nfun case_30(x: Class.NestedClass?) {","completion":"if (x?.prop_4 != null == true) {\n x\n x.prop_4\n }\n}\n\n\/*<|endoftext|>"} {"prompt":"override fun visitElement(element: IrElement, data: IrDeclaration?) {\n element.acceptChildren(this, data)\n }\n\n override fun visitDeclaration(declaration: IrDeclarationBase, data: IrDeclaration?) {\n declaration.acceptChildren(this, declaration)\n }\n\n override fun visitClass(declaration: IrClass, data: IrDeclaration?) {","completion":"declaration.thisReceiver?.accept(this, declaration)\n declaration.typeParameters.forEach { it.accept(this, declaration) }\n ArrayList(declaration.declarations).forEach { it.accept(this, declaration) }\n }\n\n override fun visitBody(body: IrBody, data: IrDeclaration?) {<|endoftext|>"} {"prompt":"for (e in other) min = minOf(min, e)\n return min\n}\n\n\/**\n * Returns the smaller of the given values.\n * \n * If any value is `NaN`, returns `NaN`.\n *\/\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Float, vararg other: Float): Float {\n var min = a","completion":"for (e in other) min = minOf(min, e)\n return min\n}\n\n\/**\n * Returns the smaller of the given values.\n * \n * If any value is `NaN`, returns `NaN`.\n *\/\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Double, vararg other: Double): Double {\n var min = a<|endoftext|>"} {"prompt":"class Value(var value: T = null as T, var text: String? = null)\n\nval Value.additionalText by DVal(Value::text)\n\nval Value.additionalValue by DVal(Value::value)\n\nclass DVal(val kmember: Any) {\n operator fun getValue(t: Any?, p: Any) = 42","completion":"}\n\nvar recivier : Any? = \"fail\"\nvar value2 : Any? = \"fail2\"\n\nvar T.bar : T\n get() = this\n set(value) { recivier = this; value2 = value}\n\nval barRef = String?::bar<|endoftext|>"} {"prompt":"constructor(extras: Iterable>) : this(extras.associateBy { it.key })\n\n constructor(extras: Array>) : this(extras.associateBy { it.key })\n\n override val keys: Set> = extras.keys\n\n override fun isEmpty(): Boolean = extras.isEmpty()","completion":"override val size: Int = extras.size\n\n override val entries: Set> = extras.values.toSet()\n\n override fun get(key: Key): T? {\n return extras[key]?.let { it.value as T }\n }\n\n internal companion object {\n private const val serialVersionUID = 0L\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.codegen.intrinsics\n\nimport org.jetbrains.kotlin.codegen.Callable\nimport org.jetbrains.kotlin.codegen.CallableMethod\n\nclass StringGetChar : IntrinsicMethod() {\n override fun toCallable(method: CallableMethod): Callable =","completion":"createIntrinsicCallable(method) {\n it.invokevirtual(\"java\/lang\/String\", \"charAt\", \"(I)C\", false)\n }\n}<|endoftext|>"} {"prompt":"\"IntList.filterManual\" to BenchmarkEntryWithInit.create(::IntListBenchmark, { filterManual() }),\n \"IntList.countFilteredManual\" to BenchmarkEntryWithInit.create(::IntListBenchmark, { countFilteredManual() }),\n \"IntList.countFiltered\" to BenchmarkEntryWithInit.create(::IntListBenchmark, { countFiltered() }),","completion":"\"IntList.countFilteredLocal\" to BenchmarkEntryWithInit.create(::IntListBenchmark, { countFilteredLocal() }),\n \"IntList.reduce\" to BenchmarkEntryWithInit.create(::IntListBenchmark, { reduce() }),\n \"IntStream.copy\" to BenchmarkEntryWithInit.create(::IntStreamBenchmark, { copy() }),<|endoftext|>"} {"prompt":"} else if (fqName == deprecatedSinceKotlinClassId) {\n deprecatedSinceKotlin = annotation\n }\n\n checkAnnotationTarget(declaration, annotation, context, reporter)\n }\n\n if (declaration is FirCallableDeclaration) {\n val receiverParameter = declaration.receiverParameter\n if (receiverParameter != null) {","completion":"for (receiverAnnotation in receiverParameter.annotations) {\n reportIfMfvc(context, reporter, receiverAnnotation, \"receivers\", receiverParameter.typeRef.coneType)\n }\n }\n }\n\n if (deprecatedSinceKotlin != null) {\n checkDeprecatedCalls(deprecatedSinceKotlin, deprecated, context, reporter)\n }<|endoftext|>"} {"prompt":"@OptIn(ExperimentalContracts::class)\ninline fun buildAnonymousFunction(init: FirAnonymousFunctionBuilder.() -> Unit): FirAnonymousFunction {\n contract {\n callsInPlace(init, InvocationKind.EXACTLY_ONCE)\n }\n return FirAnonymousFunctionBuilder().apply(init).build()\n}\n\n@OptIn(ExperimentalContracts::class)","completion":"inline fun buildAnonymousFunctionCopy(original: FirAnonymousFunction, init: FirAnonymousFunctionBuilder.() -> Unit): FirAnonymousFunction {\n contract {\n callsInPlace(init, InvocationKind.EXACTLY_ONCE)\n }\n val copyBuilder = FirAnonymousFunctionBuilder()\n copyBuilder.source = original.source\n copyBuilder.resolvePhase = original.resolvePhase<|endoftext|>"} {"prompt":"if (test3 != \"32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1\") {\n return \"test3 = $test3\"\n }","completion":"val test4 = B(54, 217, h = 236, l = 18, q = 3216, u = 8, aa = 22, ff = 33, jj = 44, mm = 55).toString()\n val test5 = B::class.java.newInstance().toString()<|endoftext|>"} {"prompt":"* Returns true if the declaration is a platform-specific implementation in a multiplatform project.\n *\/\n public val isActual: Boolean\n\n \/**\n * Returns true if the declaration is platform-specific declaration in a multiplatform project. An implementation\n * in platform modules is expected. Note, that in the following example:\n * ```\n * expect class A {\n * class Nested\n * }","completion":"* ```\n * `isExpect` returns `true` for both `A` and `A.Nested`.\n *\/\n public val isExpect: Boolean\n}<|endoftext|>"} {"prompt":"value class A7(vararg val x: Int)\n@JvmInline","completion":"value class A8(open val x: Int)\n@JvmInline\nvalue class A9(final val x: Int)\n\nclass B1 {\n companion object {\n @JvmInline<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.idea.tcs.extras.sourcesClasspath\nimport org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet\nimport org.jetbrains.kotlin.gradle.plugin.ide.IdeAdditionalArtifactResolver","completion":"import org.jetbrains.kotlin.gradle.plugin.ide.IdeaKotlinBinaryCapability\nimport org.jetbrains.kotlin.gradle.plugin.sources.internal\n\ninternal object IdeSourcesVariantsResolver : IdeAdditionalArtifactResolver {\n override fun resolve(sourceSet: KotlinSourceSet, dependencies: Set) {<|endoftext|>"} {"prompt":"irStatements.filterNotNull().takeIf { it.isNotEmpty() }\n ?: listOf(IrBlockImpl(startOffset, endOffset, irBuiltIns.unitType, null, emptyList()))\n } else {\n emptyList()\n }\n ).also {\n with(implicitCastInserter) {\n it.insertImplicitCasts()\n }\n }\n }","completion":"}\n\n private val IrStatementOrigin.isLoop: Boolean\n get() {\n return this == IrStatementOrigin.DO_WHILE_LOOP || this == IrStatementOrigin.WHILE_LOOP || this == IrStatementOrigin.FOR_LOOP\n }\n\n private fun extractOperationFromDynamicSetCall(functionCall: FirFunctionCall) =<|endoftext|>"} {"prompt":"fun main() {\n \/\/ Module java.naming\n val b: javax.naming.Binding? = null\n println(b)\n\n \/\/ Module java.logging\n val j: java.util.logging.Filter? = null\n println(j)\n\n \/\/ Module java.desktop (this module doesn't depend on it)\n val s: javax.swing.JFrame? = null","completion":"println(s)\n}<|endoftext|>"} {"prompt":"val name = JvmAbi.getSyntheticMethodNameForAnnotatedProperty(baseName)\n val desc = if (receiver == null) \"()V\" else \"(${mapType(receiver.type)})V\"\n return Method(name, desc)\n }\n\n fun mapScriptSignature(script: ScriptDescriptor): JvmMethodSignature {","completion":"val sw = BothSignatureWriter(BothSignatureWriter.Mode.METHOD)\n\n sw.writeParametersStart()\n\n for (valueParameter in script.unsubstitutedPrimaryConstructor.valueParameters) {\n writeParameter(sw, valueParameter.type, null)\/* callableDescriptor = *\/\n }\n\n writeVoidReturn(sw)<|endoftext|>"} {"prompt":"override fun printStackTrace() = original.printStackTrace()\n override fun printStackTrace(s: PrintStream?) = original.printStackTrace(s)\n override fun printStackTrace(s: PrintWriter?) = original.printStackTrace(s)\n}\n\nclass TestsCompilerError(original: Throwable) : TestsError(original, TestsExceptionType.COMPILER_ERROR)","completion":"class TestsInfrastructureError(original: Throwable) : TestsError(original, TestsExceptionType.INFRASTRUCTURE_ERROR)\nclass TestsCompiletimeError(original: Throwable) : TestsError(original, TestsExceptionType.COMPILETIME_ERROR)\nclass TestsRuntimeError(original: Throwable) : TestsError(original, TestsExceptionType.RUNTIME_ERROR)<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +ImproveReportingDiagnosticsOnProtectedMembersOfBaseClass\n\n\/\/ FILE: abc\/Foo.java\npackage abc;\n\npublic class Foo {\n public String getBar() { return \"\"; }\n protected void setBar(String x) { }\n public String getFoo() { return \"\"; }\n private void setFoo(String x) { }\n}","completion":"\/\/ FILE: main.kt\n\nimport abc.Foo\n\nclass Data(var x: Foo)\n\nclass B : Foo() {\n fun baz(a: Foo, t: Foo, d: Data) {\n a.bar = t.bar\n a.foo = t.foo<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ WITH_STDLIB\n\/\/ FILE: test.kt\n\nimport kotlin.test.*\n\nclass C {\n fun test() { J.s().memberExtension() }\n private fun String.memberExtension() {}\n}\n\nfun box(): String {\n assertFailsWith {\n C().test()\n }\n return \"OK\"","completion":"}\n\n\/\/ FILE: J.java\npublic class J {\n public static String s() { return null; }\n}<|endoftext|>"} {"prompt":"return new StaticMethod(t1, t2);\n }\n\n public static StaticMethod of2(T t1) {\n return new StaticMethod(t1);\n }\n\n private final T[] ts;\n\n private StaticMethod(T... ts) {\n this.ts = ts;\n }\n}\n\n\/\/ FILE: lib.kt","completion":"package my.lib\n\nfun String.func(): Int = this.length\n\n\/\/ FILE: test.kt\npackage kapt\n\nimport java.util.Collections.unmodifiableCollection\nimport kapt.StaticMethod.of\nimport kapt.StaticMethod.of2\nimport my.lib.func\n\nclass StaticImport {\n val x = unmodifiableCollection(listOf(\"\"))<|endoftext|>"} {"prompt":"fun notSubtype(value: ESValue, type: KotlinType) = apply { notSubtypes.initAndAdd(value, type) }\n\n fun equal(left: ESValue, right: ESValue) = apply {\n equalValues.initAndAdd(left, right)\n equalValues.initAndAdd(right, left)\n }","completion":"fun notEqual(left: ESValue, right: ESValue) = apply {\n notEqualValues.initAndAdd(left, right)\n notEqualValues.initAndAdd(right, left)\n }\n\n fun fire(effect: ESEffect) = apply { firedEffects += effect }\n\n fun or(other: MutableContextInfo): MutableContextInfo = MutableContextInfo(<|endoftext|>"} {"prompt":"appendVectorSize(element.values.size)\n if (funcIndices != null) {\n funcIndices.forEach { b.writeVarUInt32(it) }\n } else {\n element.values.forEach {\n appendExpr((it as WasmTable.Value.Expression).expr)\n }\n }\n }\n\n fun writeTypeOrKind() {","completion":"if (isFuncIndices) {\n b.writeByte(0x00)\n } else {\n appendType(element.type)\n }\n }\n\n when (val mode = element.mode) {\n WasmElement.Mode.Passive -> {\n b.writeByte(if (isFuncIndices) 0x01 else 0x05)\n writeTypeOrKind()<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) inline fun TestFunctionWithReifiedTypeParameterVsConstructorCReverse(arg: Invariant) {}\n\n\n class TestInlineFunctionVsConstructor {","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor()\n }\n inline fun TestInlineFunctionVsConstructor() {}\n\n class TestInlineFunctionVsConstructorReverse {<|endoftext|>"} {"prompt":"return exportType(type)\n\n return ExportedType.ErrorType(\"UnknownType ${type.render()}\")\n }\n\n fun exportTypeParameter(typeParameter: IrTypeParameter): ExportedType.TypeParameter {\n val constraint = typeParameter.superTypes.asSequence()\n .filter { it != context.irBuiltIns.anyNType }\n .map {","completion":"val exportedType = exportType(it)\n if (exportedType is ExportedType.ImplicitlyExportedType && exportedType.exportedSupertype == ExportedType.Primitive.Any) {\n exportedType.copy(exportedSupertype = ExportedType.Primitive.Unknown)\n } else {\n exportedType\n }\n }<|endoftext|>"} {"prompt":"\/\/ MODULE: m1-common\n\/\/ FILE: common.kt\nexpect class Foo {\n class Inner()\n}\n\nexpect class SeveralInner {\n class Inner1 {\n class Inner2 {\n class Inner3()\n }\n }\n}\n\n\/\/ MODULE: m2-jvm()()(m1-common)\n\/\/ FILE: jvm.kt\nclass FooImpl {\n class Inner\n}","completion":"actual typealias Foo = FooImpl\n\nclass SeveralInnerImpl {\n class Inner1 {\n class Inner2 {\n class Inner3\n }\n }\n}<|endoftext|>"} {"prompt":"public abstract fun getAnalysisSession(useSiteKtElement: KtElement): KtAnalysisSession\n\n public abstract fun getAnalysisSessionByUseSiteKtModule(useSiteKtModule: KtModule): KtAnalysisSession\n\n public inline fun analyse(\n useSiteKtElement: KtElement,\n action: KtAnalysisSession.() -> R,\n ): R {","completion":"return analyse(getAnalysisSession(useSiteKtElement), action)\n }\n\n public inline fun analyze(\n useSiteKtModule: KtModule,\n action: KtAnalysisSession.() -> R,\n ): R {\n return analyse(getAnalysisSessionByUseSiteKtModule(useSiteKtModule), action)\n }\n\n public inline fun analyse(<|endoftext|>"} {"prompt":"mainCallArguments = mainCallArguments\n )\n\n \/\/ Run analysis if main module is sources\n var sourceModule: ModulesStructure? = null\n val includes = arguments.includes\n if (includes == null) {\n val outputKlibPath =\n if (arguments.irProduceKlibFile) outputDir.resolve(\"$outputName.klib\").normalize().absolutePath","completion":"else outputDirPath\n if (configuration.get(CommonConfigurationKeys.USE_FIR) == true) {\n sourceModule = processSourceModuleWithK2(environmentForJS, libraries, friendLibraries, arguments, outputKlibPath)\n } else {\n sourceModule = processSourceModule(environmentForJS, libraries, friendLibraries, arguments, outputKlibPath)<|endoftext|>"} {"prompt":"override var typeParameters: List by lazyVar(stubGenerator.lock) {\n typeTranslator.buildWithScope(this) {\n stubGenerator.symbolTable.withScope(this) {\n val classTypeParametersCount = descriptor.constructedClass.original.declaredTypeParameters.size\n val allConstructorTypeParameters = descriptor.typeParameters","completion":"allConstructorTypeParameters.subList(classTypeParametersCount, allConstructorTypeParameters.size).mapTo(ArrayList()) {\n stubGenerator.generateOrGetTypeParameterStub(it)\n }\n }\n }\n }\n\n override val containerSource: DeserializedContainerSource?\n get() = (descriptor as? DescriptorWithContainerSource)?.containerSource<|endoftext|>"} {"prompt":"@OptIn(ExperimentalStdlibApi::class)\n override fun produceAdditionalFiles(globalDirectives: RegisteredDirectives, module: TestModule): List {\n if (WITH_COROUTINES !in module.directives) return emptyList()\n return buildList {\n add(File(coroutineHelpersPath).toTestFile())","completion":"if (CHECK_STATE_MACHINE in module.directives) {\n add(File(coroutineUtilPath).toTestFile())\n add(File(stateMachineCheckerPath).toTestFile())\n }\n if (CHECK_TAIL_CALL_OPTIMIZATION in module.directives) {\n add(File(tailCallOptimizationCheckerPath).toTestFile())\n }<|endoftext|>"} {"prompt":"import org.gradle.tooling.events.task.TaskExecutionResult\nimport org.gradle.tooling.events.task.TaskFailureResult\nimport org.gradle.tooling.events.task.TaskFinishEvent\nimport org.gradle.tooling.events.task.TaskSkippedResult\nimport org.gradle.util.GradleVersion","completion":"import org.jetbrains.kotlin.build.report.metrics.*\nimport org.jetbrains.kotlin.build.report.statistics.HttpReportService\nimport org.jetbrains.kotlin.gradle.plugin.BuildEventsListenerRegistryHolder\nimport org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.types\n\nimport org.jetbrains.kotlin.builtins.KotlinBuiltIns\nimport org.jetbrains.kotlin.descriptors.*\nimport org.jetbrains.kotlin.name.ClassId\nimport org.jetbrains.kotlin.resolve.descriptorUtil.classId","completion":"import org.jetbrains.kotlin.resolve.descriptorUtil.module\nimport org.jetbrains.kotlin.resolve.scopes.MemberScope\nimport org.jetbrains.kotlin.storage.CacheWithNotNullValues\nimport org.jetbrains.kotlin.storage.LockBasedStorageManager\nimport org.jetbrains.kotlin.storage.StorageManager<|endoftext|>"} {"prompt":"\/\/ library.kt:28 box: m:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=100:int, x4Var\\4$iv:int=4:int, $i$f$x4\\4\\8:int=0:int, y4\\4$iv:int=4:int","completion":"\/\/ library.kt:36 box: m:int=1:int, $i$f$foo:int=0:int, fooVar$iv:int=100:int, x4Var\\4$iv:int=4:int, $i$f$x4\\4\\8:int=0:int, y4\\4$iv:int=4:int, x6Var\\6$iv:int=6:int,<|endoftext|>"} {"prompt":"if ('2' in '1' downTo '3' != range0.contains('2')) throw AssertionError()\n if ('2' !in '1' downTo '3' != !range0.contains('2')) throw AssertionError()\n if (!('2' in '1' downTo '3') != !range0.contains('2')) throw AssertionError()","completion":"if (!('2' !in '1' downTo '3') != range0.contains('2')) throw AssertionError()\n \/\/ no local optimizations\n if (element2 in '1' downTo '3' != range0.contains(element2)) throw AssertionError()<|endoftext|>"} {"prompt":"* @throws IllegalArgumentException if [initialCapacity] is negative or [loadFactor] is non-positive.\n *\/\n public actual constructor(initialCapacity: Int, loadFactor: Float) : super(initialCapacity, loadFactor)\n\n \/**\n * Creates a new empty [LinkedHashSet] with the specified initial capacity.\n *","completion":"* Capacity is the maximum number of elements the set is able to store in current internal data structure.\n * When the set gets full by a certain default load factor, its capacity is expanded,\n * which usually leads to rebuild of the internal data structure.\n *\n * @param initialCapacity the initial capacity of the created set.\n * Note that the argument is just a hint for the implementation and can be ignored.\n *<|endoftext|>"} {"prompt":"class WeakIncompatibilityImpl {\n fun foo(differentName: String) {}\n}\n\nactual typealias WeakIncompatibility = WeakIncompatibilityImpl\n\nclass StrongIncompatibilityImpl {\n fun foo(p: String) {} \/\/ Different param type\n}","completion":"actual typealias StrongIncompatibility = StrongIncompatibilityImpl<|endoftext|>"} {"prompt":"append(\" {\\n\")\n val orderedDeclarations =\n if (sortDeclarations) declarationsInsideClass.sortedBy { it.text } else declarationsInsideClass\n for (declaration in orderedDeclarations) {\n append(\" \").append(declaration.annotations.joinToString(\"\")).append(declaration.text).append(\"\\n\")\n }\n append(\"}\")\n }\n }.toString()","completion":"override fun visitSource(source: String?, debug: String?) {\n if (source != null) {\n declarationsInsideClass.add(Declaration(\"\/\/ source: '$source'\"))\n } else {\n declarationsInsideClass.add(Declaration(\"\/\/ source: null\"))\n }\n }\n\n override fun visitPermittedSubclass(permittedSubclass: String?) {<|endoftext|>"} {"prompt":"val valueArguments = psi.valueArguments.map { arg ->\n val expression = arg.getArgumentExpression()!!\n\n val result = when {\n expression is KtCollectionLiteralExpression ->\n evaluator.evaluateToConstantArrayValue(expression.getInnerExpressions(), trace, TypeUtils.NO_EXPECTED_TYPE)","completion":"expression is KtCallExpression && expression.isArrayCall -> {\n evaluator.evaluateToConstantArrayValue(\n expression.valueArguments.mapNotNull { it.getArgumentExpression() },\n trace,\n TypeUtils.NO_EXPECTED_TYPE\n )\n }<|endoftext|>"} {"prompt":"check(js(\"Number\"), \"Float\", klass())\n check(js(\"Number\"), \"Double\", klass())\n check(js(\"Number\"), \"Number\", klass())\n\n check(js(\"Array\"), \"BooleanArray\", klass())\n check(js(\"Uint16Array\"), \"CharArray\", klass())","completion":"check(js(\"Int8Array\"), \"ByteArray\", klass())\n check(js(\"Int16Array\"), \"ShortArray\", klass())\n check(js(\"Int32Array\"), \"IntArray\", klass())\n check(js(\"Array\"), \"LongArray\", klass())<|endoftext|>"} {"prompt":"inv()\n }\n}\n\nfun poll32(flag: Boolean): Flow {\n return flow {\n val inv = when (flag) { true -> ::bar3 false -> ::foo3 }\n inv()\n }\n}\n\nfun poll33(flag: Boolean): Flow {\n return flow {\n val inv = when (flag) { true -> ::bar4 false -> ::foo4 }","completion":"inv()\n }\n}\n\nfun poll34(flag: Boolean): Flow {\n return flow {\n val inv = when (flag) { true -> ::bar5 false -> ::foo5 }\n inv\n }\n}\n\nfun poll35(flag: Boolean): Flow {\n return flow {<|endoftext|>"} {"prompt":"fun select(e1: F2, e: F2): F2 = e\n\nfun main() {\n generate {\n prop.call(\"\")\n }.length\n\n generate {\n id(prop).call(\"\")\n }.length\n\n generate {\n prop.call(\"\")","completion":"get().length<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment\nimport org.jetbrains.kotlin.config.ApiVersion\nimport org.jetbrains.kotlin.config.LanguageVersion\nimport org.jetbrains.kotlin.config.LanguageVersionSettings\nimport org.jetbrains.kotlin.config.LanguageVersionSettingsImpl","completion":"import java.nio.file.Path\nimport kotlin.contracts.ExperimentalContracts\nimport kotlin.contracts.InvocationKind\nimport kotlin.contracts.contract\nimport kotlin.io.path.isDirectory\n\n@KtModuleBuilderDsl\npublic class KtSourceModuleBuilder(\n private val kotlinCoreProjectEnvironment: KotlinCoreProjectEnvironment,<|endoftext|>"} {"prompt":"doTest(\"getA().x--\", 1, \"getA();get-A.x;set-A.x;\") { getA().x-- }","completion":"doTest(\"++getB()[1, 2, 3]\", 1, \"getB();1;2;3;get-B(1, 2, 3);set-B(1, 2, 3, 1);get-B(1, 2, 3);\") {\n ++getB()[logged(1), logged(2), logged(3)]\n }<|endoftext|>"} {"prompt":"ProtoSimpleTypeNullablity.MARKED_NULLABLE -> SimpleTypeNullability.MARKED_NULLABLE\n ProtoSimpleTypeNullablity.NOT_SPECIFIED -> SimpleTypeNullability.NOT_SPECIFIED\n ProtoSimpleTypeNullablity.DEFINITELY_NOT_NULL -> SimpleTypeNullability.DEFINITELY_NOT_NULL\n }","completion":"private fun deserializeSimpleType(proto: ProtoSimpleType): IrSimpleType {\n val symbol = deserializeIrSymbolAndRemap(proto.classifier)\n .checkSymbolType(fallbackSymbolKind = \/* just the first possible option *\/ CLASS_SYMBOL)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.*\nimport org.jetbrains.kotlin.ir.objcinterop.*\nimport org.jetbrains.kotlin.ir.types.IrType\nimport org.jetbrains.kotlin.ir.types.getClass\nimport org.jetbrains.kotlin.ir.types.isNothing","completion":"import org.jetbrains.kotlin.ir.types.isUnit\nimport org.jetbrains.kotlin.ir.util.*\nimport org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid\nimport org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid<|endoftext|>"} {"prompt":"public inline fun >> kotlin.BooleanArray.groupByTo(destination: M, keySelector: (kotlin.Boolean) -> K, valueTransform: (kotlin.Boolean) -> V): M","completion":"public inline fun >> kotlin.ByteArray.groupByTo(destination: M, keySelector: (kotlin.Byte) -> K): M<|endoftext|>"} {"prompt":"return checkTypeSpecifics(conditions, { it.isInt() }, { it.kind == IrConstKind.Int })\n }\n\n private fun areConstStringComparisons(conditions: List): Boolean {\n return checkTypeSpecifics(\n conditions,\n { it.isString() || it.isNullableString() },","completion":"{ it.kind == IrConstKind.String || it.kind == IrConstKind.Null })\n }\n\n private fun checkTypeSpecifics(\n conditions: List,\n subjectTypePredicate: (IrType) -> Boolean,\n irConstPredicate: (IrConst<*>) -> Boolean\n ): Boolean {<|endoftext|>"} {"prompt":"\/\/ TESTED_OBJECTS: Introspector$test$SchemaRetriever, SchemaRetriever\n\/\/ FLAGS: ACC_FINAL, ACC_PUBLIC, ACC_STATIC\n\n\/\/ TESTED_OBJECT_KIND: innerClass\n\/\/ TESTED_OBJECTS: Introspector$test$SchemaRetriever, DefaultImpls","completion":"\/\/ FLAGS: ACC_FINAL, ACC_PUBLIC, ACC_STATIC<|endoftext|>"} {"prompt":"DefaultKotlinUsageContext(compilation, RUNTIME, target.runtimeElementsPublishedConfiguration.name),\n DefaultKotlinUsageContext(\n compilation = compilation,\n mavenScope = null,\n dependencyConfigurationName = target.sourcesElementsPublishedConfiguration.name,\n includeIntoProjectStructureMetadata = false,\n publishOnlyIf = { target.isSourcesPublishable }\n )","completion":")\n }\n\n override fun getUsages(): Set = _usages.filter { it.publishOnlyIf.predicate() }.toSet()\n}<|endoftext|>"} {"prompt":"assertEquals(kclasses[Short::class], 16)\n assertEquals(kclasses[ShortArray::class], 17)\n assertEquals(kclasses[UShort::class], 18)\n assertEquals(kclasses[UShortArray::class], 19)\n assertEquals(kclasses[Byte::class], 20)\n assertEquals(kclasses[ByteArray::class], 21)","completion":"assertEquals(kclasses[UByte::class], 22)\n assertEquals(kclasses[UByteArray::class], 23)\n assertEquals(kclasses[Boolean::class], 24)\n assertEquals(kclasses[BooleanArray::class], 25)\n assertEquals(kclasses[Unit::class], 26)\n assertEquals(kclasses[Nothing::class], 27)<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.android.synthetic.res\n\nimport com.intellij.openapi.project.Project\nimport com.intellij.psi.PsiElement\nimport com.intellij.psi.SmartPsiElementPointer\nimport com.intellij.psi.util.CachedValue\nimport com.intellij.psi.util.CachedValueProvider","completion":"import com.intellij.psi.util.CachedValuesManager\nimport org.jetbrains.kotlin.android.synthetic.AndroidConst\nimport org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kotlin.descriptors.ModuleDescriptor\nimport org.jetbrains.kotlin.descriptors.findClassAcrossModuleDependencies<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.javac.wrappers.symbols\n\nimport org.jetbrains.kotlin.descriptors.Visibility\nimport org.jetbrains.kotlin.javac.JavacWrapper\nimport org.jetbrains.kotlin.load.java.structure.JavaAnnotation","completion":"import org.jetbrains.kotlin.load.java.structure.JavaClass\nimport org.jetbrains.kotlin.load.java.structure.JavaMember\nimport org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.name.Name\nimport javax.lang.model.element.Element<|endoftext|>"} {"prompt":"fun IrContainerExpression.unwrapBlock(): IrExpression = statements.singleOrNull() as? IrExpression ?: this\n\n\/**\n * Appends the parameters in [contextParameters] to the type parameters of\n * [this] function, renaming those that may clash with a provided collection of\n * [existingParameters] (e.g. type parameters of the function itself, when\n * creating DefaultImpls).\n *","completion":"* @returns List of newly created, possibly renamed, copies of type parameters\n * in order of the corresponding parameters in [context].\n *\/\nprivate fun IrSimpleFunction.copyAndRenameConflictingTypeParametersFrom(\n contextParameters: List,\n existingParameters: Collection\n): List {\n val newParameters = mutableListOf()<|endoftext|>"} {"prompt":"private val resolver: IdeDependencyResolver,\n val constraint: SourceSetConstraint,\n val phase: DependencyResolutionPhase,\n val priority: Priority,\n ) : IdeDependencyResolver {\n\n private class TimeMeasuredResult(val timeInMillis: Long, val dependencies: Set)","completion":"override fun resolve(sourceSet: KotlinSourceSet): Set {\n return runCatching { resolveTimed(sourceSet) }\n .onFailure { error -> reportError(sourceSet, error) }\n .onSuccess { result -> reportSuccess(sourceSet, result) }\n .onSuccess { result -> attachResolvedByExtra(result.dependencies) }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.lexer.KtTokens\nimport org.jetbrains.kotlin.psi.KtSimpleNameExpression\nimport org.jetbrains.org.objectweb.asm.Label\nimport org.jetbrains.org.objectweb.asm.Opcodes\nimport org.jetbrains.org.objectweb.asm.commons.InstructionAdapter","completion":"class InContinuousRangeOfComparableExpressionGenerator(\n operatorReference: KtSimpleNameExpression,\n private val boundedValue: BoundedValue,\n private val frameMap: FrameMap\n) : InExpressionGenerator {\n private val isNotIn = operatorReference.getReferencedNameElementType() == KtTokens.NOT_IN\n private val comparisonGenerator = ObjectComparisonGenerator<|endoftext|>"} {"prompt":"\/\/ JVM_ABI_K1_K2_DIFF: KT-63864\n\/\/ WITH_STDLIB\n\nimport kotlin.test.*\n\nval sb = StringBuilder()\n\nfun box(): String {\n\n try {\n try {\n sb.appendLine(\"Try\")\n throw Error(\"Error happens\")\n sb.appendLine(\"After throw\")\n } finally {","completion":"sb.appendLine(\"Finally\")\n }\n\n sb.appendLine(\"After nested try\")\n\n } catch (e: Error) {\n sb.appendLine(\"Caught Error\")\n }\n\n sb.appendLine(\"Done\")\n\n assertEquals(\"\"\"\n Try\n Finally\n Caught Error\n Done\n\n \"\"\".trimIndent(), sb.toString())<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM_IR\n\/\/ FILE: j\/J.java\n\npackage j;\n\npublic class J {\n public static final String ok() { return \"OK\"; }\n}\n\n\/\/ FILE: foo.kt\nfun foo(a: Any) {}\n\n\/\/ FILE: k.kt\nimport j.J\n\nfun test() {\n val a = J.ok()\n foo(a)","completion":"foo(a)\n}\n\n\/\/ @KKt.class:\n\/\/ 0 LDC \"a\"\n\/\/ 0 checkExpressionValueIsNotNull\n\/\/ 1 checkNotNull<|endoftext|>"} {"prompt":"class D @kotlin.PublishedApi constructor() {\n\n @kotlin.PublishedApi\n constructor(a: String) : this()","completion":"@kotlin.PublishedApi\n private constructor(a: String, b: String): this()\n\n @kotlin.PublishedApi\n internal constructor(a: String, b: String, c: String): this()\n}\n\nclass InConstructor(<|endoftext|>"} {"prompt":"@file:Suppress(\"FunctionName\")\n\npackage org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers\n\nimport org.gradle.api.Project\nimport org.gradle.api.artifacts.DependencySubstitutions\nimport org.gradle.api.artifacts.component.ModuleComponentSelector\nimport org.gradle.api.artifacts.component.ProjectComponentIdentifier","completion":"import org.gradle.api.attributes.Category\nimport org.gradle.api.attributes.Usage\nimport org.gradle.api.attributes.java.TargetJvmEnvironment\nimport org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryDependency<|endoftext|>"} {"prompt":"if (this[\"export_enum_class\"].Bar.B.bar(\"B\") !== \"B\") return \"fail15\"\n\n if (this[\"export_enum_class\"].Bar.A.bay() !== \"A\") return \"fail15\"\n if (this[\"export_enum_class\"].Bar.B.bay() !== \"B\") return \"fail16\"","completion":"if (this[\"export_enum_class\"].Bar.B.constructor.prototype.hasOwnProperty('d')) return \"fail17\"\n if (this[\"export_enum_class\"].Bar.B.constructor.prototype.hasOwnProperty('huh')) return \"fail18\"<|endoftext|>"} {"prompt":"variableDependencyProvider: TypeVariableDependencyInformationProvider,\n topLevelTypeVariables: Set\n ): KotlinTypeMarker? = with(resolutionTypeSystemContext) {\n val expectedType = argument.expectedType ?: return null\n val expectedTypeConstructor = expectedType.typeConstructor()\n\n if (expectedTypeConstructor !in notFixedTypeVariables) return null","completion":"val relatedTopLevelVariable = selectFirstRelatedVariable(topLevelTypeVariables, expectedTypeConstructor, variableDependencyProvider)\n val pathFromRelatedTopLevelVariable = if (relatedTopLevelVariable != null) {\n val constraintTypes = notFixedTypeVariables.getValue(relatedTopLevelVariable).constraints.map { it.type }.toSet()\n val containingType = constraintTypes.find { constraintType -><|endoftext|>"} {"prompt":"return classId.packageFqName == StandardClassIds.BASE_REFLECT_PACKAGE &&\n classId.shortClassName.identifier.startsWith(\"KMutableProperty\")\n}\n\nfun ConeKotlinType.isKClassType(): Boolean {\n return classId == StandardClassIds.KClass\n}","completion":"val FirAnonymousFunction.returnType: ConeKotlinType? get() = returnTypeRef.coneTypeSafe()\nval FirAnonymousFunction.receiverType: ConeKotlinType? get() = receiverParameter?.typeRef?.coneTypeSafe()\n\nfun ConeTypeContext.isTypeMismatchDueToNullability(\n actualType: ConeKotlinType,\n expectedType: ConeKotlinType<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ KT-55458\n\nval arr = arrayOf(\"a\", \"b\", \"c\", \"d\")\n\nfun useAny(x: Any) {}\n\nfun box(): String {\n val s = StringBuilder()\n\n for ((index: Any, x) in arr.withIndex()) {\n useAny(index)\n s.append(\"$index:$x;\")\n }","completion":"val ss = s.toString()\n return if (ss == \"0:a;1:b;2:c;3:d;\") \"OK\" else \"fail: '$ss'\"\n}<|endoftext|>"} {"prompt":"lateinit var coocoo2: Coocoo2\n lateinit var coocoo21: Coocoo2\n lateinit var coocoo3: Coocoo3\n lateinit var coocoo31: Coocoo3>\n\n lateinit var nested: Nested2\n\n val m = ABC()","completion":"val n = \"\".toString()\n\n lateinit var o11: List>>>>>>>>>\n lateinit var o10: List>>>>>>>>\n\n lateinit var p: Calendar.Builder\n\n fun f1(a: ABC): BCD? {<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.cli.common.repl\n\nimport java.util.concurrent.locks.ReentrantReadWriteLock\nimport kotlin.concurrent.read\nimport kotlin.concurrent.write\n\n\ninterface ILineId : Comparable {\n val no: Int\n val generation: Int\n}","completion":"data class ReplHistoryRecord (val id: ILineId, val item: T)\n\ninterface IReplStageHistory : List> {\n\n fun peek(): ReplHistoryRecord? = lock.read { lastOrNull() }\n\n fun push(id: ILineId, item: T)\n\n fun pop(): ReplHistoryRecord?<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.utils\n\nimport org.gradle.api.logging.Logger\n\ninternal fun formatDuration(milliseconds: Long): String {\n var ms: Long = milliseconds\n var s: Long = 0\n var m: Long = 0\n var h: Long = 0\n\n if (ms >= 1000) {\n s = ms \/ 1000","completion":"ms %= 1000\n if (s >= 60) {\n m = s \/ 60\n s %= 60\n if (m >= 60) {\n h = m \/ 60\n m %= 60\n }\n }\n }\n\n return buildString {\n if (h > 0) append(h).append(\" h \")<|endoftext|>"} {"prompt":"kotlin.Int?, out kotlin.Short?, out kotlin.String?>?>?\")!>x.propNullableT","completion":"?> & ClassWithThreeTypeParameters"} {"prompt":"visibility = if (it.index < 0) DescriptorVisibilities.PRIVATE else JavaDescriptorVisibilities.PACKAGE_VISIBILITY\n } else null\n ParameterInfo(field, it.type, it.name, it.origin)\n }\n\n context.continuationClassesVarsCountByType[attributeOwnerId] = varsCountByType","completion":"val constructor = addPrimaryConstructorForLambda(suspendLambda, arity)\n val invokeToOverride = functionNClass.functions.single {\n it.owner.valueParameters.size == arity + 1 && it.owner.name.asString() == \"invoke\"\n }\n val createToOverride = suspendLambda.symbol.functions.singleOrNull {<|endoftext|>"} {"prompt":"if (test3 != \"2NStr(s=null)NStr(s=null)\") return \"fail 3: $test3\"\n\n val test4 = testNStr(NStr(\"0\"))\n if (test4 != \"2NStr(s=0)NStr(s=0)\") return \"fail 4: $test4\"\n\n val test5 = testNStr(null)","completion":"if (test5 != \"2nullnull\") return \"fail 5: $test5\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"Companion(\"\")\n }\n}\n\n\/\/ TESTCASE NUMBER: 2\nclass Case2() {\n companion object {\n operator fun invoke(y: Any?, x: Any?): Unit = TODO() \/\/ (1.1)","completion":"operator fun invoke(vararg x: Int): String = TODO() \/\/ (1.2)\n }\n\n fun case() {\n Companion(1, 1)<|endoftext|>"} {"prompt":"projectDisposable = _projectEnvironment.parentDisposable,\n applicationDisposable = _projectEnvironment.environment.parentDisposable,\n )\n }\n\n override fun initializeProjectStructure() {\n val ktTestModuleStructure = testServices.ktTestModuleStructure\n val useSiteModule = testServices.moduleStructure.modules.first()","completion":"val useSiteCompilerConfiguration = testServices.compilerConfigurationProvider.getCompilerConfiguration(useSiteModule)\n val builtinsModule = KtBuiltinsModule(\n useSiteModule.targetPlatform,\n useSiteModule.targetPlatform.getAnalyzerServices(),\n getProject()\n )\n\n val globalLanguageVersionSettings = useSiteModule.languageVersionSettings<|endoftext|>"} {"prompt":"complexInlineFun(2.0, DPoint(3.0, 5.0), a4 = DPoint(11.0, 13.0))\n }","completion":"require(complexInlineFun(2.0, DPoint(3.0, 5.0), 7.0, DPoint(11.0, 13.0)) == \"2.0, ${DPoint(3.0, 5.0)}, 7.0, ${DPoint(11.0, 13.0)}\") {<|endoftext|>"} {"prompt":"inline fun get(node: CirNodeWithLiftingUp<*, *>): T? {\n return when {\n isCommon -> node.commonDeclaration() as T?\n node.isLiftedUp -> null\n else -> node.targetDeclarations[targetIndex] as T?\n }\n }\n\n companion object {","completion":"fun rootContext(rootNode: CirRootNode, targetIndex: Int): CirTreeSerializationContext =\n CirTreeSerializationContext(\n targetIndex = targetIndex,\n isCommon = rootNode.indexOfCommon == targetIndex,\n typeParameterIndexOffset = 0,\n currentPath = Path.Empty\n )\n }\n}\n\ninternal class ClassConsumer {<|endoftext|>"} {"prompt":"}\n\n @Anno(\"first generation setSomething: ${setterProperty}\")\n override fun setSomething(s: @Anno(\"setter type ${propertyFromSetter}\") String) {\n println(s)\n }\n}\n\n@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE)\nannotation class Anno(val s: String)","completion":"val getterProperty = 2.let { it + 1 }\nval setterProperty = 2.let { it + 1 }\nval propertyFromBody = \"str\" + 1.toString()\nval propertyFromSetter = 1.toString() + \"2\"\n\n\/\/ FILE: Base.java\npublic class Base {\n public String getSomething() {\n return \"\";\n }\n\n public void setSomething(String s) {<|endoftext|>"} {"prompt":"var x: Any? = materialize()\n for (i in 1..10) {\n require(x is String)\n atLeastOnce {\n x.length\n }\n x = materialize()\n }\n}\n\nfun test30() {\n var x: Any? = materialize()","completion":"for (i in 1..10) {\n require(x is String)\n runWithoutContract {\n x.length\n }\n x = materialize()\n }\n}\n\nfun test31() {\n var x: Any? = materialize()\n for (i in 1..10) {\n require(x is String)<|endoftext|>"} {"prompt":"* Note: Kotlin language constant appears in DWARF v6, while modern linker fails to links DWARF other then [2;4],\n * that why we emit version 4 actually.\n *\/\n fun dwarfVersion(config: KonanConfig) = when (config.debugInfoVersion()) {\n 1 -> 2","completion":"2 -> 4 \/* likely the most of the future kotlin native debug info format versions will emit DWARF v4 *\/\n else -> TODO(\"unsupported debug info format version\")\n }\n\n fun language(config: KonanConfig) = when (config.debugInfoVersion()) {\n 1 -> DwarfLanguage.DW_LANG_C89.value\n else -> DwarfLanguage.DW_LANG_Kotlin.value<|endoftext|>"} {"prompt":"trace: BindingTrace,\n isDebuggerContext: Boolean\n ): TypeQualifierResolutionResult {\n val ownerDescriptor = if (!isDebuggerContext) scope.ownerDescriptor else null\n if (userType.qualifier == null) {\n val descriptor = userType.referenceExpression?.let { expression ->\n val classifier = scope.findClassifierAndReportDeprecationIfNeeded(","completion":"expression.getReferencedNameAsName(),\n KotlinLookupLocation(expression),\n expression,\n trace\n )\n\n checkNotEnumEntry(classifier, trace, expression)\n storeResult(trace, expression, classifier, ownerDescriptor, position = QualifierPosition.TYPE, isQualifier = false)\n classifier\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.session\n\nimport org.jetbrains.kotlin.fir.NoMutableState\nimport org.jetbrains.kotlin.fir.resolve.BodyResolveComponents\nimport org.jetbrains.kotlin.fir.resolve.calls.ConeCallConflictResolverFactory","completion":"import org.jetbrains.kotlin.fir.resolve.calls.ConeCompositeConflictResolver\nimport org.jetbrains.kotlin.fir.resolve.calls.ConeIntegerOperatorConflictResolver\nimport org.jetbrains.kotlin.fir.resolve.calls.ConeOverloadConflictResolver<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.utils.withIndent\nimport java.io.File\nimport kotlin.reflect.KClass\nimport kotlin.reflect.full.createType\n\nprivate const val CONVERT_ARGUMENT = \"convertArgument\"\n\nobject ArgumentsConverterGenerator {\n fun render(file: File, packageName: String) {","completion":"val convertArgumentFunctionCallConversion = HLFunctionCallConversion(\n \"$CONVERT_ARGUMENT({0}, firSymbolBuilder)\",\n callType = Any::class.createType(nullable = true)\n )\n val convertersMap = FirToKtConversionCreator.getAllConverters(convertArgumentFunctionCallConversion)<|endoftext|>"} {"prompt":"private fun renderSetter(accessor: PropertyAccessor.Setter): String {\n val annotations = accessor.annotations.joinToString(separator = \"\") { renderAnnotation(it) + \" \" }\n return annotations + if (accessor is PropertyAccessor.Setter.ExternalSetter) {\n \"external set\"\n } else {","completion":"\"set(value) { ${renderPropertyAccessorBody(accessor)} }\"\n }\n }\n\n private fun renderPropertyAccessorBody(accessor: PropertyAccessor): String = when (accessor) {\n is PropertyAccessor.Getter.SimpleGetter -> {\n when {\n accessor in propertyAccessorBridgeBodies -> propertyAccessorBridgeBodies.getValue(accessor)<|endoftext|>"} {"prompt":"ownerFn.origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB &&\n ownerFn.needsComposableRemapping()\n ) {\n if (symbolRemapper.getReferencedConstructor(ownerFn.symbol) == ownerFn.symbol) {\n \/\/ Not remapped yet, so remap now.","completion":"\/\/ Remap only once to avoid IdSignature clash (on k\/js 1.7.20).\n symbolRemapper.visitConstructor(ownerFn)\n super.visitConstructor(ownerFn).also {\n it.patchDeclarationParents(ownerFn.parent)\n }\n }<|endoftext|>"} {"prompt":"is KtClassInitializerSymbol -> {\n val outerFirClassifier = firSymbol.getContainingClassSymbol(symbolFirSession)\n if (outerFirClassifier != null) {\n return firSymbolBuilder.buildSymbol(outerFirClassifier) as? KtDeclarationSymbol\n }\n }\n\n is KtValueParameterSymbol -> {","completion":"return firSymbolBuilder.callableBuilder.buildCallableSymbol(symbol.firSymbol.fir.containingFunctionSymbol)\n }\n\n is KtCallableSymbol -> {\n val outerFirClassifier = firSymbol.getContainingClassSymbol(symbolFirSession)\n if (outerFirClassifier != null) {<|endoftext|>"} {"prompt":"if (destructuringStatements.isNotEmpty()) {\n \/\/ Destructured variables must be in a separate block so that they can be shadowed.\n buildBlock {\n source = bodyBlock.source?.realElement()\n statements.addAll(destructuringStatements)\n statements.add(bodyBlock)\n }\n } else {\n bodyBlock\n }\n } else {","completion":"buildSingleExpressionBlock(buildErrorExpression(null, ConeSyntaxDiagnostic(\"Lambda has no body\")))\n }\n }\n context.firFunctionTargets.removeLast()\n }.also {\n target.bind(it)\n }\n return buildAnonymousFunctionExpression {\n source = expressionSource\n this.anonymousFunction = anonymousFunction\n }\n }<|endoftext|>"} {"prompt":"+booleanField(\"resolvedToCompanionObject\", withReplace = true)\n +booleanField(\"canBeValue\", withReplace = true)\n +booleanField(\"isFullyQualified\")\n +fieldList(\"nonFatalDiagnostics\", coneDiagnosticType, useMutableOrEmpty = true)\n +typeArguments.withTransform()\n }","completion":"resolvedReifiedParameterReference.configure {\n +field(\"symbol\", typeParameterSymbolType)\n }\n\n stringConcatenationCall.configure {\n }\n\n throwExpression.configure {\n +field(\"exception\", expression).withTransform()\n }\n\n variableAssignment.configure {\n +field(\"lValue\", expression).withTransform().withReplace()<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.ir.backend.js.transformers.irToJs\n\nimport org.jetbrains.kotlin.ir.IrElement\nimport org.jetbrains.kotlin.ir.backend.js.utils.TODO\nimport org.jetbrains.kotlin.ir.visitors.IrElementVisitor","completion":"import org.jetbrains.kotlin.js.backend.ast.JsNode\n\ninterface BaseIrElementToJsNodeTransformer : IrElementVisitor {\n override fun visitElement(element: IrElement, data: D): R {\n TODO(element)\n }\n}<|endoftext|>"} {"prompt":"val en1: Any = En.A\n if (en1 is En) {\n when (en1) {\n En.A -> {res2 += \"O\"}\n En.B -> {}\n En.C -> {}\n }\n \/\/ Working without other examples\n when (en1 as En) {\n En.A -> {res2 += \"K\"}\n En.B -> {}","completion":"En.C -> {}\n }\n }\n\n if (res1 != res2) return \"different results: $res1 != $res2\"\n return res1\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WITH_COROUTINES\nimport helpers.*\nimport kotlin.coroutines.*\n\nsuspend fun callLocal(): String {\n suspend fun local() = \"OK\"\n return local()\n}\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\nfun box(): String {\n var res = \"FAIL\"","completion":"builder {\n res = callLocal()\n }\n return res\n}<|endoftext|>"} {"prompt":"}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Array.min(): Float? {","completion":"return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun > Array.min(): T? {<|endoftext|>"} {"prompt":"name = \"EnumWhenLowering\",\n description = \"Replace `when` subjects of enum types with their ordinals\"\n)\ninternal class MappedEnumWhenLowering(override val context: JvmBackendContext) : EnumWhenLowering(context) {\n private val intArray = context.irBuiltIns.primitiveArrayForType.getValue(context.irBuiltIns.intType)","completion":"private val intArrayConstructor = intArray.constructors.single { it.owner.valueParameters.size == 1 }\n private val intArrayGet = intArray.functions.single { it.owner.name == OperatorNameConventions.GET }\n private val intArraySet = intArray.functions.single { it.owner.name == OperatorNameConventions.SET }<|endoftext|>"} {"prompt":"\/\/ DO_NOT_CHECK_SYMBOL_RESTORE_K1\n\/\/ FILE: Derived.kt\nfun usage() {\n Derived().something\n}\n\nclass Derived : Base() {\n override fun getSomething(): String = \"42\"\n override fun setSomething(s: String) {\n\n }\n}\n\n\/\/ FILE: Base.java\npublic class Base {","completion":"public String getSomething() {\n return \"\";\n }\n\n public void setSomething(String s) {\n\n }\n}<|endoftext|>"} {"prompt":"val metadata: Metadata? = proto.constructor?.`$metadata$`\n\n metadata?.errorInfo?.let { return it } \/\/ cached\n\n var result = 0\n if (hasProp(proto, \"message\")) result = result or 0x1\n if (hasProp(proto, \"cause\")) result = result or 0x2\n\n if (result != 0x3) { \/\/","completion":"val parentProto = getPrototypeOf(proto)\n if (parentProto != js(\"Error\").prototype) {\n result = result or calculateErrorInfo(parentProto)\n }\n }\n\n if (metadata != null) {\n metadata.errorInfo = result\n }\n\n return result\n}<|endoftext|>"} {"prompt":"Platform B: A -> B -> C Z -> Y -> X -> C\n\n Expected: A, B, C, X, Y, Z\n *\/\n fun `test sample 6`() {\n val resolver = createCommonClassifierIdResolver(\n createCirTreeRootFromSourceCode(\n \"\"\"\n class C\n typealias B = C\n typealias A = B","completion":"typealias X = C\n typealias Y = X\n typealias Z = Y\n \"\"\".trimIndent()\n ),\n createCirTreeRootFromSourceCode(\n \"\"\"\n class C\n typealias B = C\n typealias A = B\n \n typealias X = C\n typealias Y = X\n typealias Z = Y\n \"\"\".trimIndent()\n )<|endoftext|>"} {"prompt":"reporter.reportOn(backingField.source, FirErrors.PROPERTY_FIELD_DECLARATION_MISSING_INITIALIZER, context)\n } else if (backingField.initializer != null && backingField.isLateInit) {","completion":"reporter.reportOn(backingField.source, FirErrors.LATEINIT_PROPERTY_FIELD_DECLARATION_WITH_INITIALIZER, context)\n }\n\n if (backingField.isLateInit && backingField.isNullable) {<|endoftext|>"} {"prompt":"object PrecedingDocCommentsBinder : WhitespacesAndCommentsBinder {\n override fun getEdgePosition(\n tokens: List, atStreamEdge: Boolean, getter: WhitespacesAndCommentsBinder.TokenTextGetter\n ): Int {\n if (tokens.isEmpty()) return 0\n\n for (idx in tokens.indices.reversed()) {","completion":"if (tokens[idx] == KtTokens.DOC_COMMENT) return idx\n }\n\n return tokens.size\n }\n}\n\n\/\/ Binds comments on the same line\nobject TrailingCommentsBinder : WhitespacesAndCommentsBinder {\n override fun getEdgePosition(<|endoftext|>"} {"prompt":"val constantExpression = (expression as? FirLiteralExpression<*>) ?: return null\n val stringValue = constantExpression.value as? String ?: return null\n if (!stringValue.matches(RequireKotlinConstants.VERSION_REGEX)) {\n reporter.reportOn(expression.source, FirErrors.ILLEGAL_KOTLIN_VERSION_STRING_VALUE, context)","completion":"return null\n }\n val version = ApiVersion.parse(stringValue)\n if (version == null) {\n reporter.reportOn(expression.source, FirErrors.ILLEGAL_KOTLIN_VERSION_STRING_VALUE, context)\n }\n return version\n }\n\n private fun checkAnnotationsWithVersion(\n fqName: FqName?,<|endoftext|>"} {"prompt":"private fun computeSecondaryConstructors(): List =\n classProto.constructorList.filter { Flags.IS_SECONDARY.get(it.flags) }.map {\n c.memberDeserializer.loadConstructor(it, false)\n }\n\n override fun getConstructors() = constructors()","completion":"override fun getContextReceivers(): List = classProto.contextReceiverTypes(c.typeTable).map {\n val contextReceiverType = c.typeDeserializer.type(it)\n ReceiverParameterDescriptorImpl(\n thisAsReceiverParameter,\n ContextClassReceiver(\n this,\n contextReceiverType,<|endoftext|>"} {"prompt":"\/\/ test.kt:9 \n\/\/ test.kt:9 box\n\/\/ test.kt:18 box\n\/\/ test.kt:29 box\n\n\/\/ EXPECTATIONS JS_IR\n\/\/ test.kt:21 box\n\/\/ test.kt:9 box\n\/\/ test.kt:15 \n\/\/ test.kt:23 bar\n\/\/ test.kt:25 \n\/\/ test.kt:23 ","completion":"\/\/ test.kt:12 bar\n\/\/ test.kt:9 \n\/\/ test.kt:29 box\n\n\/\/ EXPECTATIONS WASM\n\/\/ test.kt:21 $box (17, 4)\n\/\/ test.kt:22 $box\n\/\/ test.kt:9 $box (4, 4)\n\/\/ test.kt:15 $.<|endoftext|>"} {"prompt":"public abstract class MemoryAllocator {\n \/**\n * Allocates a block of uninitialized linear memory of the given [size] in bytes.\n *\n * @return an address of allocated memory. It is guaranteed to be a multiple of 8.\n *\/\n public abstract fun allocate(size: Int): Pointer\n}\n\n\/**","completion":"* Runs the [block] of code, providing it a temporary [MemoryAllocator] as an argument, and returns the result of this block.\n *\n * Frees all memory allocated with the provided allocator after running the [block].\n *\n * This function is intened to facilitate the exchange of values with outside world through linear memory.\n * For example:\n *\n * ```\n * val buffer_size = ...<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.library.metadata.KlibMetadataVersion\nimport org.jetbrains.kotlin.storage.LockBasedStorageManager\nimport org.jetbrains.kotlin.test.KotlinTestUtils\n\ninternal fun mockTAType(\n typeAliasId: String,\n nullable: Boolean = false,\n underlyingType: () -> CirClassOrTypeAliasType","completion":"): CirTypeAliasType = CirTypeAliasType.createInterned(\n typeAliasId = createValidClassifierId(typeAliasId),\n underlyingType = underlyingType().makeNullableIfNecessary(nullable),\n arguments = emptyList(),\n isMarkedNullable = nullable\n)\n\ninternal fun mockClassType(\n classId: String,\n nullable: Boolean = false<|endoftext|>"} {"prompt":"fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO()\nfun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO()\n\n\/\/ FILE: Lib6.kt\npackage libPackageCase3Explicit","completion":"public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO()\n\n\/\/ FILE: LibtestsPack3.kt\npackage testsCase3\n\nval Case3.listOf: A\n get() = A()<|endoftext|>"} {"prompt":"}\n\n private var currentState = entryState\n private var currentBlock = entryState.entryBlock\n\n private val catchBlockStack = mutableListOf(rootExceptionTrap)\n private val tryStateMap = hashMapOf()\n private val tryLoopStack = mutableListOf()\n\n private fun buildExceptionTrapState(): SuspendState {","completion":"val state = SuspendState(unit)\n state.entryBlock.statements += JsIrBuilder.buildThrow(nothing, pendingException())\n return state\n }\n\n private fun newState() {\n val newState = SuspendState(unit)\n doDispatch(newState)\n updateState(newState)\n }\n\n private fun updateState(newState: SuspendState) {<|endoftext|>"} {"prompt":"\"\".topLevelExtensionFun()\n 1.topLevelExtensionFun()\n \"\".topLevelExtensionProperty\n 1.topLevelExtensionProperty","completion":"memberFun()\n memberFun(1)\n privateFun()\n privateFun(1)<|endoftext|>"} {"prompt":"override val hasStableParameterNames: Boolean\n get() = withValidityAssertion { true }\n\n override val callableIdIfNonLocal: CallableId?\n get() = withValidityAssertion { null }\n\n override val returnType: KtType","completion":"get() = withValidityAssertion { descriptor?.returnType?.toKtType(analysisContext) ?: createErrorType() }\n\n override val receiverParameter: KtReceiverParameterSymbol?\n get() = withValidityAssertion {\n if (!propertyPsi.isExtensionDeclaration()) {\n return null\n }<|endoftext|>"} {"prompt":"val uintList = mutableListOf()\n val uintProgression = 1u..<11u\n for (i in (uintProgression step 2).reversed() step 3) {\n uintList += i\n }\n assertEquals(listOf(9u, 6u, 3u), uintList)\n\n val ulongList = mutableListOf()","completion":"val ulongProgression = 1uL..<11uL\n for (i in (ulongProgression step 2L).reversed() step 3L) {\n ulongList += i\n }\n assertEquals(listOf(9uL, 6uL, 3uL), ulongList)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun ShortArray.sumBy(selector: (Short) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n\/**","completion":"* Returns the sum of all values produced by [selector] function applied to each element in the array.\n *\/\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun IntArray.sumBy(selector: (Int) -> Int): Int {\n var sum: Int = 0<|endoftext|>"} {"prompt":"return TimeSource.Monotonic.measureTimedValue(block)\n}\n\n\/**\n * Executes the given function [block] and returns an instance of [TimedValue] class, containing both\n * the result of function execution and the duration of elapsed time interval.\n *\n * The elapsed time is measured with the specified `this` [TimeSource] instance.\n *\/\n@SinceKotlin(\"1.9\")","completion":"@WasExperimental(ExperimentalTime::class)\npublic inline fun TimeSource.measureTimedValue(block: () -> T): TimedValue {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n val mark = markNow()\n val result = block()\n return TimedValue(result, mark.elapsedNow())<|endoftext|>"} {"prompt":"}\n append(DECOMPILED_CODE_COMMENT).append(\" }\")\n }\n } else {\n \/\/ descriptor instanceof PropertyDescriptor\n builder.append(\" \").append(DECOMPILED_CODE_COMMENT)\n }\n }\n if (descriptor is PropertyDescriptor) {\n for (accessor in descriptor.accessors) {","completion":"if (accessor.isDefault) continue\n builder.append(\"\\n$indent \")\n builder.append(accessor.visibility.internalDisplayName).append(\" \")\n builder.append(accessor.modality.name.toLowerCaseAsciiOnly()).append(\" \")\n if (accessor.isExternal) {\n builder.append(\"external \")\n }<|endoftext|>"} {"prompt":"LLVMAddAlias2(module, getGlobalFunctionType(entryPoint), programAddressSpace, entryPoint, \"main\")\n}\n\ninternal fun linkBitcodeDependencies(generationState: NativeGenerationState,\n generatedBitcodeFiles: List) {\n val config = generationState.config\n val produce = config.produce","completion":"if (produce == CompilerOutputKind.FRAMEWORK && config.produceStaticFramework) {\n embedAppleLinkerOptionsToBitcode(generationState.llvm, config)\n }\n linkAllDependencies(generationState, generatedBitcodeFiles.map { it.absoluteFile.normalize().path })\n\n}<|endoftext|>"} {"prompt":"AnnotationTarget.PROPERTY_GETTER,\n AnnotationTarget.PROPERTY_SETTER,\n AnnotationTarget.TYPE,\n)\nannotation class Ann\n\n@Ann\nexpect class OnClass\n\nexpect class OnMember {\n @Ann\n fun onMember()\n}\n\n@Ann\nexpect class ViaTypealias\n\nexpect class MemberScopeViaTypealias {\n @Ann","completion":"fun foo()\n}\n\nannotation class WithArg(val s: String)\n\n@WithArg(\"str\")\nexpect fun withDifferentArg()\n\nexpect fun inValueParam(@Ann arg: String)\n\nexpect fun <@Ann T> inTypeParam()\n\n@get:Ann\nexpect val onGetter: String\n\nexpect fun onType(param: @Ann Any)<|endoftext|>"} {"prompt":"class RegexTest {\n\n @Test fun properties() {\n val pattern = \"\\\\s+$\"\n val regex1 = Regex(pattern, RegexOption.IGNORE_CASE)\n assertEquals(pattern, regex1.pattern)\n assertEquals(setOf(RegexOption.IGNORE_CASE), regex1.options)","completion":"val options2 = setOf(RegexOption.MULTILINE, RegexOption.IGNORE_CASE)\n val regex2 = Regex(pattern, options2)\n assertEquals(options2, regex2.options)\n }\n\n @Test fun matchResult() {\n val p = \"\\\\d+\".toRegex()\n val input = \"123 456 789\"<|endoftext|>"} {"prompt":"override fun toString() = variable.toString()\n }\n\n data class Receiver(val value: ReceiverValue) : IdentifierInfo {\n override val kind = STABLE_VALUE\n\n override fun toString() = value.toString()\n }\n\n data class PackageOrClass(val descriptor: DeclarationDescriptor) : IdentifierInfo {\n override val kind = STABLE_VALUE","completion":"override fun toString() = descriptor.toString()\n }\n\n data class EnumEntry(val descriptor: ClassDescriptor) : IdentifierInfo {\n override val kind: DataFlowValue.Kind = STABLE_VALUE\n }\n\n class Qualified(\n val receiverInfo: IdentifierInfo,\n val selectorInfo: IdentifierInfo,\n val safe: Boolean,<|endoftext|>"} {"prompt":"private val codegen = environment.codegen\n\n private val context = codegen.context\n\n private val IrCall.llvmReturnType: LLVMTypeRef\n get() = LLVMGetReturnType(codegen.getLlvmFunctionType(symbol.owner))!!","completion":"private fun LLVMTypeRef.sizeInBits() = LLVMSizeOfTypeInBits(codegen.llvmTargetData, this).toInt()\n\n \/**\n * Some intrinsics have to be processed before evaluation of their arguments.\n * So this method looks at [callSite] and if it is call to \"special\" intrinsic\n * processes it. Otherwise, it returns null.\n *\/<|endoftext|>"} {"prompt":"else {\n Object.prop_1\n Object.prop_1.equals(null)","completion":"Object.prop_1.propT\n Object.prop_1.propAny<|endoftext|>"} {"prompt":"@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun IntArray.max(): Int? {\n return maxOrNull()\n}","completion":"@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun LongArray.max(): Long? {\n return maxOrNull()\n}<|endoftext|>"} {"prompt":"if (!classSymbol.isSuitableJavaClass()) return emptySet()\n return cache.getValue(classSymbol)?.mapTo(mutableSetOf()) {\n when (it) {\n is FirConstructorSymbol -> SpecialNames.INIT\n else -> it.callableId.callableName\n }\n } ?: emptySet()\n }","completion":"override fun generateFunctions(callableId: CallableId, context: MemberGenerationContext?): List {\n val owner = context?.owner ?: return emptyList()\n if (!owner.isSuitableJavaClass()) return emptyList()\n return cache.getValue(owner)?.filterIsInstance().orEmpty()\n }<|endoftext|>"} {"prompt":"internal class AdditionalClassAnnotationLowering(private val context: JvmBackendContext) : ClassLoweringPass {\n private val symbols = context.ir.symbols.javaAnnotations\n private val noNewJavaAnnotationTargets =\n context.config.noNewJavaAnnotationTargets || !context.isCompilingAgainstJdk8OrLater\n\n override fun lower(irClass: IrClass) {","completion":"if (!irClass.isAnnotationClass) return\n\n generateDocumentedAnnotation(irClass)\n generateRetentionAnnotation(irClass)\n generateTargetAnnotation(irClass)\n generateRepeatableAnnotation(irClass)\n }\n\n private fun generateDocumentedAnnotation(irClass: IrClass) {<|endoftext|>"} {"prompt":"useK2: Boolean,\n pluginClasspaths: List,\n pluginOptions: List,\n pluginConfigurations: List\n): Boolean {\n var hasErrors = false\n\n for (classpath in pluginClasspaths) {\n if (!File(classpath).exists()) {","completion":"messageCollector.report(ERROR, \"Plugin classpath entry points to a non-existent location: $classpath\")\n }\n }\n\n if (pluginConfigurations.isNotEmpty()) {\n messageCollector.report(WARNING, \"Argument -Xcompiler-plugin is experimental\")\n if (!useK2) {\n hasErrors = true\n messageCollector.report(\n ERROR,<|endoftext|>"} {"prompt":"b.bar()\n}\n\nfun withTest(a: I1<*>, b: I3<*>) {\n with(a) {\n val x = foo()\n \")!>x\n bar()\n }\n with(b) {\n val y = foo()","completion":"\")!>y\n bar()\n }\n}<|endoftext|>"} {"prompt":"\/\/ Auto-generated by GenerateSteppedRangesCodegenTestData. Do not edit!\n\/\/ WITH_STDLIB\nimport kotlin.test.*\n\nfun box(): String {\n val intList = mutableListOf()\n val intProgression = 1 downTo 1\n for (i in intProgression step 2) {\n intList += i\n }","completion":"assertEquals(listOf(1), intList)\n\n val longList = mutableListOf()\n val longProgression = 1L downTo 1L\n for (i in longProgression step 2L) {\n longList += i\n }\n assertEquals(listOf(1L), longList)\n\n val charList = mutableListOf()<|endoftext|>"} {"prompt":"* after Kotlin `main` function gets invoked.\n *\n * Note: runtime lookup can be forced even when the class is referenced statically from\n * Objective-C source code by adding `__attribute__((objc_runtime_visible))` to its `@interface`.\n *\/\n@Target(AnnotationTarget.CLASS)\n@Retention(AnnotationRetention.SOURCE)\n@BetaInteropApi","completion":"public annotation class ExportObjCClass(val name: String = \"\")<|endoftext|>"} {"prompt":"@file:OptIn(SymbolInternals::class)\n\npackage org.jetbrains.kotlin.fir.declarations.utils\n\nimport org.jetbrains.kotlin.fir.FirSession\nimport org.jetbrains.kotlin.fir.analysis.checkers.getContainingClassSymbol","completion":"import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration\nimport org.jetbrains.kotlin.fir.symbols.FirBasedSymbol\nimport org.jetbrains.kotlin.fir.symbols.SymbolInternals\nimport org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol<|endoftext|>"} {"prompt":"suspend fun quz(t: T): T = t\n\n suspend fun bar(): IC {\n return foo(qux(quz(suspendMe())))\n }\n\n suspend fun test() = bar().s\n}\n\n\nclass Test2 {\n\n suspend fun foo(value: IC): IC = value","completion":"suspend fun qux(s: String): IC = IC(s)\n\n suspend fun quz(): String = suspendMe()\n\n suspend fun bar(): IC {\n return foo(qux(quz()))\n }\n\n suspend fun test() = bar().s\n}\n\nclass Test3 {\n suspend fun foo(value: T): T = value<|endoftext|>"} {"prompt":"if (!specificClassId.isUnsigned && generalClassId.isUnsigned) {\n return true\n }\n\n \/\/ int >= long, int >= short, short >= byte\n\n if (specificClassId == Int) {\n return generalClassId == Long || generalClassId == Short || generalClassId == Byte\n } else if (specificClassId == Short && generalClassId == Byte) {\n return true","completion":"}\n\n \/\/ uint >= ulong, uint >= ushort, ushort >= ubyte\n\n if (specificClassId == UInt) {\n return generalClassId == ULong || generalClassId == UShort || generalClassId == UByte\n } else if (specificClassId == UShort && generalClassId == UByte) {\n return true\n }\n\n \/\/ double >= float<|endoftext|>"} {"prompt":"js(\"{ var a = ${TRUE === false}; }\")","completion":"js(\"{ var a = ${CHAR === 's'}; }\")<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact\nimport org.jetbrains.kotlin.test.model.Frontend2BackendConverter\nimport org.jetbrains.kotlin.test.model.FrontendFacade\nimport org.jetbrains.kotlin.test.model.FrontendKinds","completion":"open class AbstractIrSteppingWithBytecodeInlinerTest(\n private val useIrInliner: Boolean = false\n) : AbstractSteppingTestBase(FrontendKinds.ClassicFrontend) {\n override val frontendFacade: Constructor>\n get() = ::ClassicFrontendFacade<|endoftext|>"} {"prompt":"doTestFilters(Filter(listOf(\"A.foo*\", \"B.*\"), listOf(), listOf(\"A.foo1\", \"A.foo2\", \"B.foo1\", \"B.foo2\", \"B.bar\")))\n }\n\n @Test\n fun testFiltersNegativeGlob() {","completion":"doTestFilters(Filter(listOf(), listOf(\"A.foo*\", \"B.*\"), listOf(\"A.bar\", \"FiltersKt.foo1\", \"FiltersKt.foo2\", \"FiltersKt.bar\")))\n }\n\n @Test\n fun testFiltersPositiveGlobNegative() {<|endoftext|>"} {"prompt":"override fun visitFunctionAccess(expression: IrFunctionAccessExpression, data: Nothing?) {\n visitFunctionAccess(expression)\n }\n\n fun visitFunctionAccess(expression: IrFunctionAccessExpression) {\n visitMemberAccess(expression)\n }\n\n override fun visitConstructorCall(expression: IrConstructorCall, data: Nothing?) {\n visitConstructorCall(expression)\n }","completion":"fun visitConstructorCall(expression: IrConstructorCall) {\n visitFunctionAccess(expression)\n }\n\n override fun visitSingletonReference(expression: IrGetSingletonValue, data: Nothing?) {\n visitSingletonReference(expression)\n }\n\n fun visitSingletonReference(expression: IrGetSingletonValue) {\n visitDeclarationReference(expression)\n }<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\n\/\/ IMPORTANT!\n\/\/ Please, when your changes cause failures in bytecodeText tests for 'for' loops,\n\/\/ examine the resulting bytecode shape carefully.\n\/\/ Range and progression-based loops generated with Kotlin compiler should be\n\/\/ as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').","completion":"\/\/ Otherwise it may result in performance regression due to missing HotSpot optimizations.\n\/\/ Run Kotlin compiler benchmarks (https:\/\/github.com\/Kotlin\/kotlin-benchmarks)\n\/\/ with compiler built from your changes if you are not sure.\n\nfun test(uis: UIntArray): UInt {\n var s = 0U\n for (i in uis.indices) {\n s += uis[i]<|endoftext|>"} {"prompt":"ExpectedData(0x39a9e146ec4b3210UL, 0x8b305d532e61226eUL, 0xcaeae80da2ea2eUL, 0x88a6289a76ac684eUL, 0x8ce5b5f9df1cbd85UL),","completion":"ExpectedData(0x74cba303e2dd9d6dUL, 0x751390a8a5c41bdcUL, 0x6ee5fbf87605d34UL, 0x6ca73f610f3a8f7cUL, 0xe898b3c996570adUL),<|endoftext|>"} {"prompt":"val argType = this.typeOrNull\n if (argType == null) {\n adapter.throwIae(\"Star projections in type arguments are not allowed, but had ${ownerType.render()}\")\n return null\n }\n val classifier = argType.classifierOrNull\n if (classifier is IrTypeParameterSymbol && !classifier.owner.isReified) {","completion":"val fullName = argType.render() \/\/ T of \n val name = classifier.owner.name.asString()\n val message = \"Captured type parameter $fullName from generic non-reified function. \" +\n \"Such functionality cannot be supported because $name is erased, either specify serializer explicitly or make \" +\n \"calling function inline with reified $name.\"<|endoftext|>"} {"prompt":"\"properties\": {\n \"metric\": { \"type\": \"keyword\" },\n \"name\": { \"type\": \"keyword\" },\n \"normalizedScore\": { \"type\": \"float\" }\n \"repeat\": { \"type\": \"long\" },\n \"runtimeInUs\": { \"type\": \"float\" },\n \"score\": { \"type\": \"float\" },","completion":"\"status\": { \"type\": \"keyword\" },\n \"variance\": { \"type\": \"float\" },\n \"warmup\": { \"type\": \"long\" },\n }\n },\n \"buildNumber\" : { \"type\" : \"keyword\" },\n \"env\" : { \"type\" : \"nested\" },\n \"kotlin\" : { \"type\" : \"nested\" }<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\n\/*\n * KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)\n *\n * SPEC VERSION: 0.1-218\n * MAIN LINK: expressions, conditional-expression -> paragraph 1 -> sentence 2\n * PRIMARY LINKS: expressions, conditional-expression -> paragraph 4 -> sentence 2\n * NUMBER: 3\n * DESCRIPTION: if-expression: check the correct branch is evaluating\n *\/","completion":"fun box(): String {\n if (false) return \"NOK\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"if (a.x !== null) {\n a.x","completion":"a.x.equals(null)\n a.x.propT<|endoftext|>"} {"prompt":"\"Task info:\",\n \"Kotlin language version: 2.0\",\n \"Time metrics:\",\n \"Jps iteration:\",\n \"Compiler code analysis:\",\n \"Compiler code generation:\"\n )\n\n fun testImpl() {\n assertTrue(\"Daemon was not enabled!\", isDaemonEnabled())\n doTest()\n\n validateAndDeleteReportFile(","completion":"*reportMetricsList,\n \"Changed files: [${workDir.resolve(\"src\/Foo.kt\").path}, ${workDir.resolve(\"src\/main.kt\").path}]\"\n )\n\n val mainKt = File(workDir, \"src\/main.kt\")\n change(mainKt.path, \"fun main() {}\")\n\n buildAllModules().assertSuccessful()<|endoftext|>"} {"prompt":"children.add(TestHierarchyBuilder(Node.Group(name)).also(builder))\n }\n\n fun build(): KotlinHierarchy = KotlinHierarchy(node, children.map { it.build() }.toSet())\n}\n\nprivate fun hierarchy(build: TestHierarchyBuilder.() -> Unit): KotlinHierarchy {","completion":"return TestHierarchyBuilder(Node.Root).also(build).build()\n}<|endoftext|>"} {"prompt":"},\n {\n printer.printCollection(allBounds) { (typeParameter, bound) ->\n \" : \".separated(\n { declarationRenderer.nameRenderer.renderName(analysisSession, typeParameter, declarationRenderer, printer) },\n {\n val approximatedType = declarationRenderer.declarationTypeApproximator","completion":".approximateType(analysisSession, bound, Variance.OUT_VARIANCE)\n\n declarationRenderer.typeRenderer.renderType(analysisSession, approximatedType, printer) }\n ,\n )\n }\n },\n )\n\n }\n }\n }\n}<|endoftext|>"} {"prompt":"operator fun set(thisRef: Any?, prop: KProperty<*>, value: String) {}\n\n operator fun getValue(thisRef: Any?, prop: KProperty<*>): Int = 5\n operator fun setValue(thisRef: Any?, prop: KProperty<*>, value: Int) {}\n}\n\nclass CustomDelegate3 {","completion":"operator fun get(thisRef: Any?, prop: KProperty<*>): String = prop.name\n operator fun set(thisRef: Any?, prop: KProperty<*>, value: String) {}\n}\n\noperator fun OkDelegate.get(thisRef: Any?, prop: KProperty<*>): Int = 4<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ ASSERTIONS_MODE: jvm\n\/\/ WITH_STDLIB\n\npackage localLambda\n\ninterface Checker {\n fun checkTrue(): Boolean\n fun checkFalse(): Boolean\n fun checkTrueWithMessage(): Boolean\n fun checkFalseWithMessage(): Boolean\n}\n\nclass ShouldBeDisabled : Checker {\n override fun checkTrue(): Boolean {\n var hit = false","completion":"val l = { hit = true; true }\n val local = {\n assert(l())\n }\n local()\n return hit\n }\n\n override fun checkFalse(): Boolean {\n var hit = false\n val l = { hit = true; false }\n val local = {\n assert(l())\n }\n local()\n return hit\n }<|endoftext|>"} {"prompt":"val FULL_COMPOSABLE_NAME_PREFIX = COMPOSABLE_PACKAGE_FQN.child(Name.identifier(COMPOSABLE_NAME_PREFIX)).asString()\n}\n\nobject ComposableFunction : FunctionTypeKind(\n ComposableNames.COMPOSABLE_PACKAGE_FQN,\n ComposableNames.COMPOSABLE_NAME_PREFIX,","completion":"ComposableNames.MY_COMPOSABLE_ANNOTATION_CLASS_ID,\n isReflectType = false\n) {\n override val prefixForTypeRender: String\n get() = \"@MyComposable\"\n\n override val serializeAsFunctionWithAnnotationUntil: String\n get() = LanguageVersion.KOTLIN_2_1.versionString<|endoftext|>"} {"prompt":"assertEquals(\"fooBAR123\", \"${J.nullableStringIsNotNull() + \"BAR\" + n}\")\n assertEquals(\"fooBAR123\", \"${J.nullableStringIsNotNull()}BAR$n\")\n assertEquals(\"BARfoo123\", \"BAR\" + J.nullableStringIsNotNull() + n)","completion":"assertEquals(\"BARfoo123\", \"BAR${J.nullableStringIsNotNull()}$n\")\n assertEquals(\"BARfoo123\", \"BAR\" + (J.nullableStringIsNotNull() + n))\n assertEquals(\"123fooBAR\", \"$n${J.nullableStringIsNotNull() + \"BAR\"}\")\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\/\/ KT-10444 Do not ignore smart (unchecked) casts to the same classifier\n\nclass Base\nclass Qwe(val a: T?) {\n fun test1(obj: Any) {\n obj as Qwe\n check(obj.a)\n }","completion":"fun test1(obj: Qwe<*>) {\n obj as Qwe\n check(obj.a)\n }\n\n fun test2(b: Base<*>) {\n b as Base\n }\n\n fun check(a: T?) {\n }\n}<|endoftext|>"} {"prompt":"origin = JvmLoweredDeclarationOrigin.ENUM_MAPPINGS_FOR_ENTRIES\n isFinal = true\n isStatic = true\n }\n }\n return field\n }\n\n override fun generateMappingsClasses() {\n val backendContext = context\n for (klass in storage.values) {","completion":"\/\/ Use the same origin and visibility for `` as in StaticInitializersLowering.\n val clinit = klass.irClass.addFunction(\n \"\", context.irBuiltIns.unitType, visibility = JavaDescriptorVisibilities.PACKAGE_VISIBILITY,\n isStatic = true, origin = JvmLoweredDeclarationOrigin.CLASS_STATIC_INITIALIZER<|endoftext|>"} {"prompt":"constructor(e: T, i: Int) : this(i, 10)\n}\n\nclass J {\n constructor(e: T, i: Int) : this(i, 10)\n constructor(e: Int, i: Int)\n}\n\nclass F(s: String) {","completion":"constructor(i: Boolean) {}\n constructor(i: Int) : this(3) {}\n}\n\nclass G(x: Int) {<|endoftext|>"} {"prompt":"fun clang_getCursorReferenced(arg0: CValue): CValue {\n memScoped {\n val kniRetVal = nativeHeap.alloc()\n try {\n kniBridge214(arg0.getPointer(memScope).rawValue, kniRetVal.rawPtr)","completion":"return kniRetVal.readValue()\n } finally { nativeHeap.free(kniRetVal) }\n }\n}\n\nfun clang_getCursorDefinition(arg0: CValue): CValue {\n memScoped {\n val kniRetVal = nativeHeap.alloc()\n try {<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n@file:JsModule(\"foo\")\npackage foo\n\n@JsModule(\"A\")\nexternal class A {\n class Nested\n}\n\n@JsModule(\"B\")\nexternal object B","completion":"@JsModule(\"foo\")\nexternal fun foo(): Int\n\n@JsModule(\"bar\")\nexternal val bar: Int\n\n@JsNonModule\nexternal val baz: Int<|endoftext|>"} {"prompt":"val typeParameters = typeConstructor.parameters\n\n \/\/ For each type parameter T, let ST be the set of all constituent types of all immediate supertypes of the owner of T.\n \/\/ If T appears as a constituent type of a simple type argument A in a generic type in ST, add an edge from T","completion":"\/\/ to U, where U is the type parameter corresponding to A, and where the edge is non-expansive if A has the form T or T?,\n \/\/ the edge is expansive otherwise.\n for (constituentType in constituentTypes(typeConstructor.supertypes)) {\n val constituentTypeConstructor = constituentType.constructor\n if (constituentTypeConstructor !in processedTypeConstructors) {<|endoftext|>"} {"prompt":"private fun Member.bindArguments(\n containerId: String,\n parameters: List,\n context: ValueResolveContext\n): List {\n val bound = ArrayList(parameters.size)\n var unsatisfied: MutableList? = null\n\n for (parameter in parameters) {\n val descriptor = context.resolve(parameter)","completion":"if (descriptor == null) {\n if (unsatisfied == null)\n unsatisfied = ArrayList()\n unsatisfied.add(parameter)\n } else {\n bound.add(descriptor)\n }\n }\n if (unsatisfied != null) {<|endoftext|>"} {"prompt":"get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly","completion":"public inline fun UIEventInit(view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): UIEventInit {\n val o = js(\"({})\")\n o[\"view\"] = view\n o[\"detail\"] = detail\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable<|endoftext|>"} {"prompt":"x.propT\n x.propAny","completion":"x.propNullableT\n x.propNullableAny<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.plugin.performance\n\nimport org.gradle.api.Project\nimport org.gradle.api.tasks.Input\nimport org.gradle.api.tasks.Optional\nimport org.jetbrains.kotlin.gradle.plugin.mpp.NativeBinary\n\nenum class TrackableMetric { COMPILE_TIME, CODE_SIZE }","completion":"open class PerformanceExtension(private val project: Project) {\n val version: String\n get() = project.version.toString()\n\n var metrics = listOf(TrackableMetric.COMPILE_TIME, TrackableMetric.CODE_SIZE)\n\n val trackedBinaries = mutableListOf()<|endoftext|>"} {"prompt":"desc == \"(Ljava\/lang\/Object;Ljava\/lang\/String;)V\"\n }\n\ninternal fun AbstractInsnNode.isCheckExpressionValueIsNotNull() =\n isInsn(Opcodes.INVOKESTATIC) {\n owner == IntrinsicMethods.INTRINSICS_CLASS_NAME &&","completion":"(name == \"checkExpressionValueIsNotNull\" || name == \"checkNotNullExpressionValue\") &&\n desc == \"(Ljava\/lang\/Object;Ljava\/lang\/String;)V\"\n }\n\ninternal fun AbstractInsnNode.isThrowIntrinsic() =\n isInsn(Opcodes.INVOKESTATIC) {<|endoftext|>"} {"prompt":"x","completion":"x.equals(null)<|endoftext|>"} {"prompt":"if (max < e) max = e\n }\n return max\n}\n\n\/**\n * Returns the largest element or `null` if there are no elements.\n *\/\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.maxOrNull(): Byte? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {","completion":"val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n\/**\n * Returns the largest element or `null` if there are no elements.\n *\/\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.maxOrNull(): Short? {\n if (isEmpty()) return null\n var max = this[0]<|endoftext|>"} {"prompt":"P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21) -> R>> =","completion":"staticCFunctionImpl(\n function,<|endoftext|>"} {"prompt":"package org.jetbrains.kotlinx.serialization.compiler.fir\n\nimport org.jetbrains.kotlin.fir.extensions.predicate.*\nimport org.jetbrains.kotlinx.serialization.compiler.resolve.SerializationAnnotations\n\nobject FirSerializationPredicates {\n internal val serializerFor = DeclarationPredicate.create {","completion":"annotated(setOf(SerializationAnnotations.serializerAnnotationFqName)) \/\/ @Serializer(for=...)\n }\n internal val hasMetaAnnotation = DeclarationPredicate.create {\n metaAnnotated(SerializationAnnotations.metaSerializableAnnotationFqName, includeItself = false)\n }\n internal val annotatedWithSerializableOrMeta = DeclarationPredicate.create {<|endoftext|>"} {"prompt":"\"The feature $b is out of order; its sinceVersion is ${b.sinceVersion}, yet it comes after $a, whose \" +\n \"sinceVersion is ${a.sinceVersion}.\\n\"\n )\n }\n }\n}\n\nprivate fun String.ensureFileOrEndsWithSlash() =","completion":"if (endsWith(\"\/\") || \".\" in substringAfterLast('\/')) this else \"$this\/\"<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE\n\/\/ SKIP_TXT\n\n\/*\n * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)","completion":"*\n * SPEC VERSION: 0.1-278\n * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 5\n * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 4 -> sentence 1<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION\n\n\/\/ FILE: JavaTest.java\n\npublic class JavaTest {\n public static Number[] createNumberArray() { return null; }\n}\n\n\/\/ FILE: test.kt\n\nfun select(x: K, y: K): K = x","completion":"fun foo(f: () -> R): R = f()\n\ninterface Inv {\n fun createArray(): Array\n}\n\nfun test(n: Number) {\n val a = select(foo { JavaTest.createNumberArray() }, emptyArray())<|endoftext|>"} {"prompt":"package test\n\npublic interface TwoSuperclasses {\n\n public interface Super1 {\n public fun foo(a: A)\n }\n\n public interface Super2 {\n public fun foo(a: B)\n }\n\n public interface Sub: Super1, Super2 {\n override fun foo(a: C)\n }","completion":"}<|endoftext|>"} {"prompt":"val objType = signature.valueParameters[1].asmType\n \/\/ output = output.writeBegin(classDesc, new KSerializer[0])\n load(outputVar, encoderType)\n load(descVar, descType)\n invokeinterface(\n encoderType.internalName, CallingConventions.begin,\n \"(\" + descType.descriptor +\n \")\" + kOutputType.descriptor","completion":")\n store(outputVar, kOutputType)\n if (serializableDescriptor.isInternalSerializable) {\n val sig = StringBuilder(\"(${objType.descriptor}${kOutputType.descriptor}${descType.descriptor}\")\n \/\/ call obj.write$Self(output, classDesc)\n load(objVar, objType)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.scopes.LexicalScope\nimport org.jetbrains.kotlin.serialization.js.ModuleKind\nimport org.jetbrains.kotlin.util.slicedMap.BasicWritableSlice\nimport org.jetbrains.kotlin.util.slicedMap.RewritePolicy\n\n@JvmField","completion":"val MODULE_KIND = BasicWritableSlice(RewritePolicy.DO_NOTHING).apply { setDebugName(\"MODULE_KIND\") }\n\n@JvmField\nval LEXICAL_SCOPE_FOR_JS =\n BasicWritableSlice, LexicalScope>(RewritePolicy.DO_NOTHING).apply {<|endoftext|>"} {"prompt":"}\n override fun foo(t: Int?) { }\n}\n\nclass D: J2(){\n override fun bar(): Int {\n return 1\n }\n override fun foo(t: Int?) { }\n}\n\nfun test() {\n val k1: Int = A().a\n val k2: Unit = A().foo(1)","completion":"val k3: Int = A().bar()\n val k4: Int = B().a\n val k5: Unit = B().foo(2)\n val k6: Int = B().bar()\n val k7: Int = C().a\n val k8: Unit = C().foo(2)\n val k9: Int = C().bar()\n val k10: Int = D().a<|endoftext|>"} {"prompt":"val environment = KotlinCoreEnvironment.createForTests(disposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)\n\n val visibilityManager = ModuleVisibilityManager.SERVICE.getInstance(environment.project)\n for (friendDir in configuration.getList(JVMConfigurationKeys.FRIEND_PATHS)) {\n visibilityManager.addFriendPath(friendDir)\n }","completion":"return environment\n }\n\n override fun processModule(moduleData: ModuleData): ProcessorAction {\n val disposable = Disposer.newDisposable(\"Disposable for ${NonFirResolveModularizedTotalKotlinTest::class.simpleName}.processModule\")\n try {\n val environment = configureAndSetupEnvironment(moduleData, disposable)\n runAnalysis(environment)\n } finally {<|endoftext|>"} {"prompt":"irLoop.body = ktDoWhile.body?.let { ktLoopBody ->\n if (ktLoopBody is KtBlockExpression)\n generateDoWhileLoopBody(ktLoopBody)\n else\n ktLoopBody.genExpr()\n }\n\n irLoop.condition = ktDoWhile.condition!!.genExpr()","completion":"return IrBlockImpl(ktDoWhile.startOffsetSkippingComments, ktDoWhile.endOffset, context.irBuiltIns.unitType).apply {\n statements.add(irLoop)\n }\n }\n\n private fun generateWhileLoopBody(ktLoopBody: KtBlockExpression): IrExpression =\n IrBlockImpl(<|endoftext|>"} {"prompt":"annotation class Anno5(val s: String)\n\ninterface I\n\nclass X : @Anno1 I {\n fun f(arg: @Anno2 I): @Anno3 I = arg\n val x: @Anno4 I = this\n}\n\nfun T.foo(): List<@Anno5(\"1\") T>? = null","completion":"fun T.foo2(): List>? = null<|endoftext|>"} {"prompt":"assertEquals(\"\", \"\".trimMargin())\n\n assertEquals(\"\", \"\"\"\n \"\"\".trimMargin())\n\n assertEquals(\"\", \"\"\"\n |\"\"\".trimMargin())\n\n assertEquals(\"\", \"\"\"\n |\n \"\"\".trimMargin())\n\n assertEquals(\" a\", \"\"\"\n | a\n \"\"\".trimMargin())","completion":"assertEquals(\" a\", \"\"\"\n | a\"\"\".trimMargin())\n\n assertEquals(\" a\", \"\"\" | a\n \"\"\".trimMargin())\n\n assertEquals(\" a\", \"\"\" | a\"\"\".trimMargin())\n\n assertEquals(\"\\u0000|ABC\", \"${\"\\u0000\"}|ABC\".trimMargin())\n }<|endoftext|>"} {"prompt":"b.set(0, 73, false)\n assertContainsOnly(b, setOf(), 73)\n\n b.set(0, 73)\n assertNotContainsOnly(b, setOf(), 73)\n b.clear(0, 3)\n assertNotContainsOnly(b, setOf(0, 1, 2), 73)\n b.clear(63, 66)","completion":"assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65), 73)\n b.clear(68, 71)\n assertNotContainsOnly(b, setOf(0, 1, 2, 63, 64, 65, 68, 69, 70), 73)\n b.clear(68, 73)<|endoftext|>"} {"prompt":"fun List<*>.filterIsInstance2(): @kotlin.internal.NoInfer List = throw Exception()\n\nfun test(list: List) {\n list.filterIsInstance1().map { it * 2 }\n list.filterIsInstance2().filter { it > 10 }\n}","completion":"@Suppress(\"INVISIBLE_MEMBER\", \"INVISIBLE_REFERENCE\")\nfun foo(t: R): List<@kotlin.internal.NoInfer R> = throw Exception(\"$t\")\n\nfun test() {\n foo(1).map { it * 2 }\n}\n\n@Suppress(\"INVISIBLE_MEMBER\", \"INVISIBLE_REFERENCE\")<|endoftext|>"} {"prompt":"class LocalNested : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component {\n\n }\n\n @Fun","completion":"fun localMember(): @FunType Int {\n\n }\n\n @Prop\n @get:Getter\n @set:Setter\n @setparam:Parameter\n var localProperty: @PropType String = 1\n }\n }\n\n @Prop\n @get:Getter\n @set:Setter\n @setparam:Parameter\n var localProperty: @PropType String = 1\n }<|endoftext|>"} {"prompt":"@InternalKotlinGradlePluginApi\n override fun onPublicationCreated(publication: MavenPublication) {\n mavenPublicationActions.all { action -> action.execute(publication) }\n }\n\n private val attributeContainer = HierarchyAttributeContainer(parent = null)\n\n override fun getAttributes(): AttributeContainer = attributeContainer\n\n internal fun onCreated() {\n artifactsTask","completion":"}\n}<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_VALUE -VARIABLE_WITH_REDUNDANT_INITIALIZER\n\/\/ SKIP_TXT\n\n\/*\n * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE)\n *\n * SECTIONS: dfa","completion":"* NUMBER: 55\n * DESCRIPTION: Raw data flow analysis test\n * HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses\n *\/\n\n\/*\n * TESTCASE NUMBER: 1\n * ISSUES: KT-10662\n *\/\nfun case_1(x: Any) {\n if (x is String) {<|endoftext|>"} {"prompt":"public external abstract class SVGMeshrowElement : SVGElement, JsAny {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short","completion":"val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short<|endoftext|>"} {"prompt":"x = doubleSetWord(d = x, hi = ix) \/* x <- |x| *\/\n if (ix < 0x3fe00000) { \/* x < 0.5 *\/\n t = x + x\n t = 0.5 * log1p(t + t * x \/ (one - x))\n } else","completion":"t = 0.5 * log1p((x + x) \/ (one - x))\n if (hx >= 0) return t; else return -t\n}<|endoftext|>"} {"prompt":"getTypeConversionImpl(actualType.getInlinedClassNative(), expectedType.getInlinedClassNative())\n\nprivate fun Context.getTypeConversionImpl(\n actualInlinedClass: IrClass?,\n expectedInlinedClass: IrClass?\n): IrSimpleFunctionSymbol? {\n if (actualInlinedClass == expectedInlinedClass) return null\n\n return when {","completion":"actualInlinedClass != null && expectedInlinedClass == null -> getBoxFunction(actualInlinedClass)\n actualInlinedClass == null && expectedInlinedClass != null -> getUnboxFunction(expectedInlinedClass)\n else -> error(\"actual type is ${actualInlinedClass?.fqNameForIrSerialization}, expected ${expectedInlinedClass?.fqNameForIrSerialization}\")\n }.symbol\n}<|endoftext|>"} {"prompt":"c.extensions.forEach { it.writePackageExtensions(kmPackage, t, c) }\n c.versionRequirements.serialize()?.let {\n t.versionRequirementTable = it\n }\n }\n}\n\npublic open class ModuleFragmentWriter(stringTable: StringTable, contextExtensions: List = emptyList()) {","completion":"protected val t: ProtoBuf.PackageFragment.Builder = ProtoBuf.PackageFragment.newBuilder()!!\n protected val c: WriteContext = WriteContext(stringTable, contextExtensions)\n\n public open fun writeModuleFragment(kmPackageFragment: KmModuleFragment) {\n kmPackageFragment.pkg?.let {<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\nclass Foo\n\nclass Bar {\n fun takeFoo(foo: Foo) {}\n}\n\nclass Inv

\n\nfun , L : N, N: Int> main() {\n val foo = Foo()","completion":"Bar>().takeFoo(foo) \/\/ error in 1.3.72, no error in 1.4.31\n}<|endoftext|>"} {"prompt":"x().bar() checkType { _<A>() }","completion":"x = foobar()\n x = z.foobar()\n\n var y = noParameters()\n y = noParameters()\n\n y().foo().a() checkType { _>() }<|endoftext|>"} {"prompt":"fun box(): String {\n testYield()\n return \"OK\"\n}\n\n\/* TESTS *\/\n\n\/\/ PTV is in consuming position (yield-case)\nfun testYield() {\n build {\n it.yield(this)\n }\n}\n\n\/* REQUIRED DECLARATIONS *\/\n\nclass Buildee {\n fun yield(arg: CT) {}\n}","completion":"fun build(\n instructions: UserKlass.(Buildee) -> Unit\n): Buildee {\n return Buildee().apply { UserKlass().instructions(this) }\n}\n\nclass UserKlass<|endoftext|>"} {"prompt":"import org.w3c.dom.*\n\npublic external abstract class MediaList : ItemArrayLike, JsAny {\n open var mediaText: String\n fun appendMedium(medium: String)\n fun deleteMedium(medium: String)\n override fun item(index: Int): JsString?\n}\n\n@Suppress(\"UNUSED_PARAMETER\")","completion":"internal fun getMethodImplForMediaList(obj: MediaList, index: Int): String? { js(\"return obj[index];\") }\n\npublic operator fun MediaList.get(index: Int): String? = getMethodImplForMediaList(this, index)\n\n\/**\n * Exposes the JavaScript [StyleSheet](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/StyleSheet) to Kotlin\n *\/<|endoftext|>"} {"prompt":"suspend fun test() = bar().s.x\n}\n\n\nclass Test2 {\n\n suspend fun foo(value: IC): IC = value\n\n suspend fun qux(s: String): IC = IC(I0(s))\n\n suspend fun quz(): String = suspendMe()\n\n suspend fun bar(): IC {\n return foo(qux(quz()))\n }","completion":"suspend fun test() = bar().s.x\n}\n\nclass Test3 {\n suspend fun foo(value: T): T = value\n\n suspend fun bar(): IC {\n return foo(IC(suspendMe()))\n }\n\n suspend fun test() = bar().s.x\n}\n\nfun box(): String {\n\n var result: Any = \"FAIL\"<|endoftext|>"} {"prompt":"val descendantRelativeTo = File::descendantRelativeTo.name\n val program = ProgramWithDependencyOnCompiler(\n tmpdir, \"\"\"\n import org.jetbrains.kotlin.utils.fileUtils.$descendantRelativeTo\n import java.io.File\n\n fun main(args: Array) {","completion":"println(File(args[0]).$descendantRelativeTo(File(\".\").absoluteFile).path)\n }\n \"\"\".trimIndent()\n )\n\n program.compile()\n\n fun doTest(cwd: File, filePath: String, expectedWithForwardSlash: String) {\n \/\/ We use \"\/\" below for simplicity, but the actual paths in compiler messages use the system separator.<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING\n\ninternal class MultiplePluginDeclarationDetector\nprivate constructor() {\n private val pluginInMultipleProjectsHolder = KotlinPluginInMultipleProjectsHolder(\n trackPluginVersionsSeparately = false\n )\n\n fun detect(project: Project) {","completion":"pluginInMultipleProjectsHolder\n .addProject(project)\n\n if (pluginInMultipleProjectsHolder.isInMultipleProjects(project)) {\n error(MULTIPLE_KOTLIN_PLUGINS_LOADED_WARNING)\n }\n }\n\n \/\/ We can't use Kotlin object because we need new instance on each Gradle rebuild<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class Z(val x: Int) {\n fun test() = x\n}\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class L(val x: Long) {\n fun test() = x\n}","completion":"OPTIONAL_JVM_INLINE_ANNOTATION\nvalue class S(val x: String) {\n fun test() = x\n}\n\nfun box(): String {\n if (Z::test.let { it.invoke(Z(42)) } != 42) throw AssertionError()<|endoftext|>"} {"prompt":"CallableMemberDescriptor.Kind.DECLARATION -> {\n when {\n overriddenDescriptor.annotations.hasAnnotation(PLATFORM_DEPENDENT_ANNOTATION_FQ_NAME) ->\n return true\n overriddenDescriptor is JavaMethodDescriptor -> {\n val containingClass = DescriptorUtils.getContainingClass(overriddenDescriptor)","completion":"?: return false\n\n if (JavaToKotlinClassMap.mapKotlinToJava(containingClass.fqNameUnsafe) != null) return true\n if (overriddenDescriptor.overriddenDescriptors.isEmpty()) return false\n\n return isOverridingOnlyDescriptorsThatCanBeImplicitlyOverridden(overriddenDescriptor, visitedDescriptors)\n }\n else -><|endoftext|>"} {"prompt":"}\n }\n\n \/\/ MIN_VALUE, MAX_VALUE\n assertEquals(Float.MAX_VALUE, Float.MAX_VALUE, 0.0f)\n assertEquals(Float.MIN_VALUE, Float.MIN_VALUE, 0.0f)\n assertEquals(Float.MAX_VALUE, Float.MIN_VALUE, Float.MAX_VALUE)","completion":"assertEquals(Float.MIN_VALUE, Float.MAX_VALUE, Float.MAX_VALUE)\n\n \/\/ POSITIVE_INFINITY, NEGATIVE_INFINITY\n assertEquals(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, 0.0f)<|endoftext|>"} {"prompt":"withDaemon(compilerWithScriptingId) { daemon ->\n val repl = KotlinRemoteReplCompilerClient(daemon, null, CompileService.TargetPlatform.JVM,\n emptyArray(),\n TestMessageCollector(),\n classpathFromClassloader(),\n ScriptWithNoParam::class.qualifiedName!!)","completion":"val localEvaluator = GenericReplEvaluator(emptyList(), Thread.currentThread().contextClassLoader)\n\n doReplTestWithLocalEval(repl, localEvaluator)\n repl.dispose()\n }\n }\n\n fun testDaemonReplLocalEvalStandardTemplate() {\n withDaemon(compilerWithScriptingId) { daemon -><|endoftext|>"} {"prompt":"private fun KParameter.hasTypeOf(clazz: KClass<*>): Boolean = (type.classifier as? KClass<*>)?.qualifiedName == clazz.qualifiedName\n\n \/*************** Test run provider (for black box tests only) ***************\/\n\n \/\/ Currently, SimpleTestRunProvider is an object, so it does not need to be cached.","completion":"fun getOrCreateSimpleTestRunProvider(): SimpleTestRunProvider = SimpleTestRunProvider\n\n \/*************** Common ***************\/\n\n private val ExtensionContext.testClasses: Sequence>\n get() = generateSequence(requiredTestClass) { it.enclosingClass }\n\n private val ExtensionContext.enclosingTestClass: Class<*>\n get() = testClasses.last()<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ FILE: WithVarargs.java\n\npublic class WithVarargs {\n public static String foo() {\n return new A(\"1\", \"2\", \"3\").getProp();\n }\n}\n\n\/\/ FILE: withVarargs.kt\n\nfun join(x: Array): String {\n var result = \"\"\n for (i in x) {","completion":"result += i\n result += \"#\"\n }\n\n return result\n}\n\nclass A {\n val prop: String\n constructor(vararg x: String) {\n prop = join(x)\n }\n}\n\nfun box(): String {\n val a1 = WithVarargs.foo()\n if (a1 != \"1#2#3#\") return \"fail1: ${a1}\"<|endoftext|>"} {"prompt":"override val regularClassCheckers: Set\n get() = setOf(\n FirAnnotationClassDeclarationChecker,\n FirOptInAnnotationClassChecker,\n FirCommonConstructorDelegationIssuesChecker,\n FirDelegationSuperCallInEnumConstructorChecker,\n FirDelegationInExpectClassSyntaxChecker,","completion":"FirDelegationInInterfaceSyntaxChecker,\n FirEnumClassSimpleChecker,\n FirLocalEntityNotAllowedChecker,\n FirManyCompanionObjectsChecker,\n FirMethodOfAnyImplementedInInterfaceChecker,\n FirDataClassPrimaryConstructorChecker,\n FirDataClassNonPublicConstructorChecker,<|endoftext|>"} {"prompt":"if (cn.toInt() != -3) {\n return \"fail9\"\n }\n\n val f: Float = 3.6.toFloat()\n if (f.toDouble() != 3.6) {\n return \"fail11\"\n }\n if (f.toFloat() != 3.6.toFloat()) {\n return \"fail12\"\n }","completion":"if (f.toInt() != 3) {\n return \"fail14\"\n }\n\n val fn: Float = -3.6.toFloat()\n if (fn.toDouble() != -3.6) {\n return \"fail16\"\n }\n if (fn.toFloat() != -3.6.toFloat()) {\n return \"fail17\"\n }<|endoftext|>"} {"prompt":"fun x() = z { z { z { z { z { z { z { z { } } } } } } } }\nfun x() = z { z { z { z { z { z { z { z { } } } } } } } }","completion":"fun x() = z { z { z { z { z { z { z { z { } } } } } } } }\nfun x() = z { z { z { z { z { z { z { z { } } } } } } } }<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WITH_COROUTINES\n\/\/ WITH_REFLECT\n\/\/ CHECK_NOT_CALLED: suspendInline_61zpoe$\n\/\/ CHECK_NOT_CALLED: suspendInline_6r51u9$\n\/\/ CHECK_NOT_CALLED: suspendInline\nimport helpers.*\nimport kotlin.coroutines.*","completion":"import kotlin.coroutines.intrinsics.*\n\nclass Controller {\n fun withValue(v: String, x: Continuation) {\n x.resume(v)\n }\n\n suspend inline fun suspendInline(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->\n withValue(v, x)\n COROUTINE_SUSPENDED<|endoftext|>"} {"prompt":"contract { returns(null) implies (value_1 != null) }\n return value_1 != null\n}\n\nfun funWithReturnsNullAndNullCheck(value_1: Number?): Boolean? {\n contract { returns(null) implies (value_1 == null) }\n return value_1 == null\n}\n\nfun funWithReturnsNotNull(cond: Boolean): Boolean? {","completion":"contract { returnsNotNull() implies (cond) }\n return cond\n}\n\nfun funWithReturnsNotNullAndInvertCondition(cond: Boolean): Boolean? {\n contract { returnsNotNull() implies (!cond) }\n return !cond\n}\n\nfun funWithReturnsNotNullAndTypeCheck(value_1: Any?): Boolean? {\n contract { returnsNotNull() implies (value_1 is String) }<|endoftext|>"} {"prompt":"task.kaptJars.from(project.configurations.getByName(Kapt3GradleSubplugin.KAPT_WORKER_DEPENDENCIES_CONFIGURATION_NAME))\n }\n }\n\n constructor(project: Project, ext: KaptExtension) : super(project, ext) {\n configureTask { task ->","completion":"val kotlinSourceDir = objectFactory.fileCollection().from(task.kotlinSourcesDestinationDir)\n val nonAndroidDslOptions = getNonAndroidDslApOptions(ext, project, kotlinSourceDir, null, null)\n task.kaptPluginOptions.add(nonAndroidDslOptions.toCompilerPluginOptions())\n }\n }\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.test.framework.project.structure.KtTestModule\nimport org.jetbrains.kotlin.psi.KtFile\nimport org.jetbrains.kotlin.test.services.TestServices\nimport org.jetbrains.kotlin.test.services.assertions","completion":"abstract class AbstractCompilationPeerAnalysisTest : AbstractAnalysisApiBasedTest() {\n override val configurator = AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = false)\n\n override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {\n val project = mainFile.project<|endoftext|>"} {"prompt":"fun box(): String {\n assertEquals(B::class, B::property.instanceParameter!!.type.jvmErasure)\n assertEquals(B::class.java, B::property.instanceParameter!!.type.javaType)\n assertEquals(B::class, B::function.instanceParameter!!.type.jvmErasure)","completion":"assertEquals(B::class.java, B::function.instanceParameter!!.type.javaType)\n\n val property = B::class.members.single { it.name == \"property\" }\n val function = B::class.members.single { it.name == \"function\" }\n assertEquals(B::class, property.instanceParameter!!.type.jvmErasure)<|endoftext|>"} {"prompt":"val nonNullUnboundRef = C::class.members.single { it.name == \"p1\" } as KMutableProperty1\n nonNullUnboundRef.isAccessible = true\n assertEquals(Unit, nonNullUnboundRef.setter.call(C, one))\n assertEquals(one, nonNullUnboundRef.call(C))","completion":"assertEquals(one, nonNullUnboundRef.getter.call(C))\n\n val nullableUnboundRef = C::class.members.single { it.name == \"p2\" } as KMutableProperty1\n nullableUnboundRef.isAccessible = true\n assertEquals(Unit, nullableUnboundRef.setter.call(C, one))<|endoftext|>"} {"prompt":"total += A356.a\n total += A357.a\n total += A358.a\n total += A359.a\n total += A360.a\n total += A361.a\n total += A362.a\n total += A363.a\n total += A364.a\n total += A365.a\n total += A366.a\n total += A367.a","completion":"total += A368.a\n total += A369.a\n total += A370.a\n total += A371.a\n total += A372.a\n total += A373.a\n total += A374.a\n total += A375.a\n total += A376.a\n total += A377.a\n total += A378.a\n total += A379.a<|endoftext|>"} {"prompt":"assertTrue(classpath.isNotEmpty())\n classpath.remove(File(\"test\").absoluteFile)\n assertTrue(classpath.isEmpty())\n }\n\n @Test\n fun `test - classpath interner`() {\n val classpath1 = IdeaKotlinClasspath()\n val classpath2 = IdeaKotlinClasspath()\n\n val fileAInstance1 = File(\"a\")","completion":"val fileAInstance2 = File(\"a\")\n\n classpath1.add(fileAInstance1)\n classpath2.add(fileAInstance2)\n\n \/* Check that fileAInstance2 got interned and will re-use instance 1 *\/\n assertSame(classpath1.single(), classpath2.single())\n }\n}<|endoftext|>"} {"prompt":"text = fragmentText,\n textRange = SourceCode.Range(\n start = SourceCode.Position(fragmentStartLine, 1, fullTextLength),\n end = SourceCode.Position(fragmentEndLine, fragmentTextLength + 1, fullTextLength + fragmentTextLength + 1)\n )\n )\n (fragmentList as MutableList).add(fragment)","completion":"sb.appendLine(fragmentText)\n }\n }\n\n @Test\n fun `test `() {\n\n val fragmentedText = initFragmentedScript(params.intiCharPool, params.randomCharPool)\n val textFragments = fragmentedText.fragments()\n val includedFragments = params.fragmentsToInclude.map(textFragments::get)<|endoftext|>"} {"prompt":"$prop\") List<@Anno(\"nested nested receiver type $prop\")String>>.explicitType(@Anno(\"parameter annotation $prop\") param: @Anno(\"parameter type $prop\") ListIterator<@Anno(\"nested parameter type $prop\") List<@Anno(\"nested nested parameter type $prop\")String>>): @Anno(\"explicitType return type $prop\") List<@Anno(\"explicitType nested return","completion":"type $prop\") List<@Anno(\"explicitType nested nested return type $prop\") Int>> = emptyList()<|endoftext|>"} {"prompt":"\/\/ as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').\n\/\/ Otherwise it may result in performance regression due to missing HotSpot optimizations.\n\/\/ Run Kotlin compiler benchmarks (https:\/\/github.com\/Kotlin\/kotlin-benchmarks)\n\/\/ with compiler built from your changes if you are not sure.\n\nfun test(a: Int, b: Int): Int {","completion":"var sum = 0\n for (i in a.."} {"prompt":"@OptIn(FirImplementationDetail::class, ResolveStateAccess::class)\ninternal class FirTypeParameterImpl(\n override val source: KtSourceElement?,\n resolvePhase: FirResolvePhase,\n override val moduleData: FirModuleData,\n override val origin: FirDeclarationOrigin,\n override val attributes: FirDeclarationAttributes,\n override val name: Name,","completion":"override val symbol: FirTypeParameterSymbol,\n override val containingDeclarationSymbol: FirBasedSymbol<*>,\n override val variance: Variance,\n override val isReified: Boolean,\n override var bounds: MutableOrEmptyList,\n override var annotations: MutableOrEmptyList,\n) : FirTypeParameter() {<|endoftext|>"} {"prompt":"ImportModel(\"org.khronos.webgl.*\".toNameEntity()) \/\/ for typed arrays\n ),\n comment = null\n )\n\n return SourceFileModel(\n name = null,\n fileName = File(fileDeclaration.fileName).normalize().absolutePath,\n root = module,\n referencedFiles = fileDeclaration.referencedFiles\n )\n\n }\n}","completion":"private class IDLReferenceVisitor(private val visit: (IDLDeclaration, NameEntity?) -> Unit) : IDLLowering {\n override fun lowerTopLevelDeclaration(\n declaration: IDLTopLevelDeclaration,\n owner: IDLFileDeclaration\n ): IDLTopLevelDeclaration {\n visit(declaration, owner.packageName)<|endoftext|>"} {"prompt":"val resultField = scriptClass.declaredFields.find { it.name == resultFieldName }?.apply { isAccessible = true }\n assert(resultField != null) { \"compileResult.hasResult == true but resultField is null\" }\n val resultValue: Any? = resultField!!.get(scriptInstance)","completion":"ReplEvalResult.ValueResult(resultFieldName, resultValue, compileResult.type)\n } else {\n ReplEvalResult.UnitResult()\n }\n }\n }\n}\n\nprivate open class HistoryActionsForNoRepeat(val state: GenericReplEvaluatorState) {<|endoftext|>"} {"prompt":"require(erasedUpperBounds.size == 1) { \"Should only be one computed upper bound if no need to intersect all bounds\" }\n return erasedUpperBounds.single()\n } else {\n @Suppress(\"UNCHECKED_CAST\")\n return intersectTypes(erasedUpperBounds.toList().map { it.unwrap() })\n }\n }","completion":"return getDefaultType(typeAttr)\n }\n\n private fun TypeSubstitutor.substituteErasedUpperBounds(\n upperBounds: List,\n typeAttr: ErasureTypeAttributes\n ): Set = buildSet {\n for (upperBound in upperBounds) {<|endoftext|>"} {"prompt":"if (i != 1)\n throw IllegalStateException(\"Fail $n\")\n i = 0\n return A()\n}\n\nfun set1Boxed(): Any? = set1()\nfun test1Boxed(n: Int): Any? = test1(n)\n\nfun box(): String {\n try {\n set1() == test1(1)\n set1Boxed() == test1(2)","completion":"set1() == test1Boxed(3)\n set1Boxed() == test1Boxed(4)\n } catch (e: IllegalStateException) {\n return e.message ?: \"Fail no message\"\n }\n return \"OK\"\n}<|endoftext|>"} {"prompt":"Out<*>>>\")!>a","completion":", *, kotlin.collections.Map>>? & ClassWithSixTypeParameters<*, kotlin.Int, *, Out<*>, *, kotlin.collections.Map"} {"prompt":"open class T(var value: Int) {}\n\nfun plusAssign(): T {\n\n operator fun T.plusAssign(s: Int) {\n value += s\n }\n\n var t = T(1)\n t += 1\n\n return t\n}\n\nfun box(): String {\n val result = plusAssign().value\n if (result != 2) return \"fail 1: $result\"","completion":"return \"OK\"\n}<|endoftext|>"} {"prompt":"assertEquals(listOf(0u, 1u, 2u, 5u, 9u, 80u, 4294967200u, UInt.MAX_VALUE), uintArray.sorted())\n\n val ulongArray = ulongArrayOf(5u, 2u, 1u, 9u, 80u, 0u, ULong.MAX_VALUE, ULong.MAX_VALUE - 123u)","completion":"assertEquals(listOf(0u, 1u, 2u, 5u, 9u, 80u, ULong.MAX_VALUE - 123u, ULong.MAX_VALUE), ulongArray.sorted())\n }\n\n @Test\n fun sortedDescending() {\n assertTrue(uintArrayOf().sortedDescending().none())<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.serialization.builtins\n\nimport org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsSignatures\nimport org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment\nimport org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl","completion":"import org.jetbrains.kotlin.descriptors.resolveClassByFqName\nimport org.jetbrains.kotlin.incremental.components.NoLookupLocation\nimport org.jetbrains.kotlin.load.kotlin.computeJvmDescriptor\nimport org.jetbrains.kotlin.name.Name<|endoftext|>"} {"prompt":"@annArray(kotlin.arrayOf(\"a\"))\nfun test() = 1\n\nannotation class ann1(val p: Deprecated = kotlin.Deprecated(\"aaa\"))\nannotation class ann2(val p: ann1 = a.b.c.ann1())","completion":"annotation class ann3(val p: A.IAnn = A.IAnn(), val p2: A.IAnn = a.b.c.A.IAnn())\n\nannotation class annArray(val p: Array = kotlin.arrayOf(\"a\"))\n\nclass A {\n annotation class IAnn\n}<|endoftext|>"} {"prompt":"val kotlinLibrary = (it.getCapability(KlibModuleOrigin.CAPABILITY) as? DeserializedKlibModuleOrigin)?.library\n irLinker.deserializeIrModuleHeader(it, kotlinLibrary, _moduleName = it.name.asString())\n }\n }","completion":"val irProviders = if (ideCodegenSettings.shouldStubAndNotLinkUnboundSymbols) {\n listOf(stubGenerator)\n } else {\n val stubGeneratorForMissingClasses = DeclarationStubGeneratorForNotFoundClasses(stubGenerator)\n listOf(irLinker, stubGeneratorForMissingClasses)\n }<|endoftext|>"} {"prompt":"class C {\n val self by lazy(mode) { this }\n }\n\n val self = C()\n assertEquals(self, self.self)\n }\n\n @Test\n fun throwException() {\n class C {\n val thrower by lazy(mode) {\n error(\"failure\")\n }\n }\n\n val self = C()","completion":"repeat(10) {\n assertFailsWith {\n self.thrower\n }\n }\n }\n\n @Test\n fun multiThreadedInit() {\n val initializerCallCount = AtomicInt(0)\n\n class C {\n val data by lazy(mode) {\n initializerCallCount.getAndIncrement()\n Any()\n }\n }<|endoftext|>"} {"prompt":"J(OtherEnum.extensionProp.length),\n\n K(OtherEnum.Companion.extensionFun().length),","completion":"L(OtherEnum.Companion.extensionProp.length);\n\n companion object {\n val companionProp = \"someString\"\n fun companionFun(): String = \"someString\"\n }\n}\n\nfun OtherEnum.Companion.extensionFun(): String = companionFun()<|endoftext|>"} {"prompt":"override fun bar(o: R) {}\n}\n\nclass B : Java1, Java3() { \/\/Kotlin \u2190 Java1, Java2\n override fun foo(): R {\n return null!!\n }\n\n override fun bar(o: R) {}\n}","completion":"class C(override var a: R) : Java1, KotlinInterface { \/\/Kotlin \u2190 Java, Kotlin2\n override fun foo(): R {\n return null!!\n }\n\n override fun bar(o: R) {}\n}<|endoftext|>"} {"prompt":"interface P\n\nclass A {\n class B {\n fun test() {\n class C() : PT> {","completion":"companion object : P<W, T> {\n }\n\n inner class D : PT>\n }<|endoftext|>"} {"prompt":"safeCallOnDispatchReceiver(this@OperatorExpressionGenerator, startOffset, endOffset) { dispatchReceiver ->\n invokeConversionFunction(\n startOffset, endOffset,\n conversionFunction ?: throw AssertionError(\"No conversion function for $type ~> $targetType\"),\n dispatchReceiver\n )\n }\n\n else ->\n invokeConversionFunction(","completion":"startOffset, endOffset,\n conversionFunction ?: throw AssertionError(\"No conversion function for $type ~> $targetType\"),\n this\n )\n }\n }\n\n private fun invokeConversionFunction(\n startOffset: Int,\n endOffset: Int,\n functionDescriptor: FunctionDescriptor,\n receiver: IrExpression\n ): IrExpression {<|endoftext|>"} {"prompt":"downloadBaseUrl = downloadBaseUrl,\n ivyDependency = \"google.d8:v8:${D8Platform.platform}-$edition-$version@zip\",\n executable = getExecutable(\"d8\", command, \"exe\"),\n dir = targetPath,\n cleanableStore = cleanableStore,\n isWindows = isWindows,\n )\n }\n\n companion object {","completion":"const val EXTENSION_NAME: String = \"kotlinD8\"\n }\n}<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL -SAFE_CALL_WILL_CHANGE_NULLABILITY\n\n\/\/ MODULE: m1\n\/\/ FILE: a.kt\npackage p\n\npublic interface B {\n public fun foo(a: T): B?\n}\n\n\/\/ MODULE: m2(m1)\n\/\/ FILE: b.kt","completion":"package p\n\npublic interface C : B {\n override fun foo(a: T): B?\n\n}\n\n\/\/ MODULE: m3\n\/\/ FILE: b.kt\npackage p\n\npublic interface B {\n public fun foo(a: T): B?\n}\n\n\/\/ MODULE: m4(m3, m2)\n\/\/ FILE: c.kt\nimport p.*<|endoftext|>"} {"prompt":"return \"OK\"\n}\n\nfun testR0xE0() {\n \/\/ with possible local optimizations\n if ((-1).toByte() in 1L..3L != range0.contains((-1).toByte())) throw AssertionError()\n if ((-1).toByte() !in 1L..3L != !range0.contains((-1).toByte())) throw AssertionError()","completion":"if (!((-1).toByte() in 1L..3L) != !range0.contains((-1).toByte())) throw AssertionError()\n if (!((-1).toByte() !in 1L..3L) != range0.contains((-1).toByte())) throw AssertionError()\n \/\/ no local optimizations<|endoftext|>"} {"prompt":"if (x1.equals(x2) != x1.equals(x2)) return \"equals fail #3\"\n if (x1.hashCode() != x1.hashCode()) return \"hashCode fail\"\n return \"OK\"\n}\n\n\nfun box(): String {\n val resultC = testAnyBuiltins(C(), C())\n if (resultC != \"OK\") return resultC","completion":"val resultD = testAnyBuiltins(D(), D())\n if (resultD != \"OK\") return resultD\n\n val resultE = testAnyBuiltins(E(), E())\n if (resultE != \"OK\") return resultE\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor() : super(UserKlass())\n}\nfun TestFunctionVsDelegatedSuperConstructorCall() {}\n\nclass TestFunctionVsDelegatedSuperConstructorCallReverse: SuperConstructorSource {\n constructor() : super(UserKlass())\n}","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun TestFunctionVsDelegatedSuperConstructorCallReverse() {}\n\n\nclass TestIdenticalValueParameters {\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor(arg: UserKlass)\n}\nfun TestIdenticalValueParameters(arg: UserKlass) {}<|endoftext|>"} {"prompt":"attributes.getAttribute(key)\n ?: throw IllegalStateException(\"Failed to copy attribute. Source container is missing $key (named ${key.name}).\")\n }\n}\n\ninternal fun HasAttributes.copyAttributesTo(\n project: Project,\n dest: HasAttributes,\n keys: Iterable> = attributes.keySet(),\n) {\n for (key in keys) {","completion":"copyAttributeTo(project, dest, key)\n }\n}\n\ninternal inline fun attributeOf(\n name: String\n): Attribute = Attribute.of(name, T::class.java)<|endoftext|>"} {"prompt":"private val randomComment: String = CharArray(6) { (('0'..'9') + ('a'..'z') + ('A'..'Z')).random() }\n .joinToString(\"\", prefix = \"\/* \", postfix = \" *\/\")\n\n fun invokeForTestFile(source: String): String = source.replace(from, to + randomComment)","completion":"fun revertForFile(actual: String): String =\n actual.replace(to + randomComment, from).replace(randomComment, \"\")\n\n override fun apply(source: String): String = invokeForTestFile(source)\n override fun invoke(source: String): String = invokeForTestFile(source)\n}<|endoftext|>"} {"prompt":"function.returnType.kotlinToJsAdapterIfNeeded(isReturn = true)\n\n if (resultAdapter == null && valueParametersAdapters.all { it == null })\n return null\n\n val newFun = context.irFactory.createStaticFunctionWithReceivers(\n function.parent,","completion":"name = Name.identifier(function.name.asStringStripSpecialMarkers() + \"__JsExportAdapter\"),\n function,\n remapMultiFieldValueClassStructure = context::remapMultiFieldValueClassStructure\n )\n\n newFun.valueParameters.forEachIndexed { index, newParameter ->\n val adapter = valueParametersAdapters[index]\n if (adapter != null) {<|endoftext|>"} {"prompt":"fun KtFirAnalysisSession.create(diagnostic: KtDiagnosticWithParameters3): KtFirDiagnostic<*>\n}\n\ninternal fun interface KtFirDiagnostic4Creator : KtFirDiagnosticCreator {","completion":"fun KtFirAnalysisSession.create(diagnostic: KtDiagnosticWithParameters4): KtFirDiagnostic<*>\n}\n\ninternal class KtDiagnosticConverter(private val conversions: Map) {<|endoftext|>"} {"prompt":"assertEquals(9, atomicIntArr.getAndDecrement(1), \"getAndDecrement: FAIL 3\")\n assertEquals(8, atomicIntArr[1], \"getAndDecrement: FAIL 4\")\n assertFailsWith {\n val res = atomicIntArr.getAndDecrement(22)\n }.let { ex ->","completion":"assertEquals(\"The index 22 is out of the bounds of the AtomicIntArray with size 10.\", ex.message)\n }\n assertFailsWith {\n val res = atomicIntArr.getAndDecrement(-1)\n }.let { ex ->\n assertEquals(\"The index -1 is out of the bounds of the AtomicIntArray with size 10.\", ex.message)\n }<|endoftext|>"} {"prompt":"\/\/ [ possible first receiver - ALOAD or GETSTATIC ]\n \/\/ ALOAD v\n \/\/ { ... call ... }\n \/\/ Try to remove a load instruction for (2), so that the safe call would look like:\n \/\/ { ... evaluate receiver ... }\n \/\/ ASTORE v\n \/\/ ALOAD v\n \/\/ DUP\n \/\/ IFNONNULL L\n \/\/ POP","completion":"\/\/ { ... if null ... }\n \/\/ L:\n \/\/ [ possible dispatch receiver - ALOAD or GETSTATIC ]\n \/\/ [ SWAP if there was a dispatch receiver ]\n \/\/ { ... call ... }\n\n val aLoad1 = insn as VarInsnNode\n val ifNonNull = insn.next as JumpInsnNode\n val label1 = ifNonNull.label<|endoftext|>"} {"prompt":"suspend fun foo(value: T): T = value\n\n suspend fun bar(): IC? {\n run {\n return foo(IC(\"OK\"))\n }\n }\n\n suspend fun test() = bar()!!.s\n}\n\nfun box(): String {\n\n var result = \"FAIL\"\n builder {\n result = Test1().test()\n }","completion":"if (result != \"OK\") return \"FAIL 1 $result\"\n\n result = \"FAIL2\"\n\n builder {\n result = Test2().test()\n }\n\n if (result != \"OK\") return \"FAIL 2 $result\"\n\n result = \"FAIL 3\"\n\n builder {\n result = Test3().test()\n }<|endoftext|>"} {"prompt":"if (!(element2 in 3 until 1) != !range1.contains(element2)) throw AssertionError()\n if (!(element2 !in 3 until 1) != range1.contains(element2)) throw AssertionError()\n}\n\nfun testR1xE3() {\n \/\/ with possible local optimizations","completion":"if (-1L in 3 until 1 != range1.contains(-1L)) throw AssertionError()\n if (-1L !in 3 until 1 != !range1.contains(-1L)) throw AssertionError()\n if (!(-1L in 3 until 1) != !range1.contains(-1L)) throw AssertionError()<|endoftext|>"} {"prompt":"val (_: String, _) = A()\n\n val f: (A) -> Int = { (_, _) -> 1 }\n val g: (A) -> Int = { (_, _, _) -> 2 }","completion":"val h: (A) -> Int = { (_: String, _) -> 3}\n}<|endoftext|>"} {"prompt":"fun dependencies(action: BenchmarkDependencies.() -> Unit) =\n dependencies.action()\n\n fun dependencies(action: Closure<*>) {\n project.configure(dependencies, action)\n }\n\n inner class BenchmarkDependencies {\n public val sourceSets: NamedDomainObjectContainer\n get() = project.kotlin.sourceSets","completion":"fun project(path: String): Dependency = project.dependencies.project(mapOf(\"path\" to path))\n\n fun project(path: String, configuration: String): Dependency =\n project.dependencies.project(mapOf(\"path\" to path, \"configuration\" to configuration))\n\n fun common(notation: Any) = sourceSets.commonMain.dependencies {\n implementation(notation)\n }<|endoftext|>"} {"prompt":"forLoopNextBlock.startOffset, forLoopNextBlock.endOffset,\n forLoopNextBlock.type,\n forLoopNextBlock.origin,\n ).apply {\n statements.add(createNegatedConditionCheck(newLoopCondition, doWhileLoop))\n if (forLoopNextBlock.statements.size >= 2)","completion":"statements.addAll(forLoopNextBlock.statements.subList(0, forLoopNextBlock.statements.lastIndex))\n }\n\n doWhileLoop.body = bodyBlock\n\n val stepStartOffset = inductionVariableUpdate.startOffset\n val stepEndOffset = inductionVariableUpdate.endOffset\n val doWhileCondition =\n IrCompositeImpl(<|endoftext|>"} {"prompt":"\/\/ !SKIP_JAVAC\n\/\/ !LANGUAGE: +InlineClasses\n\/\/ ALLOW_KOTLIN_PACKAGE\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE\n\npackage kotlin.jvm\n\nannotation class JvmInline\n\n@JvmInline\nvalue class Foo(val x: Int)\n@JvmInline","completion":"value class Bar(val y: String)\n\nfun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {\n val a1 = f1 === f2 || f1 !== f2<|endoftext|>"} {"prompt":"this(classId.packageFqName, classId.relativeClassName, callableName, classId, pathToLocal = null)\n\n constructor(packageName: FqName, callableName: Name) :\n this(packageName, className = null, callableName, classId = null, pathToLocal = null)\n\n constructor(\n callableName: Name,","completion":"\/\/ Currently, it's only used for debug info\n pathToLocal: FqName?\n ) : this(PACKAGE_FQ_NAME_FOR_LOCAL, className = null, callableName, classId = null, pathToLocal)<|endoftext|>"} {"prompt":"import androidx.compose.runtime.Composable\n\n inline class InlineClass(val value: Int)\n fun used(x: Any?) {}\n\n @Composable fun A() {}\n @Composable fun A(x: Int) { }\n @Composable fun B(): Boolean { return true }\n @Composable fun B(x: Int): Boolean { return true }","completion":"@Composable fun R(): Int { return 10 }\n @Composable fun R(x: Int): Int { return 10 }\n @Composable fun P(x: Int) { }\n @Composable fun Int.A() { }\n @Composable fun L(): List { return listOf(1, 2, 3) }<|endoftext|>"} {"prompt":"* Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n *\/","completion":"public inline fun BooleanArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Boolean) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n\/**<|endoftext|>"} {"prompt":".getFunctions(Name.identifier(\"to${targetType.lookupTag.classId.shortClassName.asString()}\"))\n .singleOrNull()\n ?: error(\"No conversion function for $operandType ~> $targetType\")\n val conversionFunctionSymbol = declarationStorage.getIrFunctionSymbol(conversionFirFunction, operandFirClass.toLookupTag())","completion":"val unsafeIrCall = IrCallImpl(\n irExpression.startOffset, irExpression.endOffset,\n conversionFirFunction.resolvedReturnType.toIrType(c),\n conversionFunctionSymbol as IrSimpleFunctionSymbol,\n valueArgumentsCount = 0,\n typeArgumentsCount = 0\n ).also {\n it.dispatchReceiver = irExpression\n }<|endoftext|>"} {"prompt":"token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.TypealiasExpandsToArrayOfNothings\n\ninternal class OverridingFinalMemberImpl(\n override val overriddenDeclaration: KtCallableSymbol,\n override val containingClassName: Name,","completion":"firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.OverridingFinalMember\n\ninternal class ReturnTypeMismatchOnInheritanceImpl(\n override val conflictingDeclaration1: KtCallableSymbol,<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WORKS_WHEN_VALUE_CLASS\n\/\/ LANGUAGE: +ValueClasses, +GenericInlineClassParameter\n\ninterface IBase\n\ninterface IQ : IBase {\n fun ok(): String\n}\n\nOPTIONAL_JVM_INLINE_ANNOTATION\nvalue class X(val t: T): IQ {\n override fun ok(): String = t.ok()","completion":"}\n\ninterface IFoo1 {\n fun foo(): Any\n}\n\ninterface IFoo2 {\n fun foo(): T\n}\n\nobject OK : IQ {\n override fun ok(): String = \"OK\"\n}\n\nclass Test : IFoo1, IFoo2 {\n override fun foo(): X = X(OK)\n}\n\nfun box(): String {<|endoftext|>"} {"prompt":"fun execLlvmUtility(project: Project, utility: String, closure: Closure): ExecResult {\n return execLlvmUtility(project, utility) { project.configure(this, closure) }\n}\n\nfun PlatformManager.resolveLlvmUtility(utility: String) = \"${hostPlatform.absoluteLlvmHome}\/bin\/$utility\"","completion":"fun ExecOperations.execLlvmUtility(platformManager: PlatformManager, utility: String, action: Action): ExecResult {\n return exec {\n action.execute(this)\n executable = platformManager.resolveLlvmUtility(utility)\n }\n}<|endoftext|>"} {"prompt":"p.println(\" $HASH_CODE_NAME = 31 * $HASH_CODE_NAME + ${fieldToHashCode(field, repeatedFieldValue)}\")\n p.println(\"}\")\n\n } else if (field.isRequired) {\n p.println(\"$HASH_CODE_NAME = 31 * $HASH_CODE_NAME + ${fieldToHashCode(field, fieldValue)}\")","completion":"} else if (field.isOptional) {\n p.println(\"if ($hasMethod) {\")\n p.println(\" $HASH_CODE_NAME = 31 * $HASH_CODE_NAME + ${fieldToHashCode(field, fieldValue)}\")\n p.println(\"}\")\n }\n }<|endoftext|>"} {"prompt":"@Suppress(\"NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS\")\n@SinceKotlin(\"1.1\") public actual typealias AssertionError = java.lang.AssertionError\n\n@SinceKotlin(\"1.1\") public actual typealias NoSuchElementException = java.util.NoSuchElementException","completion":"@Suppress(\"NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS\")\n@SinceKotlin(\"1.3\") public actual typealias ConcurrentModificationException = java.util.ConcurrentModificationException\n\n@SinceKotlin(\"1.1\") public actual typealias Comparator = java.util.Comparator<|endoftext|>"} {"prompt":"fun test(a: A, b: B, c: C, d: D, e: E, f: F) {\n a.foo(\"\",\"1\")\n a.foo(null)\n\n b.foo(\"\",\"1\")\n b.foo(null)\n\n c.foo(\"\",\"1\")\n d.foo(\"\",\"1\")\n e.foo(\"\",\"1\")","completion":"f.foo(\"\",\"1\")\n}<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1293\npackage foo\n\nopen class A() {\n open fun c() = 2\n}\n\nclass B() : A() {\n override fun c() = 3\n}\n\nfun B.t() = d() + 1\n\nfun A.d() = c() + 3\n\nfun box(): String {","completion":"if (A().d() == 5 && B().d() == 6 && B().t() == 7) return \"OK\"\n return \"fail\"\n}<|endoftext|>"} {"prompt":"public fun T.let(block_: (T) -> R): R = TODO()\n\n\/\/ FILE: TestCase.kt\npackage testCase1\nimport libPackage.*\n\n\/\/ TESTCASE NUMBER: 1\nfun case2(s: String) {","completion":"s.let (block_ = { \"\" })\n s.let (block = { \"\" })\n}<|endoftext|>"} {"prompt":"\/\/ MODULE: m1-common\n\/\/ FILE: common.kt\n\nexpect open class Base\n\nexpect open class Foo : Base {\n fun foo(param: Int)\n}\n\n\/\/ MODULE: m2-jvm()()(m1-common)\n\/\/ FILE: jvm.kt\n\nactual open class Base {\n open fun foo(): Any = \"\"\n}","completion":"actual open class Foo : Base() {<|endoftext|>"} {"prompt":"assertEquals(originalText, restoredText)\n }\n\n @Test(expected = NoSuchElementException::class)\n fun failure1() {\n \/\/ There is no record with number 42!\n val originalText = \"\"\"\n |0 \\","completion":"|1 org.sample:liba,org.sample:liba-native[2.0] #0[2.0] #2[1.0] #42[42.42]\n |${'\\t'}\/some\/path\/liba.klib\n |2 org.sample:libb,org.sample:libb-native[1.0] #0[1.0]<|endoftext|>"} {"prompt":"testToKString(true, \"bb\", bytes('a'.toInt(), 'a'.toInt(), 'a'.toInt(), 0, 'b'.toInt(), 'b'.toInt(), 'b'.toInt(), 0), 5, 8)","completion":"testToKString(true, \"b\", bytes('a'.toInt(), 'a'.toInt(), 'a'.toInt(), 0, 'b'.toInt(), 'b'.toInt(), 'b'.toInt(), 0), 6, 8)<|endoftext|>"} {"prompt":"override val platformType: KotlinPlatformType = KotlinPlatformType.wasm\n\n override fun instantiateTarget(name: String): KotlinJsIrTarget {\n if (!PropertiesProvider(project).wasmStabilityNoWarn) {\n project.reportDiagnosticOncePerBuild(KotlinToolingDiagnostics.WasmStabilityWarning())\n }","completion":"val irTarget = project.objects.newInstance(KotlinJsIrTarget::class.java, project, KotlinPlatformType.wasm)\n irTarget.isMpp = true\n irTarget.wasmTargetType = targetType\n\n return irTarget\n }\n\n override fun createKotlinTargetConfigurator(): AbstractKotlinTargetConfigurator =<|endoftext|>"} {"prompt":"contextReceiverArguments.transformInplace(transformer, data)\n constructedTypeRef = constructedTypeRef.transform(transformer, data)\n transformCalleeReference(transformer, data)\n return this\n }\n\n override fun transformAnnotations(transformer: FirTransformer, data: D): FirDelegatedConstructorCallImpl {","completion":"annotations.transformInplace(transformer, data)\n return this\n }\n\n override fun transformDispatchReceiver(transformer: FirTransformer, data: D): FirDelegatedConstructorCallImpl {\n dispatchReceiver = dispatchReceiver?.transform(transformer, data)\n return this\n }<|endoftext|>"} {"prompt":"0x7ff8000000000000UL, 0x0UL, 0x3ff0000000000000UL, 0x3fefffffffdd3059UL, \n 0x3ff00000001167d3UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL,","completion":"0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3fefffffffdd3059UL, 0x3ff00000001167d3UL, \n 0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL,<|endoftext|>"} {"prompt":"-Xsam-conversions=indy Generate SAM conversions using 'invokedynamic' with 'LambdaMetafactory.metafactory'. Requires '-jvm-target 1.8' or greater.\n-Xsam-conversions=class Generate SAM conversions as explicit classes\"\"\"\n )\n var samConversions: String? = null\n set(value) {\n checkFrozen()","completion":"field = if (value.isNullOrEmpty()) null else value\n }\n\n @Argument(\n value = \"-Xlambdas\",\n valueDescription = \"{class|indy}\",\n description = \"\"\"Select the code generation scheme for lambdas.<|endoftext|>"} {"prompt":"fun doTheJob1() = simpleAsync1 { insideJob1()<|endoftext|>"} {"prompt":"}\n }\n }\n\n \/**\n * Returns a [FirExpression] matching the given PSI [receiverExpression].\n *\n * @param receiverExpression a qualified expression receiver (e.g., `foo` in `foo?.bar()`, or in `foo.bar`).\n *","completion":"* The function unwraps certain receiver expressions. For instance, for safe calls direct counterpart to a [KtSafeQualifiedExpression]\n * is (FirCheckedSafeCallSubject)[org.jetbrains.kotlin.fir.expressions.FirCheckedSafeCallSubject] which requires additional unwrapping\n * to be used for call resolution.\n *\/<|endoftext|>"} {"prompt":"Display(\"%enabled\")\n }\n ) {\n Wrap(content)\n }\n \"\"\".replace('%', '$'),\n \"\"\"\n import androidx.compose.runtime.Composable\n\n @Composable fun Display(text: String) { }\n @Composable fun Wrap(content: @Composable () -> Unit) { }\n \"\"\"\n )\n\n @Test","completion":"fun testComposabableLambdaInLocalDeclaration() = verifyGoldenComposeIrTransform(\n \"\"\"\n import androidx.compose.runtime.Composable\n\n @Composable\n fun Test(enabled: Boolean) {\n val content: @Composable () -> Unit = {\n Display(\"%enabled\")\n }\n Wrap(content)\n }<|endoftext|>"} {"prompt":"\/\/ NO_CHECK_LAMBDA_INLINING\n\/\/ FILE: 1.kt\npackage test\n\npublic inline fun with2(receiver: T, body: T.() -> String) = receiver.body()\n\n\/\/ FILE: 2.kt\nimport test.*\n\nfun test(item: T?, defaultLink: T.() -> String): String {\n return with2(\"\") {","completion":"item?.defaultLink() ?: \"fail\"\n }\n}\n\nfun box(): String {\n return test(\"O\") {\n this + \"K\"\n }\n}<|endoftext|>"} {"prompt":"val remainderUnsignedLong: IrSimpleFunctionSymbol = javaLangLong.functionByName(\"remainderUnsigned\")\n val toUnsignedStringLong: IrSimpleFunctionSymbol = javaLangLong.functionByName(\"toUnsignedString\")\n\n val intPostfixIncrDecr = createIncrDecrFun(\"\")","completion":"val intPrefixIncrDecr = createIncrDecrFun(\"\")\n\n private fun createIncrDecrFun(intrinsicName: String): IrSimpleFunctionSymbol =\n irFactory.buildFun {\n name = Name.special(intrinsicName)\n origin = IrDeclarationOrigin.IR_BUILTINS_STUB<|endoftext|>"} {"prompt":"sourceMapProvider: () -> SourceMap?,\n val outputDir: File?\n ) {\n val specialFunctions: Map by lazy(specialFunctionsProvider)\n\n val offsetToSourceMapping by lazy(offsetToSourceMappingProvider)\n\n val sourceMap: SourceMap? by lazy(sourceMapProvider)\n\n val wrapFunctionRegex by lazy {\n specialFunctions.entries","completion":".singleOrNull { (_, v) -> v == SpecialFunction.WRAP_FUNCTION }?.key\n ?.let { Regex(\"\\\\s*$it\\\\s*\\\\(\\\\s*\").toPattern() }\n }\n }\n\n private val moduleNameToInfo by lazy {\n val result = HashMultimap.create()<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.backend.konan\n\nimport kotlinx.cinterop.*\nimport llvm.*\nimport org.jetbrains.kotlin.backend.common.LoggingContext\nimport org.jetbrains.kotlin.backend.konan.driver.PhaseContext\nimport org.jetbrains.kotlin.backend.konan.llvm.*","completion":"import org.jetbrains.kotlin.konan.target.*\nimport java.io.Closeable\n\nenum class LlvmOptimizationLevel(val value: Int) {\n NONE(0),\n DEFAULT(1),\n AGGRESSIVE(3)\n}\n\nenum class LlvmSizeLevel(val value: Int) {\n NONE(0),\n DEFAULT(1),<|endoftext|>"} {"prompt":"* There was previous module, so we should save it\n *\/\n if (currentModuleName != null) {\n finishModule(lineNumber)\n } else {\n finishGlobalDirectives()\n }\n val (moduleName, dependencies, friends, dependsOn) = splitRawModuleStringToNameAndDependencies(\n values.joinToString(separator = \" \")\n )","completion":"currentModuleName = moduleName\n val kind = defaultsProvider.defaultDependencyKind\n dependencies.mapTo(dependenciesOfCurrentModule) { name ->\n DependencyDescription(name, kind, DependencyRelation.RegularDependency)\n }\n friends.mapTo(dependenciesOfCurrentModule) { name ->\n DependencyDescription(name, kind, DependencyRelation.FriendDependency)<|endoftext|>"} {"prompt":"isClosed = true\n }\n }\n\n @Test fun success() {\n val resource = Resource()\n val result = resource.use { \"ok\" }\n assertEquals(\"ok\", result)\n assertTrue(resource.isClosed)\n }\n\n @Test fun closeFails() {\n val e = assertFails {","completion":"Resource(faultyClose = true).use { it.isClosed }\n }\n assertTrue(e is IOException)\n }\n\n @Test fun opFailsCloseSuccess() {\n val e = assertFails {\n Resource().use { error(\"op fail\") }\n }\n assertTrue(e is IllegalStateException)\n assertTrue(e.suppressed.isEmpty())\n }<|endoftext|>"} {"prompt":"\/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with","completion":"* the License. You may obtain a copy of the License at\n *\n * http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun testMultipleTypeAliasedValueParameterTypesA(arg1: UserKlassA, arg2: UserKlassB) {}\n fun testMultipleTypeAliasedValueParameterTypesA(arg1: UserKlassA, arg2: SameUserKlassB) {}","completion":"fun testMultipleTypeAliasedValueParameterTypesAReverse(arg1: UserKlassA, arg2: UserKlassB) {}\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun testMultipleTypeAliasedValueParameterTypesAReverse(arg1: UserKlassA, arg2: SameUserKlassB) {}<|endoftext|>"} {"prompt":"endOffset = expression.endOffset,\n returnType = expression.type\n ) { fn ->\n fn.body = DeclarationIrBuilder(context, fn.symbol).irBlockBody {\n +irReturn(expression)\n }\n }\n )\n }\n }\n\n private fun irChanged(value: IrExpression): IrExpression = irChanged(\n irCurrentComposer(),","completion":"value,\n inferredStable = false,\n compareInstanceForFunctionTypes = false,\n compareInstanceForUnstableValues = strongSkippingModeEnabled\n )\n\n private fun IrValueDeclaration.isVar(): Boolean =\n (this as? IrVariable)?.isVar == true\n\n private fun IrValueDeclaration.isStable(): Boolean =<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.symbols.KtEnumEntrySymbol\nimport org.jetbrains.kotlin.analysis.api.symbols.KtSymbolOrigin\nimport org.jetbrains.kotlin.backend.konan.objcexport.*\nimport org.jetbrains.kotlin.name.Name\n\n\/**","completion":"* Note: At the time of writing this function (and comment) we found it easiest\n * to construct the functions manually. Potentially, there is a way to get those functions from\n * the Analysis API by requesting the combined member scope and looking for [KtSymbolOrigin.SOURCE_MEMBER_GENERATED].\n *\/\ncontext(KtAnalysisSession, KtObjCExportSession)<|endoftext|>"} {"prompt":"val USE_FIR_BASED_FAKE_OVERRIDE_GENERATOR = CompilerConfigurationKey.create(\n \"Generate all fake overrides via FIR2IR instead of IR, i.e. revert to behavior before KT-61514 was resolved.\"\n )\n}\n\nvar CompilerConfiguration.languageVersionSettings: LanguageVersionSettings","completion":"get() = get(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, LanguageVersionSettingsImpl.DEFAULT)\n set(value) = put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, value)\n\nval LanguageVersionSettings.isLibraryToSourceAnalysisEnabled: Boolean\n get() = getFlag(AnalysisFlags.libraryToSourceAnalysis)<|endoftext|>"} {"prompt":"{ \"Extension receiver must be not null if explicitReceiverKind is EXTENSION_RECEIVER\" }\n ) {\n withPsiEntry(\"explicitReceiverPsi\", explicitReceiverPsi)\n dispatchReceiver?.let { withFirEntry(\"dispatchReceiver\", it) }\n withFirSymbolEntry(\"target\", targetSymbol)\n }","completion":"dispatchReceiverValue = dispatchReceiver?.toKtReceiverValue()\n extensionReceiverValue =\n KtExplicitReceiverValue(explicitReceiverPsi, extensionReceiver.resolvedType.asKtType(), false, token)\n }\n\n else -> {\n errorWithAttachment(\"Implicit invoke call can not have no explicit receiver\") {<|endoftext|>"} {"prompt":"\/\/ FILE: anno.kt\n\nactual typealias Anno = Jnno\n\n\/\/ MODULE: main(lib)\n\/\/ FILE: main.kt\n\nannotation class A(val value: String)\n\n@Anno\nfun test() {}\n\nfun box(): String {\n \/\/ We don't need to check the contents, just check that there are no anomalities in the bytecode by loading annotations","completion":"::test.annotations.toString()\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ WITH_COROUTINES\n\nimport helpers.*\nimport kotlin.coroutines.*\n\ninline class IC(val s: Any?)\n\nvar c: Continuation? = null\n\nsuspend fun suspendMe(): T = suspendCoroutine {\n @Suppress(\"UNCHECKED_CAST\")\n c = it as Continuation\n}","completion":"interface Base {\n suspend fun generic(): T\n}\n\nclass Derived : Base {\n override suspend fun generic(): IC = suspendMe()\n}\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\nfun box(): String {\n var res: String? = null\n builder {<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\/\/ FULL_JDK\npackage test.another\n\nannotation class Anno(val value: String)\n\nfun topLevelFunction(): String? = null\n\nfun > topLevelGenericFunction(): T? {\n return null!!\n}\n\nval topLevelProperty = 2\n\nconst val topLevelConstProperty = 2\n\nval topLevelProperty2: String","completion":"get() = \"\"\n\nfun @receiver:Anno(\"rec\") String.extensionFunction(@Anno(\"1\") a: String, @Anno(\"2\") b: String) {}\n\n@Anno(\"extpr\")\nvar @receiver:Anno(\"propRec\") T.extensionProperty: String\n get() = \"\"\n set(@Anno(\"setparam\") setParamName) {}<|endoftext|>"} {"prompt":"class A {\n val a: Int\n get() {\n val b: Int\n val c: Int\n 42\n return b\n }\n\n fun foo() {\n class B {\n val a: Int\n get() {\n val b: Int\n val c: Int\n 42","completion":"return b\n }\n }\n }\n}<|endoftext|>"} {"prompt":"require(startIndex >= 0 && endIndex <= string.length && startIndex <= endIndex)\n\n val bytes = ByteArray((endIndex - startIndex) * MAX_BYTES_PER_CHAR)\n var byteIndex = 0\n var charIndex = startIndex\n\n while (charIndex < endIndex) {\n val code = string[charIndex++].code\n when {\n code < 0x80 ->","completion":"bytes[byteIndex++] = code.toByte()\n code < 0x800 -> {\n bytes[byteIndex++] = ((code shr 6) or 0xC0).toByte()\n bytes[byteIndex++] = ((code and 0x3F) or 0x80).toByte()\n }\n code < 0xD800 || code >= 0xE000 -> {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.diagnostics.DiagnosticReporter\nimport org.jetbrains.kotlin.diagnostics.reportOn\nimport org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind\nimport org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext","completion":"import org.jetbrains.kotlin.fir.analysis.checkers.hasModifier\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors\nimport org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration\nimport org.jetbrains.kotlin.fir.declarations.FirClass<|endoftext|>"} {"prompt":"val parameterIndex = diagnostic.parameterIndex\n\n val valueArgument = lambdaArgument.psiCallArgument.valueArgument\n\n val valueParameters = when (val argumentExpression = KtPsiUtil.deparenthesize(valueArgument.getArgumentExpression())) {\n is KtLambdaExpression -> argumentExpression.valueParameters","completion":"is KtNamedFunction -> argumentExpression.valueParameters \/\/ for anonymous functions\n else -> return\n }\n\n val parameter = valueParameters.getOrNull(parameterIndex)\n if (parameter != null) {\n trace.report(CANNOT_INFER_PARAMETER_TYPE.on(parameter))\n }\n }\n\n is CompatibilityWarningOnArgument -> {<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ IGNORE_BACKEND: JVM\n\/\/ WITH_STDLIB\n\/\/ FILE: kt24258.kt\n\nval lazyNullString: String by lazy { J.nullString() }\n\n\nfun testLazyNullString() {\n try {\n val s: String = lazyNullString\n throw Exception(\"'val s: String = lazyNullString' should throw NullPointerException\")","completion":"} catch (e: NullPointerException) {\n }\n}\n\nfun box(): String {\n testLazyNullString()\n\n return \"OK\"\n}\n\n\/\/ FILE: J.java\npublic class J {\n public static String nullString() {\n return null;\n }\n}<|endoftext|>"} {"prompt":"private fun > expectMinMax(min: T, max: T, elements: Array) {\n assertEquals(min, elements.minOrNull())\n assertEquals(max, elements.maxOrNull())\n assertEquals(min, elements.min())\n assertEquals(max, elements.max())\n }\n\n @Test\n fun minMax() {","completion":"expectMinMax(\"a\", \"a\", arrayOf(\"a\"))\n expectMinMax(\"a\", \"bcd\", arrayOf(\"a\", \"bcd\"))\n expectMinMax(\"a\", \"e\", arrayOf(\"a\", \"bcd\", \"e\"))\n expectMinMax(1, Int.MAX_VALUE, arrayOf(1, 2, Int.MAX_VALUE))<|endoftext|>"} {"prompt":"@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})\npublic fun kotlin.ULong.coerceIn(minimumValue: kotlin.ULong, maximumValue: kotlin.ULong): kotlin.ULong\n\n@kotlin.SinceKotlin(version = \"1.5\")","completion":"@kotlin.WasExperimental(markerClass = {kotlin.ExperimentalUnsignedTypes::class})\npublic fun kotlin.ULong.coerceIn(range: kotlin.ranges.ClosedRange): kotlin.ULong\n\n@kotlin.SinceKotlin(version = \"1.5\")<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.*\nimport org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilationResult.Companion.assertSuccess\nimport org.jetbrains.kotlin.konan.test.blackbox.support.group.FirPipeline","completion":"import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestExecutable\nimport org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunCheck\nimport org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunChecks<|endoftext|>"} {"prompt":"return fooPrivate()\n }\n\n fun testFinal(): String {\n return fooFinal()\n }\n}\n\n\/\/ FILE: 2.kt\n\nimport test.*\n\nfun box() : String {\n val p = P()\n\n if (p.testPrivate() != \"OK\") return \"fail 1 ${p.testPrivate()}\"","completion":"if (p.testFinal() != \"OK\") return \"fail 2 ${p.testFinal()}\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"if (toStringFloat3.id() != \"1.5\") return \"Fail 2.3\"\n\n \/\/ START_EVALUATION_CHECKS\n val localDoubleToString = 1.0.toString()","completion":"val localFloatToString = 1.0f.toString()\n \/\/ STOP_EVALUATION_CHECKS\n\n if (localDoubleToString.id() != toStringDouble1) return \"Fail 3.1\"\n if (localFloatToString.id() != toStringFloat1) return \"Fail 3.2\"<|endoftext|>"} {"prompt":"super.foo()\n super.foo()\n}\n\nclass A {\n fun act() {\n println(\"Test\")\n }\n\n fun String.fact() {","completion":"println(\"Fest\")\n }\n}<|endoftext|>"} {"prompt":"if (!('0' !in '3' downTo '1') != range1.contains('0')) throw AssertionError()\n \/\/ no local optimizations\n if (element0 in '3' downTo '1' != range1.contains(element0)) throw AssertionError()","completion":"if (element0 !in '3' downTo '1' != !range1.contains(element0)) throw AssertionError()\n if (!(element0 in '3' downTo '1') != !range1.contains(element0)) throw AssertionError()\n if (!(element0 !in '3' downTo '1') != range1.contains(element0)) throw AssertionError()<|endoftext|>"} {"prompt":"super@KotlinInterfaceIndirectInheritance.property\n }\n }\n }\n\n val propertyyy: String\n get() {\n super.test()\n super.property\n\n object {\n fun run () {\n super@KotlinInterfaceIndirectInheritance.test()\n super@KotlinInterfaceIndirectInheritance.property\n }\n }","completion":"return \"\"\n }\n}\n\nopen class KotlinClass : KInterface {\n fun foo() {\n super.test()\n super.property\n\n object {\n fun run () {\n super@KotlinClass.test()\n super@KotlinClass.property\n }\n }\n }\n\n val xproperty: String\n get() {\n super.test()<|endoftext|>"} {"prompt":"@myAnnotation public\npackage illegal_modifiers\n\nabstract class A() {","completion":"abstract final fun f()\n abstract open fun g()<|endoftext|>"} {"prompt":"typeConversion: (FirTypeRef) -> ConeKotlinType? = FirTypeRef::coneTypeSafe\n): String = buildString {\n if (customName != null) {\n append(customName)\n } else {\n if (this@computeJvmDescriptor is FirSimpleFunction) {\n append(name.asString())\n } else {\n append(\"\")","completion":"}\n }\n\n append(\"(\")\n for (parameter in valueParameters) {\n typeConversion(parameter.returnTypeRef)?.let { coneType ->\n try {\n appendConeType(coneType, typeConversion, mutableSetOf())\n } catch (e: ConcurrentModificationException) {\n errorWithAttachment(\"CME from appendConeType\", cause = e) {<|endoftext|>"} {"prompt":"val FRAGMENT_SHADER: Int\n val VERTEX_SHADER: Int\n val MAX_VERTEX_ATTRIBS: Int\n val MAX_VERTEX_UNIFORM_VECTORS: Int\n val MAX_VARYING_VECTORS: Int\n val MAX_COMBINED_TEXTURE_IMAGE_UNITS: Int","completion":"val MAX_VERTEX_TEXTURE_IMAGE_UNITS: Int\n val MAX_TEXTURE_IMAGE_UNITS: Int\n val MAX_FRAGMENT_UNIFORM_VECTORS: Int\n val SHADER_TYPE: Int\n val DELETE_STATUS: Int\n val LINK_STATUS: Int\n val VALIDATE_STATUS: Int<|endoftext|>"} {"prompt":"assertFalse(eqDoubleQByteQ(1.toDouble(), 0.toByte()))\n assertTrue(eqDoubleQByteQ(1.toDouble(), 1.toByte()))\n assertFalse(eqDoubleQByteQ(1.toDouble(), null))\n assertFalse(eqDoubleQByteQ(1.toDouble(), undefined))\n assertFalse(eqDoubleQByteQ(null, 0.toByte()))","completion":"assertFalse(eqDoubleQByteQ(null, 1.toByte()))\n assertTrue(eqDoubleQByteQ(null, null))\n assertTrue(eqDoubleQByteQ(null, undefined))\n assertFalse(eqDoubleQByteQ(undefined, 0.toByte()))\n assertFalse(eqDoubleQByteQ(undefined, 1.toByte()))<|endoftext|>"} {"prompt":"@file:Suppress(\"PackageDirectoryMismatch\") \/\/ Old package for compatibility\npackage org.jetbrains.kotlin.gradle.utils\n\nimport org.gradle.api.Project\nimport org.gradle.api.artifacts.repositories.ArtifactRepository\nimport org.gradle.api.file.ConfigurableFileCollection\nimport org.gradle.api.file.FileTree","completion":"import org.gradle.api.logging.Logger\nimport org.gradle.api.provider.ValueSource\nimport org.gradle.api.provider.ValueSourceParameters\nimport org.jetbrains.kotlin.compilerRunner.KotlinNativeToolRunner\nimport org.jetbrains.kotlin.compilerRunner.konanDataDir<|endoftext|>"} {"prompt":"ext.syntheticMethodForDelegate = delegateMethod?.run { JvmMethodSignature(c[name], c[desc]) }\n }\n\n override fun readConstructorExtensions(kmConstructor: KmConstructor, proto: ProtoBuf.Constructor, c: ReadContext) {\n val ext = kmConstructor.jvm","completion":"ext.signature = JvmProtoBufUtil.getJvmConstructorSignature(proto, c.strings, c.types)?.wrapAsPublic()\n }\n\n override fun readTypeParameterExtensions(kmTypeParameter: KmTypeParameter, proto: ProtoBuf.TypeParameter, c: ReadContext) {\n val ext = kmTypeParameter.jvm<|endoftext|>"} {"prompt":"\"warn:\" -> LanguageFeature.State.ENABLED_WITH_WARNING\n else -> error(\"Unknown mode for language feature: $mode\")\n }\n val name = matcher.group(2)\n val feature = LanguageFeature.fromString(name) ?: error(\"Language feature with name \\\"$name\\\" not found\")\n specificFeatures[feature] = mode\n }","completion":"@Suppress(\"INVISIBLE_MEMBER\", \"INVISIBLE_REFERENCE\", \"HIDDEN\")\n private fun analysisFlag(flag: AnalysisFlag, value: @kotlin.internal.NoInfer T?): Pair, T>? =\n value?.let(flag::to)<|endoftext|>"} {"prompt":"import testPackCase3.Case.E\n\noperator fun Case.E.plus(value: Int) = Inv()\noperator fun Case.Inv.invoke(i: Int) = 1\n\n\n\/\/ FILE: TestCase3.kt\n\/\/ TESTCASE NUMBER: 3, 4\npackage testPackCase3\nimport libPackage.plus\nimport libPackage.*\nimport libPackage.invoke\n\nclass Case() {","completion":"class E(val plus: Inv? = null) {\n operator fun plus(value: Int) = Case()\n }\n\n class Inv() {\n operator fun invoke(value: Int) = Case()\n }\n\n fun foo(e: E) {\n operator fun E.plus(value: Int) = Case()\n\n run {\n operator fun E.plus(value: Int) = Case()<|endoftext|>"} {"prompt":"x.length \/\/ bad (x#0 is String, x#1 is Nothing?, this is either)\n }\n}\n\nfun unoverriddenEquals(a: Any?) {\n val c = C(1)\n var b: Any?\n b = c\n if (b == c.also { b = a }) {","completion":"a.x \/\/ bad (b#0 is C, b#1 = a)\n b.x \/\/ bad (b#0 is C, this is b#1)\n if (b is C) { \/\/ b#1<|endoftext|>"} {"prompt":"testToKString(true, \"\u041f\u0440\u0438\", bytes(-48, -97, -47, -128, -48, -72, 0, -48, -78, 0, -48, -75, -47, -126))\n testToKString(true, \"\\uD800\\uDC00\", bytes(-16, -112, -128, -128))","completion":"testToKString(true, \"\\uD800\\uDC00\", bytes(-16, -112, -128, -128, 0, -16, -112, -128, -128))\n testToKString(true, \"\", bytes())\n testToKString(true, \"\", bytes(0, 'H'.toInt()))\n\n \/\/ Incorrect UTF-8 lead character.<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget\nimport org.jetbrains.kotlin.gradle.utils.filesProvider\nimport org.jetbrains.kotlin.gradle.utils.listProperty\n\n\ninternal fun interface KotlinCompilationAssociator {","completion":"fun associate(target: KotlinTarget, auxiliary: InternalKotlinCompilation<*>, main: InternalKotlinCompilation<*>)\n}\n\ninternal object DefaultKotlinCompilationAssociator : KotlinCompilationAssociator {\n override fun associate(target: KotlinTarget, auxiliary: InternalKotlinCompilation<*>, main: InternalKotlinCompilation<*>) {<|endoftext|>"} {"prompt":"\/\/ TESTCASE NUMBER: 16\nval value_16 = 999999999.0\n\n\/\/ TESTCASE NUMBER: 17\nval value_17 = 0000000000.1234567890\n\n\/\/ TESTCASE NUMBER: 18\nval value_18 = 123456789.23456789\n\n\/\/ TESTCASE NUMBER: 19\nval value_19 = 2345678.345678","completion":"\/\/ TESTCASE NUMBER: 20\nval value_20 = 34567.4567\n\n\/\/ TESTCASE NUMBER: 21\nval value_21 = 456.56\n\n\/\/ TESTCASE NUMBER: 22\nval value_22 = 5.65\n\n\/\/ TESTCASE NUMBER: 23\nval value_23 = 654.7654\n\n\/\/ TESTCASE NUMBER: 24<|endoftext|>"} {"prompt":"package foo\n\nimport bar.*\n\/*p:baz(C)*\/import baz.C\n\n\/*p:foo*\/val a = \/*p:bar p:foo*\/A()","completion":"\/*p:foo*\/var b: \/*p:bar p:foo p:java.lang p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.jvm p:kotlin.ranges p:kotlin.sequences p:kotlin.text*\/baz.\/*p:baz*\/B<|endoftext|>"} {"prompt":"if (psiExpression is KtSuperExpression) {\n trace.report(SUPER_CANT_BE_EXTENSION_RECEIVER.on(psiExpression, psiExpression.text))\n }\n }\n\n is StubBuilderInferenceReceiver -> {\n val stubType = callReceiver.receiver.receiverValue.type as? StubTypeForBuilderInference","completion":"val originalTypeParameter = stubType?.originalTypeVariable?.originalTypeParameter\n\n trace.report(\n BUILDER_INFERENCE_STUB_RECEIVER.on(\n callReceiver.psiExpression ?: call.callElement,\n originalTypeParameter?.name ?: SpecialNames.NO_NAME_PROVIDED,<|endoftext|>"} {"prompt":"}, id<(B) -> Unit> { x -> x })","completion":"val x18: (C) -> Unit = select(id { it }, { it<|endoftext|>"} {"prompt":"operator fun get(id: O1.Id) = \"O1 getter\"\n operator fun get(id: O2.Id) = \"O2 getter\"\n}\n\nfun box(): String {\n var service = Service()\n if (service[Bar.Id(12)] != \"Bar getter\") return \"Fail with \/**\/Bar overload\"","completion":"if (service[Foo.Id(6)] != \"Foo getter\") return \"Fail with Foo overload\"\n if (service[E1.Id.A] != \"E1 getter\") return \"Fail with E1 overload\"\n if (service[E2.Id.A] != \"E2 getter\") return \"Fail with E2 overload\"<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion\nimport org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil\nimport org.jetbrains.kotlin.name.ClassId\nimport org.jetbrains.kotlin.name.FqName","completion":"import org.jetbrains.kotlin.name.StandardClassIds\nimport org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException\nimport org.jetbrains.kotlin.resolve.jvm.JvmClassName\nimport org.jetbrains.kotlin.serialization.deserialization.IncompatibleVersionErrorData<|endoftext|>"} {"prompt":"internal actual fun ulongDivide(v1: ULong, v2: ULong): ULong {\n val dividend = v1.toLong()\n val divisor = v2.toLong()\n if (divisor < 0) { \/\/ i.e., divisor >= 2^63:\n return if (v1 < v2) ULong(0) else ULong(1)\n }","completion":"\/\/ Optimization - use signed division if both dividend and divisor < 2^63\n if (dividend >= 0) {\n return ULong(dividend \/ divisor)\n }\n\n \/\/ Otherwise, approximate the quotient, check, and correct if necessary.\n val quotient = ((dividend ushr 1) \/ divisor) shl 1<|endoftext|>"} {"prompt":"x.resume(\"OK\")\n COROUTINE_SUSPENDED\n }\n\n suspend fun myfun(): String {\n var result = \"fail\"\n builder {\n result = a()\n }\n\n return result\n }\n}\n\nfun box(): String {\n var result = \"\"\n\n builder {\n result = A().myfun()\n }\n\n return result","completion":"}<|endoftext|>"} {"prompt":"contract { returns(false) implies (value_1 is String) }\n return value_1 is String\n}\n\nfun funWithReturnsFalseAndInvertTypeCheck(value_1: Any?): Boolean {\n contract { returns(false) implies (value_1 !is String) }\n return value_1 !is String\n}\n\nfun funWithReturnsFalseAndNotNullCheck(value_1: Number?): Boolean {","completion":"contract { returns(false) implies (value_1 != null) }\n return value_1 != null\n}\n\nfun funWithReturnsFalseAndNullCheck(value_1: Number?): Boolean {\n contract { returns(false) implies (value_1 == null) }\n return value_1 == null\n}\n\nfun funWithReturnsNull(cond: Boolean): Boolean? {<|endoftext|>"} {"prompt":"if (!checkClassTypeParametersWithUpperBounds(\n A::class,\n listOf(\n Pair(\"K\", listOf(\"kotlin.collections.List>\"))\n )\n )) return null\n\n if (!checkClassTypeParametersWithUpperBounds(\n B::class,\n listOf(","completion":"Pair(\"T\", listOf(\"org.jetbrains.`true`.A>>\"))\n )\n )) return null\n\n if (!checkCallableTypeParametersWithUpperBounds(\n `false`::f3,\n listOf(<|endoftext|>"} {"prompt":"result.addAll(getContributedFunctions(descriptorName, NoLookupLocation.FROM_BACKEND))\n result.addAll(getContributedVariables(descriptorName, NoLookupLocation.FROM_BACKEND))\n\n return result\n }","completion":"private fun lookupTopLevelDescriptors(nameSegments: List, packageFqName: FqName): Collection {\n val declarationName = nameSegments[0]\n val isLeaf = nameSegments.size == 1\n return when (lookupMode) {\n LookupMode.MODULE_WITH_DEPENDENCIES -> {\n moduleDescriptor<|endoftext|>"} {"prompt":"null -> \"false\"\n }\n }\n}\n\n\/*\n * TESTCASE NUMBER: 8\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-17694\n *\/\nfun case_8(x: Any?) {\n val y: Any\n when (x) {","completion":"is Boolean? -> y = when(x) {\n true -> \"true\"\n false -> \"false\"\n null -> \"false\"\n }\n else -> y = Any()\n }\n\n}\n\n\/\/ TESTCASE NUMBER: 9\nfun case_9(x: Any?): String {\n if (x is Boolean) {<|endoftext|>"} {"prompt":"override fun f(i1: Int) = x + i1\n}\n\ninterface Outer {\n @JvmInline\n value class DefaultImpls(val x: Int) {\n fun f(i1: Int = 1) = x + i1\n }\n}\n\nfun box(): String {\n val unbounded1 = IC::f","completion":"assertEquals(3, unbounded1.callBy(mapOf(unbounded1.instanceParameter!! to IC(2))))\n assertEquals(7, unbounded1.callBy(mapOf(unbounded1.instanceParameter!! to IC(2), unbounded1.parameters[1] to 5)))\n\n val bounded1 = IC(2)::f<|endoftext|>"} {"prompt":"val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short","completion":"val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short<|endoftext|>"} {"prompt":"assertEquals(BigInteger(\"-4\"), -a shl 1)\n assertEquals(BigInteger(\"-1\"), -a shr 1)\n assertEquals(BigInteger(\"-1\"), -a shr 2)\n\n assertEquals(BigInteger(\"2\"), 2.toBigInteger())\n assertEquals(BigInteger(\"-3\"), -3L.toBigInteger())","completion":"assertEquals(BigDecimal(\"2\"), a.toBigDecimal())\n assertEquals(BigDecimal(\"0.02\"), a.toBigDecimal(2))\n assertEquals(BigDecimal(\"2E+2\"), a.toBigDecimal(-2))<|endoftext|>"} {"prompt":"x.funNullableT()\n x.funNullableAny()\n }\n}\n\n\/\/ TESTCASE NUMBER: 9","completion":"fun case_9(x: MutableMap) = select(x.values.first(), x.keys.first())\n\nfun case_9() {\n val x = case_9(mutableMapOf(null to 10))\n\n if (x != null) {<|endoftext|>"} {"prompt":"fun box(): String {\n KlassA({})\n KlassB()\n return \"OK\"\n}\n\nclass KlassA(arg: (() -> Unit)?) {\n var func: (() -> Unit)? = arg\n init {\n if (func != null) {\n func()\n }\n }\n}","completion":"class KlassB {\n var func: (() -> Unit)?\n init {\n if (true) {\n func = {}\n func()\n } else {\n func = null\n }\n }\n}<|endoftext|>"} {"prompt":"0x3da5fd7fe1796495UL, 0x0UL, 0x0UL, 0x0UL, \n 0x0UL, 0x0UL, 0x3da5fd7fe1796495UL, 0x3da5fd7fe1796495UL,","completion":"0x0UL, 0x0UL, 0x0UL, 0x0UL, \n 0x3ff0000000000000UL, 0x3ff000000000afecUL, 0x3feffffffffea028UL, 0x3fe0000000000000UL,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.declarations.IrClass\nimport org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin\nimport org.jetbrains.kotlin.ir.declarations.IrSimpleFunction\nimport org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol\nimport org.jetbrains.kotlin.ir.types.*","completion":"import org.jetbrains.kotlin.ir.util.defaultType\nimport org.jetbrains.kotlin.ir.util.functions\nimport org.jetbrains.kotlin.ir.util.isClass\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.types.Variance<|endoftext|>"} {"prompt":"serializer(typeOf()).checkSerialName(\"custom|Container.NestedEnumWithCustomCl\")?.let { return it }\n \/\/ generated serializer used in lookup for the empty module in case of specifying of @file:UseContextualSerialization or @UseSerializers","completion":"serializer(typeOf()).checkSerialName(\"EnumWithUseContextual\")?.let { return it }\n \/\/ generated serializer used in lookup for the empty module in case of specifying of @file:UseContextualSerialization or @UseSerializers<|endoftext|>"} {"prompt":"\/\/ No error, even while `Final` belongs to a different module and \"equals\" contract might be changed without re-compilation\n \/\/ But since we had such behavior in FE1.0, it might be too strict to prohibit it now, especially once there's a lot of cases\n \/\/ when different modules belong to a single project, so they're totally safe (see KT-50534)\n takeIntFinal(x)\n }","completion":"if (x === y) {\n takeIntFinal(x) \/\/ OK\n }\n}\n\nfun testBase(x: Base<*>, y: Base) {\n if (x == y) {\n takeIntBase(x) \/\/ Error\n }\n if (x === y) {\n takeIntBase(x) \/\/ OK<|endoftext|>"} {"prompt":"N()\n }\n }\n \"\"\"\n )\n\n @Test\n fun testOpenOverrideInferredToAgree() = check(\n \"\"\"\n import androidx.compose.runtime.Composable\n import androidx.compose.runtime.ComposableTarget\n\n @Composable @ComposableTarget(\"N\") fun N() { }","completion":"@Composable @ComposableTarget(\"M\") fun M() { }\n\n abstract class Base {\n @Composable @ComposableTarget(\"N\") abstract fun Compose()\n }\n\n class Invalid : Base() {\n @Composable override fun Compose() {\n N()\n }\n }\n \"\"\")\n}<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL\n\n\/\/ MODULE: m1\n\/\/ FILE: a.kt\npackage p\n\npublic interface B {\n public fun String.getParent(): B?\n}\n\n\/\/ MODULE: m2(m1)\n\/\/ FILE: b.kt\npackage p\n\npublic class C : B {","completion":"override fun String.getParent(): B? = null\n\n}\n\n\/\/ MODULE: m3\n\/\/ FILE: b.kt\npackage p\n\npublic interface B {\n public fun String.getParent(): B?\n}\n\n\/\/ MODULE: m4(m3, m2)\n\/\/ FILE: c.kt\nimport p.*\n\nfun B.test() {\n if (this is C) {<|endoftext|>"} {"prompt":"\n\n@file:\n@file:\n\n@Target(AnnotationTarget.FILE)\nannotation class \n\n@Target(AnnotationTarget.FILE)\nannotation class \n\nfun box(): String? {","completion":"if (!checkFileAnnotations(\"\", listOf(\"\", \"\"))) return null\n if (!checkClassName(::class, \"\")) return null<|endoftext|>"} {"prompt":"val questionMark = if (hasDefaultValue && couldBeOptional) \"?\" else \"\"\n return \"$name$questionMark: ${type.toTypeScript(indent)}\"\n }\n\n private fun IrClass.asNestedClassAccess(): String {\n val name = getJsNameOrKotlinName().identifier\n if (parent !is IrClass) return name","completion":"return \"${parentAsClass.asNestedClassAccess()}.$name\"\n }\n\n private fun ExportedType.toTypeScript(indent: String, isInCommentContext: Boolean = false): String = when (this) {\n is ExportedType.Primitive -> typescript\n is ExportedType.Array -> \"Array<${elementType.toTypeScript(indent, isInCommentContext)}>\"<|endoftext|>"} {"prompt":"var ts = A(Array(2, {it}), IntArray(3)).toString()\n if(ts != \"A(x=[0, 1], y=[0, 0, 0])\") return ts\n\n ts = A(null, IntArray(3)).toString()\n if(ts != \"A(x=null, y=[0, 0, 0])\") return ts","completion":"ts = A(null, null).toString()\n if(ts != \"A(x=null, y=null)\") return ts\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"expression.transformChildren(this, data)\n\n if (expression.superQualifierSymbol == null && expression.symbol.owner.isOverridable)\n ++callSitesCount\n val devirtualizedCallSite = devirtualizedCallSites[expression] ?: return expression\n val possibleCallees = devirtualizedCallSite.possibleCallees.groupBy {","completion":"if (it.receiverType is DataFlowIR.Type.External) return expression\n it.callee as? DataFlowIR.FunctionSymbol.Declared ?: return expression\n }.entries.map { entry ->\n entry.key to entry.value.map { it.receiverType as DataFlowIR.Type.Declared }.distinct()\n }<|endoftext|>"} {"prompt":"sourceModule.getModuleDescriptor(it)\n }\n\n val diagnosticsReporter = DiagnosticReporterFactory.createPendingReporter()\n generateKLib(\n sourceModule,\n outputKlibPath,\n nopack = arguments.irProduceKlibDir,\n jsOutputName = arguments.irPerModuleOutputName,\n icData = icData,","completion":"moduleFragment = moduleFragment,\n diagnosticReporter = diagnosticsReporter,\n builtInsPlatform = if (arguments.wasm) BuiltInsPlatform.WASM else BuiltInsPlatform.JS,\n wasmTarget = if (!arguments.wasm) null else arguments.wasmTarget?.let(WasmTarget::fromName)\n )<|endoftext|>"} {"prompt":"assertEquals(\"[63]zoo(42)bar{31}foo;[12]abc(34)def{56}ghi;{99}xyz[88]xyz(77)xyz;\", s)\n s = regex.replace(target, repl)","completion":"assertEquals(\"[63]zoo(42)bar{31}foo;[56]ghi(34)def{12}abc;{99}xyz[88]xyz(77)xyz;\", s)\n }\n\n @Test fun testEscapeReplace() {\n val target: String\n val pattern: String\n var repl: String\n var s: String<|endoftext|>"} {"prompt":"class TestX : IFoo> {\n override fun foo(): X = X(\"O\")\n override fun bar(): X = X(\"K\")\n}\n\nfun box(): String {\n val t: IFoo> = TestX()\n val tFoo: Any = t.foo()\n if (tFoo !is X<*>) {","completion":"throw AssertionError(\"X expected: $tFoo\")\n }\n\n return (t.foo() as X<*>).x.toString() + t.bar().x.toString()\n}<|endoftext|>"} {"prompt":"internal val _delegate: ClassBuilder\n ) : DelegatingClassBuilder() {\n\n override fun getDelegate() = _delegate\n\n private lateinit var classInternalName: String\n\n private val signatures = MultiMap.createLinked()","completion":"override fun defineClass(origin: PsiElement?, version: Int, access: Int, name: String, signature: String?, superName: String, interfaces: Array) {\n classInternalName = name\n super.defineClass(origin, version, access, name, signature, superName, interfaces)\n }<|endoftext|>"} {"prompt":"if (e != null || this.e != null) this.e.propNullableT","completion":"if (e != null || this.e != null) this.e.propNullableAny<|endoftext|>"} {"prompt":"val moduleId = getUserVisibleModuleId(deserializer)\n if (moduleId in excludedModuleIds) return@mapNotNull null\n\n val module = ResolvedDependency(\n id = moduleId,\n \/\/ TODO: support extracting all the necessary details for non-Native libs: selectedVersion, requestedVersions, artifacts\n selectedVersion = ResolvedDependencyVersion.EMPTY,","completion":"\/\/ Assumption: As we don't know for sure which modules the source code module depends on directly and which modules\n \/\/ it depends on transitively, so let's assume it depends on all modules directly.\n requestedVersionsByIncomingDependencies = hashMapOf(\n ResolvedDependencyId.DEFAULT_SOURCE_CODE_MODULE_ID to ResolvedDependencyVersion.EMPTY\n ),<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.resolve.jvm.checkers\n\nimport org.jetbrains.kotlin.descriptors.CallableMemberDescriptor\nimport org.jetbrains.kotlin.descriptors.ClassDescriptor\nimport org.jetbrains.kotlin.descriptors.DeclarationDescriptor","completion":"import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor\nimport org.jetbrains.kotlin.lexer.KtTokens\nimport org.jetbrains.kotlin.load.java.descriptors.JavaMethodDescriptor\nimport org.jetbrains.kotlin.psi.KtDeclaration<|endoftext|>"} {"prompt":"fun List.asTestFunctionContainers(): List {\n return mapNotNull { fragment ->\n fragment.testEnvironment?.let {\n JsTestFunctionTransformer.TestFunctionContainer(\n fragment.packageFqn,\n fragment.nameBindings.getTestFunctionBySignature(it.testFunctionTag),","completion":"fragment.nameBindings.getSuiteFunctionBySignature(it.suiteFunctionTag)\n )\n }\n }\n}\n\nfun CachedTestFunctionsWithTheirPackage.asTestFunctionContainers(\n suiteFunction: String?,\n nameBindings: Map\n): List {<|endoftext|>"} {"prompt":"private val annotationDiffs = ArrayList()\n private val innerClassesDiffs = ArrayList()\n private val methodListDiffs = ArrayList()\n private val fieldListDiffs = ArrayList()\n private val metadataDiffs = ArrayList()\n\n private val methodReports = ArrayList()","completion":"private val fieldReports = ArrayList()\n\n private var classMetadataReport: ClassMetadataReport? = null\n private var fileFacadeMetadataReport: PackageMetadataReport? = null\n private var multiFileClassFacadeMetadataReport: MultiFileClassFacadeMetadataReport? = null\n private var multiFileClassPartMetadataReport: MultiFileClassPartMetadataReport? = null<|endoftext|>"} {"prompt":"@Test\n fun testClosingCache() {\n cache.close()\n\n assertTrue(cacheDir.resolve(\"java-cache.bin\").exists())\n assertTrue(cacheDir.resolve(\"apt-cache.bin\").exists())\n }\n\n @Test\n fun testMentionedTypes() {\n SourceFileStructure(File(\"Mentioned.java\").toURI()).also {","completion":"it.addDeclaredType(\"test.Mentioned\")\n cache.javaCache.addSourceStructure(it)\n compiledSources.single().resolve(\"test\/Mentioned.class\").createNewFile()\n }\n SourceFileStructure(File(\"Src.java\").toURI()).also {\n it.addDeclaredType(\"test.Src\")<|endoftext|>"} {"prompt":"if (project.kotlinNativeToolchainEnabled) {\n kotlinNativeBundleBuildService.get().prepareKotlinNativeBundle(\n project,\n kotlinNativeCompilerConfiguration,\n kotlinNativeVersion,\n bundleDir.asFile,\n reinstallFlag,\n konanTargets,\n overriddenKonanHome.orNull\n )\n }","completion":"kotlinNativeVersion\n }\n\n @get:Input\n val kotlinNativeDependencies: Provider> =\n kotlinNativeBundleVersion\n .zip(bundleDirectory) { _, bundleDir ->\n if (project.kotlinNativeToolchainEnabled && enableDependenciesDownloading) {\n kotlinNativeBundleBuildService.get()<|endoftext|>"} {"prompt":"return !(this@case_6_2 !is Number || this@case_6_2 !is Int || this@case_6_2 == null)\n}\ninline fun T?.case_6_3(): Boolean? {","completion":"contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) }<|endoftext|>"} {"prompt":"if (DescriptorAsmUtil.getVisibilityAccessFlag(descriptor) == Opcodes.ACC_PRIVATE) return false\n\n if (!state.classBuilderMode.generateBodies) return true\n\n if (shouldGeneratePartHierarchy) {\n if (descriptor !is PropertyDescriptor || !descriptor.isConst) return false\n }\n\n return true","completion":"}\n\n private fun addDelegateGenerationTaskIfNeeded(callable: MemberDescriptor, task: () -> Unit) {\n if (shouldGenerateInFacade(callable)) {\n delegateGenerationTasks[callable] = task\n }\n }\n\n private fun generateDelegatesToPreviouslyCompiledParts() {\n if (compiledPackageFragment == null) return<|endoftext|>"} {"prompt":"baz(a, 1)\n baz(a, w)\n baz(a, \"\")\n }\n }","completion":"generate {\n if (a is B) {\n baz(a, 1)\n }\n\n if (a is B) {<|endoftext|>"} {"prompt":"lhsIsNotNullNode.mergeIncomingFlow { path, flow ->\n getLhsVariable(path)?.let { flow.commitOperationStatement(it notEq null) }\n }\n rhsEnterNode.mergeIncomingFlow { path, flow ->\n getLhsVariable(path)?.let { flow.commitOperationStatement(it eq null) }\n }\n }","completion":"fun exitElvis(elvisExpression: FirElvisExpression, isLhsNotNull: Boolean, callCompleted: Boolean) {\n val node = graphBuilder.exitElvis(isLhsNotNull, callCompleted)\n node.mergeIncomingFlow { path, flow ->\n \/\/ If LHS is never null, then the edge from RHS is dead and this node's flow already contains<|endoftext|>"} {"prompt":"\/**\n * Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range\n * from [start] to [end] in case of a positive [step], or from [end] to [start] in case of a negative\n * [step].\n *\n * No validation on passed parameters is performed. The given parameters should satisfy the condition:\n *","completion":"* - either `step > 0` and `start <= end`,\n * - or `step < 0` and `start >= end`.\n *\n * @param start first element of the progression\n * @param end ending bound for the progression\n * @param step increment, or difference of successive elements in the progression\n * @return the final element of the progression\n * @suppress\n *\/\n@PublishedApi<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: WASM\n\n\/\/ RUN_THIRD_PARTY_OPTIMIZER\n\/\/ WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 14_072\n\/\/ WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 5_170\n\/\/ WASM_OPT_EXPECTED_OUTPUT_SIZE: 4_108","completion":"fun box() = \"OK\"<|endoftext|>"} {"prompt":"throw RuntimeException(result)\n }\n\n a = suspendHere(\"cde\")\n if (a != \"cde#3\") {\n result = \"fail 2: $a\"\n throw RuntimeException(result)\n }\n\n a = suspendHere(i = 6)\n if (a != \"abc#7\") {\n result = \"fail 3: $a\"\n throw RuntimeException(result)","completion":"}\n\n a = suspendHere(\"xyz\", 9)\n if (a != \"xyz#10\") {\n result = \"fail 4: $a\"\n throw RuntimeException(result)\n }\n }\n\n return result\n}<|endoftext|>"} {"prompt":"val extension_generic_fun = funT.(t: T): T = null!!","completion":"fun fun_with_where() = fun T.(t: T): T where T: A = null!!\n\n\nfun outer() {<|endoftext|>"} {"prompt":"override fun signature(index: Int): ByteArray = klib.signature(index, fileIndex)\n override fun string(index: Int): ByteArray = klib.string(index, fileIndex)\n override fun body(index: Int): ByteArray = klib.body(index, fileIndex)\n override fun debugInfo(index: Int): ByteArray? = klib.debugInfo(index, fileIndex)","completion":"}\n\nfun IrLibraryFile.deserializeFqName(fqn: List): String =\n fqn.joinToString(\".\", transform = ::string)\n\nfun IrLibraryFile.createFile(module: IrModuleFragment, fileProto: ProtoFile): IrFile {\n val fileName = fileProto.fileEntry.name<|endoftext|>"} {"prompt":"@ThreadLocal\nclass Person1(val name: String) {\n var surname: String? = null\n @ThreadLocal\n val extraInfo: Information = object : Information() {\n override var field: String = \"extra info\"\n }\n}","completion":"@ThreadLocal\nval extraInfo: Information = object : Information() {\n override var field: String = \"extra info\"\n}\n\n@ThreadLocal\nval point1 = Point(1.0, 1.0)\n\n@ThreadLocal\nval cornerPoint: Point\n get() = point1\n\n@ThreadLocal<|endoftext|>"} {"prompt":"buildJdk = jdkVersion.location\n ) {\n build(\"assembleDebug\")\n\n val modifiedSrc = subProject(\"app\").kotlinSourcesDir().resolve(\"com\/example\/getSomething.kt\")\n modifiedSrc.writeText(\n \/\/language=kt\n \"\"\"\n package com.example\n\n fun getSomething() = 10\n \"\"\".trimIndent()\n )","completion":"build(\"assembleDebug\", buildOptions = buildOptions.copy(logLevel = LogLevel.DEBUG)) {\n val affectedKotlinFiles = listOf(\n \"app\/src\/main\/kotlin\/com\/example\/KotlinActivity1.kt\",\n \"app\/src\/main\/kotlin\/com\/example\/getSomething.kt\",\n )\n val affectedJavaFiles = listOf(<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.util\n\nimport org.jetbrains.kotlin.descriptors.DeclarationDescriptor\n\ninterface ModuleVisibilityHelper {\n fun isInFriendModule(what: DeclarationDescriptor, from: DeclarationDescriptor): Boolean\n\n object EMPTY: ModuleVisibilityHelper {","completion":"override fun isInFriendModule(what: DeclarationDescriptor, from: DeclarationDescriptor) = true\n }\n}<|endoftext|>"} {"prompt":"* type-system, type-contexts-and-scopes, inner-and-nested-type-contexts -> paragraph 1 -> sentence 2\n * declarations, classifier-declaration, data-class-declaration -> paragraph 1 -> sentence 2\n * SECONDARY LINKS: declarations, classifier-declaration, class-declaration -> paragraph 2 -> sentence 2\n * NUMBER: 2","completion":"* DESCRIPTION: Primary constructor for nested class with regular constructor parameter\n *\/\n\n\/\/ TESTCASE NUMBER: 1\ndata class A(x: Any?)\ndata class B(x: Any)<|endoftext|>"} {"prompt":"CompressedPointsToGraph(compressedEdges.toTypedArray()),\n escapingNodes.toTypedArray()\n )\n }\n\n private fun buildDrains() {\n \/\/ TODO: This is actually conservative. If a field is being read of some node,\n \/\/ then here it is assumed that it might also be being read from any node reachable","completion":"\/\/ by assignment edges considering them undirected. But in reality it is enough to just\n \/\/ merge two sets: reachable by assignment edges and reachable by reversed assignment edges.\n \/\/ But, there will be a downside - drains will have to be created for each field access,\n \/\/ thus increasing the graph size significantly.\n val visited = mutableSetOf()<|endoftext|>"} {"prompt":"private val loopInfo = Stack()\n private val blockScopes = Stack()\n private val elementToLoopInfo = HashMap()\n private val elementToSubroutineInfo = HashMap()\n private var labelCount = 0\n\n private val builders = Stack()","completion":"private val allBlocks = Stack()\n\n private fun pushBuilder(scopingElement: KtElement, subroutine: KtElement, shouldInline: Boolean) {\n val worker = ControlFlowInstructionsGeneratorWorker(scopingElement, subroutine, shouldInline)\n builders.push(worker)\n builder = worker\n }<|endoftext|>"} {"prompt":"\/\/ and the iterator's type parameter has enhanced nullability information (either explicit or implicit). Therefore we need\n \/\/ to traverse the initializer to find the `next()` or `componentN()` call. Example:\n \/\/\n \/\/ \/\/ In Java:\n \/\/ public static Collection<@NotNull String> collection() { \/* ... *\/ }\n \/\/\n \/\/ \/\/ In Kotlin:","completion":"\/\/ for ((i, s) in JavaClass.collection().withIndex()) {\n \/\/ println(\"$i: ${s.toUpperCase()}\") \/\/ NOTE: `s` is not nullable\n \/\/ }\n \/\/\n \/\/ The variable declaration for `s` looks like this:\n \/\/<|endoftext|>"} {"prompt":"3017, 3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032,\n 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3044, 3045, 3046, 3047, 3048,","completion":"3049, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 3057, 3058, 3059, 3060, 3061, 3062, 3063, 3064,\n 3065, 3066, 3067, 3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 3080,<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION\n\/\/ SKIP_TXT\n\n\/*\n * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)\n *","completion":"* SPEC VERSION: 0.1-280\n * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-with-named-parameters -> paragraph 1 -> sentence 2\n * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-named-parameters -> paragraph 2 -> sentence 1\n * NUMBER: 2<|endoftext|>"} {"prompt":"\/\/ cache[resourceId] ?: findViewById(resourceId)?.also { cache[resourceId] = it }\n +irReturn(irElvis(returnType, irCallOp(mapGet.symbol, returnType, irGet(cache), irGet(resourceId))) {\n irSafeLet(returnType, irFindViewById(irGet(self), irGet(resourceId), containerType)) { foundView ->","completion":"irBlock {\n +irCall(mapSet.symbol).apply {\n dispatchReceiver = irGet(cache)\n putValueArgument(0, irGet(resourceId))\n putValueArgument(1, irGet(foundView))\n }\n +irGet(foundView)\n }\n }\n })\n }\n }\n }<|endoftext|>"} {"prompt":"deserializeCompositeBlock(proto.compositeBlock)\n }\n\n JsAstProtoBuf.Statement.StatementCase.LABEL -> {\n val labelProto = proto.label\n JsLabel(deserializeName(labelProto.nameId), deserialize(labelProto.innerStatement))\n }","completion":"JsAstProtoBuf.Statement.StatementCase.IF_STATEMENT -> {\n val ifProto = proto.ifStatement\n JsIf(\n deserialize(ifProto.condition),\n deserialize(ifProto.thenStatement),\n if (ifProto.hasElseStatement()) deserialize(ifProto.elseStatement) else null\n )\n }<|endoftext|>"} {"prompt":"val wrapper = inputStream.decodingWith(Base64)\n\n wrapper.use {\n assertEquals('f'.code, it.read())\n assertEquals(-1, it.read())\n assertEquals(-1, it.read())\n\n \/\/ in the wrapped IS the chars after the padding are not consumed\n assertContentEquals(\"Zg==\".toByteArray(), inputStream.readBytes())\n }","completion":"assertFailsWith {\n wrapper.read()\n }\n }\n\n\n @Test\n fun correctPaddingMime() {\n val inputStream = \"Zg==Zg==\".byteInputStream()\n val wrapper = inputStream.decodingWith(Base64.Mime)\n\n wrapper.use {\n assertEquals('f'.code, it.read())<|endoftext|>"} {"prompt":"createClassTypeRefWithSourceKind: (KtFakeSourceElementKind) -> FirTypeRef,\n createParameterTypeRefWithSourceKind: (FirProperty, KtFakeSourceElementKind) -> FirTypeRef,\n toFirSource: (TBase?, KtFakeSourceElementKind) -> KtSourceElement?,\n addValueParameterAnnotations: FirValueParameterBuilder.(TParameter) -> Unit,","completion":"isVararg: (TParameter) -> Boolean,\n): FirSimpleFunction {\n fun generateComponentAccess(\n parameterSource: KtSourceElement?,\n firProperty: FirProperty,\n classTypeRefWithCorrectSourceKind: FirTypeRef,\n firPropertyReturnTypeRefWithCorrectSourceKind: FirTypeRef,\n ) =\n buildPropertyAccessExpression {\n this.source = parameterSource<|endoftext|>"} {"prompt":"}\n else -> FirErrors.USAGE_IS_NOT_INLINABLE\n }\n reporter.reportOn(argument.source, factory, valueParameterOfOriginalInlineFunction, context)\n }\n }\n }\n\n private fun checkReceiver(\n qualifiedAccessExpression: FirQualifiedAccessExpression,\n receiverExpression: FirExpression?,","completion":"targetSymbol: FirBasedSymbol<*>?,\n context: CheckerContext,\n reporter: DiagnosticReporter,\n ) {\n if (receiverExpression == null) return\n val receiverSymbol =\n receiverExpression.unwrapErrorExpression()?.toResolvedCallableSymbol(session) as? FirValueParameterSymbol ?: return<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\nopen class A\nopen class B: A()\n\nopen class Base\nclass SubBase: Base()\n\n\/\/ f is SubBase => (SubBase <: Base) f is Base => (B <: A, Base => SubBase <: Base) f is Base","completion":"fun test(f: SubBase) = f is Base<|endoftext|>"} {"prompt":"* The operation is _intermediate_ and _stateful_.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n *\/\npublic inline fun > Sequence.sortedBy(crossinline selector: (T) -> R?): Sequence {\n return sortedWith(compareBy(selector))\n}\n\n\/**","completion":"* Returns a sequence that yields elements of this sequence sorted descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * The operation is _intermediate_ and _stateful_.\n *\/<|endoftext|>"} {"prompt":"for (statement in expression.statements.subListWithoutLast(if (resultIsUsed) 1 else 0)) {\n val call = getFunctionCallOrNull(statement) ?: continue\n val node = replacements.getRootMfvcNodeOrNull(call.type.erasedUpperBound) ?: continue\n if (node.boxMethod == call.symbol.owner &&","completion":"List(call.valueArgumentsCount) { call.getValueArgument(it) }.all { it.isRepeatableGetter() }\n ) {\n statementsToRemove.add(statement)\n }\n }\n expression.statements.removeIf { it in statementsToRemove }\n }\n }, false)\n }\n}<|endoftext|>"} {"prompt":"}\n }\n\n for (file in sourceFiles) {\n val fileTranslationData = serializer.translationData(file)\n\n val packagePart =\n serializeScope(bindingTrace.bindingContext, moduleDescriptor, file.packageFqName, fileTranslationData.memberScope)\n\n val ioFile = VfsUtilCore.virtualToIoFile(file.virtualFile)","completion":"incrementalResults?.processPackagePart(\n ioFile,\n packagePart.toByteArray(),\n fileTranslationData.binaryAst ?: ByteArray(0),\n fileTranslationData.inlineData ?: ByteArray(0)\n )\n }\n\n val settings = config.configuration.languageVersionSettings<|endoftext|>"} {"prompt":"else -> defaultType\n }\n }\n\n private fun convert(typeReference: KtTypeReference?, substitutions: SubstitutionMap): JCTree.JCExpression {\n val type = typeReference?.typeElement ?: return defaultType\n return convert(type, substitutions)\n }\n\n private fun convert(type: SimpleType): JCTree.JCExpression {","completion":"\/\/ TODO now the raw Java type is returned. In future we need to properly convert all type parameters\n return treeMaker.Type(KaptTypeMapper.mapType(type))\n }\n\n private fun convertUserType(type: KtUserType, substitutions: SubstitutionMap): JCTree.JCExpression {<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\nfun takeFnToAny(fn: () -> Any) {}\nfun takeFnToUnit(fn: () -> Unit) {}\nfun

takeFnToParameter(fn: () -> P) {}\n\nfun testAny() {\n takeFnToAny { }\n takeFnToAny { Unit }","completion":"takeFnToAny { unresolved() }\n takeFnToAny { if (true) unresolved() }<|endoftext|>"} {"prompt":"TypeUtils.createSubstitutedSupertype(this, it, TypeSubstitutor.create(this))\n }\n}\n\nfun KotlinType.asTypeProjection(): TypeProjection = TypeProjectionImpl(this)\nfun KotlinType.contains(predicate: (UnwrappedType) -> Boolean) = TypeUtils.contains(this, predicate)","completion":"fun KotlinType.replaceArgumentsWithStarProjections() = replaceArgumentsByParametersWith(::StarProjectionImpl)\nfun KotlinType.replaceArgumentsWithNothing() = replaceArgumentsByParametersWith { it.builtIns.nothingType.asTypeProjection() }<|endoftext|>"} {"prompt":"override fun visitBreak(x: JsBreak) { }\n\n override fun visitContinue(x: JsContinue) { }\n\n override fun visit(x: JsVars.JsVar) {\n val initializer = x.initExpression\n if (initializer != null) {\n accept(initializer)\n }\n }","completion":"override fun visitNameRef(nameRef: JsNameRef) {\n super.visitNameRef(nameRef)\n val name = nameRef.name\n if (name != null && nameRef.qualifier == null) {\n references.add(name)\n }\n }\n\n override fun visitFunction(x: JsFunction) {\n references += x.collectFreeVariables()<|endoftext|>"} {"prompt":"list1.add(i)\n if (list1.size > 23) break\n }\n if (list1 != listOf(3u, 4u, 5u)) {\n return \"Wrong elements for (1u + 2u)..(6u - 1u): $list1\"\n }\n\n val list2 = ArrayList()","completion":"val range2 = (1u.toUByte() + 2u.toUByte()).toUByte()..(6u.toUByte() - 1u.toUByte()).toUByte()\n for (i in range2) {\n list2.add(i)\n if (list2.size > 23) break\n }<|endoftext|>"} {"prompt":"context.symbolTable.descriptorExtension.referenceClass(context.getJsInternalClass(\"JsImplicitExport\"))\n\n \/\/ TODO move CharSequence-related stiff to IntrinsifyCallsLowering\n val charSequenceClassSymbol = context.symbolTable.descriptorExtension.referenceClass(context.getClass(FqName(\"kotlin.CharSequence\")))","completion":"val charSequenceLengthPropertyGetterSymbol by context.lazy2 {\n with(charSequenceClassSymbol.owner.declarations) {\n filterIsInstance().firstOrNull { it.name.asString() == \"length\" }?.getter ?:\n filterIsInstance().first { it.name.asString() == \"\" }\n }.symbol<|endoftext|>"} {"prompt":"return directExpansionType.fullyExpandedType(useSiteSession, expandedConeType)\n}\n\nfun ConeClassLikeType.directExpansionType(\n useSiteSession: FirSession,\n expandedConeType: (FirTypeAlias) -> ConeClassLikeType? = { alias ->\n alias.lazyResolveToPhase(FirResolvePhase.SUPER_TYPES)","completion":"alias.expandedConeType\n },\n): ConeClassLikeType? {\n if (this is ConeErrorType) return null\n val typeAliasSymbol = lookupTag.toSymbol(useSiteSession) as? FirTypeAliasSymbol ?: return null\n val typeAlias = typeAliasSymbol.fir\n\n val resultType = expandedConeType(typeAlias)<|endoftext|>"} {"prompt":"requireNotNull(atomicProperty.backingField) { \"The backing field of the atomic array [${atomicProperty.atomicfuRender()}] should not be null.\" + CONSTRAINTS_MESSAGE }\n val initializer = atomicArrayField.initializer?.expression\n if (initializer == null) {\n \/\/ replace field initialization in the init block","completion":"val initBlock = atomicArrayField.getInitBlockForField(parentContainer)\n \/\/ property initialization order in the init block matters -> transformed initializer should be placed at the same position\n val initExprWithIndex = initBlock.getInitExprWithIndexFromInitBlock(atomicArrayField.symbol)<|endoftext|>"} {"prompt":"BindingUtils.getClassDescriptor(context.bindingContext(), classDeclaration)\n\n private val delegationBySpecifiers =\n classDeclaration.superTypeListEntries.filterIsInstance()\n\n private class Field (val name: JsName, val generateField: Boolean)","completion":"private val fields = mutableMapOf()\n\n init {\n for (specifier in delegationBySpecifiers) {\n val expression = specifier.delegateExpression ?:\n throw IllegalArgumentException(\"delegate expression should not be null: ${specifier.text}\")<|endoftext|>"} {"prompt":"if (!(0.toByte() in 3..<1) != !range1.contains(0.toByte())) throw AssertionError()\n if (!(0.toByte() !in 3..<1) != range1.contains(0.toByte())) throw AssertionError()\n \/\/ no local optimizations","completion":"if (element4 in 3..<1 != range1.contains(element4)) throw AssertionError()\n if (element4 !in 3..<1 != !range1.contains(element4)) throw AssertionError()\n if (!(element4 in 3..<1) != !range1.contains(element4)) throw AssertionError()<|endoftext|>"} {"prompt":"privateVarTopLevel = 1\n\n publishedVar\n publishedVar = 1\n }\n\n @PublishedApi\n internal inline fun testInline() {\n publicFun()\n internalFun()","completion":"privateFun()\n\n publicVarTopLevel\n publicVarTopLevel = 1\n internalVarTopLevel<|endoftext|>"} {"prompt":"A(169), A(170), A(171), A(172), A(173), A(174), A(175), A(176), A(177), A(178), A(179), A(180),\n A(181), A(182), A(183), A(184), A(185), A(186), A(187), A(188), A(189), A(190), A(191), A(192),","completion":"A(193), A(194), A(195), A(196), A(197), A(198), A(199), A(200), A(201), A(202), A(203), A(204),\n A(205), A(206), A(207), A(208), A(209), A(210), A(211), A(212), A(213), A(214), A(215), A(216),<|endoftext|>"} {"prompt":"fun bar(s: S?) = when (s) {\n is Derived -> \"Derived\"\n null -> \"\"\n else -> TODO(\"What?!?!\")\n}\n\nfun baz(b: Boolean?) = when (b) {\n true -> 1\n false -> 0\n null -> -1\n \/\/ Still warning\n else -> TODO()\n}","completion":"fun baz(b: Boolean) = when (b) {\n true -> 1\n false -> 0\n \/\/ Still warning\n else -> TODO()\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler\nimport org.jetbrains.kotlin.test.frontend.classic.handlers.OldNewInferenceMetaInfoProcessor\nimport org.jetbrains.kotlin.test.model.DependencyKind\nimport org.jetbrains.kotlin.test.model.FrontendKinds","completion":"import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerTest\nimport org.jetbrains.kotlin.test.services.AbstractEnvironmentConfigurator\nimport org.jetbrains.kotlin.test.services.LibraryProvider\nimport org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator<|endoftext|>"} {"prompt":"* @param cacheDir - the directory where the incremental cache updater will store its caches. [CacheUpdater] maintains the directory fully.\n * @param compilerInterfaceFactory - is a factory that creates an instance of the compiler used for building dirty files.\n *\n * The main public methods are:\n * [actualizeCaches] - performs the entire incremental compilation routine;","completion":"* [getDirtyFileLastStats] - retrieves stats about dirty files, explaining why the file has been marked as dirty (see [DirtyFileState]);\n * [getStopwatchLastLaps] - retrieves the durations of the incremental compilation subroutines;\n *\n * For a better understanding of what happens here, pay attention to [stopwatch] usages.<|endoftext|>"} {"prompt":"fun reportElement() = annotationEntry.typeArguments.singleOrNull() ?: annotationEntry\n\n if (parcelerClass.kind != ClassKind.OBJECT) {\n context.trace.report(ErrorsAndroid.PARCELER_SHOULD_BE_OBJECT.on(reportElement()))\n return\n }","completion":"fun KotlinType.fqName() = constructor.declarationDescriptor?.fqNameSafe\n val parcelerSuperType = parcelerClass.defaultType.supertypes().firstOrNull { it.fqName() == PARCELER_FQNAME } ?: return\n val expectedType = parcelerSuperType.arguments.singleOrNull()?.type ?: return<|endoftext|>"} {"prompt":"includedLibraryDescriptors: List,\n exportedDependencies: List,\n ): FqName {\n \/\/ Consider exported libraries only if we cannot infer the package from sources or included libs.\n return guessMainPackage(includedLibraryDescriptors + moduleDescriptor)\n ?: guessMainPackage(exportedDependencies)\n ?: FqName.ROOT","completion":"}\n\n private fun guessMainPackage(modules: List): FqName? {\n if (modules.isEmpty()) {\n return null\n }\n\n val allPackages = modules.flatMap {\n it.getPackageFragments() \/\/ Includes also all parent packages, e.g. the root one.\n }\n\n val nonEmptyPackages = allPackages<|endoftext|>"} {"prompt":"val deserializeOverridden = classDescriptor.unsubstitutedMemberScope\n .getContributedFunctions(LOAD_NAME, NoLookupLocation.FROM_BACKEND).singleOrNull {\n it.valueParameters.size == 1\n && it.overriddenDescriptors.isNotEmpty()\n && it.kind != CallableMemberDescriptor.Kind.SYNTHESIZED","completion":"} != null\n\n if (descriptorOverridden && serializeOverridden && deserializeOverridden) {\n val entry = classDescriptor.findAnnotationDeclaration(SerializationAnnotations.serializerAnnotationFqName)\n trace.report(EXTERNAL_SERIALIZER_USELESS.on(entry ?: declaration, classDescriptor.defaultType))\n return\n }<|endoftext|>"} {"prompt":"}\n\n companion object {\n fun from(pattern: MappingPattern, charCode: Int, categoryCode: String, mapping: Int): LuLtLlMappingPattern? {\n if (pattern is EqualDistanceMappingPattern\n && pattern.length == 1\n && pattern.categoryCode == \"Lu\"\n && pattern.mapping == 1\n ) {","completion":"val newPattern = LuLtLlMappingPattern(pattern.start, pattern.categoryCode, pattern.mapping)\n if (newPattern.append(charCode, categoryCode, mapping)) {\n return newPattern\n }\n }\n return null\n }\n }\n}<|endoftext|>"} {"prompt":"}\n }\n\n @GradleTestVersions(minVersion = TestVersions.Gradle.G_7_6)\n @GradleTest\n fun `test dependency on java testFixtures and feature source sets`(gradleVersion: GradleVersion) {\n project(\n \"kt-60053-dependencyOn-testFixtures\",\n gradleVersion,","completion":"localRepoDir = defaultLocalRepo(gradleVersion)\n ) {\n build(\"publish\")\n\n resolveIdeDependencies(\":consumer\") { dependencies ->\n val jvmMainDependencies = dependencies[\"jvmMain\"].filterIsInstance().assertMatches(\n kotlinStdlibDependencies,<|endoftext|>"} {"prompt":"val substitutedLambdaTypes = substituteFunctionLiteralDescriptor(lambda, descriptor, resultSubstitutor)\n\n val existingLambdaType = topLevelTrace.getType(ktArgumentExpression)\n\n if (existingLambdaType == null) {\n if (ktFunction is KtNamedFunction && ktFunction.nameIdentifier != null) return \/\/ it's a statement","completion":"throw AssertionError(\"No type for resolved lambda argument: ${ktArgumentExpression.text}\")\n }\n\n val substitutedFunctionalType = createFunctionType(\n builtIns,\n existingLambdaType.annotations,\n substitutedLambdaTypes.receiverType?.substitutedType,<|endoftext|>"} {"prompt":"val list1 = ArrayList()\n for (i in (MaxI - 5)..MaxI step 3) {\n list1.add(i)\n if (list1.size > 23) break\n }\n if (list1 != listOf(MaxI - 5, MaxI - 2)) {","completion":"return \"Wrong elements for (MaxI - 5)..MaxI step 3: $list1\"\n }\n\n val list2 = ArrayList()\n for (i in (MaxB - 5).toByte()..MaxB step 3) {\n list2.add(i)\n if (list2.size > 23) break\n }<|endoftext|>"} {"prompt":"noArgs {}\n noArgs() {}\n noArgs() \/\/ {}\n noArgs() \/* *\/ {}\n noArgs() \/*\n block comment, no new line","completion":"*\/ {}\n noArgs()\n \/*\n block comment with new line\n *\/\n {}\n noArgs() \/\/ comment\n \/\/ comment\n {}<|endoftext|>"} {"prompt":"ll.last\n ll.last()\n ll.removeFirst()\n ll.removeLast()","completion":"ll.reversed()\n\n al.addFirst(\"\")\n al.addLast(\"\")\n al.getFirst()\n al.first\n al.first()\n al.getLast()\n al.last\n al.last()<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.konan.test.blackbox\n\nimport org.jetbrains.kotlin.konan.test.blackbox.support.ClassLevelProperty\nimport org.jetbrains.kotlin.konan.test.blackbox.support.EnforcedProperty","completion":"import org.jetbrains.kotlin.konan.test.blackbox.support.TestCompilerArgs\nimport org.jetbrains.kotlin.konan.test.blackbox.support.compilation.ExistingDependency\nimport org.jetbrains.kotlin.konan.test.blackbox.support.compilation.ObjCFrameworkCompilation<|endoftext|>"} {"prompt":"recapturedParamInfo.functionalArgument = NonInlineArgumentForInlineSuspendParameter.INLINE_LAMBDA_AS_VARIABLE\n }\n capturedParamBuilder.addCapturedParam(recapturedParamInfo, recapturedParamInfo.newFieldName).remapValue =","completion":"StackValue.field(desc.type, oldObjectType, recapturedParamInfo.newFieldName, false, StackValue.LOCAL_0)\n allRecapturedParameters.add(desc)\n }\n }\n } else if (capturedLambdas.isNotEmpty()) {<|endoftext|>"} {"prompt":"final override fun visitEffectDeclaration(effectDeclaration: FirEffectDeclaration, data: D): FirContractElementDeclaration {\n return transformEffectDeclaration(effectDeclaration, data)\n }\n\n open fun transformContractDescription(contractDescription: FirContractDescription, data: D): FirContractDescription {\n return transformElement(contractDescription, data)\n }","completion":"final override fun visitContractDescription(contractDescription: FirContractDescription, data: D): FirContractDescription {\n return transformContractDescription(contractDescription, data)\n }\n\n open fun transformLegacyRawContractDescription(legacyRawContractDescription: FirLegacyRawContractDescription, data: D): FirContractDescription {\n return transformElement(legacyRawContractDescription, data)\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProviderInternals\nimport org.jetbrains.kotlin.fir.scopes.FirKotlinScopeProvider\nimport org.jetbrains.kotlin.fir.symbols.impl.*\nimport org.jetbrains.kotlin.fir.types.ConeTypeProjection","completion":"import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef\nimport org.jetbrains.kotlin.fir.types.constructClassType\nimport org.jetbrains.kotlin.fir.types.toLookupTag\nimport org.jetbrains.kotlin.library.KotlinLibrary<|endoftext|>"} {"prompt":"expectFailure(linkage(\"Constructor 'AnnotationClassWithChangedParameterType.' can not be called: No constructor found for symbol '\/AnnotationClassWithChangedParameterType.'\")) { getAnnotationClassWithChangedParameterTypeAsAnyInline() }\n expectSuccess(105) { getAnnotationClassThatBecomesRegularClass().x }","completion":"expectSuccess(106) { getAnnotationClassThatBecomesRegularClassInline().x }\n expectSuccess(\"AnnotationClassThatBecomesRegularClass[x=107]\") { getAnnotationClassThatBecomesRegularClassAsAny().toString() }\n expectSuccess(\"AnnotationClassThatBecomesRegularClass[x=108]\") { getAnnotationClassThatBecomesRegularClassAsAnyInline().toString() }<|endoftext|>"} {"prompt":"\/**\n * Converts this [Float] value to [Int].\n *\n * The fractional part, if any, is rounded down towards zero.\n * Returns zero if this `Float` value is `NaN`, [Int.MIN_VALUE] if it's less than `Int.MIN_VALUE`,\n * [Int.MAX_VALUE] if it's bigger than `Int.MAX_VALUE`.\n *\/","completion":"@kotlin.internal.IntrinsicConstEvaluation\n public override fun toInt(): Int =\n wasm_i32_trunc_sat_f32_s(this)\n\n \/**\n * Converts this [Float] value to [Long].\n *\n * The fractional part, if any, is rounded down towards zero.<|endoftext|>"} {"prompt":"x.propNullableT\n x.propNullableAny","completion":"x.funT()\n x.funAny()<|endoftext|>"} {"prompt":"},\n\n E4 {\n fun c() {\n this.B()\n\n C.A()\n A()\n \/\/TODO: should be resolved with error\n this.A()\n }\n };\n\n class A\n inner class B\n object O {\n object InO\n }\n}","completion":"fun f() {\n C.E1.A\n C.E1.A()\n C.E2.B()\n\n C.E2.O<|endoftext|>"} {"prompt":"val dependencySrcMetadata = dependencyCache.fetchSourceFileFullMetadata(dependencySrcFile)\n val oldSignatures = dependencySrcMetadata.inverseDependencies[libFile, srcFile] ?: emptySet()\n if (oldSignatures == newSignatures) {\n continue\n }","completion":"val newMetadata = addNewMetadata(dependencyLibFile, dependencySrcFile, dependencySrcMetadata)\n newMetadata.inverseDependencies[libFile, srcFile] = newSignatures.keys\n }\n }\n }\n\n private fun KotlinSourceFileMutableMap.addDependenciesWithRemovedInverseDependencies(<|endoftext|>"} {"prompt":"package kotlin.coroutines\n\n\/**\n * Marks coroutine context element that intercepts coroutine continuations.\n * The coroutines framework uses [ContinuationInterceptor.Key] to retrieve the interceptor and\n * intercepts all coroutine continuations with [interceptContinuation] invocations.\n *\n * [ContinuationInterceptor] behaves like a [polymorphic element][AbstractCoroutineContextKey], meaning that","completion":"* its implementation delegates [get][CoroutineContext.Element.get] and [minusKey][CoroutineContext.Element.minusKey]\n * to [getPolymorphicElement] and [minusPolymorphicKey] respectively.\n * [ContinuationInterceptor] subtypes can be extracted from the coroutine context using either [ContinuationInterceptor.Key]\n * or subtype key if it extends [AbstractCoroutineContextKey].\n *\/<|endoftext|>"} {"prompt":"import kotlin.script.experimental.host.ScriptingHostConfiguration\n\nclass ScriptingCompilerConfigurationExtension(\n val project: MockProject,\n val baseHostConfiguration: ScriptingHostConfiguration\n) : CompilerConfigurationExtension {\n\n override fun updateConfiguration(configuration: CompilerConfiguration) {","completion":"if (!configuration.getBoolean(ScriptingConfigurationKeys.DISABLE_SCRIPTING_PLUGIN_OPTION)) {\n\n val projectRoot = project.run { basePath ?: baseDir?.canonicalPath }?.let(::File)\n if (projectRoot != null) {\n configuration.put(<|endoftext|>"} {"prompt":"* @param V the type of map values. The map is covariant in its value type.\n *\/\npublic interface Map {\n \/\/ Query Operations\n \/**\n * Returns the number of key\/value pairs in the map.\n *\/\n public val size: Int\n\n \/**\n * Returns `true` if the map is empty (contains no elements), `false` otherwise.\n *\/","completion":"public fun isEmpty(): Boolean\n\n \/**\n * Returns `true` if the map contains the specified [key].\n *\/\n public fun containsKey(key: K): Boolean\n\n \/**\n * Returns `true` if the map maps one or more keys to the specified [value].\n *\/\n public fun containsValue(value: @UnsafeVariance V): Boolean\n\n \/**<|endoftext|>"} {"prompt":"\/\/ the user is required to provide an explicit override of such a property in a non-abstract subclass.\n \/\/ See: compiler\/testData\/diagnostics\/tests\/varOverriddenByValThroughIntersection.kt.\n val key = mostSpecific.find { it is FirPropertySymbol && it.isVar } as? S ?: mostSpecific.first() as S\n val keyFir = key.fir","completion":"val callableId = CallableId(dispatchReceiverType.classId ?: keyFir.dispatchReceiverClassLookupTagOrNull()?.classId!!, keyFir.name)\n val newSymbol = createIntersectionOverrideSymbol(callableId, overrides, containsMultipleNonSubsumed)\n val deferredReturnTypeCalculation = deferredReturnTypeCalculationOrNull(mostSpecific)<|endoftext|>"} {"prompt":"fun poll74(): Flow {\n return flow {\n val inv = ::bar5!!\n inv\n }\n}\n\nfun poll75(): Flow {\n return flow {","completion":"val inv = ::Foo6!!\n inv\n }\n}\n\nfun poll76(): Flow {\n return flow {<|endoftext|>"} {"prompt":"override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =\n K2JSCompilerArguments().apply {\n libraries = \"build\/js-ir-runtime\/full-runtime.klib\"\n outputDir = destinationDir.path\n moduleName = testDir.name\n sourceMap = false\n irProduceKlibDir = false","completion":"irProduceKlibFile = true\n irOnly = true\n languageVersion = \"1.9\"\n }\n\n override val buildLogFinder: BuildLogFinder\n get() = super.buildLogFinder.copy(\n isFirEnabled = false,\n isKlibEnabled = true,\n isJsEnabled = true,<|endoftext|>"} {"prompt":"return obj1 === obj2 && (obj1 !== 0 || 1.asDynamic() \/ obj1 === 1.asDynamic() \/ obj2)\n }\n return obj1 === obj2\n}\n\ninternal fun toString(o: dynamic): String = when {\n o == null -> \"null\"\n isArrayish(o) -> \"[...]\"","completion":"jsTypeOf(o.toString) != \"function\" -> anyToString(o)\n else -> (o.toString)().unsafeCast()\n}\n\ninternal fun anyToString(o: dynamic): String = js(\"Object\").prototype.toString.call(o)\n\ninternal fun hashCode(obj: dynamic): Int {\n if (obj == null) return 0<|endoftext|>"} {"prompt":"open var onupdatefound: ((Event) -> Unit)?\n open val APISpace: JsAny?\n fun update(): Promise\n fun unregister(): Promise\n fun showNotification(title: String, options: NotificationOptions = definedExternally): Promise\n fun getNotifications(filter: GetNotificationOptions = definedExternally): Promise>","completion":"fun methodName(): Promise\n}\n\n\/**\n * Exposes the JavaScript [ServiceWorkerContainer](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/ServiceWorkerContainer) to Kotlin\n *\/\npublic external abstract class ServiceWorkerContainer : EventTarget, JsAny {\n open val controller: ServiceWorker?\n open val ready: Promise<|endoftext|>"} {"prompt":"|For the Cinterop task, either the `definitionFile` or `packageName` parameter must be specified, however, neither has been provided.\n |\n |More info here: https:\/\/kotlinlang.org\/docs\/multiplatform-dsl-reference.html#cinterops \n \"\"\".trimMargin()\n )\n }\n }\n }","completion":"@DisplayName(\"KT-62800: check that optional .def file in cinterop works well with configuration cache\")\n @GradleTestVersions(minVersion = TestVersions.Gradle.G_8_1) \/\/ Gradle supports checking file existence with configuration cache only since 8.1 version\n @GradleTest\n fun cinteropWithOptionalDefFileAndConfigurationCache(gradleVersion: GradleVersion) {\n nativeProject(<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.utils.*\nimport org.jetbrains.kotlin.gradle.utils.lowerCamelCaseName\nimport org.jetbrains.kotlin.gradle.utils.named\nimport org.jetbrains.kotlin.gradle.utils.newInstance\n\n\/**","completion":"* Creates an adhoc\/external Kotlin Target which can be maintained and evolved outside the kotlin.git repository.\n * The target will be created adhering to the configuration provided by the [descriptor].\n * The instance will be backed by an internal implementation of [KotlinTarget]\n * The instance will be created using the [ExternalKotlinTargetDescriptor.targetFactory] which will have to inject the backing<|endoftext|>"} {"prompt":"@DisplayName(\"UTD with adding and removing target\")\n @GradleTest\n fun testUTDTargetAdded(gradleVersion: GradleVersion) {\n nativeProjectWithCocoapodsAndIosAppPodFile(gradleVersion = gradleVersion) {\n buildGradleKts.addPod(defaultPodName, produceGitBlock())\n\n testImport()","completion":"buildGradleKts.addCocoapodsBlock(\"osx.deploymentTarget = \\\"10.15\\\"\")\n testImport()\n\n val tasks = listOf(\n podspecTaskName,\n defaultPodGenTaskName,\n defaultSetupBuildTaskName,\n defaultBuildTaskName,\n defaultCinteropTaskName\n )\n val anotherTarget = \"MacosX64\"<|endoftext|>"} {"prompt":"* [destination] should be either a path to the directory under [tmpdir], or a path to the resulting .jar file (also under [tmpdir]).\n * Kotlin sources are compiled first, and there should be no errors or warnings. Java sources are compiled next.\n *\n * @return [destination]\n *\/\n protected fun compileLibrary(\n libraryName: String,","completion":"destination: File = File(tmpdir, \"$libraryName.jar\"),\n additionalOptions: List = emptyList(),\n compileJava: (sourceDir: File, javaFiles: List, outputDir: File) -> Boolean = { _, javaFiles, outputDir ->\n KotlinTestUtils.compileJavaFiles(javaFiles, listOf(\"-d\", outputDir.path))\n },<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1287\npackage foo\n\nval r = \"OK\"\n\nfun simple(s: String? = null): String {\n if (s != null) return s\n\n return myRun {\n simple(\"OK\")\n }\n}\n\nval ok = \"OK\"\nfun withClosure(s: String? = null): String {\n if (s != null) return s","completion":"return ok + myRun {\n withClosure(ok)\n }\n}\n\nfun box(): String {\n if (simple(\"OK\") != \"OK\") return \"failed on simple recursion\"\n\n if (withClosure() != ok + ok) return \"failed when closure something\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"if (isFunction) append(\"(\")\n parameterTypes.withIndex().drop(1).joinTo(this) { (index, type) ->\n castValue(('a' + index).toString(), type)\n }\n if (isFunction) append(\")\")\n }\n }\n }\n\n private fun getIrMethodSymbolByName(methodName: String): String? {","completion":"return when (methodName) {\n BuiltInOperatorNames.LESS -> \"<\"\n BuiltInOperatorNames.LESS_OR_EQUAL -> \"<=\"\n BuiltInOperatorNames.GREATER -> \">\"\n BuiltInOperatorNames.GREATER_OR_EQUAL -> \">=\"\n BuiltInOperatorNames.EQEQ -> \"==\"<|endoftext|>"} {"prompt":"if (this != null) {\n this\n this.inv()\n }\n }\n\n x[0].also {","completion":"if (it != null) {\n it\n it.inv()\n }\n }\n}\n\n\/\/ TESTCASE NUMBER: 3<|endoftext|>"} {"prompt":"\/** Divides this value by the other value, truncating the result to an integer that is closer to zero. *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public inline operator fun div(other: Int): Int =\n this.toInt() \/ other\n\n \/** Divides this value by the other value, truncating the result to an integer that is closer to zero. *\/","completion":"@kotlin.internal.IntrinsicConstEvaluation\n public inline operator fun div(other: Long): Long =\n this.toLong() \/ other\n\n \/** Divides this value by the other value. *\/\n @kotlin.internal.IntrinsicConstEvaluation\n public inline operator fun div(other: Float): Float =\n this.toFloat() \/ other<|endoftext|>"} {"prompt":"regularNestedClassifierScope: FirNestedClassifierScope?,\n ): FirGeneratedClassNestedClassifierScope? {\n \/*\n * Extensions can modify source classes of the same session in which they are enabled\n * This implies the contract that if declaration-site session and use-site session\n * differs for some class, generated declarations should be provided by extensions\n * of declaration-site session\n *\/","completion":"val storage = classSymbol.moduleData\n .session\n .generatedDeclarationsStorage\n .getClassifierStorage(classSymbol, regularNestedClassifierScope)\n ?: return null\n\n return FirGeneratedClassNestedClassifierScope(useSiteSession, classSymbol.fir, storage,)\n }\n }<|endoftext|>"} {"prompt":"return \"Wrong elements for 3u.toUByte()..9u.toUByte() step 2: $list2\"\n }\n\n val list3 = ArrayList()\n val range3 = 3u.toUShort()..9u.toUShort() step 2\n for (i in range3) {\n list3.add(i)","completion":"if (list3.size > 23) break\n }\n if (list3 != listOf(3u, 5u, 7u, 9u)) {\n return \"Wrong elements for 3u.toUShort()..9u.toUShort() step 2: $list3\"\n }\n\n val list4 = ArrayList()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.types.*\nimport org.jetbrains.kotlin.types.typeUtil.asTypeProjection\nimport org.jetbrains.kotlin.types.typeUtil.isNullableAny\nimport org.jetbrains.kotlin.types.typeUtil.replaceArgumentsWithNothing","completion":"class SamTypeApproximator(builtIns: KotlinBuiltIns, languageVersionSettings: LanguageVersionSettings) {\n private val typeApproximator = TypeApproximator(builtIns, languageVersionSettings)\n\n fun getSamTypeForValueParameter(\n valueParameter: ValueParameterDescriptor,\n carefulApproximationOfContravariantProjection: Boolean,\n ): KotlinType? {<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.config\n\nimport org.jetbrains.kotlin.platform.TargetPlatformVersion\nimport org.jetbrains.org.objectweb.asm.Opcodes\n\nenum class JvmTarget(\n override val description: String,\n val majorVersion: Int,\n) : TargetPlatformVersion {","completion":"JVM_1_6(\"1.6\", Opcodes.V1_6),\n JVM_1_8(\"1.8\", Opcodes.V1_8),\n JVM_9(\"9\", Opcodes.V9),\n JVM_10(\"10\", Opcodes.V10),\n JVM_11(\"11\", Opcodes.V11),<|endoftext|>"} {"prompt":"@DisplayName(\"works with android tests\")\n @GradleAndroidTest\n fun testKotlinAndroidProjectTests(\n gradleVersion: GradleVersion,\n agpVersion: String,\n jdkVersion: JdkVersions.ProvidedJdk,\n ) {\n project(\n \"AndroidIncrementalMultiModule\",\n gradleVersion,","completion":"buildOptions = defaultBuildOptions.copy(androidVersion = agpVersion),\n buildJdk = jdkVersion.location\n ) {\n testConfigurationCacheOf(\n \":app:compileDebugAndroidTestKotlin\",\n \":app:compileDebugUnitTestKotlin\"\n )\n }\n }\n}<|endoftext|>"} {"prompt":"fun longTimeMarkRoundingEqualHashCode() {\n run {\n val step = Long.MAX_VALUE \/ 4\n val timeSource = LongTimeSource(DurationUnit.NANOSECONDS)\n val mark0 = timeSource.markNow() + step.nanoseconds + step.nanoseconds\n timeSource.reading += step","completion":"val mark1 = timeSource.markNow() + step.nanoseconds\n timeSource.reading += step\n val mark2 = timeSource.markNow()\n assertEqualMarks(mark1, mark2)\n assertEqualMarks(mark0, mark2)\n assertEqualMarks(mark0, mark1)\n }\n\n for (unit in units) {<|endoftext|>"} {"prompt":"setResult(factory, valueElement)\n }\n\n val synthetic: Boolean get() = outputValue.element == null\n\n override val outputValue: PseudoValue\n get() = resultValue!!\n\n override fun accept(visitor: InstructionVisitor) = visitor.visitMagic(this)","completion":"override fun accept(visitor: InstructionVisitorWithResult): R = visitor.visitMagic(this)\n\n override fun createCopy() =\n MagicInstruction(element, blockScope, inputValues, kind).setResult(resultValue)\n\n override fun toString() = renderInstruction(\"magic[$kind]\", render(element))\n}<|endoftext|>"} {"prompt":"\/\/ TESTCASE NUMBER: 10\nfun case_10(x: Any?) {\n when (x) {\n !is Pair<*, *>? -> return\n else -> {\n ?\")!>x","completion":"?\"), DEBUG_INFO_SMARTCAST!>x?.first\n }\n }\n ?\")!>x<|endoftext|>"} {"prompt":"moduleDescriptor, KonanManglerDesc,\n DescriptorByIdSignatureFinderImpl.LookupMode.MODULE_ONLY\n )\n\n private fun IdSignature.isInteropSignature() = IdSignature.Flags.IS_NATIVE_INTEROP_LIBRARY.test()\n\n override fun contains(idSig: IdSignature): Boolean {","completion":"if (idSig.isPubliclyVisible) {\n if (idSig.isInteropSignature()) {\n \/\/ TODO: add descriptor cache??\n return descriptorByIdSignatureFinder.findDescriptorBySignature(idSig) != null\n }\n }\n\n return false\n }<|endoftext|>"} {"prompt":"val foo = object {\n fun bar() {}\n }\n\n fun bar() = object {\n val foo = 239\n }\n\n class Nested\n}\n\nclass D {\n companion object {\n val foo = object {\n fun bar() {}\n }\n\n fun bar() = object {\n val foo = 239\n }\n }\n}","completion":"\/\/ FILE:c.kt\nimport a\nimport a.b\n\nimport a.foo\nimport a.foo.bar\nimport a.bar<|endoftext|>"} {"prompt":"when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_3.toByte()) }","completion":"when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_4.length) }<|endoftext|>"} {"prompt":"fun baz(a: Foo, t: Foo, d: Data) {\n a.bar = t.bar\n a.foo = t.foo\n\n if (d.x is B) {\n d.x.bar = d.x.bar + \"\"","completion":"d.x.foo = d.x.foo + \"\"\n }\n }\n}<|endoftext|>"} {"prompt":"* A *jumping phase* is a phase that can request the phase-specific information during that same phase from another declaration.\n *\n * Currently, we have four ***jumping phases***:\n *\n * - [COMPILER_REQUIRED_ANNOTATIONS] \u2013 The compiler can jump from the use site of an annotation to the annotation class\n * and resolve its annotations as well.","completion":"* - [SUPER_TYPES] \u2013 The compiler resolves super types recursively for all classes from the bottom class to the top one.\n * - [STATUS] \u2013 The compiler resolves the status for super declarations first.\n * - [IMPLICIT_TYPES_BODY_RESOLVE] \u2013 The compiler can jump from one declaration to another during this phase as one<|endoftext|>"} {"prompt":"if (-1 !in collection.indices != !range0.contains(-1)) throw AssertionError()\n if (!(-1 in collection.indices) != !range0.contains(-1)) throw AssertionError()\n if (!(-1 !in collection.indices) != range0.contains(-1)) throw AssertionError()\n \/\/ no local optimizations","completion":"if (element2 in collection.indices != range0.contains(element2)) throw AssertionError()\n if (element2 !in collection.indices != !range0.contains(element2)) throw AssertionError()\n if (!(element2 in collection.indices) != !range0.contains(element2)) throw AssertionError()<|endoftext|>"} {"prompt":"\/\/ This file was generated automatically. See compiler\/fir\/tree\/tree-generator\/Readme.md.\n\/\/ DO NOT MODIFY IT MANUALLY.\n\n@file:Suppress(\"DuplicatedCode\", \"unused\")\n\npackage org.jetbrains.kotlin.fir.expressions.builder\n\nimport kotlin.contracts.*","completion":"import org.jetbrains.kotlin.KtSourceElement\nimport org.jetbrains.kotlin.fir.builder.FirAnnotationContainerBuilder\nimport org.jetbrains.kotlin.fir.builder.FirBuilderDsl\nimport org.jetbrains.kotlin.fir.builder.toMutableOrEmpty<|endoftext|>"} {"prompt":"convertBuiltinType(type)?.let { return it }\n if (type.sort == ARRAY) {\n return TypeArray(Type(AsmUtil.correctElementType(type)))\n }\n return FqName(type.internalName)\n }\n\n @Suppress(\"FunctionName\")\n fun FqName(internalOrFqName: String): JCTree.JCExpression {","completion":"val path = getQualifiedName(internalOrFqName).split('.')\n assert(path.isNotEmpty())\n return FqName(path)\n }\n\n @Suppress(\"FunctionName\")\n fun FqName(fqName: FqName) = FqName(fqName.pathSegments().map { it.asString() })\n\n @Suppress(\"FunctionName\")<|endoftext|>"} {"prompt":"val tryBuilder = JsAstProtoBuf.Try.newBuilder()\n tryBuilder.tryBlock = serialize(x.tryBlock)\n x.catches.firstOrNull()?.let { c ->\n val catchBuilder = JsAstProtoBuf.Catch.newBuilder()\n catchBuilder.parameter = serializeParameter(c.parameter)","completion":"catchBuilder.body = serialize(c.body)\n tryBuilder.catchBlock = catchBuilder.build()\n }\n x.finallyBlock?.let { tryBuilder.finallyBlock = serialize(it) }\n builder.tryStatement = tryBuilder.build()\n }\n\n override fun visitEmpty(x: JsEmpty) {<|endoftext|>"} {"prompt":"val makePerFileCaches = cacheMode == CacheMode.Alias.STATIC_PER_FILE_EVERYWHERE\n val useHeaders = cacheMode == CacheMode.Alias.STATIC_USE_HEADERS_EVERYWHERE\n\n return if (defaultCache == CacheMode.Alias.NO)\n CacheMode.WithoutCache\n else CacheMode.WithStaticCache(\n distribution,","completion":"kotlinNativeTargets,\n optimizationMode,\n useStaticCacheForUserLibraries,\n makePerFileCaches,\n useHeaders,\n cacheMode\n )\n }\n\n private fun computeTestMode(enforcedProperties: EnforcedProperties): TestMode =<|endoftext|>"} {"prompt":"var font: String\n var textAlign: CanvasTextAlign\n var textBaseline: CanvasTextBaseline\n var direction: CanvasDirection\n}\n\npublic external interface CanvasPath {\n fun closePath()\n fun moveTo(x: Double, y: Double)\n fun lineTo(x: Double, y: Double)","completion":"fun quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double)\n fun bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double)\n fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double)<|endoftext|>"} {"prompt":"\/\/ considered to be non-user-reproducible code for the purposes of these tests\n checkExactType>(buildee)\n}\n\n\/\/ PTV is in producing position (materialize-case) and passed to a mutable extension property\nfun testMaterializeWithMutableProperty() {\n val buildee = build {\n this.typeInfoSourcingVariable\n }","completion":"\/\/ exact type equality check \u2014 turns unexpected compile-time behavior into red code\n \/\/ considered to be non-user-reproducible code for the purposes of these tests\n checkExactType>(buildee)\n}\n\n\/* REQUIRED DECLARATIONS *\/\n\nclass Buildee\n\nfun build(\n instructions: Buildee.() -> Unit<|endoftext|>"} {"prompt":"fun test1(): Boolean {\n test1@ for(i in 1..2) {\n continue@test1\n return false\n }\n\n return true\n}\n\nfun test2(): Boolean {\n test2@ while (true) {\n break@test2\n }\n\n return true\n}\n\nfun box(): String {\n if (!test1()) return \"fail test1\"","completion":"if (!test2()) return \"fail test2\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"ProgressionDirection.INCREASING -> conditionForIncreasing()\n ProgressionDirection.UNKNOWN -> {\n \/\/ If the direction is unknown, we check depending on the \"step\" value:\n \/\/ \/\/ (use `<` if last is exclusive)\n \/\/ (step > 0 && inductionVar <= last) || (step < 0 || last <= inductionVar)\n context.oror(","completion":"context.andand(\n irCall(builtIns.greaterFunByOperandType.getValue(stepClass.symbol)).apply {\n putValueArgument(0, stepExpression.shallowCopy())\n putValueArgument(1, zeroStepExpression())\n },\n conditionForIncreasing()\n ),\n context.andand(<|endoftext|>"} {"prompt":"for (element in this) if (predicate(element)) return element\n return null\n}\n\n\/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n *\/\n@kotlin.internal.InlineOnly","completion":"public inline fun Array.getOrElse(index: Int, defaultValue: (Int) -> T): T {\n contract {\n callsInPlace(defaultValue, InvocationKind.AT_MOST_ONCE)\n }\n return if (index in indices) get(index) else defaultValue(index)\n}\n\n\/**<|endoftext|>"} {"prompt":"}\n\n fun defineEntriesField() {\n irClass.declarations.add(0, entriesField)\n entriesField.parent = irClass\n val irBuilder = context.createIrBuilder(entriesField.symbol, irClass.startOffset, irClass.endOffset)\n entriesField.initializer = irBuilder.irExprBody(irBuilder.irBlock {","completion":"val irValuesArray = irTemporary(irGetField(null, valuesField))\n val irEntriesArray = this@EnumClassLowering.context.createArrayOfExpression(\n startOffset, endOffset,\n irClass.defaultType,\n enumEntriesMap.values\n .sortedBy { it.ordinal }\n .map {<|endoftext|>"} {"prompt":"\/\/ There is no sense to resolve such declarations as they do not have bodies\n \/\/ Also, they have STUB expression instead of default values, so we shouldn't change them\n if (target is FirCallableDeclaration && target.isCopyCreatedInScope) return\n\n when (target) {","completion":"is FirFile, is FirScript, is FirRegularClass, is FirCodeFragment -> error(\"Should have been resolved in ${::doResolveWithoutLock.name}\")\n is FirConstructor -> resolve(target, BodyStateKeepers.CONSTRUCTOR)\n is FirFunction -> resolve(target, BodyStateKeepers.FUNCTION)\n is FirProperty -> resolve(target, BodyStateKeepers.PROPERTY)<|endoftext|>"} {"prompt":"class VisitorState(val insideTryBlock: Boolean, val isTailExpression: Boolean)\n\n val isUnitReturn = irFunction.returnType.isUnit()\n var hasNotTailSuspendCall = false\n val tailSuspendCalls = mutableSetOf()\n val tailReturnableBlocks = mutableSetOf()","completion":"val visitor = object : IrElementVisitor {\n override fun visitElement(element: IrElement, data: VisitorState) {\n element.acceptChildren(this, VisitorState(data.insideTryBlock, isTailExpression = false))\n }\n\n override fun visitTypeOperator(expression: IrTypeOperatorCall, data: VisitorState) {<|endoftext|>"} {"prompt":"@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.maxOf(selector: (UShort) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {","completion":"val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n\/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n *<|endoftext|>"} {"prompt":"if (x != null) {\n x.length \/\/ OK\n y.length \/\/ Bad\n z.length \/\/ Bad\n }\n if (y != null) {\n x.length \/\/ Bad\n y.length \/\/ OK","completion":"z.length \/\/ Bad\n }\n\n if (z != null) {\n x.length \/\/ Bad\n y.length \/\/ Bad\n z.length \/\/ OK\n }\n\n y = null\n\n if (x != null) {<|endoftext|>"} {"prompt":"a.length \/\/ \/\/ can be ok\n }\n}\n\nfun test_6(a: String?) {\n var b = a?.length\n if (b != null) {\n a.length \/\/ can be ok\n }\n nonInPlaceRun {\n b = 0\n }","completion":"if (b != null) {\n a.length \/\/ not ok\n }\n}<|endoftext|>"} {"prompt":"\/\/ LANGUAGE: -UseConsistentRulesForPrivateConstructorsOfSealedClasses\n\/\/ ISSUE: KT-44866, KT-49729\n\n\/\/ FILE: base.kt\nsealed class SealedBase(x: Int) {\n private constructor(y: String) : this(y.length)\n\n class SealedNested : SealedBase(\"nested\")\n}","completion":"class SealedOuter : SealedBase(\"outer\")\n\nabstract class RegularBase(x: Int) {\n private constructor(y: String) : this(y.length)\n\n class RegularNested : RegularBase(\"nested\")\n}<|endoftext|>"} {"prompt":"x.funNullableAny()\n x\n }","completion":"\/\/ TESTCASE NUMBER: 14\nfun case_14() {\n val a = Class()\n if (a.prop_6 != a.prop_7) {\n a.prop_6<|endoftext|>"} {"prompt":"override fun afterChange(property: KProperty<*>, oldValue: T, newValue: T) = onChange(property, oldValue, newValue)\n }\n\n \/**\n * Returns a property delegate for a read\/write property that calls a specified callback function when changed,\n * allowing the callback to veto the modification.\n * @param initialValue the initial value of the property.","completion":"* @param onChange the callback which is called before a change to the property value is attempted.\n * The value of the property hasn't been changed yet, when this callback is invoked.\n * If the callback returns `true` the value of the property is being set to the new value,\n * and if the callback returns `false` the new value is discarded and the property remains its old value.\n *<|endoftext|>"} {"prompt":"val aggregatedStats = HashMap()\n\n override fun writeHeader(header: StatsOutput.StatsHeader) {\n check(header is RawStatsCollector.RawStatsHeader)\n \/\/ do nothing\n }\n\n override fun writeRow(row: StatsOutput.StatsRow) {\n check(row is RawStatsCollector.RawStatsRow)","completion":"val declarationType = row.statsKey.declarationType\n val aggregatedStatsRow = aggregatedStats.getOrPut(declarationType) { AggregatedStatsRow(declarationType) }\n when (row.common) {\n LIFTED_UP -> aggregatedStatsRow.liftedUp++\n EXPECT -> aggregatedStatsRow.successfullyCommonized++\n MISSING -> {<|endoftext|>"} {"prompt":"class Scope(val depth: Int, nodes: List) : Node() {\n val nodes = mutableSetOf().also { it += nodes }\n }\n }\n\n \/\/ Note: scopes form a tree.\n class FunctionBody(val rootScope: Node.Scope, val allScopes: List,\n val returns: Node.Variable, val throws: Node.Variable) {","completion":"inline fun forEachNonScopeNode(block: (Node) -> Unit) {\n for (scope in allScopes)\n for (node in scope.nodes)\n if (node !is Node.Scope)\n block(node)\n }\n }\n\n class Function(val symbol: FunctionSymbol, val body: FunctionBody) {\n\n fun debugOutput() = println(debugString())<|endoftext|>"} {"prompt":"public fun kotlin.CharSequence.findAnyOf(strings: kotlin.collections.Collection, startIndex: kotlin.Int = ..., ignoreCase: kotlin.Boolean = ...): kotlin.Pair?\n\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.CharSequence.findLast(predicate: (kotlin.Char) -> kotlin.Boolean): kotlin.Char?<|endoftext|>"} {"prompt":"build(\":compileAppleMainKotlinMetadata\", buildOptions = testSourceSetsDependingOnMainParameterOption) {\n assertTestSourceSetsDependingOnMainParameter()\n }\n\n build(\":compileIosMainKotlinMetadata\", buildOptions = testSourceSetsDependingOnMainParameterOption) {\n assertTestSourceSetsDependingOnMainParameter()\n }\n }\n }\n }","completion":"private fun testSingleNativePlatform(projectName: String, gradleVersion: GradleVersion) {\n\n val posixInIntransitiveMetadataConfigurationRegex = Regex(\"\"\".*intransitiveMetadataConfiguration:.*([pP])osix\"\"\")\n\n nativeProject(projectName, gradleVersion) {<|endoftext|>"} {"prompt":"private object B88 { val a = B87.a + Random.nextInt(100) }\nprivate object B89 { val a = B88.a + Random.nextInt(100) }\nprivate object B90 { val a = B89.a + Random.nextInt(100) }\nprivate object B91 { val a = B90.a + Random.nextInt(100) }","completion":"private object B92 { val a = B91.a + Random.nextInt(100) }\nprivate object B93 { val a = B92.a + Random.nextInt(100) }\nprivate object B94 { val a = B93.a + Random.nextInt(100) }\nprivate object B95 { val a = B94.a + Random.nextInt(100) }<|endoftext|>"} {"prompt":"inline fun with(receiver: T, block: T.() -> R): R {\/* DeclarationStructureElement *\/\n return receiver.block()\n}\n\ninline fun T.let(block: (T) -> R): R {\/* DeclarationStructureElement *\/\n return block(this)\n}\n\nclass A {\/* ClassDeclarationStructureElement *\/","completion":"fun foo() {\/* DeclarationStructureElement *\/\n val a = with(1) {\n this.let { it }\n }.let { 2 }\n }\n}<|endoftext|>"} {"prompt":"val signatureWriter = BothSignatureWriter(BothSignatureWriter.Mode.SKIP_CHECKS)\n typeMapper.mapType(type, mode, signatureWriter)\n\n val canonicalSignature = signatureWriter.toString()\n require(!canonicalSignature.contains(SpecialNames.ANONYMOUS_STRING))\n\n if (canonicalSignature.contains(\"L\")) return null","completion":"if (canonicalSignature.contains(SpecialNames.NO_NAME_PROVIDED.asString())) return null\n\n val signature = StringCharacterIterator(canonicalSignature)\n val javaType = SignatureParsing.parseTypeString(signature, StubBuildingVisitor.GUESSING_MAPPER)\n val typeInfo = TypeInfo.fromString(javaType, false)<|endoftext|>"} {"prompt":"0x0ca9, 0x0caa, 0x0cb4, 0x0cb5, 0x0cba,","completion":"0x0cbc, 0x0cc0, 0x0cc5, 0x0cc7, 0x0ccc, 0x0cce, 0x0cd5, 0x0cd7, 0x0cde, 0x0ce2, 0x0ce4, 0x0ce6, 0x0cf0, 0x0cf3, 0x0d00, 0x0d02,<|endoftext|>"} {"prompt":"createExpressionByPattern(\"if ($0) $1 else $2\", condition, thenExpr, elseExpr) as KtIfExpression\n else\n createExpressionByPattern(\"if ($0) $1\", condition, thenExpr)) as KtIfExpression\n }\n\n fun createArgument(\n expression: KtExpression?,\n name: Name? = null,","completion":"isSpread: Boolean = false,\n reformat: Boolean = true\n ): KtValueArgument {\n val argumentList = buildByPattern(\n { pattern, args -> createByPattern(pattern, *args, reformat = reformat) { createCallArguments(it) } }) {\n appendFixedText(\"(\")\n\n if (name != null) {\n val asString = name.asString()<|endoftext|>"} {"prompt":"val container = annotations.firstOrNull { it.annotationClass.java == containerClass }\n if (container != null) {\n \/\/ A repeatable annotation container must have a method \"value\" returning the array of repeated annotations.\n val valueMethod = container::class.java.getMethod(\"value\")\n @Suppress(\"UNCHECKED_CAST\")\n return (valueMethod(container) as Array).asList()","completion":"}\n }\n\n return emptyList()\n}\n\n@Suppress(\"UNCHECKED_CAST\")\nprivate object Java8RepeatableContainerLoader {\n class Cache(val repeatableClass: Class?, val valueMethod: Method?)\n\n var cache: Cache? = null\n\n private fun buildCache(): Cache {\n val repeatableClass = try {<|endoftext|>"} {"prompt":"(MFVC1(5.0, 100) as Any) != MFVC1(3, 100) -> \"Fail 1.2\"\n MFVC1(5.0, 100) != (MFVC1(3, 100) as Any) -> \"Fail 1.3\"\n (MFVC1(5.0, 100) as Any) != (MFVC1(3, 100) as Any) -> \"Fail 1.4\"","completion":"MFVC2(Generic(\"aba\", 5.0), 100) != MFVC2(Generic(3, 8), 100) -> \"Fail 2.1\"\n (MFVC2(Generic(\"aba\", 5.0), 100) as Any) != MFVC2(Generic(3, 8), 100) -> \"Fail 2.2\"<|endoftext|>"} {"prompt":"is FirIntersectionCallableSymbol -> {\n val nonSubsumedOverriddenSymbols = symbol.getNonSubsumedOverriddenSymbols(\n sessionHolder.session,\n sessionHolder.scopeSession\n )\n val overriddenSymbols = nonSubsumedOverriddenSymbols.map { it.originalForSubstitutionOverride ?: it }","completion":"addAllSymbolsFrom(overriddenSymbols, sessionHolder)\n for (intersectedSymbol in overriddenSymbols) {\n overrideIntersections.getOrPut(intersectedSymbol) { hashSetOf() }.addAll(overriddenSymbols)\n }\n }\n else -> allSymbols.add(symbol)\n }\n }\n }<|endoftext|>"} {"prompt":"with(builder) {\n defaultDirectives {\n +ConfigurationDirectives.WITH_STDLIB\n }\n }\n }\n}\n\nabstract class AbstractSourceNonLocalDeclarationAnchorTest : AbstractNonLocalDeclarationAnchorTest() {","completion":"override val configurator: AnalysisApiTestConfigurator = AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = false)\n}\n\nabstract class AbstractScriptNonLocalDeclarationAnchorTest : AbstractNonLocalDeclarationAnchorTest() {<|endoftext|>"} {"prompt":"public Set> entrySet() {\n return null;\n }\n}\n\n\n\/\/ FILE: m.kt\nfun foo(x: Int2IntMap): String {\n if (!x.containsKey(56)) return \"fail 1\"\n if (x.containsKey(239)) return \"fail 1\"\n return \"OK\"\n}\n\nfun box(): String {","completion":"return foo(Int2IntMapImpl())\n}<|endoftext|>"} {"prompt":"* - FE 1.0, since it does not support custom functional kinds from plugins\n * - places in FIR where session is not accessible by design (like in renderer of FIR elements)\n *\/\n @JvmStatic\n @AllowedToUsedOnlyInK1\n val Default = FunctionTypeKindExtractor(\n listOf(\n FunctionTypeKind.Function,\n FunctionTypeKind.SuspendFunction,","completion":"FunctionTypeKind.KFunction,\n FunctionTypeKind.KSuspendFunction,\n )\n )\n }\n\n private val knownKindsByPackageFqName = kinds.groupBy { it.packageFqName }\n\n fun getFunctionalClassKind(packageFqName: FqName, className: String): FunctionTypeKind? {<|endoftext|>"} {"prompt":"override fun saveExtension(project: JpsProject, componentTag: Element) {\n }\n}\n\ninternal class KotlinCompilerSettingsSerializer : BaseJpsCompilerSettingsSerializer(\n SettingConstants.KOTLIN_COMPILER_SETTINGS_SECTION, ::CompilerSettings\n) {","completion":"override fun onLoad(project: JpsProject, settings: CompilerSettings) {\n project.kotlinCompilerSettings = settings\n }\n}\n\ninternal class KotlinJpsPluginSettingsSerializer : BaseJpsCompilerSettingsSerializer(\n SettingConstants.KOTLIN_JPS_PLUGIN_SETTINGS_SECTION, ::JpsPluginSettings\n) {<|endoftext|>"} {"prompt":"* This class should be invisible for checkers, but should be only used by DiagnosticCollectorVisitor who runs those checkers\n * It contains all context-modification-related methods unlike CheckerContext that is assumed to be read-only\n *\/\nabstract class CheckerContextForProvider(\n sessionHolder: SessionHolder,\n returnTypeCalculator: ReturnTypeCalculator,\n allInfosSuppressed: Boolean,","completion":"allWarningsSuppressed: Boolean,\n allErrorsSuppressed: Boolean\n) : AbstractCheckerContext(sessionHolder, returnTypeCalculator, allInfosSuppressed, allWarningsSuppressed, allErrorsSuppressed) {\n\n abstract fun addSuppressedDiagnostics(\n diagnosticNames: Collection,\n allInfosSuppressed: Boolean,<|endoftext|>"} {"prompt":"visitVarInsn(ALOAD, 1)\n val continuationInternalName = CONTINUATION_ASM_TYPE.internalName\n\n visitTypeInsn(\n CHECKCAST,\n continuationInternalName\n )\n visitMethodInsn(\n INVOKESTATIC,\n packagePartClassInternalName,\n signatureOfRealDeclaration.asmMethod.name,","completion":"signatureOfRealDeclaration.asmMethod.descriptor,\n false\n )\n visitInsn(ARETURN)\n visitEnd()\n }\n\n writeSyntheticClassMetadata(lambdaBuilder, state.config, false)\n\n lambdaBuilder.done(state.config.generateSmapCopyToAnnotation)\n return lambdaBuilder.thisName\n}<|endoftext|>"} {"prompt":"var receiverParameter: FirReceiverParameter? = null\n var deprecationsProvider: DeprecationsProvider = UnresolvedDeprecationProvider\n var containerSource: DeserializedContainerSource? = null\n var dispatchReceiverType: ConeSimpleKotlinType? = null\n val contextReceivers: MutableList = mutableListOf()\n lateinit var name: Name","completion":"var delegate: FirExpression? = null\n var isVar: Boolean by kotlin.properties.Delegates.notNull()\n var isVal: Boolean by kotlin.properties.Delegates.notNull()\n var getter: FirPropertyAccessor? = null\n var setter: FirPropertyAccessor? = null\n var backingField: FirBackingField? = null<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.objcexport.extras\n\nimport org.jetbrains.kotlin.backend.konan.objcexport.ObjCNullableReferenceType\nimport org.jetbrains.kotlin.backend.konan.objcexport.ObjCType\nimport org.jetbrains.kotlin.name.ClassId","completion":"import org.jetbrains.kotlin.tooling.core.MutableExtras\nimport org.jetbrains.kotlin.tooling.core.extrasKeyOf\n\n\nprivate val originClassIdKey = extrasKeyOf()\n\n\/**\n * Tracks the Kotlin origin associated with [this] [ObjCType].<|endoftext|>"} {"prompt":"testGroup(\"compiler\/fir\/raw-fir\/light-tree2fir\/tests-gen\", \"compiler\/fir\/raw-fir\/psi2fir\/testData\") {\n testClass {\n model(\"rawBuilder\")\n }\n }","completion":"testGroup(\"compiler\/fir\/analysis-tests\/legacy-fir-tests\/tests-gen\", \"compiler\/testData\") {\n testClass {\n model(\"loadJava\/compiledJava\", extension = \"java\")\n }\n }<|endoftext|>"} {"prompt":"val cOutOfRaneMin = '\ud800\udc00' \/\/u+10000","completion":"val cOutOfRangeAroundMax = '\udb40\uddff\udb40\uddff\udb3f\udfff' \/\/u+Dfffff\n}<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ JVM_TARGET: 1.8\n\/\/ SAM_CONVERSIONS: INDY\n\/\/ FULL_JDK\n\n\/\/ CHECK_BYTECODE_TEXT\n\/\/ JVM_IR_TEMPLATES\n\/\/ 2 java\/lang\/invoke\/LambdaMetafactory\n\n\/\/ FILE: serializableLambdaCapturingInlineClassInt.kt\nimport java.io.*","completion":"inline class IC(val x: Int)\n\nfun box(): String {\n val k = IC('K'.toInt())\n return roundtrip(Sam { s -> s + k.x.toChar().toString() })\n .get(\"O\")\n}\n\nfun roundtrip(x: T): T {\n val out1 = ByteArrayOutputStream()<|endoftext|>"} {"prompt":"* NUMBER: 3\n * DESCRIPTION: contracts with not allowed complex conditions in implies.\n *\/\n\nimport kotlin.contracts.*\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1(value_1: Boolean?): Boolean {\n contract { returns(true) implies (value_1 != null && value_1 == false) }","completion":"return value_1 != null && value_1 == false\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun case_2(value_1: Boolean, value_2: Boolean): Boolean? {\n contract { returnsNotNull() implies (value_1 != false || value_2) }<|endoftext|>"} {"prompt":"irClass.isAny() -> NullPointer(runtime.typeInfoType)\n irClass.isKotlinObjCClass() -> context.ir.symbols.any.owner.typeInfoPtr\n else -> {\n val superTypeOrAny = irClass.getSuperClassNotAny() ?: context.ir.symbols.any.owner\n superTypeOrAny.typeInfoPtr\n }\n }","completion":"val implementedInterfaces = irClass.implementedInterfaces.filter { it.requiresRtti() }\n\n val interfaces = implementedInterfaces.map { it.typeInfoPtr }\n val interfacesPtr = staticData.placeGlobalConstArray(\"kintf:$className\",\n pointerType(runtime.typeInfoType), interfaces)\n\n val objOffsets = getObjOffsets(bodyType)<|endoftext|>"} {"prompt":"* Returns an array with all elements of this array sorted according to their natural sort order.\n *\/\npublic fun ByteArray.sortedArray(): ByteArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n\/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n *\/\npublic fun ShortArray.sortedArray(): ShortArray {","completion":"if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n\/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n *\/\npublic fun IntArray.sortedArray(): IntArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n\/**<|endoftext|>"} {"prompt":"expect(listOf(2000000000000), { longArrayOf(3000000000000, 2000000000000).drop(1) })\n expect(listOf(3.toByte()), { byteArrayOf(2, 3).drop(1) })\n expect(listOf(3.toShort()), { shortArrayOf(2, 3).drop(1) })","completion":"expect(listOf(3.0f), { floatArrayOf(2f, 3f).drop(1) })\n expect(listOf(3.0), { doubleArrayOf(2.0, 3.0).drop(1) })\n expect(listOf(false), { booleanArrayOf(true, false).drop(1) })<|endoftext|>"} {"prompt":"callGraph.directEdges[callee]?.let { escapeAnalysisResults[it.symbol]!! }\n ?: getExternalFunctionEAResult(it)\n pointsToGraph.processCall(it, calleeEAResult)\n\n if (pointsToGraph.allNodes.size > maxAllowedGraphSize)\n return false\n }\n\n context.log { \"After calls analysis\" }","completion":"pointsToGraph.log()\n pointsToGraph.logDigraph(false)\n\n \/\/ Build transitive closure.\n val eaResult = pointsToGraph.buildClosure()\n\n context.log { \"After closure building\" }\n pointsToGraph.log()\n pointsToGraph.logDigraph(true)\n\n escapeAnalysisResults[function] = eaResult\n\n return true\n }<|endoftext|>"} {"prompt":"value == \"true\"\n )\n LIVE_LITERALS_V2_ENABLED_OPTION -> configuration.put(\n ComposeConfiguration.LIVE_LITERALS_V2_ENABLED_KEY,\n value == \"true\"\n )\n GENERATE_FUNCTION_KEY_META_CLASSES_OPTION -> configuration.put(","completion":"ComposeConfiguration.GENERATE_FUNCTION_KEY_META_CLASSES_KEY,\n value == \"true\"\n )\n SOURCE_INFORMATION_ENABLED_OPTION -> configuration.put(\n ComposeConfiguration.SOURCE_INFORMATION_ENABLED_KEY,\n value == \"true\"\n )\n METRICS_DESTINATION_OPTION -> configuration.put(<|endoftext|>"} {"prompt":"\/\/ A compiled file for a class should only contain a single class declaration. `*Kt.class` files on the other hand may contain\n \/\/ top-level callables and need to be skipped.\n val classOrObject = ktFile.declarations.singleOrNull() as? KtClassOrObject ?: return\n handleCompiledClassDeclaration(classOrObject, text)\n } else {","completion":"ktFile.collectDescendantsOfType()\n .sortedBy { it.fqName?.asString() ?: it.name.toString() }\n .forEach { classOrObject ->\n handleClassDeclaration(classOrObject, text)\n appendLine()\n }\n }\n }\n\n \/**<|endoftext|>"} {"prompt":"val b: Two = foo(outA, inB)\n use(b)\n}\n\nfun bar(o: Out, i: In): Two = throw Exception(\"$o $i\")\n\nfun test2(outA: Out, inC: In) {","completion":"bar(outA, inC)\n\n val b: Two = bar(outA, inC)\n use(b)\n}<|endoftext|>"} {"prompt":"private fun PsiAnnotationMemberValue.renderAnnotationMemberValue(): String = when (this) {\n is KtLightPsiArrayInitializerMemberValue -> \"{${initializers.joinToString { it.renderAnnotationMemberValue() }}}\"\n is PsiAnnotation -> renderAnnotation()\n is KtLightPsiLiteral -> renderKtLightPsiLiteral()\n else -> text\n }","completion":"private fun PsiMethod.renderMethod() =\n renderModifiers(returnType) +\n (if (isVarArgs) \"\/* vararg *\/ \" else \"\") +\n typeParameters.renderTypeParams() +\n (returnType?.renderType() ?: \"\") + \" \" +\n name +<|endoftext|>"} {"prompt":"package kotlin.jdk7.test\n\nimport test.platformNull\nimport java.io.*\nimport kotlin.test.*\n\nclass UseCloseableResourceTest {\n\n class Resource(val faultyClose: Boolean = false) : Closeable {\n\n var isClosed = false\n private set\n\n override fun close() {\n if (faultyClose)\n throw IOException(\"Close failed\")","completion":"isClosed = true\n }\n }\n\n @Test fun success() {\n val resource = Resource()\n val result = resource.use { \"ok\" }\n assertEquals(\"ok\", result)\n assertTrue(resource.isClosed)\n }\n\n @Test fun closeFails() {\n val e = assertFails {<|endoftext|>"} {"prompt":"options.freeCompilerArgs.get()\n }\n }\n\n set(value) = if (isTaskExecuting) {\n task().nagUserFreeArgsModifiedOnExecution(value)\n task().executionTimeFreeCompilerArgs = value\n } else {\n options.freeCompilerArgs.set(value)\n }\n\n private val isTaskExecuting: Boolean","completion":"get() = task().state.executing\n}<|endoftext|>"} {"prompt":"if (list5.size > 23) break\n }\n if (list5 != listOf()) {\n return \"Wrong elements for 1u.toUByte() until MinUB step 3: $list5\"\n }\n\n val list6 = ArrayList()\n for (i in 1u.toUShort() until MinUS step 3) {","completion":"list6.add(i)\n if (list6.size > 23) break\n }\n if (list6 != listOf()) {\n return \"Wrong elements for 1u.toUShort() until MinUS step 3: $list6\"\n }\n\n val list7 = ArrayList()\n for (i in 1u until MinUI step 3) {<|endoftext|>"} {"prompt":"getAsFirExpression(rightArg, \"No right operand\")\n else\n buildErrorExpression(null, ConeSyntaxDiagnostic(\"No right operand\"))\n\n val leftArgAsFir = getAsFirExpression(leftArgNode, \"No left operand\")\n\n \/\/ No need for the callee name since arguments are already generated","completion":"context.calleeNamesForLambda.removeLast()\n\n when (operationToken) {\n ELVIS ->\n return leftArgAsFir.generateNotNullOrOther(rightArgAsFir, baseSource)\n ANDAND, OROR ->\n return leftArgAsFir.generateLazyLogicalOperation(rightArgAsFir, operationToken == ANDAND, baseSource)<|endoftext|>"} {"prompt":"defaultPodGenTaskName,\n podSetupBuildFullTaskName(anotherPodName),\n podBuildFullTaskName(anotherPodName),\n cinteropFullTaskName(anotherPodName)\n )\n assertTasksUpToDate(\n defaultSetupBuildTaskName,\n defaultBuildTaskName,\n defaultCinteropTaskName\n )\n\n buildGradleKts.removePod(anotherPodName)","completion":"testImport {\n assertOutputDoesNotContain(podBuildFullTaskName(anotherPodName))\n assertOutputDoesNotContain(cinteropFullTaskName(anotherPodName))\n assertTasksUpToDate(\n defaultBuildTaskName,\n defaultSetupBuildTaskName,\n defaultCinteropTaskName\n )\n }\n }\n }\n }<|endoftext|>"} {"prompt":"}\n }\n return null\n }\n\n fun shouldReportParameterNameOverrideWarning(\n parameterFromSubclass: ValueParameterDescriptor,\n parameterFromSuperclass: ValueParameterDescriptor\n ): Boolean {\n return parameterFromSubclass.containingDeclaration.hasStableParameterNames() &&\n parameterFromSuperclass.containingDeclaration.hasStableParameterNames() &&","completion":"parameterFromSuperclass.name != parameterFromSubclass.name\n }\n\n private fun checkPropertyKind(descriptor: CallableMemberDescriptor, isVar: Boolean): Boolean {\n return descriptor is PropertyDescriptor && descriptor.isVar == isVar\n }\n }\n}<|endoftext|>"} {"prompt":"ss.hashCode() \/\/ Smart-cast to Int, should be unsafe call\n val sss = if (true) {\n s?.copy\n }\n else {\n s?.copy\n }\n sss.length\n}\n\nclass My {\n val String.copy2: String","completion":"get() = this\n\n fun foo() {\n val s: String? = null\n val ss = if (true) {\n s?.length\n } else {\n s?.length\n }\n ss.hashCode()\n val sss = if (true) {\n s?.copy2\n }\n else {<|endoftext|>"} {"prompt":"public fun CloseEventInit(wasClean: Boolean? = false, code: Short? = 0, reason: String? = \"\", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): CloseEventInit { js(\"return { wasClean, code, reason, bubbles, cancelable, composed };\") }\n\n\/**","completion":"* Exposes the JavaScript [MessageChannel](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/MessageChannel) to Kotlin\n *\/\npublic external open class MessageChannel : JsAny {\n open val port1: MessagePort\n open val port2: MessagePort\n}\n\n\/**<|endoftext|>"} {"prompt":"return messages.joinToString(\"\\n\") { \"${it.severity}: ${it.message}${it.location?.let{\" at $it\"} ?: \"\"}\" }\n }\n}\n\nfun TestMessageCollector.assertHasMessage(msg: String, desiredSeverity: CompilerMessageSeverity? = null) {","completion":"assert(messages.any { it.message.contains(msg) && (desiredSeverity == null || it.severity == desiredSeverity) }) {\n \"Expecting message \\\"$msg\\\" with severity ${desiredSeverity?.toString() ?: \"Any\"}, actual:\\n\" +<|endoftext|>"} {"prompt":"contextReceiver.customLabelName,\n builder.token\n)\n\ninternal fun FirCallableSymbol<*>.getCallableIdIfNonLocal(): CallableId? {\n return when {\n origin == FirDeclarationOrigin.DynamicScope -> null\n callableId.isLocal -> null\n else -> callableId\n }\n}","completion":"internal fun FirClassLikeSymbol<*>.getClassIdIfNonLocal(): ClassId? =\n classId.takeUnless { it.isLocal }\n\ninternal fun FirCallableSymbol<*>.dispatchReceiverType(\n builder: KtSymbolByFirBuilder,\n): KtType? {\n val type = if (\n origin == FirDeclarationOrigin.DynamicScope<|endoftext|>"} {"prompt":"\"Unexpected typeArgument: $typeArgument, ${typeArgument.javaClass.canonicalName}\"\n }\n }\n }\n }\n\n fun TypeParameterDescriptor.shouldBeFlexible(flexibleCheck: (KotlinType) -> Boolean = { it.isFlexible() }): Boolean {\n return upperBounds.any {","completion":"flexibleCheck(it) || ((it.constructor.declarationDescriptor as? TypeParameterDescriptor)?.run { shouldBeFlexible() } ?: false)\n }\n }\n\n private fun getTypePreservingFlexibilityWrtTypeVariable(\n type: KotlinType,\n typeVariable: TypeVariableFromCallableDescriptor\n ): KotlinType {<|endoftext|>"} {"prompt":"super.areEqualTypeConstructors(c1, c2)\n }\n }\n\n return areCompatibleTypes(\n a, b,\n typeSystemContext = typeSystemContext,\n kotlinTypeRefiner = KotlinTypeRefiner.Default,\n )\n }\n\n private fun areCompatibleTypes(\n a: KotlinType,\n b: KotlinType,","completion":"typeSystemContext: ClassicTypeSystemContext,\n kotlinTypeRefiner: KotlinTypeRefiner,\n ): Boolean {\n with(NewKotlinTypeCheckerImpl(kotlinTypeRefiner)) {\n return createClassicTypeCheckerState(\n isErrorTypeEqualsToAnything = false,\n typeSystemContext = typeSystemContext,\n kotlinTypeRefiner = kotlinTypeRefiner,<|endoftext|>"} {"prompt":"CXAvailabilityKind.CXAvailability_NotAccessible -> false\n }\n\n \/\/ Skip functions which parameter or return type is TemplateRef\n protected open fun isFuncDeclEligible(cursor: CValue): Boolean {\n var ret = true\n visitChildren(cursor) { childCursor, _ ->\n when (childCursor.kind) {","completion":"CXCursorKind.CXCursor_TemplateRef -> {\n ret = false\n CXChildVisitResult.CXChildVisit_Break\n }\n else -> CXChildVisitResult.CXChildVisit_Recurse\n }\n }\n return ret\n }\n\n private fun getFunctionParameters(cursor: CValue): List? {<|endoftext|>"} {"prompt":"}\n }\n\n private fun KtAnalysisSession.renderScopeMembers(\n scope: KtScope,\n printer: PrettyPrinter,\n printPretty: Boolean,\n additionalSymbolInfo: KtAnalysisSession.(KtSymbol) -> String?,\n ) {\n fun List.renderAll(\n symbolKind: String,","completion":"renderPrettySymbol: KtAnalysisSession.(T) -> String,\n ) = with(printer) {\n appendLine(\"$symbolKind: $size\")\n withIndent {\n forEach {\n appendLine(\n if (printPretty) {\n this@KtAnalysisSession.renderPrettySymbol(it)\n } else {\n debugRenderer.render(analysisSession, it)<|endoftext|>"} {"prompt":"if (!(x !is Class.NestedClass?) != false == true) {\n x\n x?.prop_4\n }\n}","completion":"\/\/ TESTCASE NUMBER: 6\nfun case_6(x: Any?) {\n if (!(x !is Object) != false != false != false) {\n x\n x.prop_1<|endoftext|>"} {"prompt":"for (platformDir in platformDirs) {\n if (platformDir.isDirectory) {\n bases.add(platformDir.absolutePath)\n }\n }\n if (bases.isEmpty()) {\n bases.add(moduleSourceDir.absolutePath)\n }\n put(CommonConfigurationKeys.KLIB_RELATIVE_PATH_BASES, bases)\n }","completion":"private inner class ProjectStepsExecutor(\n private val projectInfo: ProjectInfo,\n private val moduleInfos: Map,\n private val testDir: File,\n private val sourceDir: File,\n private val buildDir: File,\n private val jsDir: File,\n ) {\n private inner class TestStepInfo(\n val moduleName: String,<|endoftext|>"} {"prompt":"if (parent is KtCallableReferenceExpression && expression == parent.callableReference) {\n return CALLABLE_REFERENCE(parent.receiverExpression)\n }\n\n val receiverExpression = expression.getReceiverExpression()\n\n if (expression.isImportDirectiveExpression()) {\n return IMPORT_DIRECTIVE(receiverExpression)\n }","completion":"if (expression.isPackageDirectiveExpression()) {\n return PACKAGE_DIRECTIVE(receiverExpression)\n }\n\n if (parent is KtUserType) {\n val constructorCallee = (parent.parent as? KtTypeReference)?.parent as? KtConstructorCalleeExpression<|endoftext|>"} {"prompt":"private var transformationInfo: TransformationInfo? = null\n private var currentLabel: Label? = null\n\n override fun visitLabel(label: Label?) {\n currentLabel = label\n super.visitLabel(label)\n }\n\n override fun visitLineNumber(line: Int, start: Label) {\n if (!isInlineOnlyMethod) {\n currentLineNumber = line\n }","completion":"super.visitLineNumber(line, start)\n }\n\n private fun handleAnonymousObjectRegeneration() {\n transformationInfo = iterator.next()\n\n val oldClassName = transformationInfo!!.oldClassName\n if (inliningContext.parent?.transformationInfo?.oldClassName == oldClassName) {\n \/\/ Object constructs itself, don't enter an infinite recursion of regeneration.<|endoftext|>"} {"prompt":"val callee = expression.symbol.owner\n return callee.valueParameters.size == 1 &&\n callee.extensionReceiverParameter?.type?.isSubtypeOfClass(context.ir.symbols.comparable) == true &&\n callee.kotlinFqName == FqName(\"kotlin.ranges.${OperatorNameConventions.RANGE_TO}\")","completion":"}\n\n override fun build(expression: IrCall, data: Nothing?, scopeOwner: IrSymbol) =\n ComparableRangeInfo(\n start = expression.extensionReceiver!!,\n endInclusive = expression.getValueArgument(0)!!\n )\n}<|endoftext|>"} {"prompt":"\/\/ MODULE: m1-common\n\/\/ FILE: common.kt\n\nexpect class Foo1\nexpect class Foo2\nexpect class Foo3\n\nexpect class Bar1()","completion":"expect class Bar2()\nexpect class Bar3()<|endoftext|>"} {"prompt":"* [build cache](https:\/\/docs.gradle.org\/current\/userguide\/build_cache.html) with the same JDK version.\n *\/\ninterface KotlinJavaToolchain {\n\n \/**\n * The configured JVM toolchain [JavaVersion].\n *\n * This property represents the configured JVM toolchain [JavaVersion] used for the task.","completion":"* If the toolchain is not explicitly set, it defaults to the version of the JDK that Gradle is currently running.\n *\/\n @get:Input\n val javaVersion: Provider\n\n \/**\n * Provides access to the [JdkSetter] to configure the JVM toolchain for the task using an explicit JDK location.\n *\/\n @get:Internal<|endoftext|>"} {"prompt":"(spread is IrFunctionAccessExpression && spread.symbol == builder.irSymbols.arrayOfNulls))\n return spread\n\n return builder.irBlock {\n val spreadVar = if (spread is IrGetValue) spread.symbol.owner else irTemporary(spread)\n val size = unwrappedArrayType.classOrNull!!.getPropertyGetter(\"size\")!!","completion":"val arrayCopyOf = builder.irSymbols.getArraysCopyOfFunction(unwrappedArrayType as IrSimpleType)\n \/\/ TODO consider using System.arraycopy if the requested array type is non-generic.\n +irCall(arrayCopyOf).apply {\n putValueArgument(0, coerce(irGet(spreadVar), unwrappedArrayType))<|endoftext|>"} {"prompt":"* Resolve owner of the call with special handling of Any methods:\n * if toString\/eq\/hc is invoked on an interface instance, we resolve\n * owner as Any and dispatch it via vtable.\n * Note: Keep on par with DFG builder.\n *\/\n val anyMethod = irFunction.findOverriddenMethodOfAny()\n\n return getVirtualFunctionTrampolineImpl(anyMethod ?: irFunction)","completion":"}\n\nprivate fun CodeGenerator.getVirtualFunctionTrampolineImpl(irFunction: IrSimpleFunction) =\n generationState.virtualFunctionTrampolines.getOrPut(irFunction) {\n val targetName = if (irFunction.isExported())\n irFunction.computeSymbolName()\n else<|endoftext|>"} {"prompt":"\/\/ library.kt:18 box: xFoo$iv:int=1:int, $i$f$foo:int=0:int, xBar1\\1$iv:int=0:int, xBar2\\1$iv:int=1:int, xBar3\\1$iv:int=2:int, $i$f$bar\\1\\6:int=0:int,","completion":"xBaz1\\2$iv:int=100:int, xBaz2\\2$iv:int=101:int, xBaz3\\2$iv:int=102:int, $i$f$baz\\2\\31:int=0:int<|endoftext|>"} {"prompt":"913, 788, 837, 913, 787, 768, 837, 913, 788, 768, 837, 913, 787, 769, 837, 913,\n 788, 769, 837, 913, 787, 834, 837, 913, 788, 834, 837, 951, 787, 837, 951, 788,","completion":"837, 951, 787, 768, 837, 951, 788, 768, 837, 951, 787, 769, 837, 951, 788, 769,\n 837, 951, 787, 834, 837, 951, 788, 834, 837, 919, 787, 837, 919, 788, 837, 919,<|endoftext|>"} {"prompt":"@JvmField\n val KOTLIN_1_1 = createByLanguageVersion(LanguageVersion.KOTLIN_1_1)\n\n @JvmField\n val KOTLIN_1_2 = createByLanguageVersion(LanguageVersion.KOTLIN_1_2)\n\n @JvmField","completion":"val KOTLIN_1_3 = createByLanguageVersion(LanguageVersion.KOTLIN_1_3)\n\n @JvmField\n val KOTLIN_1_4 = createByLanguageVersion(LanguageVersion.KOTLIN_1_4)\n\n @JvmField\n val KOTLIN_1_5 = createByLanguageVersion(LanguageVersion.KOTLIN_1_5)<|endoftext|>"} {"prompt":"f(r)\n r\n require(B(\"3\") == B(3U))\n C(2, B(3U), \"\")\n D(C(2, B(3U), \"\"))\n val x = D(C(2, B(3U), \"\"))\n var y = D(C(4, B(5U), \"1\"))\n supply(y)","completion":"y = D(C(6, B(7U), \"2\"))\n y = D(6, 7U, 2)\n y = inlined(6, 7U, 2)\n y = notInlined(6, 7U, 2)\n supply(y)\n}\n\nfun h1() {\n var y = inlined(1, 2U, 3) \/\/ todo fix box<|endoftext|>"} {"prompt":"total += A488.a\n total += A489.a\n total += A490.a\n total += A491.a\n total += A492.a\n total += A493.a\n total += A494.a\n total += A495.a\n total += A496.a\n total += A497.a\n total += A498.a\n total += A499.a","completion":"return total\n}\n\nprivate object B0 { val a = Random.nextInt(100) }\nprivate object B1 { val a = B0.a + Random.nextInt(100) }\nprivate object B2 { val a = B1.a + Random.nextInt(100) }\nprivate object B3 { val a = B2.a + Random.nextInt(100) }<|endoftext|>"} {"prompt":"\/\/ MODULE: m1-common\n\/\/ FILE: common.kt\nannotation class Ann\n\n@Ann\nexpect class AnnotationMatching\n\n@Ann\nexpect class AnnotationOnExpectOnly\n\nexpect class AnnotationOnActualOnly\n\nexpect class AnnotationInside {\n @Ann\n fun matches()\n\n @Ann\n fun onlyOnExpect()\n\n fun onlyOnActual()\n}","completion":"\/\/ MODULE: m1-jvm()()(m1-common)\n\/\/ FILE: jvm.kt\n@Ann\nactual class AnnotationMatching\n\nactual class AnnotationOnExpectOnly\n\n@Ann\nactual class AnnotationOnActualOnly\n\nactual class AnnotationInside {\n @Ann\n actual fun matches() {}<|endoftext|>"} {"prompt":"import java.nio.file.Files\n\nval ModuleKind.extension: String\n get() = when (this) {\n ModuleKind.ES -> ESM_EXTENSION\n else -> REGULAR_EXTENSION\n }\n\nenum class TsCompilationStrategy {\n NONE,\n MERGED,\n EACH_FILE\n}\n\nabstract class CompilationOutputs {","completion":"var dependencies: Collection> = emptyList()\n\n abstract val tsDefinitions: TypeScriptFragment?\n\n abstract val jsProgram: JsProgram?\n\n abstract fun writeJsCode(outputJsFile: File, outputJsMapFile: File)<|endoftext|>"} {"prompt":"x.equals(null)\n x.propT","completion":"x.propAny\n x.propNullableT<|endoftext|>"} {"prompt":"propertyCache.synthetic.values.forEachWithRemapping(symbolsMappingForLazyClasses::remapPropertySymbol, block)\n getterForPropertyCache.values.forEachWithRemapping(symbolsMappingForLazyClasses::remapFunctionSymbol, block)","completion":"setterForPropertyCache.values.forEachWithRemapping(symbolsMappingForLazyClasses::remapFunctionSymbol, block)\n backingFieldForPropertyCache.values.forEach(block)\n propertyForBackingFieldCache.values.forEach(block)\n delegateVariableForPropertyCache.values.forEach(block)\n }<|endoftext|>"} {"prompt":"override fun build(): FirAnonymousFunction {\n return FirAnonymousFunctionImpl(\n source,\n resolvePhase,\n annotations.toMutableOrEmpty(),\n moduleData,\n origin,\n attributes,\n status,\n returnTypeRef,\n receiverParameter,\n deprecationsProvider,\n containerSource,\n dispatchReceiverType,","completion":"contextReceivers.toMutableOrEmpty(),\n controlFlowGraphReference,\n valueParameters,\n body,\n contractDescription,\n symbol,\n label,\n invocationKind,\n inlineStatus,\n isLambda,\n hasExplicitParameterList,\n typeParameters,\n typeRef,\n )\n }\n\n}<|endoftext|>"} {"prompt":"if (f != null) f.propNullableT\n\n if (f != null) f.propNullableAny","completion":"if (f != null) f.funT()\n\n if (f != null) f.funAny()<|endoftext|>"} {"prompt":"\/\/ test.kt:16 box\n\/\/ test.kt:17 box\n\/\/ test.kt:13 box\n\n\/\/ EXPECTATIONS JS_IR\n\/\/ test.kt:4 box\n\/\/ test.kt:6 box\n\/\/ test.kt:9 box\n\/\/ test.kt:11 box\n\/\/ test.kt:13 box\n\n\/\/ EXPECTATIONS WASM\n\/\/ test.kt:4 $box (12, 4)","completion":"\/\/ test.kt:5 $box\n\/\/ test.kt:16 $box (4, 4)\n\/\/ test.kt:6 $box (12, 8)\n\/\/ test.kt:9 $box\n\/\/ test.kt:8 $box\n\/\/ test.kt:10 $box\n\/\/ test.kt:11 $box (12, 8)\n\/\/ test.kt:13 $box<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor\nimport org.jetbrains.kotlin.diagnostics.Errors\nimport org.jetbrains.kotlin.diagnostics.reportDiagnosticOnce\nimport org.jetbrains.kotlin.diagnostics.reportDiagnosticOnceWrtDiagnosticFactoryList","completion":"import org.jetbrains.kotlin.psi.KtNameReferenceExpression\nimport org.jetbrains.kotlin.psi.KtParameter\nimport org.jetbrains.kotlin.resolve.BindingContext\nimport org.jetbrains.kotlin.resolve.calls.SPECIAL_FUNCTION_NAMES<|endoftext|>"} {"prompt":"* @sample samples.collections.Arrays.CopyOfOperations.copyOf\n *\/\npublic actual fun LongArray.copyOf(): LongArray {\n return this.copyOfUninitializedElements(size)\n}\n\n\/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n *\/","completion":"public actual fun FloatArray.copyOf(): FloatArray {\n return this.copyOfUninitializedElements(size)\n}\n\n\/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n *\/\npublic actual fun DoubleArray.copyOf(): DoubleArray {\n return this.copyOfUninitializedElements(size)\n}<|endoftext|>"} {"prompt":"fun generatedTopLevelFunction1(): GeneratedClass2\n\n\/\/ FILE: extension2.kt\n\/\/ RESOLVE_EXTENSION_FILE\npackage generated\n\n\/\/ RESOLVE_EXTENSION_CLASSIFIER: GeneratedClass2\nclass GeneratedClass2 {\n fun generatedClassMember2(): GeneratedClass1\n}\n\n\/\/ FILE: main.kt\nimport generated.*\n\nfun main() {","completion":"generatedTopLevelFunction1()\n}<|endoftext|>"} {"prompt":"val FirResolvePhase.isBodyResolve: Boolean\n get() = when (this) {\n FirResolvePhase.BODY_RESOLVE,\n FirResolvePhase.IMPLICIT_TYPES_BODY_RESOLVE -> true\n else -> false\n }\n\n\/**\n * See [FirResolvePhase] KDoc for more details about resolution contacts.\n *","completion":"* @param this The current phase\n * @param requestedPhase The requested phase\n *\n * @see FirResolvePhase\n * @see org.jetbrains.kotlin.fir.symbols.FirLazyDeclarationResolver\n * @see org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase<|endoftext|>"} {"prompt":"|tasks.named(\"jar\", Jar) {\n | duplicatesStrategy = DuplicatesStrategy.INCLUDE\n |}\n |\n |sourceSets.main.resources.srcDir \"src\/main\/extra-resources\"\n |\n |apply plugin: 'org.jetbrains.kotlin.jvm'\n |\n \"\"\".trimMargin()\n )","completion":"build(\"jar\") {\n assertFileInProjectExists(\"build\/libs\/simpleProject.jar\")\n projectPath.resolve(\"build\/libs\/simpleProject.jar\").assertZipArchiveContainsFilesOnce(\n listOf(mainResFile.name, additionalResFile.name)\n )\n }\n }\n }\n\n @GradleTest<|endoftext|>"} {"prompt":"override fun categoryId(categoryCode: String): String = when (categoryCode) {\n CharCategory.NON_SPACING_MARK.code,\n CharCategory.ENCLOSING_MARK.code,\n CharCategory.FORMAT.code,\n CharCategory.MODIFIER_LETTER.code,\n CharCategory.MODIFIER_SYMBOL.code -> id\n else -> \"Else\"","completion":"}\n\n override fun shouldSkip(categoryId: String): Boolean {\n return categoryId != id\n }\n}<|endoftext|>"} {"prompt":"fun test4(): String = \"\"\n\n class Test5(val x: Int) {\n constructor(): this(0)\n }\n fun Test5() {}","completion":"fun Test5(x: Int) = x\n\n return 0\n }\n}\n\nval obj = object {\n fun test() {\n fun test1() {}\n fun test1() {}<|endoftext|>"} {"prompt":"\/\/ library.kt:48 box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass","completion":"\/\/ library.kt:56 box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass, $i$f$test\\38\\476:int=0:int<|endoftext|>"} {"prompt":"* Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n *","completion":"* @sample samples.collections.Collections.Aggregates.reduceOrNull\n *\/\n@SinceKotlin(\"1.4\")\npublic inline fun DoubleArray.reduceIndexedOrNull(operation: (index: Int, acc: Double, Double) -> Double): Double? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {<|endoftext|>"} {"prompt":"fun getAbiTypes() = abiTypes.filter { !toIgnore.contains(it) && it != classInternalName }.toSet()\n fun getPrivateTypes() = privateTypes.filter { !toIgnore.contains(it) && it != classInternalName && !abiTypes.contains(it) }.toSet()","completion":"override fun visit(version: Int, access: Int, name: String?, signature: String?, superName: String?, interfaces: Array?) {\n super.visit(version, access, name, signature, superName, interfaces)\n classInternalName = name!!\n superName?.let {\n abiTypes.add(it)\n }\n interfaces?.let {<|endoftext|>"} {"prompt":"replaceEmptyParameterWithEmptyArray(expression)\n return expression\n }\n\n override fun visitVararg(expression: IrVararg): IrExpression {\n expression.transformChildrenVoid(transformer)\n\n val hasSpreadElement = hasSpreadElement(expression)\n val type = expression.varargElementType\n val arrayHandle = arrayType(expression.type)","completion":"val irBuilder = context.createIrBuilder(owner, expression.startOffset, expression.endOffset)\n val isConstantVararg = expression.elements.all {\n it is IrConst<*> || it is IrConstantValue\n }\n if (isConstantVararg) {\n return irBuilder.irCall(\n arrayHandle.copyOfSymbol,\n ).apply {<|endoftext|>"} {"prompt":"o6.c()\n o6.i1()\n o6.i2()\n o7.c()\n o7.i1()\n o7.i2()\n o8.g()\n o9.g()\n o9.i1()\n o9.i2()\n o10.g()\n o10.i1()\n o10.i2()","completion":"}\n}<|endoftext|>"} {"prompt":"val interopCreateObjCObjectHolder = interopFunction(\"createObjCObjectHolder\")\n\n val interopCreateKotlinObjectHolder = interopFunction(\"createKotlinObjectHolder\")\n val interopUnwrapKotlinObjectHolderImpl = interopFunction(\"unwrapKotlinObjectHolderImpl\")\n\n val interopCreateObjCSuperStruct = interopFunction(\"createObjCSuperStruct\")","completion":"val interopGetMessenger = interopFunction(\"getMessenger\")\n val interopGetMessengerStret = interopFunction(\"getMessengerStret\")\n\n val interopGetObjCClass = interopFunction(InteropFqNames.getObjCClassFunName)\n val interopObjCObjectSuperInitCheck = interopFunction(InteropFqNames.objCObjectSuperInitCheckFunName)<|endoftext|>"} {"prompt":".associateBy { it.versionNumber }\n\n val abiSignatureVersion = library.versions.irSignatureVersions\n .map { it.number }\n .sortedDescending()\n .firstNotNullOfOrNull { versionsSupportedByAbiReader[it] }\n\n if (abiSignatureVersion == null) {\n output.logError(","completion":"\"There is no signature version that would be both supported in library ${library.libraryFile}\" +\n \" and by the KLIB ABI reader. Supported versions in the library:\" +\n \" ${library.versions.irSignatureVersions.joinToString { it.number.toString() }}\" +<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.api.components\n\nimport org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeOwner\nimport org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion\nimport org.jetbrains.kotlin.name.FqName","completion":"import org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.psi.KtFile\n\npublic abstract class KtImportOptimizer : KtLifetimeOwner {\n public abstract fun analyseImports(file: KtFile): KtImportOptimizerResult\n}\n\npublic interface KtImportOptimizerMixIn : KtAnalysisSessionMixIn {\n\n \/**<|endoftext|>"} {"prompt":"if (a.b !== null) a.b.propNullableAny\n if (a.b !== null) a.b.funT()","completion":"if (a.b !== null) a.b.funAny()\n if (a.b !== null) a.b.funNullableT()<|endoftext|>"} {"prompt":"diagnostic = ConeSimpleDiagnostic(\"empty body\", DiagnosticKind.Other)\n }\n result.transformReturnTypeRef(transformer, withExpectedType(returnTypeRef))\n }\n\n return result\n }\n\n override fun transformFunction(\n function: FirFunction,\n data: ResolutionMode\n ): FirFunction {\n if (function.bodyResolved) return function","completion":"return transformFunction(function, data, shouldResolveEverything = true)\n }\n\n private fun transformFunction(\n function: FirFunction,\n data: ResolutionMode,\n shouldResolveEverything: Boolean,\n ): FirFunction = whileAnalysing(session, function) {\n val bodyResolved = function.bodyResolved\n dataFlowAnalyzer.enterFunction(function)<|endoftext|>"} {"prompt":"private fun createFileStub(project: Project, text: String): PsiFileStub<*> {\n val virtualFile = LightVirtualFile(\"dummy.kt\", KotlinFileType.INSTANCE, text)\n virtualFile.language = KotlinLanguage.INSTANCE\n SingleRootFileViewProvider.doNotCheckFileSizeLimit(virtualFile)","completion":"val psiFileFactory = PsiFileFactory.getInstance(project) as PsiFileFactoryImpl\n val file = psiFileFactory.trySetupPsiForFile(virtualFile, KotlinLanguage.INSTANCE, false, false)!!\n return KtFileElementType.INSTANCE.builder.buildStubTree(file) as PsiFileStub<*>\n }\n}<|endoftext|>"} {"prompt":"prerequisite = setOf(localClassesInInlineFunctionsPhase)\n)\n\n\nprivate val wrapInlineDeclarationsWithReifiedTypeParametersPhase = makeIrModulePhase(\n ::WrapInlineDeclarationsWithReifiedTypeParametersLowering,\n name = \"WrapInlineDeclarationsWithReifiedTypeParametersPhase\",\n description = \"Wrap inline declarations with reified type parameters\"\n)","completion":"private val functionInliningPhase = makeIrModulePhase(\n ::WasmFunctionInlining,\n name = \"FunctionInliningPhase\",\n description = \"Perform function inlining\",\n prerequisite = setOf(\n expectDeclarationsRemovingPhase,\n wrapInlineDeclarationsWithReifiedTypeParametersPhase,\n localClassesInInlineLambdasPhase,<|endoftext|>"} {"prompt":"val version = json.nextString()\n if (version != this.version) return null\n\n check(json.nextName() == \"items\")\n json.obj {\n while (json.peek() == JsonToken.NAME) {\n val key = json.nextName()\n json.beginObject()\n check(json.nextName() == \"src\")\n val src = json.nextString()","completion":"var target: String? = null\n if (json.peek() == JsonToken.NAME) {\n check(json.nextName() == \"target\")\n if (json.peek() != JsonToken.NULL) {\n target = json.nextString()\n }\n }\n json.endObject()\n\n result[decodeHexString(key)] = Element(src, target)<|endoftext|>"} {"prompt":"* HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses\n *\/\n\n\/*\n * TESTCASE NUMBER: 1\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-28759\n *\/\nfun case_1() {\n val x: Int? = 10\n val y: Int?\n y = x\n if (y != null) {","completion":"x\n x.inv()\n }\n}\n\n\/*\n * TESTCASE NUMBER: 2\n * UNEXPECTED BEHAVIOUR<|endoftext|>"} {"prompt":"\"\u0430\u0432\u0442\u043e\u0440\u0435\u043c\u043e\u043d\u0442\u043d\u0438\u043a\",\n\"\u0430\u0432\u0442\u043e\u0440\u0435\u043c\u043e\u043d\u0442\u043d\u044b\u0439\",\n\"\u0430\u0432\u0442\u043e\u0440\u0435\u0444\u0435\u0440\u0430\u0442\",\n\"\u0430\u0432\u0442\u043e\u0440\u0435\u0444\u0440\u0438\u0436\u0435\u0440\u0430\u0442\u043e\u0440\",\n\"\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f\",","completion":"\"\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439\",\n\"\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\",\n\"\u0430\u0432\u0442\u043e\u0440\u0438\u0442\u0430\u0440\u043d\u043e\u0441\u0442\u044c\",\n\"\u0430\u0432\u0442\u043e\u0440\u0438\u0442\u0430\u0440\u043d\u044b\u0439\",\n\"\u0430\u0432\u0442\u043e\u0440\u0438\u0442\u0435\u0442\",\n\"\u0430\u0432\u0442\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u043e\u0441\u0442\u044c\",<|endoftext|>"} {"prompt":"private fun getRealParent(variable: IrVariable) =\n variable.parent.let { skippedFunctionsParents[it] ?: it }\n\n }, irDeclaration as? IrDeclarationParent ?: irDeclaration.parent)\n }\n\n private fun rewriteSharedVariables() {\n val transformedSymbols = HashMap()","completion":"irBody.transformChildrenVoid(object : IrElementTransformerVoid() {\n override fun visitVariable(declaration: IrVariable): IrStatement {\n declaration.transformChildrenVoid(this)\n\n if (declaration !in sharedVariables) return declaration\n\n val newDeclaration = context.sharedVariablesManager.declareSharedVariable(declaration)\n newDeclaration.parent = declaration.parent<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.FirPureAbstractElement\nimport org.jetbrains.kotlin.fir.visitors.FirTransformer\nimport org.jetbrains.kotlin.fir.visitors.FirVisitor\n\n\/**\n * Generated from: [org.jetbrains.kotlin.fir.tree.generator.FirTreeBuilder.reference]","completion":"*\/\nabstract class FirReference : FirPureAbstractElement(), FirElement {\n abstract override val source: KtSourceElement?\n\n override fun accept(visitor: FirVisitor, data: D): R =\n visitor.visitReference(this, data)\n\n @Suppress(\"UNCHECKED_CAST\")<|endoftext|>"} {"prompt":"private val descriptorMetadataMap: MutableMap = hashMapOf()\n\n private val ClassDescriptor.needSaveProgramOrder: Boolean\n get() = isInternalSerializable && (modality == Modality.OPEN || modality == Modality.ABSTRACT)","completion":"internal fun putIfNeeded(descriptor: ClassDescriptor, properties: SerializableProperties) {\n if (!descriptor.needSaveProgramOrder) return\n descriptorMetadataMap[descriptor] = properties\n }\n\n override fun afterClass(\n descriptor: ClassDescriptor,\n proto: ProtoBuf.Class.Builder,<|endoftext|>"} {"prompt":"return ReceiverParameterDescriptorImpl(owner, TransientReceiver(dynamicType), Annotations.EMPTY)\n }\n\n private fun createTypeParameters(owner: DeclarationDescriptor, call: Call): List =\n call.typeArguments.indices.map { index\n ->\n TypeParameterDescriptorImpl.createWithDefaultBound(\n owner,","completion":"Annotations.EMPTY,\n false,\n Variance.INVARIANT,\n Name.identifier(\"T$index\"),\n index,\n storageManager\n )\n }\n\n private fun createValueParameters(owner: FunctionDescriptor, call: Call): List {\n val parameters = ArrayList()<|endoftext|>"} {"prompt":"val LLVMValueRef.isConst:Boolean\n get() = (LLVMIsConstant(this) == 1)\n\n\ninternal inline fun generateFunction(\n codegen: CodeGenerator,\n function: IrFunction,\n startLocation: LocationInfo?,\n endLocation: LocationInfo?,\n code: FunctionGenerationContext.() -> Unit\n) {","completion":"val llvmFunction = codegen.llvmFunction(function)\n\n val isCToKotlinBridge = function.origin == CBridgeOrigin.C_TO_KOTLIN_BRIDGE\n \/\/ TODO: Alternative approach: lowering that changes origin of such functions to C_TO_KOTLIN_BRIDGE?\n || function.hasAnnotation(RuntimeNames.exportedBridge)<|endoftext|>"} {"prompt":"const val plus7 = twoVal.plus(longVal)\nconst val plus8 = twoVal.plus(floatVal)\n\nconst val minus1 = oneVal.minus(twoVal)","completion":"const val minus2 = twoVal.minus(twoVal)\nconst val minus3 = threeVal.minus(twoVal)\nconst val minus4 = twoVal.minus(byteVal)<|endoftext|>"} {"prompt":"* General category \"So\" in the Unicode specification.\n *\/\n OTHER_SYMBOL,\n\n \/**\n * General category \"Pi\" in the Unicode specification.\n *\/\n INITIAL_QUOTE_PUNCTUATION,\n\n \/**\n * General category \"Pf\" in the Unicode specification.\n *\/\n FINAL_QUOTE_PUNCTUATION;\n\n \/**","completion":"* Two-letter code of this general category in the Unicode specification.\n *\/\n public val code: String\n\n \/**\n * Returns `true` if [char] character belongs to this category.\n *\/\n public operator fun contains(char: Char): Boolean\n}<|endoftext|>"} {"prompt":"val c = Node(\"c\")\n val d = Node(\"d\")\n val e = Node(\"e\")\n val f = Node(\"f\")\n val g = Node(\"g\")\n\n \/\/ a -> (b, c)\n \/\/ c -> (d)\n a.children.add(b)\n a.children.add(c)\n c.children.add(d)","completion":"\/\/ e -> (f, g, a)\n e.children.add(f)\n e.children.add(g)\n e.children.add(a) \/\/ <- cycle back to a!\n\n assertEquals(\n listOf(\"b\", \"c\", \"f\", \"g\", \"d\"), \/\/ <- a *is not* listed in closure!!!<|endoftext|>"} {"prompt":"fun get(): List>\n}\n\nclass GetScriptClassForImplicits(\n private val previousScriptClassesProvider: PreviousScriptClassesProvider\n) : GetScriptingClassByClassLoader {\n private val getScriptingClass = JvmGetScriptingClass()\n\n private val lastClassLoader\n get() = previousScriptClassesProvider.get().lastOrNull()?.java?.classLoader","completion":"override fun invoke(\n classType: KotlinType,\n contextClass: KClass<*>,\n hostConfiguration: ScriptingHostConfiguration\n ): KClass<*> {\n return getScriptingClass(classType, lastClassLoader ?: contextClass.java.classLoader, hostConfiguration)\n }\n\n override fun invoke(\n classType: KotlinType,\n contextClassLoader: ClassLoader?,<|endoftext|>"} {"prompt":"override inline final fun <reified T> qux(x: T) {}\n }\n\n val anObject = object : IBase {\n override inline final fun foo() {}","completion":"override inline fun bar() {}\n override inline final fun <reified T> qux(x: T) {}\n }\n\n fun aMethod() {\n class CLocal : IBase {<|endoftext|>"} {"prompt":"return context.symbolTable.descriptorExtension.referenceSimpleFunction(descriptor)\n }\n\n private fun getFunctionInEnumPackage(name: String) =\n context.symbolTable.descriptorExtension.referenceSimpleFunction(\n context.getFunctions(kotlinEnumsPackageFqn.child(Name.identifier(name))).single()\n )","completion":"private fun getFunctionInKotlinPackage(name: String) =\n context.symbolTable.descriptorExtension.referenceSimpleFunction(\n context.getFunctions(kotlinPackageFqn.child(Name.identifier(name))).single()\n )\n\n private fun getInternalClassWithoutPackage(fqName: String) =<|endoftext|>"} {"prompt":"declarationRenderer.nameRenderer.renderName(analysisSession, symbol, declarationRenderer, printer)\n\n printer.printCollection(symbol.valueParameters, prefix = \"(\", postfix = \")\") {\n declarationRenderer.typeRenderer.renderType(analysisSession, it.returnType, printer)\n }\n\n withPrefix(\": \") {","completion":"declarationRenderer.returnTypeRenderer\n .renderReturnType(analysisSession, symbol, declarationRenderer, printer)\n }\n }\n }\n }\n}<|endoftext|>"} {"prompt":"public inline fun kotlin.FloatArray.zip(other: kotlin.collections.Iterable, transform: (a: kotlin.Float, b: R) -> V): kotlin.collections.List","completion":"public infix fun kotlin.IntArray.zip(other: kotlin.Array): kotlin.collections.List><|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid\nimport org.jetbrains.kotlin.psi.KtElement\nimport org.jetbrains.kotlin.test.builders.TestConfigurationBuilder\nimport org.jetbrains.kotlin.test.services.PreAnalysisHandler\nimport org.jetbrains.kotlin.test.services.TestModuleStructure","completion":"import org.jetbrains.kotlin.test.services.TestServices\n\n\ninternal fun FirElement.renderWithClassName(): String =\n \"${this::class.simpleName} `${render()}`\"\n\n\ninternal fun FirBasedSymbol<*>.name(): String = when (this) {\n is FirCallableSymbol<*> -> callableId.callableName.asString()<|endoftext|>"} {"prompt":"public interface KtPossiblyNamedSymbol : KtSymbol {\n public val name: Name?\n}\n\npublic interface KtNamedSymbol : KtPossiblyNamedSymbol {\n override val name: Name\n}\n\npublic interface KtSymbolWithTypeParameters : KtSymbol {\n public val typeParameters: List\n}\n\n\/**","completion":"* A marker interface for symbols which could potentially be `expect` or `actual`. For more details about `expect` and `actual`\n * declarations, see [documentation](https:\/\/kotlinlang.org\/docs\/multiplatform-connect-to-apis.html).\n *\/\npublic interface KtPossibleMultiplatformSymbol : KtSymbol {\n \/**<|endoftext|>"} {"prompt":"val topLevelName = classifier.topLevelName\n if (topLevelName in alreadyDeclared) {\n throw IllegalStateException(\"'$topLevelName' is already declared\")\n }\n alreadyDeclared.add(topLevelName)\n\n return topLevelName\n }\n\n override fun declareProperty(receiver: String?, name: String): String? {","completion":"val fullName = receiver?.let { \"$it.${name}\" } ?: name\n return if (fullName in declaredProperties || name in namesToBeDeclared || name in importedNameToPkg) {\n null\n \/\/ TODO: using original global name should be preferred to importing the clashed name.\n } else {\n declaredProperties.add(fullName)\n name\n }\n }<|endoftext|>"} {"prompt":"case405 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 406\nfun case406(){\n val case406 = '\\ucaff'\n case406\n case406 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 407\nfun case407(){","completion":"val case407 = '\\ucb00'\n case407\n case407 checkType { check()}\n}\n\/\/ TESTCASE NUMBER: 408\nfun case408(){\n val case408 = '\\ucbff'<|endoftext|>"} {"prompt":"expect(2) { arrayOf(\"cat\", \"dog\", \"bird\").indexOf(\"bird\") }\n expect(0) { arrayOf(null, \"dog\", null).indexOf(null as String?)}\n\n expect(-1) { arrayOf(\"cat\", \"dog\", \"bird\").indexOfFirst { it.contains(\"p\") } }","completion":"expect(0) { arrayOf(\"cat\", \"dog\", \"bird\").indexOfFirst { it.startsWith('c') } }\n expect(1) { arrayOf(\"cat\", \"dog\", \"bird\").indexOfFirst { it.startsWith('d') } }\n expect(2) { arrayOf(\"cat\", \"dog\", \"bird\").indexOfFirst { it.endsWith('d') } }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.codegen.state.isMethodWithDeclarationSiteWildcardsFqName\nimport org.jetbrains.kotlin.descriptors.DescriptorVisibilities\nimport org.jetbrains.kotlin.descriptors.FunctionDescriptor\nimport org.jetbrains.kotlin.ir.declarations.*","completion":"import org.jetbrains.kotlin.ir.declarations.lazy.IrLazyClass\nimport org.jetbrains.kotlin.ir.declarations.lazy.IrLazyFunctionBase\nimport org.jetbrains.kotlin.ir.declarations.lazy.IrMaybeDeserializedClass\nimport org.jetbrains.kotlin.ir.descriptors.IrBasedSimpleFunctionDescriptor<|endoftext|>"} {"prompt":"serializerDescriptor, SerialEntityNames.TYPE_PARAMS_SERIALIZERS_GETTER.identifier,\n { true }, { it.isEmpty() }\n )?.takeIf { it.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE }?.let { generateTypeParamsSerializersGetter(it) }\n }","completion":"protected abstract fun generateTypeParamsSerializersGetter(function: FunctionDescriptor)\n\n protected abstract fun generateChildSerializersGetter(function: FunctionDescriptor)\n\n protected val generatedSerialDescPropertyDescriptor = getPropertyToGenerate(\n serializerDescriptor, SerialEntityNames.SERIAL_DESC_FIELD,\n serializerDescriptor::checkSerializableClassPropertyResult\n )<|endoftext|>"} {"prompt":"\/\/ Inputs and outputs.\n\n @OutputFile\n val outputFileProvider: Provider = project.provider { destinationDir.get().resolve(outputFileName) }\n\n \/\/Error file will be written only for errors during a project sync because for the sync task mustn't fail","completion":"\/\/see: org.jetbrains.kotlin.gradle.targets.native.tasks.IdeaSyncKotlinNativeCInteropRunnerExecutionContext\n @get:OutputFile\n internal val errorFileProvider: Provider = project.provider { destinationDir.get().resolve(\"cinterop_error.out\") }\n\n init {\n \/\/KTIJ-25563:<|endoftext|>"} {"prompt":"\/\/ with explicit type:\nfun function1(): Int = 1\nfun function2(): String = \"hello\"\nfun function3(): Planet = Planet(\"Earth\", 12742)\nfun function4(): B = A(\"Earth\", 12742)\nfun function5(): Planet = A(\"Earth\", 12742)\nfun function6(): Planet = Planet(\"Earth\", 12742)\nfun function7(): C = C(\"Earth\", 12742)","completion":"val propertyWithMismatchedType1: Long = 1\nval propertyWithMismatchedType2: Short = 1\nval propertyWithMismatchedType3: Number = 1\nval propertyWithMismatchedType4: Comparable = 1\nval propertyWithMismatchedType5: String = 1.toString()\n\nfun functionWithMismatchedType1(): Long = 1\nfun functionWithMismatchedType2(): Short = 1<|endoftext|>"} {"prompt":"open class Test {\n companion object {\n fun testStatic(ic: InnerClass): NotInnerClass = NotInnerClass(ic.value)\n }\n\n fun test(): InnerClass = InnerClass(150)\n\n inner open class InnerClass(val value: Int)\n open class NotInnerClass(val value: Int)\n}","completion":"fun box() = if (Test.testStatic(Test().test()).value == 150) \"OK\" else \"FAIL\"<|endoftext|>"} {"prompt":"*\/\n\nfun throwException(b: Boolean) = run { if (b) throw Exception() }\n\nfun box(): String {\n var isTryExecuted = false\n var isCatched = false\n var isFinallyExecuted = false\n try {\n isTryExecuted = true\n throwException(true)\n } catch (e: Exception) {\n isCatched = true\n } finally {","completion":"isFinallyExecuted = true\n }\n return if (isTryExecuted &&isCatched && isFinallyExecuted) \"OK\"\n else \"NOK\"\n}<|endoftext|>"} {"prompt":"const val d2 = `!>Person(\"Ivan\", 20).wholeName\n\n@CompileTimeCalculation\nclass A {\n val prop: Int\n constructor(arg: Boolean) {\n if (arg) {\n prop = 1\n return\n }\n prop = 2\n }\n}","completion":"const val e1 = A(true).prop\nconst val e2 = A(false).prop<|endoftext|>"} {"prompt":"\/\/ALLOW_AST_ACCESS\n\npackage test\n\nfun test1(): suspend () -> Unit = null!!\nfun test1N(): (suspend () -> Unit)? = null\nfun test2(): suspend Int.() -> Int = null!!\nfun test2N(): (suspend Int.() -> Int)? = null\nfun test3(): List Unit> = null!!","completion":"fun test3N(): List<(suspend () -> Unit)?> = null!!\nfun test4(): suspend () -> (suspend () -> Unit) = null!!\nfun test4N(): (suspend () -> (suspend () -> Unit)?)? = null<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ WITH_REFLECT\n\nimport kotlin.reflect.*\nimport kotlin.reflect.jvm.isAccessible\nimport kotlin.test.*\n\nobject Delegate {\n var storage = \"\"\n operator fun getValue(instance: Any?, property: KProperty<*>) = storage","completion":"operator fun setValue(instance: Any?, property: KProperty<*>, value: String) { storage = value }\n}\n\nclass Bar\n\nclass Foo {\n var Bar.result: String by Delegate\n}\n\nfun box(): String {\n val foo = Foo()\n val bar = Bar()\n with(foo) { bar.result = \"Fail\" }<|endoftext|>"} {"prompt":"* @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.","completion":"* @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n *\/\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"raised(\"a.a.B.failing.exception\")\n call(\"a.a.B.after\")\n caught(\"a.a.B.failing.exception\")\n }\n test(\"ignored\", true) {\n call(\"a.a.B.before\")\n call(\"a.a.B.ignored\")\n call(\"a.a.B.after\")\n }","completion":"test(\"withException\") {\n call(\"a.a.B.before\")\n call(\"withException\")\n raised(\"some exception\")\n call(\"a.a.B.after\")\n caught(\"some exception\")\n }\n suite(\"Inner\") {\n test(\"innerTest\") {\n call(\"a.a.B.Inner.innerTest\")\n }\n }<|endoftext|>"} {"prompt":"assertConstraint(nativeSharedSourceSet, IdeMultiplatformImport.SourceSetConstraint.unconstrained, isMatchExpected = true)\n }\n\n for (nativeLeafSourceSet in listOf(linuxX64Main, linuxX64Test, linuxArm64Main, linuxArm64Test)) {","completion":"assertConstraint(nativeLeafSourceSet, IdeMultiplatformImport.SourceSetConstraint.isAndroid, isMatchExpected = false)\n assertConstraint(nativeLeafSourceSet, IdeMultiplatformImport.SourceSetConstraint.isJvmAndAndroid, isMatchExpected = false)<|endoftext|>"} {"prompt":"require(x is String)\n for(i in 1..10) {\n x += \"\"\n x.length\n }\n}\n\nfun test9() {\n var x: Any? = materialize()\n require(x is Int)\n for(i in 1..10) {\n x++\n x.inc()\n }\n}\n\n\/\/Assignment after loop\n\nfun test10() {","completion":"var x: Any? = materialize()\n require(x is String)\n for(i in 1..10) {\n x.length\n }\n x = \"\"\n}\n\nfun test11() {\n var x: Any? = materialize()\n require(x is String)\n for(i in 1..10) {\n x.length\n }\n x = 10\n}<|endoftext|>"} {"prompt":"var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Collection contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as T","completion":"}\n\n\/**\n * Returns single element, or `null` if the collection is empty or has more than one element.\n *\/\npublic fun Iterable.singleOrNull(): T? {\n when (this) {\n is List -> return if (size == 1) this[0] else null\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null<|endoftext|>"} {"prompt":"v.propAny\n v.propNullableT","completion":"v.propNullableAny\n v.funT()<|endoftext|>"} {"prompt":"\/\/ running a watcher thread that ensures that if the daemon is not exited normally (may be due to RMI leftovers), it's forced to exit\n timer.schedule(daemonOptions.forceShutdownTimeoutMilliseconds) {\n cancel()\n log.info(\"force JVM shutdown\")\n exitProcess(0)\n }\n }\n else {","completion":"timer.cancel()\n }\n })\n Pair(compilerService, port)\n }\n}<|endoftext|>"} {"prompt":"if (element != null) {\n bindValue(value, element)\n }\n return value\n }\n }\n\n private fun add(instruction: Instruction) {\n pseudocode.addInstruction(instruction)\n }\n\n override fun createUnboundLabel(): Label = pseudocode.createLabel(\"L\" + labelCount++, null)","completion":"override fun createUnboundLabel(name: String): Label = pseudocode.createLabel(\"L\" + labelCount++, name)\n\n override fun enterLoop(expression: KtLoopExpression): LoopInfo {\n if (expression is KtDoWhileExpression) {\n (pseudocode.rootPseudocode as PseudocodeImpl).containsDoWhile = true\n }<|endoftext|>"} {"prompt":"+WasmEnvironmentConfigurationDirectives.GENERATE_SOURCE_MAP\n }\n }\n}\n\nopen class AbstractK1WasmTypeScriptExportTest : AbstractK1WasmTest(\n \"${JsEnvironmentConfigurator.TEST_DATA_DIR_PATH}\/typescript-export\/wasm\/\",\n \"typescript-export\/\"\n) {","completion":"override fun configure(builder: TestConfigurationBuilder) {\n super.configure(builder)\n builder.defaultDirectives {\n +WasmEnvironmentConfigurationDirectives.CHECK_TYPESCRIPT_DECLARATIONS\n }\n }\n}\n\nopen class AbstractFirWasmTypeScriptExportTest : AbstractK1WasmTest(<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.types.Variance\n\nabstract class AbstractHLExpressionTypeTest : AbstractAnalysisApiBasedTest() {\n override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {","completion":"val selected = testServices.expressionMarkerProvider.getSelectedElementOfTypeByDirective(mainFile, mainModule).let {\n if (it is KtBlockExpression && it.statements.size == 1 && it.textRange == it.statements.single().textRange) {\n it.statements.single()\n } else {\n it\n }\n }<|endoftext|>"} {"prompt":"if (0 in 1..<3 != range0.contains(0)) throw AssertionError()\n if (0 !in 1..<3 != !range0.contains(0)) throw AssertionError()\n if (!(0 in 1..<3) != !range0.contains(0)) throw AssertionError()","completion":"if (!(0 !in 1..<3) != range0.contains(0)) throw AssertionError()\n \/\/ no local optimizations\n if (element6 in 1..<3 != range0.contains(element6)) throw AssertionError()\n if (element6 !in 1..<3 != !range0.contains(element6)) throw AssertionError()<|endoftext|>"} {"prompt":"::JsCollectClassIdentifiersLowering,\n name = \"CollectClassIdentifiersLowering\",\n description = \"Save classId before all the lowerings\",\n)\n\nprivate val inventNamesForLocalClassesPhase = makeIrModulePhase(\n ::JsInventNamesForLocalClasses,\n name = \"InventNamesForLocalClasses\",\n description = \"Invent names for local classes and anonymous objects\",\n)","completion":"private val annotationInstantiationLowering = makeIrModulePhase(\n ::JsAnnotationImplementationTransformer,\n name = \"AnnotationImplementation\",\n description = \"Create synthetic annotations implementations and use them in annotations constructor calls\"\n)\n\nprivate val expectDeclarationsRemovingPhase = makeIrModulePhase(\n ::ExpectDeclarationsRemoveLowering,\n name = \"ExpectDeclarationsRemoving\",<|endoftext|>"} {"prompt":"@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.firstOrNull(predicate: (ULong) -> Boolean): ULong? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n\/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n *\/","completion":"@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.firstOrNull(predicate: (UByte) -> Boolean): UByte? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n\/**<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.api.fir.types\n\nimport org.jetbrains.kotlin.analysis.api.KtTypeProjection\nimport org.jetbrains.kotlin.analysis.api.annotations.KtAnnotationsList\nimport org.jetbrains.kotlin.analysis.api.fir.KtSymbolByFirBuilder","completion":"import org.jetbrains.kotlin.analysis.api.fir.annotations.KtFirAnnotationListForType\nimport org.jetbrains.kotlin.analysis.api.fir.types.qualifiers.UsualClassTypeQualifierBuilder\nimport org.jetbrains.kotlin.analysis.api.fir.utils.cached<|endoftext|>"} {"prompt":"testInteropObjCSmoke(\"smoke\")\n }\n\n @Test\n @TestMetadata(\"smoke_noopgc.kt\")\n fun testInteropObjCSmokeNoopGC() {\n Assumptions.assumeTrue(testRunSettings.get() == GCType.NOOP)","completion":"Assumptions.assumeTrue(testRunSettings.get() == CacheMode.WithoutCache) \/\/ TODO: Remove line after fix of KT-63944\n testInteropObjCSmoke(\"smoke_noopgc\")\n }\n\n private fun testInteropObjCSmoke(ktFilePrefix: String) {<|endoftext|>"} {"prompt":"* @return `true` if the two arrays are structurally equal, `false` otherwise.\n * \n * @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals\n *\/\n@SinceKotlin(\"1.4\")\npublic actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean {\n return contentEqualsInternal(other)\n}\n\n\/**","completion":"* Checks if the two specified arrays are *structurally* equal to one another.\n * \n * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.\n * \n * The arrays are also considered structurally equal if both are `null`.\n * \n * @param other the array to compare with this array.<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +VariableDeclarationInWhenSubject\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER\n\nfun foo(): Any = 42\nfun useInt(i: Int) {}\n\nfun testShadowingParameter(y: Any) {\n when (val y = foo()) {\n else -> {}\n }\n}","completion":"fun testShadowedInWhenBody(x: Any) {\n when (val y = x) {\n is String -> {\n val y = y.length\n useInt(y)\n }\n }\n}\n\nfun testShadowinLocalVariable() {\n val y = foo()\n when (val y = foo()) {\n else -> {}\n }\n}<|endoftext|>"} {"prompt":"makeDescription(StandardNames.FqNames.number.toSafe(), \"toDouble\") to BuiltInWithDifferentJvmName(),\n makeDescription(StandardNames.FqNames.charSequence.toSafe(), \"get\", 1) to BuiltInWithDifferentJvmName(),\n makeDescription(StandardNames.FqNames.mutableList, \"removeAt\", 1) to","completion":"BuiltInWithDifferentJvmName(needsGenericSignature = true, isOverriding = false)\n )\n\n val specialMethodNames = (specialMethodsWithDefaults + specialMethods).map { (description) -> description.name }.toHashSet()\n val specialPropertyNames = specialProperties.map { (description) -> description.name }.toHashSet()\n\n fun findSpecialWithOverride(<|endoftext|>"} {"prompt":"p19: Any?, p20: Any?, p21: Any?): Any? = call(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21)","completion":"override fun invoke(p1: Any?, p2: Any?, p3: Any?, p4: Any?, p5: Any?, p6: Any?, p7: Any?, p8: Any?, p9: Any?, p10: Any?, p11: Any?, p12: Any?, p13: Any?, p14: Any?, p15: Any?, p16: Any?, p17: Any?, p18: Any?,<|endoftext|>"} {"prompt":"Bar().foo18(x)\n Bar().foo18(y)","completion":"foo21(x, Foo(Foo(OutBar())))\n foo21(y, Foo(Foo(OutBar())))\n\n foo22(x, Foo(Foo(InBar())))\n foo22(y, Foo(Foo(InBar())))\n\n foo23(x, Foo(Foo(Bar())))\n foo23(y, Foo(Foo(Bar())))<|endoftext|>"} {"prompt":"CallableId(name, pathFqName)\n }\n else -> CallableId(context.packageFqName, context.className, name)\n }\n\n fun currentDispatchReceiverType(): ConeClassLikeType? = currentDispatchReceiverType(context)\n\n \/**\n * @return second from the end dispatch receiver. For the inner class constructor it would be the outer class.\n *\/","completion":"protected fun dispatchReceiverForInnerClassConstructor(): ConeClassLikeType? {\n val dispatchReceivers = context.dispatchReceiverTypesStack\n return dispatchReceivers.getOrNull(dispatchReceivers.lastIndex - 1)\n }\n\n fun callableIdForClassConstructor(): CallableId {\n val packageName = if (context.inLocalContext) {<|endoftext|>"} {"prompt":"override val returnExpressionCheckers: Set\n get() = setOf(\n FirReturnSyntaxAndLabelChecker,\n FirFunctionReturnTypeMismatchChecker\n )\n\n override val blockCheckers: Set\n get() = setOf(\n FirForLoopChecker,","completion":"FirConflictsExpressionChecker,\n FirSingleNamedFunctionChecker,\n )\n\n override val checkNotNullCallCheckers: Set\n get() = setOf(\n FirNotNullAssertionChecker,\n )\n\n override val elvisExpressionCheckers: Set<|endoftext|>"} {"prompt":"when {\n targetType.isByte() -> invokeIntegerCoercionFunction(targetType, \"toByte\")\n targetType.isShort() -> invokeIntegerCoercionFunction(targetType, \"toShort\")\n targetType.isLong() -> invokeIntegerCoercionFunction(targetType, \"toLong\")","completion":"KotlinBuiltIns.isUByte(targetType) -> invokeUnsignedIntegerCoercionFunction(targetType, \"toUByte\")\n KotlinBuiltIns.isUShort(targetType) -> invokeUnsignedIntegerCoercionFunction(targetType, \"toUShort\")\n KotlinBuiltIns.isUInt(targetType) -> invokeUnsignedIntegerCoercionFunction(targetType, \"toUInt\")<|endoftext|>"} {"prompt":"CANNOT_INFER_PARAMETER_TYPE, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>getMyProperty())","completion":"var f: String by foo("} {"prompt":"\/\/ TARGET_BACKEND: JS\n\/\/ WITH_REFLECT\n\/\/ KJS_WITH_FULL_RUNTIME\n\nimport kotlin.test.*\nimport kotlin.reflect.*\n\ninline fun kType() = typeOf()\n\ninline fun kType(obj: R) = kType()\n\nclass C\nclass D","completion":"fun kTypeForCWithTypeParameter() = kType>()\n\nclass Outer {\n companion object Friend\n inner class Inner\n}\n\nobject Object\n\nfun testBasics1() {\n assertEquals(\"C\", kType>().toString())<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.cfg.pseudocode.instructions.*\nimport org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicInstruction\nimport org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MagicKind","completion":"import org.jetbrains.kotlin.cfg.pseudocode.instructions.eval.MergeInstruction\nimport org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.AbstractJumpInstruction\nimport org.jetbrains.kotlin.cfg.pseudocode.instructions.jumps.ConditionalJumpInstruction<|endoftext|>"} {"prompt":"expectFailure(linkage(\"Reference to function 'changedFun' can not be evaluated: No function found for symbol '\/InterfaceWithChangedMembers.changedFun'\")) { referenceChangedFunFromInterface() }\n\n expectFailure(linkage(\"Reference to function 'functionWithUnlinkedParameter' can not be evaluated: Function uses unlinked class symbol '\/RemovedClass'\")) { referenceFunctionWithUnlinkedParameter() }","completion":"expectFailure(linkage(\"Reference to function 'functionWithUnlinkedReturnValue' can not be evaluated: Function uses unlinked class symbol '\/RemovedClass'\")) { referenceFunctionWithUnlinkedReturnValue() }\n expectFailure(linkage(\"Reference to function 'functionWithRemovedTypeParameter' can not be evaluated: Function uses unlinked class symbol '\/RemovedClass' (via type parameter 'T')\")) { referenceFunctionWithRemovedTypeParameter() }<|endoftext|>"} {"prompt":"* store the resulting 'metadata path' in this index file.\n *\/\ninternal class KotlinMetadataLibrariesIndexFile(private val file: File) {\n fun read(): List = file.readLines().map { File(it) }\n\n fun write(files: Iterable) {\n val content = files.joinToString(System.lineSeparator()) { it.path }","completion":"file.writeText(content)\n }\n}<|endoftext|>"} {"prompt":"if (a.w != null) a.w.funAny()\n if (a.w != null) a.w.funNullableT()","completion":"if (a.w != null) a.w.funNullableAny()\n if (a.w != null) a.w<|endoftext|>"} {"prompt":"package second\n\n@Target(AnnotationTarget.TYPE)\nannotation class Anno(val i: Int)\n\nopen class Base\n\nconst val outer = 0\nconst val inner = \"\"\n\nclass MyClass() : @Anno(1 + outer) Base<@Anno(2 + outer) Base<@Anno(3 + outer) Int>>() {\n open class Base","completion":"companion object {\n const val outer = \"\"\n const val inner = 0\n }\n}<|endoftext|>"} {"prompt":"NoChildren2 {}\n NoChildren2()\n\n MultiChildren {}\n MultiChildren { x ->\n println(x)\n }\n MultiChildren { x, y ->\n println(x + y)\n }","completion":"MultiChildren { x,\n y, z ->\n println(x + y + z)\n }\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase\nimport org.jetbrains.kotlin.fir.types.*","completion":"import org.jetbrains.kotlin.name.StandardClassIds\nimport org.jetbrains.kotlin.name.StandardClassIds.Annotations.ParameterNames\nimport org.jetbrains.kotlin.resolve.UseSiteTargetsList\nimport org.jetbrains.kotlin.resolve.checkers.OptInNames<|endoftext|>"} {"prompt":"private fun putNeedClassReificationMarker(declaration: IrClass) {\n \/\/ Fix KT-55398, try to get nested irclass type parameters reified info\n val reifiedTypeParameters = closureReifiedMarkers.getOrPut(declaration) { declaration.reifiedTypeParameters }\n if (reifiedTypeParameters.wereUsedReifiedParameters()) {\n putNeedClassReificationMarker(mv)","completion":"propagateChildReifiedTypeParametersUsages(reifiedTypeParameters)\n }\n }\n\n private fun generateGlobalReturnFlagIfPossible(expression: IrExpression, label: String) {\n if (config.isInlineDisabled) {<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\nfun <in T> f() {\n \n}\n\nfun <out T> g() {\n\n}","completion":"fun <out T, in X, Y> h() {\n\n}<|endoftext|>"} {"prompt":"\/\/ the unsubstituted underlying constructor with signature ' (T) -> C'\n \/\/ producing substituted underlying constructor with signature '(List) -> C>'.\n val substitutedTypeAliasConstructor = super.substitute(substitutor) as TypeAliasConstructorDescriptorImpl","completion":"val underlyingConstructorSubstitutor = TypeSubstitutor.create(substitutedTypeAliasConstructor.returnType)\n val substitutedUnderlyingConstructor = underlyingConstructorDescriptor.original.substitute(underlyingConstructorSubstitutor)\n ?: return null\n substitutedTypeAliasConstructor.underlyingConstructorDescriptor = substitutedUnderlyingConstructor\n return substitutedTypeAliasConstructor<|endoftext|>"} {"prompt":"object : GenericMetadataPropertyChecker(\"class.metadata.constructor.$name\") {\n override fun getProperty(node: KmConstructor) = propertyGetter(node)\n }\n\nfun functionMetadataPropertyChecker(name: String, propertyGetter: (KmFunction) -> String) =","completion":"object : GenericMetadataPropertyChecker(\"class.metadata.function.$name\") {\n override fun getProperty(node: KmFunction) = propertyGetter(node)\n }\n\nfun typeAliasMetadataPropertyChecker(name: String, propertyGetter: (KmTypeAlias) -> String) =<|endoftext|>"} {"prompt":"versionRequirementTable?.writeInlineParameterNullCheckRequirement(proto::addVersionRequirement)\n }\n\n if (!DescriptorUtils.hasJvmNameAnnotation(descriptor) && requiresFunctionNameManglingForReturnType(descriptor)) {\n if (!useOldManglingScheme) {","completion":"versionRequirementTable?.writeNewFunctionNameManglingRequirement(proto::addVersionRequirement)\n }\n versionRequirementTable?.writeFunctionNameManglingForReturnTypeRequirement(proto::addVersionRequirement)\n }\n }\n\n private fun PropertyDescriptor.isJvmFieldPropertyInInterfaceCompanion(): Boolean {<|endoftext|>"} {"prompt":"* Sorts the array in-place according to the order specified by the given [comparison] function.\n *\/\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit {","completion":"nativeSort(comparison)\n}\n\n\/**\n * Sorts the array in-place according to the order specified by the given [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\/\npublic actual fun Array.sortWith(comparator: Comparator): Unit {<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.psi2ir.generators.GeneratorContext\n\nprivate val varTypeAnnotationFqName = FqName(\"kotlinx.cinterop.internal.CStruct.VarType\")\n\n@OptIn(ObsoleteDescriptorBasedAPI::class)\ninternal class CStructVarCompanionGenerator(\n context: GeneratorContext,","completion":"private val symbols: KonanSymbols\n) : DescriptorToIrTranslationMixin {\n\n override val irBuiltIns: IrBuiltIns = context.irBuiltIns\n override val symbolTable: SymbolTable = context.symbolTable\n override val typeTranslator: TypeTranslator = context.typeTranslator<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.konan.test.blackbox.support.group.TestCaseGroupProvider\nimport org.jetbrains.kotlin.konan.test.blackbox.support.settings.Settings\nimport org.jetbrains.kotlin.konan.test.blackbox.support.util.ThreadSafeCache","completion":"import org.jetbrains.kotlin.konan.test.blackbox.support.util.TreeNode\nimport org.jetbrains.kotlin.konan.test.blackbox.support.util.buildTree\nimport org.jetbrains.kotlin.konan.test.blackbox.support.util.startsWith<|endoftext|>"} {"prompt":"if (plus2.id() != 4) return \"Fail 2.2\"\n if (plus3.id() != 5) return \"Fail 2.3\"\n if (plus4.id() != 4) return \"Fail 2.4\"\n if (plus5.id() != 4) return \"Fail 2.5\"","completion":"if (plus6.id() != 4L) return \"Fail 2.6\"\n if (plus7.id() != 4.0f) return \"Fail 2.7\"\n if (plus8.id() != 4.0) return \"Fail 2.8\"\n\n if (minus1.id() != -1) return \"Fail 3.1\"<|endoftext|>"} {"prompt":"): ProcessorAction {\n val ownerTag = containingClass.symbol.toLookupTag()\n return processDirectOverriddenFunctionsWithBaseScope(functionSymbol) { overridden, _ ->\n val unwrapped = if (overridden.fir.isSubstitutionOverride && ownerTag.isRealOwnerOf(overridden))\n overridden.originalForSubstitutionOverride!!\n else\n overridden","completion":"processor(unwrapped)\n }\n}\n\nfun FirTypeScope.processOverriddenPropertiesFromSuperClasses(\n propertySymbol: FirPropertySymbol,\n containingClass: FirClass,\n processor: (FirPropertySymbol) -> ProcessorAction\n): ProcessorAction {\n val ownerTag = containingClass.symbol.toLookupTag()<|endoftext|>"} {"prompt":"@OptIn(kotlin.native.runtime.NativeRuntimeApi::class, ObsoleteWorkersApi::class)\npublic fun performGCOnCleanerWorker(): Unit =\n getCleanerWorker().execute(TransferMode.SAFE, {}) {\n GC.collect()\n }.result\n\n\/**\n * Wait for a worker that executes Cleaner blocks to complete its scheduled tasks.\n *\/","completion":"@InternalForKotlinNative\n@OptIn(ObsoleteWorkersApi::class)\npublic fun waitCleanerWorker(): Unit =\n getCleanerWorker().execute(TransferMode.SAFE, {}) {\n Unit\n }.result\n\n@GCUnsafeCall(\"Kotlin_CleanerImpl_getCleanerWorker\")\n@OptIn(ObsoleteWorkersApi::class)<|endoftext|>"} {"prompt":"@kotlin.internal.InlineOnly\npublic inline fun kotlin.UIntArray.none(predicate: (kotlin.UInt) -> kotlin.Boolean): kotlin.Boolean\n\n@kotlin.SinceKotlin(version = \"1.3\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.ULongArray.none(): kotlin.Boolean\n\n@kotlin.SinceKotlin(version = \"1.3\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun kotlin.ULongArray.none(predicate: (kotlin.ULong) -> kotlin.Boolean): kotlin.Boolean<|endoftext|>"} {"prompt":"if (elements is Collection) {\n val result = ArrayList(this.size + elements.size)\n result.addAll(this)\n result.addAll(elements)\n return result\n } else {\n val result = ArrayList(this)\n result.addAll(elements)\n return result\n }\n \"\"\"\n }","completion":"specialFor(Sets) {\n doc {\n \"\"\"\n Returns a set containing all elements of the original set and the given [elements] collection,\n which aren't already in this set.\n The returned set preserves the element iteration order of the original set.\n \"\"\"\n }\n body {\n \"\"\"<|endoftext|>"} {"prompt":"@kotlin.jvm.JvmName(\"maxWithOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun LongArray.maxWith(comparator: Comparator): Long {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]","completion":"if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n\/**\n * Returns the first element having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n *\/\n@SinceKotlin(\"1.7\")<|endoftext|>"} {"prompt":"it is KtKotlinPropertySymbol && it.origin == KtSymbolOrigin.SOURCE_MEMBER_GENERATED && it.name == StandardNames.ENUM_ENTRIES\n }\n }\n .filterNot {\n it.hasTypeForValueClassInSignature()\n }\n\n val suppressStatic = classKind() == KtClassKind.COMPANION_OBJECT","completion":"createMethods(visibleDeclarations, result, suppressStatic = suppressStatic)\n\n createConstructors(declaredMemberScope.getConstructors(), result)\n\n\n addMethodsFromCompanionIfNeeded(result, classOrObjectSymbol)\n\n addMethodsFromDataClass(result, classOrObjectSymbol)\n addDelegatesToInterfaceMethods(result, classOrObjectSymbol)\n\n result\n }\n }<|endoftext|>"} {"prompt":"type: Inv> (0 parameter has declared variance: in, but argument variance is out))]>\n typeParameter: defined in Inv\n typeProjection: out [Error type: Resolution error type (Inconsistent type: In> (0 parameter has declared variance: in, but argument variance is out))]","completion":"psi: val foo = getT>>>()\n type: [Error type: Resolution error type (Inconsistent type: In> (0 parameter has declared variance: in, but argument variance is out))]\n*\/<|endoftext|>"} {"prompt":"checkReferenceIsToAllowedMember(descriptor, context.trace, expression)\n\n val scope = context.scope.ownerDescriptor\n val type = createKCallableTypeForReference(descriptor, lhs, reflectionTypes, scope) ?: return null\n\n when (descriptor) {\n is FunctionDescriptor -> bindFunctionReference(expression, type, context, descriptor)","completion":"is PropertyDescriptor -> bindPropertyReference(expression, type, context, isMutablePropertyReference(descriptor, lhs, scope))\n }\n\n return type\n }\n\n internal fun checkReferenceIsToAllowedMember(\n descriptor: CallableDescriptor, trace: BindingTrace, expression: KtCallableReferenceExpression\n ) {\n val simpleName = expression.callableReference<|endoftext|>"} {"prompt":"languageVersionSettings.supportsFeature(LanguageFeature.JvmInlineValueClasses)) &&\n languageVersionSettings.supportsFeature(LanguageFeature.AllowResultInReturnType)\n ) return\n\n if (languageVersionSettings.supportsFeature(LanguageFeature.AllowNullOperatorsForResultAndResultReturnTypeByDefault)) return","completion":"if (declaration !is KtCallableDeclaration || descriptor !is CallableMemberDescriptor) return\n\n val returnType = descriptor.returnType ?: return\n if (isForbiddenReturnType(returnType, declaration, descriptor)) {\n val typeReferenceOrDeclarationName = declaration.typeReference ?: declaration.nameIdentifier ?: return<|endoftext|>"} {"prompt":"override val atomicLongArrayClassSymbol: IrClassSymbol\n get() = context.referenceClass(ClassId(FqName(\"kotlin.concurrent\"), Name.identifier(\"AtomicLongArray\")))\n ?: error(\"kotlin.concurrent.AtomicLongArray is not found\")\n\n \/\/ kotlin.concurrent.AtomicArray","completion":"override val atomicRefArrayClassSymbol: IrClassSymbol\n get() = context.referenceClass(ClassId(FqName(\"kotlin.concurrent\"), Name.identifier(\"AtomicArray\")))\n ?: error(\"kotlin.concurrent.AtomicArray is not found\")\n\n override fun getAtomicArrayConstructor(atomicArrayClassSymbol: IrClassSymbol): IrFunctionSymbol =<|endoftext|>"} {"prompt":"declarationRenderer?.render(constructor)\n\n constructor.typeParameters.renderTypeParameters()\n valueParameterRenderer?.renderParameters(constructor.valueParameters)\n print(\": \")\n constructor.returnTypeRef.accept(this)\n val body = constructor.body\n val delegatedConstructor = constructor.delegatedConstructor\n if (body == null) {","completion":"bodyRenderer?.renderDelegatedConstructor(delegatedConstructor)\n }\n bodyRenderer?.renderBody(body, listOfNotNull(delegatedConstructor))\n }\n\n override fun visitErrorPrimaryConstructor(errorPrimaryConstructor: FirErrorPrimaryConstructor) = visitConstructor(errorPrimaryConstructor)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol\nimport org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase\nimport org.jetbrains.kotlin.fir.types.*","completion":"import org.jetbrains.kotlin.fir.types.builder.buildErrorTypeRef\nimport org.jetbrains.kotlin.fir.types.impl.FirImplicitBuiltinTypeRef\nimport org.jetbrains.kotlin.fir.visitors.FirDefaultTransformer\nimport org.jetbrains.kotlin.fir.visitors.FirDefaultVisitor<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.gradle.model\n\nimport java.io.File\n\n\/**\n * Represents a source set for a given Kotlin Gradle project.\n * @see KotlinProject\n *\/\ninterface SourceSet {\n\n \/**\n * Possible source set types.\n *\/\n enum class SourceSetType {\n PRODUCTION,\n TEST\n }\n\n \/**","completion":"* Return the source set name.\n *\n * @return the source set name.\n *\/\n val name: String\n\n \/**\n * Return the type of the source set.\n *\n * @return the type of the source set.\n *\/\n val type: SourceSetType\n\n \/**\n * Return the names of all friend source sets.\n *\n * @return friend source sets.<|endoftext|>"} {"prompt":"val directNestedClasses: Collection = node.classes.mapNotNull { (nestedClassName, nestedClassNode) ->\n val nestedClassContext = classContext.classifierContext(nestedClassName, classTypeParametersCount)\n val nestedClass: KmClass = nestedClassNode.accept(this, nestedClassContext)?.cast() ?: return@mapNotNull null","completion":"classConsumer.consume(nestedClass)\n statsCollector?.logClass(nestedClass, nestedClassContext)\n nestedClass\n }\n\n val nestedConstructors: Collection = node.constructors.mapNotNull { (constructorKey, constructorNode) ->\n val constructorContext = classContext.callableMemberContext(DEFAULT_CONSTRUCTOR_NAME, classTypeParametersCount)<|endoftext|>"} {"prompt":"override fun check(declaration: FirBackingField, context: CheckerContext, reporter: DiagnosticReporter) {\n if (declaration !is FirDefaultPropertyBackingField &&\n !context.session.languageVersionSettings.supportsFeature(LanguageFeature.ExplicitBackingFields)\n ) {\n reporter.reportOn(\n declaration.source,","completion":"FirErrors.UNSUPPORTED_FEATURE,\n LanguageFeature.ExplicitBackingFields to context.session.languageVersionSettings,\n context\n )\n }\n }\n}<|endoftext|>"} {"prompt":"fun get(id: String): Promise\n fun matchAll(options: ClientQueryOptions = definedExternally): Promise>\n fun openWindow(url: String): Promise\n fun claim(): Promise\n}\n\npublic external interface ClientQueryOptions : JsAny {\n var includeUncontrolled: Boolean? \/* = false *\/\n get() = definedExternally","completion":"set(value) = definedExternally\n var type: ClientType? \/* = ClientType.WINDOW *\/\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"UNUSED_PARAMETER\")<|endoftext|>"} {"prompt":"val (simpleNameAddress, simpleNamePoolId) = context.referenceStringLiteralAddressAndId(simpleName)\n\n val typeInfo = ConstantDataStruct(\n name = \"TypeInfo\",\n elements = listOf(\n ConstantDataIntField(\"TypePackageNameLength\", packageName.length),\n ConstantDataIntField(\"TypePackageNameId\", packageNamePoolId),","completion":"ConstantDataIntField(\"TypePackageNamePtr\", packageNameAddress),\n ConstantDataIntField(\"TypeNameLength\", simpleName.length),\n ConstantDataIntField(\"TypeNameId\", simpleNamePoolId),\n ConstantDataIntField(\"TypeNamePtr\", simpleNameAddress)\n )\n )<|endoftext|>"} {"prompt":"\/\/ FILE: 1.kt\npackage test\n\ninterface Foo {\n fun call(): String\n}\n\ninline fun f(crossinline g: () -> String) = object: Foo {\n fun foo() = g()\n fun bar() = \"K\"\n override fun call(): String = foo() + bar()\n}\n\n\/\/ FILE: 2.kt\nimport test.*","completion":"val x = f { \"O\" }\n\nfun box() : String {\n return x.call()\n}<|endoftext|>"} {"prompt":"}\n\nobject TestFn16 : TestFnBase {\n override fun testGood(x: Any) =\n reifiedSafeAsReturnsNonNull>(","completion":"x, \"x as? Function16<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *>\")\n override fun testBad(x: Any) =<|endoftext|>"} {"prompt":"class Lazy(override val name: String, private val lazyValue: kotlin.Lazy) : ComputedTestProperty() {\n override val value get() = lazyValue.value\n }\n}\n\nprivate class ComputedTestProperties(private val task: Test) {\n private val computedProperties = arrayListOf()","completion":"fun Project.compute(property: TestProperty, defaultValue: () -> String? = { null }) {\n val gradleValue = readFromGradle(property)\n computedProperties += ComputedTestProperty.Normal(property.fullName, gradleValue ?: defaultValue())\n }\n\n fun Project.computeLazy(property: TestProperty, defaultLazyValue: () -> Lazy) {<|endoftext|>"} {"prompt":"if (isNotEqualAnyNullableLeft(null, null)) return \"Fail 20\"\n if (isNotEqualAnyNullableLeft(A(\"\"), A(\"\"))) return \"Fail 21\"\n if (!isNotEqualAnyNullableLeft(A(\"\"), \"\")) return \"Fail 22\"\n if (!isNotEqualAnyNullableLeft(null, \"\")) return \"Fail 23\"","completion":"if (!isNotEqualAnyNullableLeft(A(\"\"), null)) return \"Fail 24\"\n if (!isNotEqualAnyNullableLeft(A(\"\"), A(\"a\"))) return \"Fail 25\"\n if (isNotEqualAnyNullableRight(null, null)) return \"Fail 26\"\n if (isNotEqualAnyNullableRight(A(\"\"), A(\"\"))) return \"Fail 27\"<|endoftext|>"} {"prompt":"\"kotlin.Short\" -> return (a as Int).rem(b as Short)\n }\n \"kotlin.Float\" -> when (typeB) {\n \"kotlin.Byte\" -> return (a as Float).rem(b as Byte)\n \"kotlin.Double\" -> return (a as Float).rem(b as Double)","completion":"\"kotlin.Float\" -> return (a as Float).rem(b as Float)\n \"kotlin.Int\" -> return (a as Float).rem(b as Int)\n \"kotlin.Long\" -> return (a as Float).rem(b as Long)\n \"kotlin.Short\" -> return (a as Float).rem(b as Short)\n }<|endoftext|>"} {"prompt":"val passedTypeArgumentsToInvoke = outerCall.typeArguments.isNotEmpty() &&\n resolvedCall.functionCall.candidateDescriptor.typeParameters.isNotEmpty()\n return passedTypeArgumentsToInvoke && resolvedCall.variableCall.candidateDescriptor.typeParameters.isNotEmpty()\n }\n }\n}\n\nfun FunctionDescriptor.isOperatorMod(): Boolean {","completion":"return this.isOperator && name in OperatorConventions.REM_TO_MOD_OPERATION_NAMES.values\n}\n\nfun shouldWarnAboutDeprecatedModFromBuiltIns(languageVersionSettings: LanguageVersionSettings): Boolean {\n return languageVersionSettings.supportsFeature(LanguageFeature.OperatorRem) && languageVersionSettings.apiVersion >= ApiVersion.KOTLIN_1_1\n}<|endoftext|>"} {"prompt":"\"\"\".trimIndent()\n )\n\n simpleSingleSourceTarget(\n \"b\", \"\"\"\n class AB\n typealias TA_AB = AB\n val x: TA_AB = TA_AB()\n \"\"\".trimIndent()\n )\n }\n\n result.assertCommonized(\n \"(a, b)\", \"\"\"\n expect class AB()\n typealias TA_AB = AB","completion":"expect val x: TA_AB\n \"\"\".trimIndent()\n )\n }\n\n fun `test property with and without setter`() {\n val result = commonize {\n outputTarget(\"(a, b)\")\n\n simpleSingleSourceTarget(\n \"a\", \"\"\"\n val x: Int = 42\n \"\"\".trimIndent()\n )<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.descriptors.FunctionDescriptor\nimport org.jetbrains.kotlin.descriptors.TypeParameterDescriptor\nimport org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.resolve.isInlineClass","completion":"import org.jetbrains.kotlin.types.*\nimport org.jetbrains.kotlin.types.typeUtil.asTypeProjection\n\nclass ReceiverTypeAndTypeParameters(val receiverType: KotlinType, val typeParameters: List)\n\nfun patchTypeParametersForDefaultImplMethod(function: CallableMemberDescriptor): ReceiverTypeAndTypeParameters {<|endoftext|>"} {"prompt":"is PsiElement -> if (!source.isFakePsiElement) extractLocation(source) else null\n else -> null\n }\n }\n\n private fun extractLocation(element: PsiElement): JsLocation {\n val file = element.containingFile\n val document = file.viewProvider.document!!\n\n val path = pathResolver(File(file.viewProvider.virtualFile.path))","completion":"val startOffset = element.node.startOffset\n val startLine = document.getLineNumber(startOffset)\n val startChar = startOffset - document.getLineStartOffset(startLine)\n\n return JsLocation(path, startLine, startChar)\n }\n}<|endoftext|>"} {"prompt":"assertEquals(tosses1, tosses2)\n }\n\n arrayOf(\"x\").let { singletonArray ->\n val tosses = List(10) { singletonArray.random() }\n assertEquals(singletonArray.toList(), tosses.distinct())\n }\n\n assertFailsWith { emptyArray().random() }\n }","completion":"@Test fun randomOrNull() {\n Array(100) { it }.let { array ->\n val tosses = List(10) { array.randomOrNull() }\n assertTrue(tosses.distinct().size > 1, \"Should be some distinct elements in $tosses\")\n\n val seed = Random.nextInt()\n val random1 = Random(seed)<|endoftext|>"} {"prompt":"private fun ExportedConstructor.generateTypeScriptString(indent: String): String {\n return \"${visibility.keyword}constructor(${parameters.generateTypeScriptString(indent)});\"\n }\n\n private fun ExportedConstructSignature.generateTypeScriptString(indent: String): String {","completion":"return \"new(${parameters.generateTypeScriptString(indent)}): ${returnType.toTypeScript(indent)};\"\n }\n\n private fun ExportedProperty.generateTypeScriptString(indent: String, prefix: String, esModules: Boolean = false): String {\n val extraIndent = \"$indent \"\n val optional = if (isOptional) \"?\" else \"\"<|endoftext|>"} {"prompt":"if (b.foo(4) != \"B.foo(4: Int)\") return \"b.foo(4) != \\\"B.foo(4: Int)\\\", it: ${b.foo(4)}\"","completion":"if (b.boo(434) != \"A.boo(434)\") return \"b.boo(434) != \\\"A.boo(434)\\\", it: ${b.boo(434)}\"<|endoftext|>"} {"prompt":"get() = annotationClass!!\n\n override val AnnotationDescriptor.fqName: FqName?\n get() = fqName\n\n override fun AnnotationDescriptor.enumArguments(onlyValue: Boolean): Iterable =\n allValueArguments.flatMap { (parameter, argument) ->","completion":"if (!onlyValue || parameter == JvmAnnotationNames.DEFAULT_ANNOTATION_MEMBER_NAME)\n argument.toEnumNames()\n else\n emptyList()\n }\n\n private fun ConstantValue<*>.toEnumNames(): List =\n when (this) {\n is ArrayValue -> value.flatMap { it.toEnumNames() }<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_EXPRESSION\n\/\/ SKIP_TXT\n\/\/ WITH_EXTENDED_CHECKERS\n\n\/*\n * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE)\n *\n * SECTIONS: dfa\n * NUMBER: 19\n * DESCRIPTION: Raw data flow analysis test","completion":"* HELPERS: classes, objects, typealiases, enumClasses, interfaces, sealedClasses\n *\/\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1(x: Any?) {\n if (x is Int) {\n x<|endoftext|>"} {"prompt":"val parameterList = KotlinPlaceHolderStubImpl(functionType, KtStubElementTypes.VALUE_PARAMETER_LIST)\n val typeArgumentsWithoutReceiverAndReturnType = typeArgumentList.subList(processedTypes, typeArgumentList.size - 1)\n var suspendParameterType: Type? = null","completion":"for ((index, argument) in typeArgumentsWithoutReceiverAndReturnType.withIndex()) {\n val parameterType = argument.type(c.typeTable)!!\n if (isSuspend && index == typeArgumentsWithoutReceiverAndReturnType.size - 1) {\n if (parameterType.hasClassName() && parameterType.argumentCount == 1) {<|endoftext|>"} {"prompt":"callsInPlace(block2, InvocationKind.AT_LEAST_ONCE)\n callsInPlace(block3, InvocationKind.EXACTLY_ONCE)\n }\n block1()\n block2()\n block2()\n block3()\n}\n\n\/\/ FILE: main.kt\n\nimport contracts.*\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1() {","completion":"val value_1: Int\n funWithExactlyOnceCallsInPlace({ value_1 = 11 })\n value_1.inc()\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun case_2() {\n var value_1: Int\n funWithAtLeastOnceCallsInPlace({ value_1 = 11 })\n value_1.inc()\n}<|endoftext|>"} {"prompt":"if (actualReachableNodes < minThreshold || actualReachableNodes > maxThreshold) {\n val message = \"Number of reachable nodes ($actualReachableNodes) does not fit into expected range \" +\n \"[$minThreshold; $maxThreshold]\"\n val additionalMessage: String =\n if (overwriteReachableNodes) {","completion":"val oldValue = \"\/\/ ${JsEnvironmentConfigurationDirectives.EXPECTED_REACHABLE_NODES.name}: $expectedReachableNodes\"\n val newText = fileContent.replaceFirst(oldValue, replacement)\n file.writeText(newText)\n \"\"\n } else {\n \"\\n$enablingMessage\"\n }\n\n throw AssertionError(\"$message$additionalMessage\")<|endoftext|>"} {"prompt":"if (a is String) {\n var b = a\n b\n b.length","completion":"if (a is String) {\n b = a\n b\n b.length<|endoftext|>"} {"prompt":"fun builder(c: suspend () -> Unit) {\n c.startCoroutine(Continuation(EmptyCoroutineContext) {\n it.getOrThrow()\n })\n}\n\nfun box(): String {\n var res = \"FAIL 1\"\n builder {\n val impl = SuspendImpl()\n val implResult = impl.execute()\n res = implResult.getOrThrow()\n }","completion":"if (res != \"OK\") return res\n\n res = \"FAIL 2\"\n builder {\n val iface: SuspendInterface = SuspendImpl()\n val result = iface.execute()\n res = result.getOrThrow()\n }\n return res\n}<|endoftext|>"} {"prompt":"val expectedContextReceivers = expectedType.getContextReceiverTypesFromFunctionType().map { it.unwrap() }.toTypedArray()\n val argumentAsFunctionExpression = argument as? FunctionExpression\n\n val receiverFromExpected = argumentAsFunctionExpression?.receiverType == null && expectedReceiver != null\n\n fun UnwrappedType?.orExpected(index: Int) =","completion":"this ?: expectedParameters.getOrNull(index)?.type?.unwrap() ?: expectedType.builtIns.nullableAnyType\n\n \/\/ Extracting parameters and receiver type, taking into account the actual lambda definition and expected lambda type\n val (parameters, receiver) = when {\n argumentAsFunctionExpression != null -> {\n \/\/ lambda has explicit functional type - use types from it if available<|endoftext|>"} {"prompt":"z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z +\n z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z +","completion":"z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + z + \/\/200\n z \/\/201\n}\n\/\/ 2 INVOKEDYNAMIC makeConcatWithConstants\n\/\/ 0 append\n\/\/ 0 stringPlus<|endoftext|>"} {"prompt":"\/\/ test.kt:11 compute: a=\"a\":kotlin.String, gLocal=\"gLocal\":kotlin.String, hLocal=\"hLocal\":kotlin.String, b=\"b\":kotlin.String","completion":"\/\/ test.kt:20 compute: a=\"a\":kotlin.String, gLocal=\"gLocal\":kotlin.String, hLocal=\"hLocal\":kotlin.String, b=\"b\":kotlin.String, h=\"h\":kotlin.String<|endoftext|>"} {"prompt":"if (0UL in 10UL downTo 1UL) throw AssertionError()\n if (1UL !in 10UL downTo 1UL) throw AssertionError()\n if (5UL !in 10UL downTo 1UL) throw AssertionError()\n if (10UL !in 10UL downTo 1UL) throw AssertionError()","completion":"if (20UL in 10UL downTo 1UL) throw AssertionError()\n\n if (0UL in M2 downTo M1) throw AssertionError()\n if (1UL in M2 downTo M1) throw AssertionError()\n if (10UL in M2 downTo M1) throw AssertionError()<|endoftext|>"} {"prompt":"TestClass.intNWrapperN = null\n assertEquals(\"null (object)\", describeValueOfProperty(TestClass, \"intNWrapperN\"))\n assertEquals(null, TestClass.intNWrapperN?.value)\n\n assertEquals(\"null (object)\", describeValueOfProperty(TestClass, \"fooWrapper\"))\n TestClass.fooWrapper = FooWrapper(Foo(\"cat\"))","completion":"assertEquals(\"Foo(s=cat) (object)\", describeValueOfProperty(TestClass, \"fooWrapper\"))\n assertEquals(\"cat\", TestClass.fooWrapper.foo.s)\n\n assertEquals(\"null (object)\", describeValueOfProperty(TestClass, \"fooWrapperN\"))\n TestClass.fooWrapperN = FooWrapper(Foo(\"dog\"))<|endoftext|>"} {"prompt":"private val stateStackHolder = ThreadLocal.withInitial> {\n mutableListOf()\n }\n\n \/**\n * Adds [newState] to the stack and set [waitingFor][FirInProcessOfResolvingToJumpingPhaseState.waitingFor]\n * for the previous state if needed\n *\/","completion":"fun push(newState: FirInProcessOfResolvingToJumpingPhaseState) {\n val states = stateStackHolder.get()\n\n val currentState = states.lastOrNull()\n currentState?.waitingFor = newState\n states += newState\n }\n\n \/**\n * Pops from the top of the stack the last state and return it.<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.incremental.components.NoLookupLocation\nimport org.jetbrains.kotlin.ir.util.IdSignature\nimport org.jetbrains.kotlin.ir.util.KotlinMangler\nimport org.jetbrains.kotlin.load.java.descriptors.JavaForKotlinOverridePropertyDescriptor","completion":"import org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe\nimport org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeAsSequence\nimport org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor<|endoftext|>"} {"prompt":"staticFramework.convention(false)\n destinationDir.convention(debuggable.flatMap {\n val kind = outputKind.visibleName\n val target = konanTarget.visibleName\n val type = if (it) \"debug\" else \"release\"\n projectLayout.buildDirectory.dir(\"out\/$kind\/$target\/$type\")\n })\n }\n\n @TaskAction","completion":"fun link() {\n val metricReporter = metrics.get()\n\n addBuildMetricsForTaskAction(metricsReporter = metricReporter, languageVersion = null) {\n\n val outFile = outputFile.get()\n outFile.ensureParentDirsCreated()\n\n fun FileCollection.klibs() = files.filter { it.extension == \"klib\" }<|endoftext|>"} {"prompt":"accessor.constant != null -> renderValueUsage(accessor.constant)\n else -> error(\"Bridge body for getter was not generated\")\n }\n }\n\n is PropertyAccessor.Getter.GetConstructorParameter -> accessor.constructorParameter.name\n\n is PropertyAccessor.Getter.ArrayMemberAt -> \"arrayMemberAt(${accessor.offset})\"","completion":"is PropertyAccessor.Getter.MemberAt -> {\n val typeArguments = renderTypeArguments(accessor.typeArguments)\n val valueAccess = if (accessor.hasValueAccessor) \".value\" else \"\"\n \"memberAt$typeArguments(${accessor.offset})$valueAccess\"\n }\n\n is PropertyAccessor.Getter.ReadBits -> {<|endoftext|>"} {"prompt":"contract { returns(null) implies (this@case_1_2 is String) }\n return if (this@case_1_2 is String) null else true\n}\n\n\/\/ TESTCASE NUMBER: 2\nfun T.case_2_1(): Boolean? {\n contract { returnsNotNull() implies (this@case_2_1 != null) }","completion":"return if (this@case_2_1 != null) true else null\n}\nfun T.case_2_2(): Boolean? {\n contract { returns(null) implies (this@case_2_2 != null) }\n return if (this@case_2_2 != null) null else true\n}\n\n\/\/ FILE: main.kt\n\nimport contracts.*<|endoftext|>"} {"prompt":"val left = evaluate(binaryLogicExpression.leftOperand)\n val right = evaluate(binaryLogicExpression.rightOperand)\n\n val leftBoolean = left.unwrapOr> { return it }?.value as? Boolean ?: return NotEvaluated","completion":"val rightBoolean = right.unwrapOr> { return it }?.value as? Boolean ?: return NotEvaluated\n val result = when (binaryLogicExpression.kind) {\n LogicOperationKind.AND -> leftBoolean && rightBoolean\n LogicOperationKind.OR -> leftBoolean || rightBoolean<|endoftext|>"} {"prompt":"v.castIfNeeded(elementSerializer.asmType)\n\n v.invokevirtual(collectionType.internalName, \"add\", \"(Ljava\/lang\/Object;)Z\", false) \/\/ -> bool\n v.pop()\n }\n}\n\ninternal class MapParcelSerializer(\n asmType: Type,\n private val keySerializer: ParcelSerializer,","completion":"elementSerializer: ParcelSerializer,\n frameMap: FrameMap\n) : AbstractCollectionParcelSerializer(asmType, elementSerializer, frameMap) {\n override fun getSize(v: InstructionAdapter) {\n v.invokeinterface(\"java\/util\/Map\", \"size\", \"()I\")\n }\n\n override fun getIterator(v: InstructionAdapter) {<|endoftext|>"} {"prompt":"val subprojectBuildScript = subProject(subproject).buildGradleKts\n assert(\"dependencies {\" in subprojectBuildScript.readText())\n subprojectBuildScript.modify {\n it.replace(\n \"dependencies {\",\n \"\"\"\n tasks.whenTaskAdded {} \/\/ break lazy initialization of all tasks\n dependencies {\n \"\"\".trimIndent()\n )\n }\n }","completion":"build(\"build\")\n }\n }\n\n @MppGradlePluginTests\n @GradleTest\n @DisplayName(\"works in MPP\") \/\/ aka KT-56131\n fun testBrokenTcaInMpp(gradleVersion: GradleVersion) {\n project(\"new-mpp-lib-with-tests\", gradleVersion) {<|endoftext|>"} {"prompt":"public inline fun > LongArray.minBy(selector: (Long) -> R): Long? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))","completion":"@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > FloatArray.minBy(selector: (Float) -> R): Float? {\n return minByOrNull(selector)\n}<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNCHECKED_CAST\n\/\/ SKIP_TXT\n\/\/ Issue: KT-20849\n\nfun test_1(x: T): T = null as T\nfun test_2(x: () -> T): T = null as T\n\nfun case_1() {","completion":"null?.run { return }\n null!!.run { throw Exception() }\n}\n\nfun case_2() {\n test_1 { null!! }\n test_2 { null!! }\n}\n\nfun case_3() {\n test_1 { throw Exception() }\n test_2 { throw Exception() }\n}\n\nfun case_6() {\n null!!\n}<|endoftext|>"} {"prompt":"OPTIONAL_JVM_INLINE_ANNOTATION\nvalue class I32(val value: T) : IFoo\n\nfun boxToTypeParameter(x: I32?) = BoxT(x)\nfun boxToTypeParameter2(x: I32?) = BoxT2(x)","completion":"fun boxToNullableAny(x: I32?) = BoxAny(x)\nfun boxToNullableInterface(x: I32?) = BoxFoo(x)\n\nfun useNullableI32(x: I32?) {\n if (x != null) throw AssertionError()\n}<|endoftext|>"} {"prompt":"\/\/ This file was generated automatically. See native\/swift\/sir\/tree-generator\/Readme.md.\n\/\/ DO NOT MODIFY IT MANUALLY.\n\n@file:Suppress(\"DuplicatedCode\", \"unused\")\n\npackage org.jetbrains.kotlin.sir.builder\n\nimport kotlin.contracts.*\nimport org.jetbrains.kotlin.sir.*","completion":"import org.jetbrains.kotlin.sir.impl.SirSetterImpl\n\n@SirBuilderDsl\nclass SirSetterBuilder {\n var origin: SirOrigin = SirOrigin.Unknown\n var visibility: SirVisibility = SirVisibility.PUBLIC\n var documentation: String? = null\n lateinit var kind: SirCallableKind\n var body: SirFunctionBody? = null<|endoftext|>"} {"prompt":"private fun resolveSupertypesByPropertyName(supertypes: Collection, propertyName: Name): Collection =\n resolveSupertypesByMembers(supertypes, allowNonConcreteInterfaceMembers = true) {\n getPropertyMembers(it, propertyName)\n }.first\n\nprivate inline fun resolveSupertypesByMembers(\n supertypes: Collection,","completion":"allowNonConcreteInterfaceMembers: Boolean,\n getMembers: (KotlinType) -> Collection\n): Pair, Boolean> {\n val typesWithConcreteMembers = SmartList()\n val typesWithNonConcreteMembers = SmartList()\n\n for (supertype in supertypes) {<|endoftext|>"} {"prompt":"* Encodes bytes from the specified [source] array or its subrange and writes resulting symbols into the [destination] array.\n * Returns the number of symbols written.\n *\n * If the size of the [source] array or its subrange is not an integral multiple of 3,\n * the result is padded with `'='` to an integral multiple of 4 symbols.\n *","completion":"* @param source the array to encode bytes from.\n * @param destination the array to write symbols into.\n * @param destinationOffset the starting index in the [destination] array to write symbols to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to encode, 0 by default.<|endoftext|>"} {"prompt":"kclassConstructor = symbols.jsRelatedSymbols.kExternalClassImpl.owner.constructors.first()\n constructorArgument = getExternalKClassCtorArgument(type, builder)\n } else {\n kclassConstructor = symbols.reflectionSymbols.kClassImpl.owner.constructors.first()\n constructorArgument = getKClassCtorArgument(type, builder)\n }","completion":"return IrConstructorCallImpl(\n startOffset = UNDEFINED_OFFSET,\n endOffset = UNDEFINED_OFFSET,\n type = kclassConstructor.returnType,\n symbol = kclassConstructor.symbol,\n typeArgumentsCount = 1,\n valueArgumentsCount = 1,\n constructorTypeArgumentsCount = 0\n ).also {<|endoftext|>"} {"prompt":"mainIrFragment = irModuleFragment\n } else {\n dependentIrFragments.add(irModuleFragment)\n }\n }\n\n val irActualizer = if (dependentIrFragments.isEmpty()) null else IrActualizer(\n KtDiagnosticReporterWithImplicitIrBasedContext(\n fir2IrConfiguration.diagnosticReporter,","completion":"fir2IrConfiguration.languageVersionSettings\n ),\n actualizerTypeContextProvider(mainIrFragment.irBuiltins),\n fir2IrConfiguration.expectActualTracker,\n fir2IrConfiguration.useFirBasedFakeOverrideGenerator,\n mainIrFragment,\n dependentIrFragments,\n )\n\n if (!fir2IrConfiguration.useFirBasedFakeOverrideGenerator) {<|endoftext|>"} {"prompt":"val sourceSetsBySourceSetTree = mutableMapOf>()\n for (sourceSet in sourceSets) {\n val trees = sourceSet.internal.compilations.map { KotlinSourceSetTree.orNull(it) }","completion":"trees.forEach { tree -> sourceSetsBySourceSetTree.getOrPut(tree) { mutableSetOf() }.add(sourceSet) }\n }\n\n for ((sourceSetTree, sourceSetsOfTree) in sourceSetsBySourceSetTree) {\n val configurationName = when(sourceSetTree) {\n null -> continue \/\/ for unknown trees there should be no relation between source sets, so just skip<|endoftext|>"} {"prompt":" kotlin.Number\")!>select(A4(), id { x: Number -> x })","completion":" {Comparable<*> & Number<|endoftext|>"} {"prompt":"var f3 = false\nvar f4 = false\n\nclass B {\n operator fun plusAssign(c: C) {\n f1 = true\n print(\"1\")\n }\n\n operator fun plus(c: C): C {\n f2 = true\n print(\"2\")\n return c\n }\n}\n\noperator fun B.plusAssign(c: C) {\n f3 = true","completion":"print(\"3\")\n}\n\noperator fun B.plusAssign(c: Any) {\n f4 = true\n print(\"4\")\n}\n\n\nclass C<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.kapt3.base.stubs.KotlinPosition\nimport org.jetbrains.kotlin.kapt3.base.stubs.LineInfoMap\nimport java.io.ByteArrayOutputStream\nimport java.io.File\nimport java.io.ObjectOutputStream\n\nabstract class KaptLineMappingCollectorBase {","completion":"protected val lineInfo: LineInfoMap = mutableMapOf()\n protected val signatureInfo = mutableMapOf()\n private val filePaths = mutableMapOf>()\n\n protected fun register(fqName: String, psiElement: PsiElement) {\n val containingVirtualFile = psiElement.containingFile.virtualFile<|endoftext|>"} {"prompt":"MAP.put(\n ErrorsParcelize.PARCELABLE_CONSTRUCTOR_PARAMETER_SHOULD_BE_VAL_OR_VAR,\n \"'Parcelable' constructor parameter should be 'val' or 'var'\"\n )\n\n MAP.put(\n ErrorsParcelize.PROPERTY_WONT_BE_SERIALIZED,","completion":"\"Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning\"\n )\n\n MAP.put(\n ErrorsParcelize.OVERRIDING_WRITE_TO_PARCEL_IS_NOT_ALLOWED,\n \"Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead\"\n )<|endoftext|>"} {"prompt":"interface TypeParameterAsReifiedArrayError : KtFirDiagnostic {\n override val diagnosticClass get() = TypeParameterAsReifiedArrayError::class\n val typeParameter: KtTypeParameterSymbol\n }\n\n interface TypeParameterAsReifiedArrayWarning : KtFirDiagnostic {","completion":"override val diagnosticClass get() = TypeParameterAsReifiedArrayWarning::class\n val typeParameter: KtTypeParameterSymbol\n }\n\n interface ReifiedTypeForbiddenSubstitution : KtFirDiagnostic {\n override val diagnosticClass get() = ReifiedTypeForbiddenSubstitution::class\n val type: KtType\n }<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.native.interop.gen\n\nimport kotlinx.cinterop.usingJvmCInteropCallbacks\nimport org.jetbrains.kotlin.konan.util.DefFile\nimport org.jetbrains.kotlin.utils.usingNativeMemoryAllocator","completion":"import org.jetbrains.kotlin.native.interop.gen.jvm.KotlinPlatform\nimport org.jetbrains.kotlin.native.interop.gen.jvm.buildNativeLibrary\nimport org.jetbrains.kotlin.native.interop.gen.jvm.prepareTool\nimport org.jetbrains.kotlin.native.interop.indexer.NativeLibraryHeaders<|endoftext|>"} {"prompt":"abstract class FirNamedReference : FirReference() {\n abstract override val source: KtSourceElement?\n abstract val name: Name\n\n override fun accept(visitor: FirVisitor, data: D): R =\n visitor.visitNamedReference(this, data)\n\n @Suppress(\"UNCHECKED_CAST\")","completion":"override fun transform(transformer: FirTransformer, data: D): E =\n transformer.transformNamedReference(this, data) as E\n}<|endoftext|>"} {"prompt":"appendProperty(value::right, ::renderKtContractBooleanExpression)\n appendSimpleProperty(value::operation, endWithNewLine)\n }\n is KtContractIsInstancePredicateExpression -> {\n appendProperty(value::argument, ::renderKtContractParameterValue)\n appendProperty(value::type, renderer = { type, _ ->","completion":"appendLine(with(session) { symbolRenderer.renderType(analysisSession, type) })\n })\n appendSimpleProperty(value::isNegated, endWithNewLine)\n }\n is KtContractIsNullPredicateExpression -> {\n appendProperty(value::argument, ::renderKtContractParameterValue)\n appendSimpleProperty(value::isNegated, endWithNewLine)\n }<|endoftext|>"} {"prompt":"import java.io.ByteArrayOutputStream\nimport java.io.PrintStream\nimport java.nio.file.Files\nimport java.nio.file.Path\nimport java.util.stream.Stream\nimport kotlin.test.Test\nimport kotlin.test.assertEquals\nimport kotlin.test.assertTrue\n\ndata class ConsentConfiguration(\n val globalConsent: Boolean?,","completion":"val localConsent: Boolean?,\n val expected: Boolean?,\n)\n\nclass ConsentManagerTest {\n @TempDir\n lateinit var workingDir: Path\n\n private val localPropertiesFile by lazy {\n workingDir.resolve(\"local.properties\")\n }\n\n private val modifier by lazy {\n LocalPropertiesModifier(localPropertiesFile.toFile())\n }<|endoftext|>"} {"prompt":"@SinceKotlin(\"1.4\")\npublic actual fun BooleanArray?.contentHashCode(): Int {\n if (this === null) return 0\n var result = 1\n for (element in this)\n result = 31 * result + element.hashCode()\n return result\n}\n\n\/**\n * Returns a hash code based on the contents of this array as if it is [List].\n *\/","completion":"@SinceKotlin(\"1.4\")\npublic actual fun CharArray?.contentHashCode(): Int {\n if (this === null) return 0\n var result = 1\n for (element in this)\n result = 31 * result + element.hashCode()\n return result\n}\n\n\/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n *<|endoftext|>"} {"prompt":"\/\/ (DataClassMembersGenerator typically tries to access fields)\n \/\/ 3. Custom equals function should be used on properties\n fun generateEqualsUsingGetters(equalsFun: IrSimpleFunction, typeForEquals: IrType, properties: List) = equalsFun.apply {","completion":"body = backendContext.createIrBuilder(symbol, SYNTHETIC_OFFSET, SYNTHETIC_OFFSET).irBlockBody {\n val irType = typeForEquals\n fun irOther() = irGet(valueParameters[0])\n fun irThis() = irGet(dispatchReceiverParameter!!)<|endoftext|>"} {"prompt":"if (y != null) this.y\n if (y != null || this.y != null) y.equals(null)","completion":"if (y != null || this.y != null) y.propT<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.types.typeUtil.builtIns\n\nopen class ReplaceWithSupertypeAnonymousTypeTransformer : DeclarationSignatureAnonymousTypeTransformer {\n override fun transformAnonymousType(descriptor: DeclarationDescriptorWithVisibility, type: KotlinType): KotlinType? =\n if (!DescriptorUtils.isLocal(descriptor))","completion":"replaceAnonymousTypeWithSuperType(type)\n else type\n}\n\nfun replaceAnonymousTypeWithSuperType(type: KotlinType): KotlinType {\n val declaration = type.constructor.declarationDescriptor as? ClassDescriptor ?: return type\n\n if (KotlinBuiltIns.isArray(type)) {\n val elementTypeProjection = type.arguments.singleOrNull()<|endoftext|>"} {"prompt":"instance.doOnSuccess {}\n instance.doOnSuccess(::functionReference)\n}\n\nfun functionReference(x: Any) {}\n\nclass GenericHolder {\n fun doOnSuccess(onSuccess: Consumer) {\n onSuccess.accept(object : BaseClass() {} as T)\n }\n}\n\n\/\/ FILE: Consumer.java\n\npublic interface Consumer {","completion":"void accept(T t);\n}<|endoftext|>"} {"prompt":"fun use4(x: Sam4) {}\n\n\/\/ FILE: Sam1.java\npublic interface Sam1 {\n String get(String x, Object y);\n}\n\n\/\/ FILE: Sam2.java\npublic interface Sam2 {\n void run();\n}\n\n\/\/ FILE: Sam3.java\npublic interface Sam3 {\n int[] get(int[] s);\n}","completion":"\/\/ FILE: Sam4.java\npublic interface Sam4 {\n T get();\n}<|endoftext|>"} {"prompt":"\/\/ test.kt:12 foo\n\/\/ test.kt:13 foo\n\/\/ test.kt:7 alternate\n\/\/ test.kt:8 alternate\n\/\/ test.kt:13 foo\n\/\/ test.kt:12 foo\n\/\/ test.kt:13 foo\n\/\/ test.kt:7 alternate\n\/\/ test.kt:8 alternate\n\/\/ test.kt:13 foo\n\/\/ test.kt:14 foo\n\/\/ test.kt:17 foo","completion":"\/\/ test.kt:21 box\n\n\/\/ EXPECTATIONS JS_IR\n\/\/ test.kt:20 box\n\/\/ test.kt:7 alternate\n\/\/ test.kt:8 alternate\n\/\/ test.kt:7 alternate\n\/\/ test.kt:8 alternate\n\/\/ test.kt:17 foo\n\/\/ test.kt:21 box\n\n\/\/ EXPECTATIONS WASM\n\/\/ test.kt:20 $box<|endoftext|>"} {"prompt":"return root\n }\n}\n\ninternal fun ClassLoader.rawClassPathFromKeyResourcePath(keyResourcePath: String): Sequence {\n val resourceRootCalc = ClassLoaderResourceRootFIlePathCalculator(keyResourcePath)\n return getResources(keyResourcePath).asSequence().mapNotNull { url ->\n if (url.protocol == \"jar\") {","completion":"(url.openConnection() as? JarURLConnection)?.jarFileURL?.toFileOrNull()\n } else {\n url.toFileOrNull()?.let { resourceRootCalc(it) }\n }\n }\n}\n\nfun ClassLoader.classPathFromTypicalResourceUrls(): Sequence =\n\/\/ roots without manifest cases are detected in some test scenarios<|endoftext|>"} {"prompt":"* on `:kotlin-native:dependencies` (that project must provide native dependencies by using [NativeDependenciesDownloaderPlugin])\n *\n * [llvmPath], [libffiPath] and [hostPlatform] are accessors that can be used during configuration\n * phase and do not anyhow force the actual dependencies to be downloaded. So, anytime these\n * accessors are used, make sure that execution of related tasks (or configurations resolving)","completion":"* depend on [llvmDependency], [libffiDependency] and [hostPlatformDependency] respectively.\n *\n * Apply [plugin][NativeDependenciesPlugin] to create this extension.\n * The extension name is `nativeDependencies`.\n *\n * @see NativeDependenciesPlugin\n *\/\nabstract class NativeDependenciesExtension @Inject constructor(private val project: Project) {<|endoftext|>"} {"prompt":"val inv = try { ::bar3 } finally { ::foo3 }\n inv()\n }\n}\n\nfun poll43(): Flow {\n return flow {\n val inv = try { ::bar4 } finally { ::foo4 }\n inv()\n }\n}\n\nfun poll44(): Flow {\n return flow {","completion":"val inv = try { ::bar5 } finally { ::foo5 }\n inv()\n }\n}\n\nfun poll45(): Flow {\n return flow {\n val inv = try { ::Foo6 } finally { ::Foo6 }\n inv()\n }\n}\n\nfun poll46(): Flow {\n return flow {<|endoftext|>"} {"prompt":"to.typedArrays = from.typedArrays\n to.useEsClasses = from.useEsClasses\n to.useEsGenerators = from.useEsGenerators\n to.wasm = from.wasm\n to.wasmDebug = from.wasmDebug\n to.wasmEnableArrayRangeChecks = from.wasmEnableArrayRangeChecks","completion":"to.wasmEnableAsserts = from.wasmEnableAsserts\n to.wasmGenerateWat = from.wasmGenerateWat\n to.wasmKClassFqn = from.wasmKClassFqn\n to.wasmTarget = from.wasmTarget\n to.wasmUseNewExceptionProposal = from.wasmUseNewExceptionProposal<|endoftext|>"} {"prompt":"ProtoDynamicOperatorExpression.IrDynamicOperator.MINUSEQ -> IrDynamicOperator.MINUSEQ\n ProtoDynamicOperatorExpression.IrDynamicOperator.MULEQ -> IrDynamicOperator.MULEQ\n ProtoDynamicOperatorExpression.IrDynamicOperator.DIVEQ -> IrDynamicOperator.DIVEQ","completion":"ProtoDynamicOperatorExpression.IrDynamicOperator.MODEQ -> IrDynamicOperator.MODEQ\n\n ProtoDynamicOperatorExpression.IrDynamicOperator.ARRAY_ACCESS -> IrDynamicOperator.ARRAY_ACCESS\n\n ProtoDynamicOperatorExpression.IrDynamicOperator.INVOKE -> IrDynamicOperator.INVOKE\n }<|endoftext|>"} {"prompt":"* \n * The arrays are also considered structurally equal if both are `null`.\n * \n * If the arrays contain nested arrays, use [contentDeepEquals] to recursively compare their elements.\n * \n * @param other the array to compare with this array.\n * @return `true` if the two arrays are structurally equal, `false` otherwise.\n *","completion":"* @sample samples.collections.Arrays.ContentOperations.arrayContentEquals\n *\/\n@SinceKotlin(\"1.4\")\npublic expect infix fun Array?.contentEquals(other: Array?): Boolean\n\n\/**\n * Checks if the two specified arrays are *structurally* equal to one another.\n *<|endoftext|>"} {"prompt":"private fun KtParameter.reportIncorrectInline(modifierToken: KtModifierKeywordToken, diagnosticHolder: DiagnosticSink) {\n val modifier = modifierList?.getModifier(modifierToken)\n modifier?.let {\n diagnosticHolder.report(Errors.ILLEGAL_INLINE_PARAMETER_MODIFIER.on(modifier, modifierToken))\n }","completion":"}\n}<|endoftext|>"} {"prompt":"override fun equals(other: Any?) =\n other is Open && (other.index == index || (other.index < 0 && index < 0))\n override fun hashCode(): Int = if (index < 0) -31 else index * 31\n override fun serializeTo(writer: SchemeStringSerializationWriter) { writer.writeNumber(index) }\n}\n\n\/**","completion":"* A [Scheme] declares the applier the type expects and which appliers are expected of the\n * lambda parameters of a function or bound callable types of a generic type. The applier can be\n * open but all open appliers of the same non-negative index must be bound to the same applier.\n *\n * All non-composable lambda parameters of a function type are ignored and skipped when producing<|endoftext|>"} {"prompt":"--b?.a\n}\n\n\nclass Case1() {\n var a: A = A()\n}\n\nclass A() {\n var i = 0\n\n operator fun dec(): A {\n this.i--\n return this\n }\n}\n\n\/\/ TESTCASE NUMBER: 2\n\nfun case2() {","completion":"var b= Case2()\n --b.a\n}\n\nclass Case2() {\n val a = A2()\n}\n\nclass A2() {\n var i = 0\n\n operator fun dec(): A2 {\n this.i--\n return this\n }\n}<|endoftext|>"} {"prompt":"val externRefToKotlinDoubleAdapter = getInternalFunction(\"externRefToKotlinDoubleAdapter\")\n\n val externRefToKotlinUByteAdapter = getInternalFunction(\"externRefToKotlinUByteAdapter\")\n val externRefToKotlinUShortAdapter = getInternalFunction(\"externRefToKotlinUShortAdapter\")","completion":"val externRefToKotlinUIntAdapter = getInternalFunction(\"externRefToKotlinUIntAdapter\")\n val externRefToKotlinULongAdapter = getInternalFunction(\"externRefToKotlinULongAdapter\")\n\n val kotlinIntToExternRefAdapter = getInternalFunction(\"kotlinIntToExternRefAdapter\")<|endoftext|>"} {"prompt":"\/\/ Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT!\n\/\/ WITH_STDLIB\n\n\n\nfun box(): String {\n val list1 = ArrayList()\n for (i in 10..5) {\n list1.add(i)\n if (list1.size > 23) break\n }","completion":"if (list1 != listOf()) {\n return \"Wrong elements for 10..5: $list1\"\n }\n\n val list2 = ArrayList()\n for (i in 10.toByte()..(-5).toByte()) {\n list2.add(i)\n if (list2.size > 23) break\n }<|endoftext|>"} {"prompt":"}\n else -> {}\n }\n LONG -> when (rightType) {\n LONG -> when (name) {\n \"and\" -> return left.and(right)\n \"div\" -> return left.divide(right)\n \"minus\" -> return left.subtract(right)\n \"or\" -> return left.or(right)\n \"plus\" -> return left.add(right)","completion":"\"rem\" -> return left.rem(right)\n \"times\" -> return left.multiply(right)\n \"xor\" -> return left.xor(right)\n }\n BYTE -> when (name) {\n \"div\" -> return left.divide(right)\n \"minus\" -> return left.subtract(right)\n \"plus\" -> return left.add(right)<|endoftext|>"} {"prompt":"appendLine(\n \"\"\"\n ${suspendModifier}fun main() {\n $mainBody\n }\n \"\"\".trimIndent()\n )\n }\n val file = testServices.temporaryDirectoryManager.getOrCreateTempDirectory(\"src\").resolve(BOX_MAIN_FILE_NAME)\n file.writeText(code)\n\n return listOf(file.toTestFile())","completion":"}\n}<|endoftext|>"} {"prompt":"environment = jdk11,\n )\n runProcess(\n \"kotlin\", \"-cp\", tmpdir.path, \"test.JdkModuleUsageKt\",\n expectedStdout = \"interface java.sql.Driver\\n\",\n environment = jdk11,\n )\n }\n\n fun testKotlinUseJdkModuleFromJar() {","completion":"val jdk11 = mapOf(\"JAVA_HOME\" to KtTestUtil.getJdk11Home().absolutePath)\n val output = tmpdir.resolve(\"out.jar\")\n runProcess(\n \"kotlinc\", \"$testDataDirectory\/jdkModuleUsage.kt\", \"-d\", output.path,\n environment = jdk11,\n )\n runProcess(<|endoftext|>"} {"prompt":"): Collection> {\n val result = mutableSetOf>()\n\n collectRealOverridden(symbol, scope, result, mutableSetOf(), processDirectOverridden)\n\n return result\n }\n\n private fun > collectRealOverridden(\n symbol: D,\n scope: FirTypeScope,","completion":"result: MutableCollection>,\n \/\/ There's no guarantee that directOverridden(symbol) is strictly different\n \/\/ It might be the same instance that when being requested with a different\/new scope would return next level of overridden\n visited: MutableSet>,<|endoftext|>"} {"prompt":"if (a2!! != 2.toShort()) return \"fail 2\"\n if (a3!! != 2) return \"fail 3\"\n if (a4!! != 2L) return \"fail 4\"\n if (a5!! != 2.0) return \"fail 5\"\n if (a6!! != 2f) return \"fail 6\"\n if (a7!! != 'B') return \"fail 7\"","completion":"if (a8!! != 1) return \"fail 8\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"@DisplayName(\"Multiplatform project could depend on JVM project\")\n @GradleTest\n fun testMppLibResolvesJvmKtApp(gradleVersion: GradleVersion) {\n project(\"new-mpp-lib-and-app\/sample-lib\", gradleVersion) {\n includeOtherProjectAsSubmodule(\"simpleProject\")\n buildGradle.appendText(\n \"\"\"\n |","completion":"|dependencies { jvm6MainImplementation project(':simpleProject') }\n |\n \"\"\".trimMargin()\n )\n\n testResolveAllConfigurations()\n }\n }\n\n @DisplayName(\"Multiplatform project could depend on JS project\")\n @GradleTest\n fun testMppLibResolvesJsKtApp(gradleVersion: GradleVersion) {<|endoftext|>"} {"prompt":"@NullMarked\npublic class B {\n public void foo(T t) {}\n public void bar(E e) {}\n}\n\n\/\/ FILE: Test.java\npublic class Test {}\n\n\/\/ FILE: main.kt\n\/\/ jspecify_nullness_mismatch, jspecify_nullness_mismatch","completion":"fun main(a1: A<Any?>, a2: A, b1: B<Any?>, b2: B, x: T): Unit {\n a1.foo(null)<|endoftext|>"} {"prompt":"override fun get(index: Int): Nothing = null!!\n override fun indexOf(element: Nothing): Int = -1\n override fun lastIndexOf(element: Nothing): Int = -1\n\n override fun iterator(): Iterator = null!!\n override fun listIterator(): ListIterator = null!!\n override fun listIterator(index: Int): ListIterator = null!!","completion":"override fun subList(fromIndex: Int, toIndex: Int): List = null!!\n}\n\nfun box(): String {\n try {\n J.test()\n return \"Fail: no exception is thrown from J.add()\"\n } catch (e: UnsupportedOperationException) {\n return \"OK\"\n } catch (e: Throwable) {<|endoftext|>"} {"prompt":"fun List.filterClashingDeclarations(classSymbol: FirClassSymbol<*>): List> {\n @Suppress(\"UNCHECKED_CAST\")\n val allStaticFunctionsAndConstructors = classSymbol.fir.declarations.filterIsInstance().toMutableList()\n val result = mutableListOf()","completion":"for (function in this) {\n if (allStaticFunctionsAndConstructors.none { sameSignature(it, function) }) {\n allStaticFunctionsAndConstructors += function\n result += function\n }\n }\n return result.map { it.symbol }\n}\n\n\/**\n * Lombok treat functions as having the same signature by arguments count only<|endoftext|>"} {"prompt":"COROUTINE_SUSPENDED\n }\n}\n\nsuspend fun lock(owner: Controller) {\n owner.result += \"L\"\n}\n\nfun unlock(owner: Controller) {\n owner.result += \"U\"\n}\n\npublic suspend inline fun doInline(owner: Controller, action: () -> Unit): Unit {\n lock(owner)\n try {\n return action()","completion":"} finally {\n unlock(owner)\n }\n}\n\n\nfun builder(c: suspend Controller.() -> Unit): String {\n val controller = Controller()\n c.startCoroutine(controller, EmptyContinuation)\n return controller.result\n}\n\nfun box(): String {\n val value = builder {\n doInline(this) {\n result += \"X\"\n }\n }<|endoftext|>"} {"prompt":"fun minMaxOfEmpty() {\n val empty = mapOf()\n\n assertNull(empty.minOfOrNull { it.toString() })\n assertNull(empty.maxOfOrNull { it.toString() })\n assertFailsWith { empty.minOf { it.toString() } }","completion":"assertFailsWith { empty.maxOf { it.toString() } }\n\n\n assertNull(empty.minOfOrNull { 0.0 })\n assertNull(empty.maxOfOrNull { 0.0 })\n assertFailsWith { empty.minOf { 0.0 } }<|endoftext|>"} {"prompt":"0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL, \n 0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL,","completion":"0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL, \n 0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL, 0x7ff0000000000000UL,<|endoftext|>"} {"prompt":"class length {\n companion object {\n fun test() {}\n }\n}\n\n@JsExport\nclass C {\n class prototype\n\n class length","completion":"class `$metadata$`\n\n fun constructor() {}\n}\n\n\/\/ FILE: f2.kt\npackage foo2\n\nexternal class prototype {\n companion object {\n fun test()\n }\n}\n\nexternal class length {\n companion object {<|endoftext|>"} {"prompt":"if (SIndex < 0 || SIndex >= SCount) {\n return null\n } else {\n val L = LBase + SIndex \/ NCount\n val V = VBase + SIndex % NCount \/ TCount\n var T = SIndex % TCount\n val decomp: IntArray\n\n if (T == 0) {\n decomp = intArrayOf(L, V)\n } else {","completion":"T = TBase + T\n decomp = intArrayOf(L, V, T)\n }\n return decomp\n }\n }\n }\n}<|endoftext|>"} {"prompt":"package test.collections\n\nimport kotlin.test.*\n\nclass IteratorsTest {\n @Test\n fun iterationOverIterator() {\n val c = listOf(0, 1, 2, 3, 4, 5)\n var s = \"\"\n for (i in c.iterator()) {\n s = s + i.toString()\n }\n assertEquals(\"012345\", s)","completion":"}\n}<|endoftext|>"} {"prompt":"require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n\/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n *\/","completion":"@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n\/**\n * Returns a list containing all elements except last [n] elements.<|endoftext|>"} {"prompt":"class GD: GetterDeprecated() {\n override var p: Int\n get() = 3\n set(value) {\n }\n}\n\nclass SD: SetterDeprecated() {\n override var p: Int\n get() = 3\n set(value) {\n }\n}\n\nclass SDH: SetterDeprecated(), HiddenDeprecated {\n override var p: Int","completion":"get() = 3\n set(value) {\n }\n}\n\nclass EDH: ErrorDeprecated(), HiddenDeprecated {\n override var p: Int\n get() = 3\n set(value) {\n }\n}\n\nclass NED: ErrorDeprecated(), NoDeprecation {\n override var p: Int\n get() = 3<|endoftext|>"} {"prompt":"annotation class Anno(val value: String = \"Anno\")\n\nexpect annotation class Classes(\n val s: String = \"OK\",\n val e: En = En.B,\n \/\/ TODO: this does not work at the moment because AnnotationDescriptor subclasses do not implement equals correctly\n \/\/ val a: Anno = Anno(),\n val k: KClass<*> = List::class\n)","completion":"expect annotation class ClassArrays(\n val s: Array = [\"OK\"],\n val e: Array = [En.B],\n \/\/ val a: Array = [Anno()],\n val k: Array> = [List::class],\n vararg val v: Int = [42]\n)<|endoftext|>"} {"prompt":"public actual interface KProperty1 : kotlin.reflect.KProperty, (T) -> V {\n public actual fun get(receiver: T): V\n\n public override operator fun invoke(p1: T): V\n}\n\npublic actual interface KProperty2 : kotlin.reflect.KProperty, (D, E) -> V {","completion":"public actual fun get(receiver1: D, receiver2: E): V\n\n public override operator fun invoke(p1: D, p2: E): V\n}\n\n\/**\n * Represents a property declared as a `var`.\n *\/\npublic actual interface KMutableProperty : KProperty\n\npublic actual interface KMutableProperty0 : KProperty0, KMutableProperty {<|endoftext|>"} {"prompt":"val __UNRESOLVED__> a1 = \"\"","completion":"val String> a2 = 0<|endoftext|>"} {"prompt":"@Special(NestedNested::class)","completion":"class Nested<@Special(NestedNested::class) T> :<|endoftext|>"} {"prompt":"\/\/ IGNORE_BACKEND: JS\n\nprivate object EmptyList : List {\n override fun contains(element: Nothing): Boolean = false\n override fun containsAll(elements: Collection): Boolean = elements.isEmpty()\n override fun indexOf(element: Nothing): Int = -2\n override fun lastIndexOf(element: Nothing): Int = -2","completion":"override val size: Int get() = 0\n override fun isEmpty(): Boolean = true\n\n override fun iterator(): Iterator = throw UnsupportedOperationException()\n override fun get(index: Int): Nothing = throw UnsupportedOperationException()\n override fun listIterator(): ListIterator = throw UnsupportedOperationException()<|endoftext|>"} {"prompt":"if (topLevelDelegatedVal != 1) throw AssertionError()\n if (topLevelDelegatedVar != 2) throw AssertionError()\n topLevelDelegatedVar = 3\n if (topLevelDelegatedVar != 3) throw AssertionError()\n\n if (topLevelDelegatedValByProvider != 1) throw AssertionError()","completion":"if (topLevelDelegatedVarByProvider != 2) throw AssertionError()\n topLevelDelegatedVarByProvider = 3\n if (topLevelDelegatedVarByProvider != 3) throw AssertionError()\n\n if (localDelegatedVal != 1) throw AssertionError()\n if (localDelegatedVar != 2) throw AssertionError()\n localDelegatedVar = 3<|endoftext|>"} {"prompt":"constructor() : this(0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f)\n}\n\ndata class C(val a: B, val b: B) {\n\n constructor(aW: B, aX: B, aY: B, aZ: B,","completion":"bW: B, bX: B, bY: B, bZ: B) : this(aW, bW)\n\n constructor() : this(B(), B())\n}\n\nfun box(): String {\n require(B().a == A(0.0f))\n require(B().b == A(4.0f))<|endoftext|>"} {"prompt":"* Rounds the given value [x] towards the closest integer with ties rounded towards even integer.\n *\n * Special cases:\n * - `round(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n *\/\n@SinceKotlin(\"1.2\")","completion":"public actual fun round(x: Double): Double = kotlin.math.fdlibm.rint(x)\n\n\/**\n * Returns the absolute value of the given value [x].\n *\n * Special cases:\n * - `abs(NaN)` is `NaN`\n *\n * @see absoluteValue extension property for [Double]\n *\/\n@SinceKotlin(\"1.2\")<|endoftext|>"} {"prompt":"is FirDeclarationOrigin.Synthetic -> {\n when {\n source?.kind == KtFakeSourceElementKind.DataClassGeneratedMembers -> KtSymbolOrigin.SOURCE_MEMBER_GENERATED\n this is FirValueParameter && this.containingFunctionSymbol.origin is FirDeclarationOrigin.Synthetic -> KtSymbolOrigin.SOURCE_MEMBER_GENERATED","completion":"this is FirSyntheticProperty || this is FirSyntheticPropertyAccessor -> KtSymbolOrigin.JAVA_SYNTHETIC_PROPERTY\n\n else -> errorWithAttachment(\"Invalid FirDeclarationOrigin ${origin::class.simpleName}\") {\n withFirEntry(\"firToGetOrigin\", this@ktSymbolOrigin)\n }\n }\n }<|endoftext|>"} {"prompt":"if (framework.buildType != envBuildType || !envTargets.contains(framework.konanTarget)) return\n\n embedAndSignTask.configure { task ->\n val frameworkFile = framework.outputFile\n task.dependsOn(assembleTask)\n if (swiftExportTask != null) {\n task.dependsOn(swiftExportTask)\n }","completion":"task.sourceFramework.fileProvider(appleFrameworkDir(frameworkTaskName).map { it.resolve(frameworkFile.name) })\n task.destinationDirectory.set(envEmbeddedFrameworksDir)\n if (envSign != null) {\n task.doLast {\n val binary = envEmbeddedFrameworksDir\n .resolve(frameworkFile.name)<|endoftext|>"} {"prompt":"return -(low + 1) \/\/ key not found\n}\n\n\/**\n * Searches the array or the range of the array for the provided [element] using the binary search algorithm.\n * The array is expected to be sorted, otherwise the result is undefined.\n * \n * If the array contains multiple elements equal to the specified [element], there is no guarantee which one will be found.\n * \n * @param element the to search for.","completion":"* @param fromIndex the start of the range (inclusive) to search in, 0 by default.\n * @param toIndex the end of the range (exclusive) to search in, size of this array by default.\n * \n * @return the index of the element, if it is contained in the array within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.<|endoftext|>"} {"prompt":"expectOrder(\"x(4) !in 3 downTo low(1)\", \"LX\") { assertTrue(x(4) !in 3 downTo low(1)) }\n\n expectOrder(\"x(2) in (high(3) downTo low(1)).reversed()\", \"HLX\") { assertTrue(x(2) in (high(3) downTo low(1)).reversed()) }","completion":"expectOrder(\"2 in (high(3) downTo low(1)).reversed()\", \"HL\") { assertTrue(2 in (high(3) downTo low(1)).reversed()) }\n expectOrder(\"x(2) in high(3) downTo 1\", \"HX\") { assertTrue(x(2) in high(3) downTo 1) }<|endoftext|>"} {"prompt":"statements.forEach { remapper.remap(it) }\n }\n null -> {}\n }\n block.statements += statements\n file.moduleName?.let { dce.moduleMapping[block] = it }\n block\n }\n\n if (hasErrors) return DeadCodeEliminationResult(dce.context, emptySet(), DeadCodeEliminationStatus.FAILED)","completion":"program.globalBlock.statements += blocks\n program.globalBlock.fixForwardNameReferences()\n\n dce.reachableNames += rootReachableNames\n dce.apply(program.globalBlock)\n\n for ((file, block) in inputFiles.zip(blocks)) {\n val sourceMapFile = File(file.outputPath + \".map\")\n val textOutput = TextOutputImpl()<|endoftext|>"} {"prompt":"if (b.getAInA() != 2) return \"b.getAInA() != 2, it: ${b.getAInA()}\"\n\n if (b.getSuperA() != 1) return \"b.getSuperA() != 1, it: ${b.getSuperA()}\"\n b.setSuperA(3)","completion":"if (b.getSuperA() != 3) return \"b.getSuperA() != 3, it: ${b.getSuperA()}\"\n\n if (b.getAInA() != 2) return \"b.getAInA() != 2 after b.setAInB(3), it: ${b.getAInA()}\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"\/\/ !JAVAC_EXPECTED_FILE\n\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\nclass BaseT> : HashSet() {\n fun foo() {\n super.remove(\"\")\n }","completion":"}<|endoftext|>"} {"prompt":"try {\n initIsRunning.set(true)\n try {\n calculatedValue = computeValue()\n } finally {\n initIsRunning.set(false)\n }\n } finally {\n lock.unlock()\n }\n }\n }\n\n calculatedValue ?: computeValue()\n }\n }\n\n override fun isInitialized() = holder.isInitialized()","completion":"}\n\n companion object {\n @JvmStatic\n private val initIsRunning: ThreadLocal = ThreadLocal.withInitial { false }\n }\n}<|endoftext|>"} {"prompt":"var x: String? = null\n\n outer@ while (x != null) {\n inner@ do {\n x = null\n } while (x != null)\n x","completion":"x.length\n }\n}\n\n\/\/ TESTCASE NUMBER: 10\nfun case_10() {\n var x: String? = null\n\n outer@ while (x != null) {\n inner@ do {<|endoftext|>"} {"prompt":"\/\/ FILE: 1.kt\n\ninline fun performWithFinally(finally: () -> R) : R {\n try {\n throw RuntimeException(\"1\")\n } catch (e: RuntimeException) {\n throw RuntimeException(\"2\")\n } finally {\n return finally()\n }\n}\n\n\/\/ FILE: 2.kt\n\ninline fun test2Inline() = performWithFinally { \"OK\" }","completion":"fun box(): String {\n return test2Inline()\n}<|endoftext|>"} {"prompt":"memberOwnerLookupTag = memberOwnerLookupTag,\n memberRequiredPhase = memberRequiredPhase,\n)\n\nfun ConeKotlinType.scopeForSupertype(\n useSiteSession: FirSession,\n scopeSession: ScopeSession,\n derivedClass: FirClass,\n memberRequiredPhase: FirResolvePhase?,\n): FirTypeScope? {\n if (this !is ConeClassLikeType) return null","completion":"if (this is ConeErrorType) return null\n\n val symbol = lookupTag.toSymbol(useSiteSession) as? FirRegularClassSymbol ?: return null\n\n val substitutor = substitutorForSuperType(useSiteSession, symbol)\n\n return symbol.fir.scopeForClassImpl(\n substitutor,\n useSiteSession,\n scopeSession,\n skipPrivateMembers = true,<|endoftext|>"} {"prompt":"\/\/ - shutdown\/takeover smaller daemon\n \/\/ - run (or better persuade client to run) a bigger daemon (in fact may be even simple shutdown will do, because of client's daemon choosing logic)\n }\n }\n }\n }\n\n private fun shutdownNow() {\n log.info(\"Shutdown started\")\n fun Long.mb() = this \/ (1024 * 1024)","completion":"with(Runtime.getRuntime()) {\n log.info(\"Memory stats: total: ${totalMemory().mb()}mb, free: ${freeMemory().mb()}mb, max: ${maxMemory().mb()}mb\")\n }\n state.alive.set(Aliveness.Dying.ordinal)\n\n UnicastRemoteObject.unexportObject(this, true)\n log.info(\"Shutdown complete\")<|endoftext|>"} {"prompt":"\/\/ library.kt:17 box: $i$f$flaf:int=0:int, flafVar$iv:int=0:int, fooParam\\1$iv:int=0:int, $i$f$foo\\1\\12:int=0:int, fooVar\\1$iv:int=0:int, it\\2$iv:int=42:int,","completion":"$i$a$-foo-LibraryKt$flaf$1\\2\\25\\0$iv:int=0:int, x\\2$iv:int=1:int<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.plugin.KotlinProjectSetupAction\nimport org.jetbrains.kotlin.gradle.plugin.KotlinTarget\nimport org.jetbrains.kotlin.gradle.plugin.PropertiesProvider\nimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget","completion":"import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinWithJavaCompilation\nimport org.jetbrains.kotlin.gradle.utils.providerWithLazyConvention\nimport org.jetbrains.kotlin.gradle.utils.withType\n\ninternal const val KOTLIN_MODULE_GROUP = \"org.jetbrains.kotlin\"<|endoftext|>"} {"prompt":"packageProto,\n FirDeserializationContext.createForPackage(\n packageFqName, packageProto, nameResolver, moduleData,\n JvmBinaryAnnotationDeserializer(session, kotlinClass, kotlinClassFinder, byteContent),\n JavaAwareFlexibleTypeFactory,","completion":"FirJvmConstDeserializer(session, facadeBinaryClass ?: kotlinClass, BuiltInSerializerProtocol),\n source\n ),\n )\n }\n\n private object JavaAwareFlexibleTypeFactory : FirTypeDeserializer.FlexibleTypeFactory {\n override fun createFlexibleType(\n proto: ProtoBuf.Type,<|endoftext|>"} {"prompt":"return if (psi.hasBody() && (psi.funKeyword == null || psi.nameIdentifier == null)) {\n getAnonymousFunctionSymbol(psi)\n } else {\n KtFe10PsiFunctionSymbol(psi, analysisContext)\n }\n }","completion":"override fun getConstructorSymbol(psi: KtConstructor<*>): KtConstructorSymbol {\n return KtFe10PsiConstructorSymbol(psi, analysisContext)\n }\n\n override fun getTypeParameterSymbol(psi: KtTypeParameter): KtTypeParameterSymbol {\n return KtFe10PsiTypeParameterSymbol(psi, analysisContext)<|endoftext|>"} {"prompt":"contract { returnsNotNull() implies (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) }","completion":"return if (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) true else null\n}\nfun T.case_6_4(value_2: Any?): Boolean? {<|endoftext|>"} {"prompt":"description = \"Handle inline class usages\"\n)\n\nprivate val autoboxingTransformerPhase = makeIrModulePhase(\n { context -> AutoboxingTransformer(context) },\n name = \"AutoboxingTransformer\",\n description = \"Insert box\/unbox intrinsics\"\n)\n\nprivate val staticMembersLoweringPhase = makeIrModulePhase(\n ::StaticMembersLowering,","completion":"name = \"StaticMembersLowering\",\n description = \"Move static member declarations to top-level\"\n)\n\nprivate val classReferenceLoweringPhase = makeIrModulePhase(\n ::WasmClassReferenceLowering,\n name = \"WasmClassReferenceLowering\",\n description = \"Handle class references\"\n)\n\nprivate val wasmVarargExpressionLoweringPhase = makeIrModulePhase(<|endoftext|>"} {"prompt":"abstract override fun transformSetter(transformer: FirTransformer, data: D): FirValueParameter\n\n abstract override fun transformBackingField(transformer: FirTransformer, data: D): FirValueParameter\n\n abstract override fun transformAnnotations(transformer: FirTransformer, data: D): FirValueParameter","completion":"abstract override fun transformOtherChildren(transformer: FirTransformer, data: D): FirValueParameter\n}<|endoftext|>"} {"prompt":"override fun getOrPutScopeForClass(classDescriptor: ClassDescriptor, compute: () -> S): S {\n return compute()\n }\n }\n}\n\n@TypeRefinement\nfun KotlinTypeRefiner.refineTypes(types: Iterable): List = types.map { refineType(it) }","completion":"class Ref(var value: T)\n\n@TypeRefinement\nval REFINER_CAPABILITY = ModuleCapability>(\"KotlinTypeRefiner\")\n\nsealed class TypeRefinementSupport(val isEnabled: Boolean) {\n object Disabled : TypeRefinementSupport(isEnabled = false)\n object EnabledUninitialized : TypeRefinementSupport(isEnabled = true)<|endoftext|>"} {"prompt":"private val autoCacheRootDirectory = configuration.get(KonanConfigKeys.AUTO_CACHE_DIR)?.let {\n File(it).apply {\n if (!isDirectory) configuration.reportCompilationError(\"auto cache directory $this is not found or is not a directory\")\n }\n } ?: systemCacheRootDirectory","completion":"internal val autoCacheDirectory = autoCacheRootDirectory.child(userCacheFlavorString).also { it.mkdirs() }\n private val incrementalCacheRootDirectory = configuration.get(KonanConfigKeys.INCREMENTAL_CACHE_DIR)?.let {\n File(it).apply {\n if (!isDirectory) configuration.reportCompilationError(\"incremental cache directory $this is not found or is not a directory\")<|endoftext|>"} {"prompt":"}\n\n private fun warnAboutInheritedAnnotations(\n kind: FunctionKind,\n function: IrFunctionSymbol,\n annotatedFunction: IrFunctionSymbol\n ) {\n if (function.owner != annotatedFunction.owner) {\n context.reportWarning(\n \"Super method has a test annotation ${kind.annotationFqName} but the overriding method doesn't. \" +","completion":"\"Note that the overriding method will still be executed.\",\n irFile,\n function.owner\n )\n }\n }\n\n private fun warnAboutLoneIgnore(functionSymbol: IrFunctionSymbol): Unit = with(functionSymbol) {\n if (hasAnnotation(IGNORE_FQ_NAME) && !hasAnnotation(FunctionKind.TEST.annotationFqName)) {<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION\n\/\/ SKIP_TXT\n\n\/*\n * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)\n *","completion":"* SPEC VERSION: 0.1-220\n * MAIN LINK: expressions, comparison-expressions -> paragraph 1 -> sentence 2\n * PRIMARY LINKS: overloadable-operators -> paragraph 4 -> sentence 1\n * NUMBER: 1\n * DESCRIPTION: <, >, <= and >= operators are overloadable\n *\/\n\n\/\/ TESTCASE NUMBER: 1\nclass A(val a: Int) {<|endoftext|>"} {"prompt":"val propagateExiledToHeapObjects: Boolean\n ) {\n\n private val symbols = context.ir.symbols\n\n private fun DataFlowIR.Type.resolved(): DataFlowIR.Type.Declared {\n if (this is DataFlowIR.Type.Declared) return this\n val hash = (this as DataFlowIR.Type.External).hash","completion":"return externalModulesDFG.publicTypes[hash] ?: error(\"Unable to resolve exported type $hash\")\n }\n\n val escapeAnalysisResults = mutableMapOf()\n\n fun analyze() {\n context.logMultiple {\n +\"CALL GRAPH\"<|endoftext|>"} {"prompt":"addDependencies(cachedDependency, notHandledFiles.toList())\n }\n }\n }\n }\n\n private inner class Dependencies {\n val immediateBitcodeDependencies = run {\n val usedBitcode = usedBitcode().groupBy { it.library }\n val bitcodeModuleDependencies = mutableListOf()","completion":"val bitcodeFileDependencies = mutableListOf()\n val libraryToCache = config.cacheSupport.libraryToCache\n val strategy = libraryToCache?.strategy as? CacheDeserializationStrategy.SingleFile\n topSortedLibraries.forEach { library ->\n val filesUsed = usedBitcode[library]<|endoftext|>"} {"prompt":"}\n }\n\n \/\/endregion Task Configuration State & Inputs\n\n @TaskAction\n fun transformMetadata() {\n val transformation = GranularMetadataTransformation(\n params = transformationParameters,\n parentSourceSetVisibilityProvider = ParentSourceSetVisibilityProvider { identifier: ComponentIdentifier ->\n val serializableKey = identifier.serializableUniqueKey","completion":"parentVisibleSourceSetFiles.flatMap { visibleSourceSetsFile ->\n readVisibleSourceSetsFile(visibleSourceSetsFile)[serializableKey].orEmpty()\n }.toSet()\n }\n )\n\n if (outputsDir.isDirectory) {\n outputsDir.deleteRecursively()\n }\n outputsDir.mkdirs()<|endoftext|>"} {"prompt":"\/\/ FIR_IDENTICAL\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE\n\ninterface X\ninterface A: X\ninterface B : A, X\n\nfun foo(x: B) {","completion":"\/\/ Checks that when checking subtypes we search closes corresponding constructor (e.g. with BFS)\n val y: X = x\n}<|endoftext|>"} {"prompt":"val setMethodSymbol = with(arraySymbol.owner.functions) {\n \/\/ For unsigned types use set method.\n singleOrNull { it.name == KonanNameConventions.setWithoutBoundCheck } ?: single { it.name == OperatorNameConventions.SET }\n }\n val sizeGetterSymbol = arraySymbol.getPropertyGetter(\"size\")!!","completion":"val copyIntoSymbol = symbols.copyInto[arraySymbol]!!\n val copyOfSymbol = symbols.copyOf[arraySymbol]!!\n protected val singleParameterConstructor =\n arraySymbol.owner.constructors.find { it.valueParameters.size == 1 }!!<|endoftext|>"} {"prompt":"public inline fun kotlin.UByteArray.minOfWith(comparator: kotlin.Comparator, selector: (kotlin.UByte) -> R): R\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.OverloadResolutionByLambdaReturnType\n@kotlin.ExperimentalUnsignedTypes","completion":"@kotlin.internal.InlineOnly\npublic inline fun kotlin.UIntArray.minOfWith(comparator: kotlin.Comparator, selector: (kotlin.UInt) -> R): R\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.OverloadResolutionByLambdaReturnType<|endoftext|>"} {"prompt":"val x = listOf(1, 2, 3)\n}\n\n@Test\nfun `stable refs in root set`() {\n GC.collect()\n val stat0 = GC.lastGCInfo\n assertNotNull(stat0)\n val rootSet0 = stat0.rootSet\n assertNotNull(rootSet0)\n val x = listOf(1, 2, 3)","completion":"val stable = kotlinx.cinterop.StableRef.create(x)\n GC.collect();\n val stat1 = GC.lastGCInfo\n assertNotNull(stat1)\n val rootSet1 = stat1.rootSet\n assertNotNull(rootSet1)\n assertEquals(rootSet0.stableReferences + 1, rootSet1.stableReferences)\n stable.dispose()<|endoftext|>"} {"prompt":"public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO()\nfun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO()\n\n\/\/ FILE: Lib4.kt\npackage libPackageCase2Explicit","completion":"import testsCase2.*\n\nval Case2.listOf: A\n get() = A()\n\nfun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO()<|endoftext|>"} {"prompt":"(readUByte().toUInt() shl 16) or\n (readUByte().toUInt() shl 24)\n\n fun readUInt64(): ULong =\n readUByte().toULong() or\n (readUByte().toULong() shl 8) or\n (readUByte().toULong() shl 16) or","completion":"(readUByte().toULong() shl 24) or\n (readUByte().toULong() shl 32) or\n (readUByte().toULong() shl 40) or\n (readUByte().toULong() shl 48) or\n (readUByte().toULong() shl 56)\n\n\n fun readVarInt7() = readSignedLeb128().let {<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1285\npackage foo\n\nvar flag = false\nfun toggle(): Boolean {\n flag = !flag\n\n return flag\n}\n\ninline fun run(noinline f: () -> Int): Int {\n return f()\n}\n\n\/\/ CHECK_BREAKS_COUNT: function=box count=0 TARGET_BACKENDS=JS_IR","completion":"\/\/ CHECK_LABELS_COUNT: function=box name=$l$block count=0 TARGET_BACKENDS=JS_IR\nfun box(): String {\n run({ toggle(); 4 })\n assertEquals(true, flag)\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.abicmp.defects\n\nval JAR_FILE1_A = DefectAttribute(\"JAR_FILE1\", \"jarFile1\")\nval JAR_FILE2_A = DefectAttribute(\"JAR_FILE2\", \"jarFile2\")\nval CLASS_A = DefectAttribute(\"CLASS\", \"class\")","completion":"val METHOD_A = DefectAttribute(\"METHOD\", \"method\")\nval FIELD_A = DefectAttribute(\"FIELD\", \"field\")\nval VALUE1_A = DefectAttribute(\"VALUE1\", \"value1\")\nval VALUE2_A = DefectAttribute(\"VALUE2\", \"value2\")\nval VP_INDEX_A = DefectAttribute(\"VP_INDEX\", \"vpIndex\")<|endoftext|>"} {"prompt":") : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.ExpandedTypeCannotBeInherited\n\ninternal class ProjectionInImmediateArgumentToSupertypeImpl(\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,","completion":") : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.ProjectionInImmediateArgumentToSupertype\n\ninternal class InconsistentTypeParameterValuesImpl(\n override val typeParameter: KtTypeParameterSymbol,\n override val type: KtClassLikeSymbol,\n override val bounds: List,<|endoftext|>"} {"prompt":"contract { returns(false) implies ((this@case_8_2 is Number || this@case_8_2 is Int) && value_2 is Int && value_3 != null && value_3 is Number && value_4 != null) }","completion":"return !((this@case_8_2 is Number || this@case_8_2 is Int) && value_2 is Int && value_3 != null && value_3 is Number && value_4 != null)\n}\ninline fun T?.case_8_3(value_2: Number, value_3: Any?, value_4: String?): Boolean? {<|endoftext|>"} {"prompt":"\/\/ DO_NOT_CHECK_NON_PSI_SYMBOL_RESTORE_K1\nannotation class PropertyAnnotation\nannotation class FieldAnnotation\nannotation class GetAnnotation\nannotation class SetAnnotation\nannotation class SetparamAnnotation\nannotation class ExplicitGetAnnotation\nannotation class ExplicitSetAnnotation\nannotation class ExplicitSetparamAnnotation\n\n@property:PropertyAnnotation\n@field:FieldAnnotation","completion":"@get:GetAnnotation\n@set:SetAnnotation\n@setparam:SetparamAnnotation\nvar x: Int = 0\n @ExplicitGetAnnotation\n get() = field\n @ExplicitSetAnnotation\n set(@ExplicitSetparamAnnotation value) {\n field = value\n }<|endoftext|>"} {"prompt":"#endif\"\"\".trimIndent())\n\n output(\"#endif \/* KONAN_${prefix.uppercase()}_H *\/\")\n\n outputStreamWriter.close()\n\n outputStreamWriter = cppAdapterFile.printWriter()\n\n \/\/ Include header into C++ source.\n headerFile.forEachLine { it -> output(it) }\n\n output(\"#include \")","completion":"output(\"\"\"\n |struct KObjHeader;\n |typedef struct KObjHeader KObjHeader;\n |struct KTypeInfo;\n |typedef struct KTypeInfo KTypeInfo;\n |\n |struct FrameOverlay;\n |typedef struct FrameOverlay FrameOverlay;\n |\n |#define RUNTIME_NOTHROW __attribute__((nothrow))<|endoftext|>"} {"prompt":"* applied to each character in the char sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n *\/\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)","completion":"@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOf(selector: (Char) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])<|endoftext|>"} {"prompt":"package kotlin.time\n\nimport kotlin.math.truncate\nimport kotlin.time.Duration.Companion.milliseconds\nimport kotlin.time.TimeSource.Monotonic.ValueTimeMark\n\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\") \/\/ visibility\ninternal actual typealias ValueTimeMarkReading = Any\n\ninternal interface DefaultTimeSource : TimeSource.WithComparableMarks {","completion":"override fun markNow(): ValueTimeMark\n fun elapsedFrom(timeMark: ValueTimeMark): Duration\n fun differenceBetween(one: ValueTimeMark, another: ValueTimeMark): Duration\n fun adjustReading(timeMark: ValueTimeMark, duration: Duration): ValueTimeMark\n}\n\n@SinceKotlin(\"1.3\")<|endoftext|>"} {"prompt":"val OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS: KtDiagnosticFactory0 by warning0()\n val OVERLOADS_ABSTRACT: KtDiagnosticFactory0 by error0()\n val OVERLOADS_INTERFACE: KtDiagnosticFactory0 by error0()","completion":"val OVERLOADS_LOCAL: KtDiagnosticFactory0 by error0()\n val OVERLOADS_ANNOTATION_CLASS_CONSTRUCTOR: KtDiagnosticFactoryForDeprecation0 by deprecationError0(ProhibitJvmOverloadsOnConstructorsOfAnnotationClasses)<|endoftext|>"} {"prompt":"object TestFn17 : TestFnBase {\n override fun testGood(x: Any) =\n reifiedAsSucceeds>(","completion":"x, \"x as Function17<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *>\")\n override fun testBad(x: Any) =<|endoftext|>"} {"prompt":"override fun getTopLevelPropertySymbolsTo(destination: MutableList, packageFqName: FqName, name: Name) {\n }\n\n override fun getPackage(fqName: FqName): FqName? = providers.firstNotNullOfOrNull { it.getPackage(fqName) }\n\n companion object {","completion":"fun merge(session: FirSession, project: Project, providers: List): FirSymbolProvider? =\n if (providers.size > 1) {\n val combinedScope = GlobalSearchScope.union(providers.map { it.searchScope })\n val javaClassFinder = project.createJavaClassFinder(combinedScope)<|endoftext|>"} {"prompt":"@Ann(intArrayOf(i, i2, i3))","completion":"@Ann(intArrayOf(intArrayOf(i, i2,<|endoftext|>"} {"prompt":"FirPackageMemberScope(file.packageFqName, session, excludedNames = excludedNamesInPackage)\n }\n }\n \/\/ TODO: explicit simple importing scope should have highest priority (higher than inner scopes added in process)\n this += FirExplicitSimpleImportingScope(file.imports, session, scopeSession)\n }\n}","completion":"private class ListStorageFirScope(val result: List) : FirScope()<|endoftext|>"} {"prompt":"private fun computeClassLikeSymbolByClassId(classId: ClassId): FirClassLikeSymbol<*>? {\n val candidates = declarationProvider.getAllClassesByClassId(classId) + declarationProvider.getAllTypeAliasesByClassId(classId)\n val (ktClass, provider) = selectFirstElementInClasspathOrder(candidates) { it } ?: return null","completion":"return provider.getClassLikeSymbolByClassId(classId, ktClass)\n }\n\n @FirSymbolProviderInternals\n override fun getTopLevelCallableSymbolsTo(destination: MutableList>, packageFqName: FqName, name: Name) {\n forEachCallableProvider(\n packageFqName,\n name,<|endoftext|>"} {"prompt":"assertEquals(0, count, \"onEachIndex should be executed only when resulting sequence is iterated\")\n\n val sum = newData.foldIndexed(0) { i, acc, e -> acc + i + e.length }\n assertEquals(sum, count)\n }\n\n\n @Test fun filterAndTakeWhileExtractTheElementsWithinRange() {","completion":"assertEquals(listOf(144, 233, 377, 610, 987), fibonacci().filter { it > 100 }.takeWhile { it < 1000 }.toList())\n }\n\n @Test fun foldReducesTheFirstNElements() {\n val sum = { a: Int, b: Int -> a + b }<|endoftext|>"} {"prompt":"\/\/ no local optimizations\n if (element11 in emptyCharSequence.indices != range1.contains(element11)) throw AssertionError()\n if (element11 !in emptyCharSequence.indices != !range1.contains(element11)) throw AssertionError()","completion":"if (!(element11 in emptyCharSequence.indices) != !range1.contains(element11)) throw AssertionError()\n if (!(element11 !in emptyCharSequence.indices) != range1.contains(element11)) throw AssertionError()\n}\n\nfun testR1xE12() {\n \/\/ with possible local optimizations<|endoftext|>"} {"prompt":"get() = booleanProperty(\"kotlin.wasm.stability.nowarn\") ?: false\n\n val ignoreDisabledNativeTargets: Boolean?\n get() = booleanProperty(KOTLIN_NATIVE_IGNORE_DISABLED_TARGETS)\n\n val ignoreAbsentAndroidMultiplatformTarget: Boolean","completion":"get() = booleanProperty(\"kotlin.mpp.absentAndroidTarget.nowarn\") ?: false\n\n val ignoreAndroidGradlePluginCompatibilityIssues: Boolean\n get() = booleanProperty(KOTLIN_MPP_ANDROID_GRADLE_PLUGIN_COMPATIBILITY_NO_WARN) ?: false\n\n val mppAndroidSourceSetLayoutVersion: Int?<|endoftext|>"} {"prompt":"map.put(DELEGATION_NOT_TO_INTERFACE, \"Delegation is supported only for interfaces.\")\n map.put(\n DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE,\n \"Delegated member ''{0}'' hides supertype override ''{1}''. Please specify proper override explicitly.\", SYMBOL, SYMBOL\n )","completion":"map.put(NESTED_CLASS_NOT_ALLOWED, \"''{0}'' is prohibited here.\", TO_STRING)\n map.put(VAL_OR_VAR_ON_LOOP_PARAMETER, \"''{0}'' on loop parameter is prohibited.\", TO_STRING)<|endoftext|>"} {"prompt":"jump: HighLevelJump,\n startOffset: Int,\n endOffset: Int,\n value: IrExpression\n ): IrExpression {\n if (index == tryScopes.size)\n return jump.toIr(context, startOffset, endOffset, value)\n\n val currentTryScope = tryScopes[index]\n currentTryScope.jumps.getOrPut(jump) {","completion":"val type = (jump as? Return)?.target?.owner?.returnType(context) ?: value.type\n jump.toString()\n val symbol = IrReturnableBlockSymbolImpl()\n with(currentTryScope) {\n irBuilder.run {\n val inlinedFinally = irInlineFinally(symbol, type, expression, finallyExpression)\n expression = performHighLevelJump(<|endoftext|>"} {"prompt":"var packageFilter: String? = null\n val argsIterator = args.iterator()\n while (argsIterator.hasNext()) {\n val arg = argsIterator.next()\n\n when (arg) {\n \"--pkg\" -> if (argsIterator.hasNext()) packageFilter = argsIterator.next() else throw IllegalArgumentException(\"argument $arg requires argument\")","completion":"else -> throw IllegalArgumentException(\"Argument $arg is unknown\")\n }\n }\n\n val urlsPerFiles = urls.filter { packageFilter == null || it.second == packageFilter }.groupBy { it.second + \".idl\" }\n\n urlsPerFiles.forEach { e ->\n val fileName = e.key\n val pkg = e.value.first().second<|endoftext|>"} {"prompt":".finalizeValueOnRead()\n task.buildFinishedListenerService.value(buildFinishedListenerService).disallowChanges()\n task.buildIdService.value(buildIdService).disallowChanges()\n\n task.incremental = false\n task.useModuleDetection.convention(false)","completion":"task.runViaBuildToolsApi.convention(propertiesProvider.runKotlinCompilerViaBuildToolsApi).finalizeValueOnRead()\n task.classLoadersCachingService.value(cachedClassLoadersService).disallowChanges()\n\n task.explicitApiMode\n .value(project.providers.provider { ext.explicitApi })\n .finalizeValueOnRead()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.konan.file.File\nimport org.jetbrains.kotlin.konan.library.KonanLibrary\nimport org.jetbrains.kotlin.library.SearchPathResolver\nimport org.jetbrains.kotlin.library.isInterop\nimport org.jetbrains.kotlin.library.metadata.CurrentKlibModuleOrigin","completion":"import org.jetbrains.kotlin.library.metadata.DeserializedKlibModuleOrigin\nimport org.jetbrains.kotlin.library.metadata.SyntheticModulesOrigin\nimport org.jetbrains.kotlin.library.metadata.klibModuleOrigin\nimport org.jetbrains.kotlin.library.metadata.resolver.KotlinLibraryResolveResult<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol\nimport org.jetbrains.kotlin.ir.types.IrType\nimport org.jetbrains.kotlin.ir.util.classId\nimport org.jetbrains.kotlin.ir.util.isAnnotationClass\nimport org.jetbrains.kotlin.ir.util.parentClassOrNull","completion":"import org.jetbrains.kotlin.ir.visitors.IrElementVisitor\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.name.SpecialNames\nimport org.jetbrains.kotlin.name.StandardClassIds\nimport org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource<|endoftext|>"} {"prompt":"fun Array.test3Nested(): Array {\n fun local(): Array {\n fun local2(): Array {\n return this@test3Nested\n }\n return local2()\n }\n return local()\n}\n\n\nfun Array.test4() : Array {\n return object {\n fun run() : Array {","completion":"return this@test4\n }\n }.run()\n}\n\nfun Array.test4Nested() : Array {\n return object {\n fun run() : Array {\n return object {\n fun run() : Array {\n return this@test4Nested\n }\n }.run()\n }\n }.run()\n}<|endoftext|>"} {"prompt":"0x0UL, 0x3da5fd7fe1796495UL, 0x3da5fd7fe1796495UL, 0x0UL, \n 0x0UL, 0x0UL, 0x0UL, 0x0UL,","completion":"0x3da5fd7fe1796495UL, 0x3da5fd7fe1796495UL, 0x0UL, 0x0UL, \n 0x0UL, 0x0UL, 0x3ff0000000000000UL, 0x3ff000000000afecUL,<|endoftext|>"} {"prompt":"public inline fun Int.toBigInteger(): BigInteger = BigInteger.valueOf(this.toLong())\n\n\/**\n * Returns the value of this [Long] number as a [BigInteger].\n *\/\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic inline fun Long.toBigInteger(): BigInteger = BigInteger.valueOf(this)\n\n\/**","completion":"* Returns the value of this [BigInteger] number as a [BigDecimal].\n *\/\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic inline fun BigInteger.toBigDecimal(): BigDecimal = BigDecimal(this)\n\n\/**\n * Returns the value of this [BigInteger] number as a [BigDecimal]<|endoftext|>"} {"prompt":"a.x.funNullableAny()\n }\n}\n\n\/*\n * TESTCASE NUMBER: 29\n * UNEXPECTED BEHAVIOUR\n * ISSUES: KT-28785\n *\/\nfun case_29(a: Inv) {","completion":"if (a.x != null) {\n a.x\n a.x.equals(null)<|endoftext|>"} {"prompt":"* to fix the KT-65218, which provoked by different stdlib declarations order in CLI compilation mode and AA mode (see\n * the issue for more details)\n *\/\n if (\n (applicability == currentApplicability && group == bestGroup) ||","completion":"(currentApplicability == INAPPLICABLE_ARGUMENTS_MAPPING_ERROR && applicability == INAPPLICABLE_WRONG_RECEIVER)\n ) {\n candidates.add(candidate)\n }\n\n return applicability\n }\n\n fun bestCandidates(): List = candidates\n\n open fun shouldStopAtTheGroup(group: TowerGroup): Boolean =<|endoftext|>"} {"prompt":"if (f < 8) { \/\/ Want more precision with smallest values.\n f = f shl 2\n pow -= 2\n }\n var ff = f\n while (ff and 0x00800000 == 0) {\n ff = ff shl 1\n numBits--\n }\n } else {\n \/\/ 0 < e < 255.\n \/\/ A \"normalized\" number.","completion":"f = f or 0x00800000\n pow = e - p\n }\n\n if (-59 < pow && pow < 35 || pow == -59 && !mantissaIsZero)\n longDigitGenerator(f.toLong(), pow, e == 0, mantissaIsZero, numBits)\n else<|endoftext|>"} {"prompt":"assertFileExists(javaClassesDir().resolve(\"example\/SourceAnnotatedTestClassGenerated.class\"))\n assertFileExists(javaClassesDir().resolve(\"example\/BinaryAnnotatedTestClassGenerated.class\"))\n assertFileExists(javaClassesDir().resolve(\"example\/RuntimeAnnotatedTestClassGenerated.class\"))\n }","completion":"javaSourcesDir().resolve(\"test.kt\").modify {\n it.replace(\"@ExampleBinaryAnnotation\", \"\")\n }\n\n build(\"build\") {\n assertTasksExecuted(\":kaptGenerateStubsKotlin\", \":kaptKotlin\", \":compileKotlin\")\n assertTasksUpToDate(\":compileJava\")<|endoftext|>"} {"prompt":"partiallyAppliedSymbol as KtPartiallyAppliedVariableSymbol,\n fir.unwrapLValue()?.toTypeArgumentsMapping(partiallyAppliedSymbol) ?: emptyMap(),\n KtSimpleVariableAccess.Write(rhs)\n )\n }\n is FirPropertyAccessExpression, is FirCallableReferenceAccess -> {","completion":"@Suppress(\"USELESS_IS_CHECK\") \/\/ K2 warning suppression, TODO: KT-62472\n require(fir is FirQualifiedAccessExpression)\n when (unsubstitutedKtSignature.symbol) {\n is KtVariableLikeSymbol -> {\n @Suppress(\"UNCHECKED_CAST\") \/\/ safe because of the above check on targetKtSymbol<|endoftext|>"} {"prompt":"* overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 8 -> sentence 1\n * overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 5","completion":"* overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 6 -> sentence 1\n * overload-resolution, building-the-overload-candidate-set-ocs, call-with-specified-type-parameters -> paragraph 1 -> sentence 2\n * NUMBER: 5<|endoftext|>"} {"prompt":"\/\/ we can create element with just value, no list\n A(value=x)\n\n \/\/ if we add a list, it can infer the type\n A(\n value=x,\n list=listOf(234, x)\n )\n }\n \"\"\"\n )\n }\n\n @Test\n fun testSimpleNoArgsComponent() {\n testCompile(\n \"\"\"","completion":"import androidx.compose.runtime.*\n\n @Composable\n fun Simple() {}\n\n @Composable\n fun run() {\n Simple()\n }\n \"\"\"\n )\n }\n\n @Test\n fun testDotQualifiedObjectToClass() {\n testCompile(\n \"\"\"\n import androidx.compose.runtime.*\n\n object Obj {<|endoftext|>"} {"prompt":"public val Long.milliseconds: Duration get() = toDuration(DurationUnit.MILLISECONDS)\n\n\/**\n * Returns a [Duration] equal to this [Double] number of milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalTime","completion":"@Deprecated(\"Use 'Double.milliseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.milliseconds\", \"kotlin.time.Duration.Companion.milliseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\", errorSince = \"1.8\", hiddenSince = \"1.9\")<|endoftext|>"} {"prompt":"public fun maxOf(a: UShort, b: UShort): UShort {\n return if (a >= b) a else b\n}\n\n\/**\n * Returns the greater of three values.\n *\/\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly","completion":"public inline fun maxOf(a: UInt, b: UInt, c: UInt): UInt {\n return maxOf(a, maxOf(b, c))\n}\n\n\/**\n * Returns the greater of three values.\n *\/\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"0x3fefffffffdd3059UL, 0x3ff00000001167d3UL, 0x3ff0000000000000UL, 0x3ff0000000000000UL, \n 0x3ff0000000000000UL, 0x3ff0000000000000UL, 0x3da5fd7fe1796495UL, 0x3da5fd7fe161788bUL,","completion":"0x3da5fd7fe191509fUL, 0x3eca86f0875fcf94UL, 0x3b5e392010175ee5UL, 0x3f5d22a4fa316facUL,<|endoftext|>"} {"prompt":"\/\/ EXPECTED_REACHABLE_NODES: 1286\nopen class A {\n private val `.` = \"A\"\n private val `;` = \"B\"\n\n private fun `@`() = \"C\"\n private fun `#`() = \"D\"\n\n fun foo() = `.` + `;` + `@`() + `#`()\n}\n\nfun box(): String {","completion":"val x = A().foo()\n if (x != \"ABCD\") return \"fail: $x\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"override fun createStubTypeForBuilderInference(typeVariable: TypeVariableMarker): StubTypeMarker {\n return StubTypeForBuilderInference(\n typeVariable.freshTypeConstructor() as NewTypeVariableConstructor,\n typeVariable.defaultType().isMarkedNullable()\n )\n }","completion":"override fun createStubTypeForTypeVariablesInSubtyping(typeVariable: TypeVariableMarker): StubTypeMarker {\n return StubTypeForTypeVariablesInSubtyping(\n typeVariable.freshTypeConstructor() as NewTypeVariableConstructor,\n typeVariable.defaultType().isMarkedNullable()\n )\n }\n\n override fun TypeConstructorMarker.isTypeVariable(): Boolean {<|endoftext|>"} {"prompt":"x.propNullableAny\n x.funT()\n x.funAny()","completion":"x.funNullableT()\n x.funNullableAny()\n }\n}\n\n\/\/ TESTCASE NUMBER: 18\nfun case_18(x: T, f: Boolean) {<|endoftext|>"} {"prompt":"|stderr: $stdErr\n \"\"\".trimMargin()\n )\n check(exitCode == 0) { \"Compilation failed\" }\n check(output.toFile().exists()) { \"Compiler swiftc hasn't produced an output file: $output\" }\n}\n\nfun targetSupportsMimallocAllocator(targetName: String) =","completion":"HostManager().targetByName(targetName).supportsMimallocAllocator()\n\nfun targetSupportsLibBacktrace(targetName: String) =\n HostManager().targetByName(targetName).supportsLibBacktrace()\n\nfun targetSupportsCoreSymbolication(targetName: String) =\n HostManager().targetByName(targetName).supportsCoreSymbolication()<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.api.renderer.declarations.bodies\n\nimport org.jetbrains.kotlin.analysis.api.KtAnalysisSession\nimport org.jetbrains.kotlin.analysis.api.symbols.*\nimport org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolWithMembers","completion":"public interface KtRendererBodyMemberScopeProvider {\n public fun getMemberScope(analysisSession: KtAnalysisSession, symbol: KtSymbolWithMembers): List\n\n public object ALL : KtRendererBodyMemberScopeProvider {\n override fun getMemberScope(analysisSession: KtAnalysisSession, symbol: KtSymbolWithMembers): List {<|endoftext|>"} {"prompt":"true as java.lang.Boolean, '#' as java.lang.Character,\n 3.toByte() as java.lang.Byte, 10.toShort() as java.lang.Short,\n -300 as java.lang.Integer, -5.0f as java.lang.Float,\n 10L as java.lang.Long, 3.14 as java.lang.Double,","completion":"true as java.lang.Boolean, '#' as java.lang.Character,\n 3.toByte() as java.lang.Byte, 10.toShort() as java.lang.Short,\n -300 as java.lang.Integer, -5.0f as java.lang.Float,\n 10L as java.lang.Long, 3.14 as java.lang.Double\n )<|endoftext|>"} {"prompt":"if (virtualFile != null && virtualFile.extension == BuiltInSerializerProtocol.BUILTINS_FILE_EXTENSION) {\n return builtinsModule\n }\n\n computeSpecialModule(containingFile)?.let { return it }\n\n if (virtualFile == null) {\n throw KotlinExceptionWithAttachments(\"Cannot find a KtModule for a non-physical file\")","completion":".withPsiAttachment(\"containingFile\", containingFile)\n .withAttachment(\"contextualModule\", contextualModule?.asDebugString())\n }\n\n return allKtModules.firstOrNull { module -> virtualFile in module.contentScope }\n ?: throw KotlinExceptionWithAttachments(\"Cannot find a KtModule for the VirtualFile\")\n .withPsiAttachment(\"containingFile\", containingFile)<|endoftext|>"} {"prompt":"* the returned value is an angle in the range from `-PI\/2` to `PI\/2` radians.\n *\n * Special cases:\n * - `asin(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`\n *\/\n@SinceKotlin(\"1.2\")\npublic expect fun asin(x: Float): Float\n\n\/**","completion":"* Computes the arc cosine of the value [x];\n * the returned value is an angle in the range from `0.0` to `PI` radians.\n *\n * Special cases:\n * - `acos(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`\n *\/\n@SinceKotlin(\"1.2\")<|endoftext|>"} {"prompt":"sealed class KtDiagnosticWithParameters3 : KtDiagnostic(), DiagnosticWithParameters3Marker {\n abstract override val a: A\n abstract override val b: B\n abstract override val c: C\n abstract override val factory: KtDiagnosticFactory3\n}","completion":"sealed class KtDiagnosticWithParameters4 : KtDiagnostic(), DiagnosticWithParameters4Marker {\n abstract override val a: A\n abstract override val b: B\n abstract override val c: C\n abstract override val d: D<|endoftext|>"} {"prompt":"error(\"Debug metadata version mismatch. Expected: $expected, got $actual. Please update the Kotlin standard library.\")\n }\n}\n\n\/**\n * Returns an array of spilled variable names and continuation's field names where the variable has been spilled.\n * The structure is the following:\n * - field names take 2*k'th indices\n * - corresponding variable names take (2*k + 1)'th indices.\n *","completion":"* The function is for debugger to use, thus it returns simplest data type possible.\n * This function should only be called on suspended coroutines to get accurate mapping.\n *\n * The result is `null` when debug metadata is not available.\n *\/\n@SinceKotlin(\"1.3\")\n@JvmName(\"getSpilledVariableFieldMapping\")<|endoftext|>"} {"prompt":"override fun f(b: B): B = b\n}\n\npublic interface I3 : I4\n\npublic expect interface I4 {\n public fun f(b: B): B\n}\n\nfun box() = X().f(\"O\") + Y().f(\"K\")\n\n\/\/ MODULE: platform()()(common)\n\/\/ FILE: platform.kt","completion":"public actual interface I2 {\n public actual fun f(a: A): A\n}\n\npublic actual interface I4 {\n public actual fun f(b: B): B\n}<|endoftext|>"} {"prompt":"isMutable = false,\n init = initITableGlobal\n )\n context.defineGlobalClassITable(klass.symbol, wasmClassIFaceGlobal)\n }\n\n override fun visitClass(declaration: IrClass) {\n if (declaration.isExternal) return\n val symbol = declaration.symbol\n\n \/\/ Handle arrays","completion":"declaration.getWasmArrayAnnotation()?.let { wasmArrayAnnotation ->\n val nameStr = declaration.fqNameWhenAvailable.toString()\n val wasmArrayDeclaration = WasmArrayDeclaration(\n nameStr,\n WasmStructFieldDeclaration(\n name = \"field\",\n type = context.transformFieldType(wasmArrayAnnotation.type),\n isMutable = true<|endoftext|>"} {"prompt":"LookupSymbol(name = \"changedProperty\", scope = \"com.example.SubClassOfChangedSuperClass\"),\n LookupSymbol(name = \"changedProperty\", scope = \"com.example.SubSubClassOfChangedSuperClass\"),\n LookupSymbol(name = \"changedFunction\", scope = \"com.example.ChangedSuperClass\"),","completion":"LookupSymbol(name = \"changedFunction\", scope = \"com.example.SubClassOfChangedSuperClass\"),\n LookupSymbol(name = \"changedFunction\", scope = \"com.example.SubSubClassOfChangedSuperClass\"),\n LookupSymbol(name = SAM_LOOKUP_NAME.asString(), scope = \"com.example.ChangedSuperClass\"),<|endoftext|>"} {"prompt":") : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.CannotInferParameterType\n\ninternal class NoTailCallsFoundImpl(\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,","completion":") : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.NoTailCallsFound\n\ninternal class TailrecOnVirtualMemberErrorImpl(\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,<|endoftext|>"} {"prompt":"internal fun consumerApiUsage(target: KotlinTarget): Usage =\n consumerApiUsage(target.project, target.platformType)\n\n internal fun consumerRuntimeUsage(project: Project, platformType: KotlinPlatformType) = project.usageByName(\n when (platformType) {\n in jvmPlatformTypes -> JAVA_RUNTIME\n else -> KOTLIN_RUNTIME\n }","completion":")\n\n internal fun consumerRuntimeUsage(target: KotlinTarget) = consumerRuntimeUsage(target.project, target.platformType)\n\n internal fun producerApiUsage(project: Project, platformType: KotlinPlatformType) = project.usageByName(\n when (platformType) {\n in jvmPlatformTypes -> \"java-api-jars\"\n else -> KOTLIN_API\n }\n )<|endoftext|>"} {"prompt":"@JvmField\n val EMPTY: TypeSubstitution = object : TypeSubstitution() {\n override fun get(key: KotlinType): Nothing? = null\n override fun isEmpty() = true\n override fun toString() = \"Empty TypeSubstitution\"\n }\n }\n\n abstract operator fun get(key: KotlinType): TypeProjection?","completion":"\/\/ This can be used to perform preliminary manipulations with top-level types\n open fun prepareTopLevelType(topLevelType: KotlinType, position: Variance): KotlinType = topLevelType\n\n open fun isEmpty(): Boolean = false\n\n open fun approximateCapturedTypes(): Boolean = false\n open fun approximateContravariantCapturedTypes(): Boolean = false<|endoftext|>"} {"prompt":"require(y is String)\n x.length\n y += \"\"\n } while (i < 10)\n}\n\nfun test21(i: Int) {\n val x: Any? = materialize()\n var y = x\n do {\n require(y is Int)\n x.inc()\n y++\n } while (i < 10)\n}\n\n\/\/With bounds: assignment before smartcast","completion":"fun test22(i: Int) {\n val x: Any? = materialize()\n var y = x\n do {\n require(y is String)\n y = \"\"\n x.length\n } while (i < 10)\n}\n\nfun test23(i: Int) {\n val x: Any? = materialize()<|endoftext|>"} {"prompt":"\/\/ IGNORE_BACKEND: WASM\n\/\/ WASM_MUTE_REASON: STDLIB_ASSERT\n\/\/ IGNORE_BACKEND: JS_IR\n\/\/ IGNORE_BACKEND: JS_IR_ES6\n\/\/ IGNORE_BACKEND: JS","completion":"\/\/ See related issue: https:\/\/youtrack.jetbrains.com\/issue\/KT-59059\/Native-Assert-does-not-evaluate-argument-value-when-disabled\n\/\/ ASSERTIONS_MODE: always-disable\n\/\/ WITH_STDLIB\n\n@file:Suppress(\"OPT_IN_USAGE_ERROR\") \/\/ ExperimentalNativeApi is defined only in Native\n\nfun checkTrue(): Boolean {<|endoftext|>"} {"prompt":"Family.TVOS -> BinaryFormat.MACH_O\n Family.OSX -> BinaryFormat.MACH_O\n Family.ANDROID -> BinaryFormat.ELF\n Family.LINUX -> BinaryFormat.ELF\n Family.MINGW -> BinaryFormat.PE_COFF\n}\n\nfun KonanTarget.pointerBits() = when (architecture) {\n Architecture.X64 -> 64","completion":"Architecture.X86 -> 32\n Architecture.ARM64 -> if (this == KonanTarget.WATCHOS_ARM64) 32 else 64\n Architecture.ARM32 -> 32\n}\n\nfun KonanTarget.supportsMimallocAllocator(): Boolean =\n when(this) {\n is KonanTarget.LINUX_X64 -> true<|endoftext|>"} {"prompt":"if (!(element10 !in 3.0..<1.0) != range1.contains(element10)) throw AssertionError()\n}\n\nfun testR1xE11() {\n \/\/ with possible local optimizations\n if (4.0 in 3.0..<1.0 != range1.contains(4.0)) throw AssertionError()","completion":"if (4.0 !in 3.0..<1.0 != !range1.contains(4.0)) throw AssertionError()\n if (!(4.0 in 3.0..<1.0) != !range1.contains(4.0)) throw AssertionError()<|endoftext|>"} {"prompt":"when (x) {\n is IBase.A -> \"\"\n null -> \"\"\n }\n}\n\nfun test_8(x: Boolean?) {\n when (x) {\n true -> \"\"\n false -> \"\"\n }\n\n when (x) {\n true -> \"\"","completion":"null -> \"\"\n }\n}\n\n\/\/ ------------------ with else ------------------\n\nfun test_9(x: SomeEnum?) {\n when (x) {\n SomeEnum.A -> \"\"\n else -> \"\"\n }\n}\n\nfun test_10(x: Base?) {\n when (x) {\n is Base.A -> \"\"\n else -> \"\"\n }\n}<|endoftext|>"} {"prompt":"val a: String by MyProperty2()\n}\n\nclass MyProperty2 {}\noperator fun MyProperty2.getValue(thisRef: Any?, desc: KProperty<*>): T {\n throw Exception(\"$thisRef $desc\")\n}\n\n\/\/--------------------\n\nclass A3 {\n val a: String by MyProperty3()\n\n class MyProperty3 {}","completion":"operator fun MyProperty3.getValue(thisRef: Any?, desc: KProperty<*>): T {\n throw Exception(\"$thisRef $desc\")\n }\n}<|endoftext|>"} {"prompt":"\/*p:bar p:foo p:foo.E(values) p:kotlin(Array)*\/E.values()\n \/*p:bar p:foo p:foo.E(valueOf)*\/E.valueOf(\"\")\n}\n\n\/*p:foo*\/fun classifiers(\n a: \/*p:bar p:foo*\/A,","completion":"ab: \/*p:bar p:bar.A(B) p:foo p:foo.A(B)*\/A.B,\n ac: \/*p:bar p:bar.A(C) p:foo p:foo.A(C)*\/A.C,<|endoftext|>"} {"prompt":"kotlinCompileTask: TaskProvider,\n config: Property.() -> Unit\n ) {\n project.whenKaptEnabled {\n val kaptGenerateStubsTaskName = getKaptTaskName(kotlinCompileTask.name, KAPT_GENERATE_STUBS_PREFIX)","completion":"project.tasks.withType().configureEach { task ->\n if (task.name == kaptGenerateStubsTaskName) {\n config(task.useModuleDetection)\n }\n }\n }\n }\n }\n}<|endoftext|>"} {"prompt":"\/\/ LANGUAGE: -ProhibitSimplificationOfNonTrivialConstBooleanExpressions\nfun x(): Boolean { return true }\n\npublic fun foo(p: String?): Int {\n \/\/ Like whileTrue but 2 == 2 is in use\n while(2 == 2) {\n p!!.length\n if (x()) break","completion":"}\n \/\/ Smart cast should not work in this case, see KT-6284\n return p.length\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.providers.impl.util.mergeInto\nimport org.jetbrains.kotlin.analysis.utils.errors.withKtModuleEntry\nimport org.jetbrains.kotlin.assignment.plugin.AssignmentCommandLineProcessor\nimport org.jetbrains.kotlin.assignment.plugin.AssignmentConfigurationKeys","completion":"import org.jetbrains.kotlin.assignment.plugin.k2.FirAssignmentPluginExtensionRegistrar\nimport org.jetbrains.kotlin.cli.plugins.processCompilerPluginsOptions\nimport org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi\nimport org.jetbrains.kotlin.config.CompilerConfiguration<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM_IR\n\/\/ LANGUAGE: +MultiPlatformProjects\n\/\/ FULL_JDK\n\/\/ ISSUE: KT-63574\n\n\/\/ MODULE: commonJvm\n\/\/ FILE: common.kt\nimport java.nio.ByteOrder\n\nfun foo(): String = ByteOrder.LITTLE_ENDIAN.toString()\n\n\/\/ MODULE: platformJvm()()(commonJvm)","completion":"\/\/ FILE: platform.kt\nimport java.nio.ByteOrder\n\nfun bar(): String = ByteOrder.LITTLE_ENDIAN.toString()\n\nfun box(): String {\n val expected = \"LITTLE_ENDIAN\"\n if (foo() != expected) return \"Fail 1\"\n if (bar() != expected) return \"Fail 2\"\n return \"OK\"\n}<|endoftext|>"} {"prompt":"xBar3$iv:int=3:int, $i$f$bar:int=0:int, xBaz1\\1$iv:int=100:int, xBaz2\\1$iv:int=101:int, xBaz3\\1$iv:int=102:int, $i$f$baz\\1\\14:int=0:int,","completion":"$i$f$x1\\2\\76:int=0:int<|endoftext|>"} {"prompt":"v.pop() \/\/ -> arr, length, (index + 1)\n v.goTo(nextLoopIteration)\n\n v.visitLabel(loopIsOver)\n v.pop2() \/\/ -> arr\n v.pop()\n }\n\n override fun readValue(v: InstructionAdapter) {","completion":"v.invokevirtual(PARCEL_TYPE.internalName, \"readInt\", \"()I\", false) \/\/ -> length\n v.dup() \/\/ -> length, length\n v.newarray(elementSerializer.asmType) \/\/ -> length, arr\n v.swap() \/\/ -> arr, length\n v.aconst(0) \/\/ -> arr, length, index\n\n val nextLoopIteration = Label()<|endoftext|>"} {"prompt":"is KmClassifier.TypeAlias -> t.typeAliasName = getClassName(cls.name)\n is KmClassifier.TypeParameter -> t.typeParameter = cls.id\n }\n kmType.arguments.forEach { argument ->\n t.addArgument(writeTypeProjection(argument))\n }","completion":"kmType.abbreviatedType?.let { t.abbreviatedType = writeType(it).build() }\n kmType.outerType?.let { t.outerType = writeType(it).build() }\n kmType.flexibleTypeUpperBound?.let { fub ->\n val fubType = writeType(fub.type)<|endoftext|>"} {"prompt":"* Returns the value of this duration expressed as a [Long] number of nanoseconds.\n *\n * If the value doesn't fit in the range of [Long] type, it is coerced into that range, see the conversion [Double.toLong] for details.\n *\n * The range of durations that can be expressed as a `Long` number of nanoseconds is approximately \u00b1292 years.\n *\/","completion":"@ExperimentalTime\n @Deprecated(\"Use inWholeNanoseconds property instead.\", ReplaceWith(\"this.inWholeNanoseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.5\", errorSince = \"1.8\", hiddenSince = \"1.9\")\n public fun toLongNanoseconds(): Long = inWholeNanoseconds\n\n \/**<|endoftext|>"} {"prompt":"\/\/ Auto-generated by GenerateSteppedRangesCodegenTestData. Do not edit!\n\/\/ WITH_STDLIB\nimport kotlin.test.*\n\nfun box(): String {\n val intList = mutableListOf()\n for (i in ((1..8).reversed() step 2).reversed()) {\n intList += i\n }","completion":"assertEquals(listOf(2, 4, 6, 8), intList)\n\n val longList = mutableListOf()\n for (i in ((1L..8L).reversed() step 2L).reversed()) {\n longList += i\n }\n assertEquals(listOf(2L, 4L, 6L, 8L), longList)<|endoftext|>"} {"prompt":"protected abstract val typesCreatorImpl: KtTypeCreator\n\n internal val substitutorProvider: KtSubstitutorProvider get() = substitutorProviderImpl\n protected abstract val substitutorProviderImpl: KtSubstitutorProvider\n\n @KtAnalysisNonPublicApi\n internal val dataFlowInfoProvider: KtDataFlowInfoProvider get() = dataFlowInfoProviderImpl\n @KtAnalysisNonPublicApi","completion":"protected abstract val dataFlowInfoProviderImpl: KtDataFlowInfoProvider\n\n internal val klibSourceFileProvider: KtKlibSourceFileNameProvider get() = klibSourceFileProviderImpl\n protected abstract val klibSourceFileProviderImpl: KtKlibSourceFileNameProvider\n}\n\npublic fun KtAnalysisSession.getModule(element: PsiElement): KtModule {<|endoftext|>"} {"prompt":"\/\/ IGNORE_FE10\n\/\/ KT-64503\n\n\/\/ MODULE: lib\n\/\/ MODULE_KIND: LibraryBinary\n\/\/ FILE: Lib.kt\ninterface KotlinForDelegationInterface {\n fun justFun()\n}\n\nopen class KotlinAbsImplKtInterface(val delegate: KotlinForDelegationInterface) : KotlinForDelegationInterface by delegate\n\n\/\/ MODULE: main(lib)","completion":"\/\/ FILE: usage.kt\nclass UseLibDelegate(private val b: KotlinForDelegationInterface) : KotlinAbsImplKtInterface(b)<|endoftext|>"} {"prompt":"}\n return name\n}\n\ninternal class LocationInfo(val scope: DIScopeOpaqueRef,\n val line: Int,\n val column: Int,\n val inlinedAt: LocationInfo? = null)\n\ninternal fun NativeGenerationState.generateRuntimeConstantsModule() : LLVMModuleRef {\n val llvmModule = LLVMModuleCreateWithNameInContext(\"constants\", llvmContext)!!","completion":"LLVMSetDataLayout(llvmModule, runtime.dataLayout)\n val static = StaticData(llvmModule, llvm)\n\n fun setRuntimeConstGlobal(name: String, value: ConstValue) {\n val global = static.placeGlobal(name, value)\n global.setConstant(true)\n global.setLinkage(LLVMLinkage.LLVMExternalLinkage)\n }<|endoftext|>"} {"prompt":"a.propNullableT","completion":"a.propNullableAny<|endoftext|>"} {"prompt":"is FirQualifiedAccessExpression -> qualifiedAccess.calleeReference.symbol?.let { it.fir as? FirProperty }?.getter\n is FirVariableAssignment -> qualifiedAccess.calleeReference?.symbol?.let { it.fir as? FirProperty }?.setter\n else -> null\n } ?: return","completion":"if (callee.symbol.callableId == StandardClassIds.Callables.not) {\n \/\/ Special hardcoded contract for Boolean.not():\n \/\/ returns(true) implies (this == false)\n \/\/ returns(false) implies (this == true)\n return exitBooleanNot(flow, qualifiedAccess as FirFunctionCall)\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.platform.isWasm\n\n@PhaseDescription(\n name = \"ConstEvaluationLowering\",\n description = \"Evaluate functions that are marked as `IntrinsicConstEvaluation`\"\n)\nclass ConstEvaluationLowering(\n val context: CommonBackendContext,","completion":"private val suppressErrors: Boolean = context.configuration.getBoolean(CommonConfigurationKeys.IGNORE_CONST_OPTIMIZATION_ERRORS),\n configuration: IrInterpreterConfiguration = IrInterpreterConfiguration(printOnlyExceptionMessage = true),\n) : FileLoweringPass {\n private val interpreter = IrInterpreter(IrInterpreterEnvironment(context.irBuiltIns, configuration), emptyMap())<|endoftext|>"} {"prompt":"val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short","completion":"val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n\/**\n * Exposes the JavaScript [SVGSymbolElement](https:\/\/developer.mozilla.org\/en\/docs\/Web\/API\/SVGSymbolElement) to Kotlin\n *\/<|endoftext|>"} {"prompt":"predefinedOrigin: IrDeclarationOrigin?,\n isLocal: Boolean,\n fakeOverrideOwnerLookupTag: ConeClassLikeLookupTag?,\n allowLazyDeclarationsCreation: Boolean\n ): IrSimpleFunction = convertCatching(function) {\n val simpleFunction = function as? FirSimpleFunction\n val isLambda = function is FirAnonymousFunction && function.isLambda\n val updatedOrigin = when {","completion":"isLambda -> IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA\n function.symbol.callableId.isKFunctionInvoke() -> IrDeclarationOrigin.FAKE_OVERRIDE\n !predefinedOrigin.isExternal && \/\/ we should preserve origin for external enums\n simpleFunction?.isStatic == true &&<|endoftext|>"} {"prompt":"fun collectPackageFragments(fqName: FqName, packageFragments: MutableCollection)\n fun isEmpty(fqName: FqName): Boolean\n}\n\nfun PackageFragmentProvider.packageFragments(fqName: FqName): List {\n val packageFragments = mutableListOf()","completion":"collectPackageFragmentsOptimizedIfPossible(fqName, packageFragments)\n return packageFragments\n}\n\nfun PackageFragmentProvider.isEmpty(fqName: FqName): Boolean {\n return when (this) {\n is PackageFragmentProviderOptimized -> isEmpty(fqName)\n else -> packageFragments(fqName).isEmpty()\n }\n}<|endoftext|>"} {"prompt":"klass.addFunction(\"invoke\", returnType.defaultType, Modality.ABSTRACT, isSuspend = isSuspend).apply {\n for (i in 1..n) {\n addValueParameter(\"p$i\", klass.typeParameters[i - 1].defaultType)\n }\n }\n }\n\n fun getJvmFunctionClass(parameterCount: Int): IrClassSymbol =","completion":"jvmFunctionClasses(parameterCount)\n\n private val jvmSuspendFunctionClasses = storageManager.createMemoizedFunction { n: Int ->\n createFunctionClass(n, true)\n }\n\n fun getJvmSuspendFunctionClass(parameterCount: Int): IrClassSymbol =\n jvmSuspendFunctionClasses(parameterCount)<|endoftext|>"} {"prompt":"* where the first value is the key and the second is the value.\n *\n * The resulting [SortedMap] determines the equality and order of keys according to their natural sorting order.\n *\n * @sample samples.collections.Maps.Instantiation.sortedMapFromPairs\n *\/","completion":"public fun , V> sortedMapOf(vararg pairs: Pair): SortedMap =\n TreeMap().apply { putAll(pairs) }\n\n\/**\n * Returns a new [SortedMap] with the specified contents, given as a list of pairs\n * where the first value is the key and the second is the value.\n *<|endoftext|>"} {"prompt":"@get:Optional\n @get:Input\n val packageName: String? get() = settings.packageName\n\n @get:Input\n val compilerOpts: List get() = settings.compilerOpts\n\n @get:Input\n val linkerOpts: List get() = settings.linkerOpts\n\n @get:IgnoreEmptyDirectories\n @get:InputFiles","completion":"@get:NormalizeLineEndings\n @get:PathSensitive(PathSensitivity.RELATIVE)\n val headers: FileCollection get() = settings.headers\n\n @get:IgnoreEmptyDirectories\n @get:InputFiles\n @get:PathSensitive(PathSensitivity.RELATIVE)<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS: -UNUSED_PARAMETER\n\/\/ !LANGUAGE: +InlineClasses, -JvmInlineValueClasses\n\ninline class Z(val x: Int)\n\n@JvmOverloads\nfun testTopLevelFunction1(z: Z, x: Int = 0) {}\n\n@JvmOverloads","completion":"fun testTopLevelFunction2(x: Int, z: Z = Z(0)) {}\n\n@JvmOverloads\nfun testTopLevelFunction3(x: Int = 0): Z = Z(x)\n\nclass C {\n @JvmOverloads\n constructor(i: Int, z: Z = Z(0))\n\n @JvmOverloads<|endoftext|>"} {"prompt":"} else {\n val (lower, upper) = approximateProjection(typeArgument)\n lowerBoundArguments.add(lower)\n upperBoundArguments.add(upper)\n }\n }\n val lowerBoundIsTrivial = lowerBoundArguments.any { !it.isConsistent }\n return ApproximationBounds(","completion":"if (lowerBoundIsTrivial) type.builtIns.nothingType else type.replaceTypeArguments(lowerBoundArguments),\n type.replaceTypeArguments(upperBoundArguments)\n )\n}\n\nprivate fun KotlinType.replaceTypeArguments(newTypeArguments: List): KotlinType {<|endoftext|>"} {"prompt":"if (value_3.compareTo(0.000) != 0 || value_3.compareTo(0.000) != 0) return null\n if (value_4.compareTo(0.0000) != 0 || value_4.compareTo(0.0) != 0) return null","completion":"if (value_5.compareTo(00.0) != 0 || value_5.compareTo(0.0) != 0) return null\n if (value_6.compareTo(000.000) != 0 || value_6.compareTo(0.0) != 0) return null<|endoftext|>"} {"prompt":"DoubleArray(size) { it.toDouble() }.runningFoldIndexed(\"+\") { index, acc, e -> \"$acc[$index: ${'a' + e.toInt()}]\" }\n )\n assertEquals(","completion":"expected.map { it.map { c -> if (c.isAsciiLetter()) c.code % 2 != 0 else c }.joinToString(separator = \"\") },\n BooleanArray(size) { it % 2 == 0 }.runningFoldIndexed(\"+\") { index, acc, e -> \"$acc[$index: $e]\" }\n )\n }\n }\n\n @Test<|endoftext|>"} {"prompt":"for (typeParameter in descriptor.declaredTypeParameters) {\n checkTypeParameter(typeParameter)\n }\n\n val wrongDeclaration: String? = when (descriptor.kind) {\n ANNOTATION_CLASS -> \"annotation class\"\n CLASS -> when {\n descriptor.isInsideInterface -> \"nested class inside exported interface\"","completion":"descriptor.isInlineClass() -> \"${if (descriptor.isInline) \"inline \" else \"\"}${if (descriptor.isValue) \"value \" else \"\"}class\"\n else -> null\n }\n else -> if (descriptor.isInsideInterface && (!allowCompanionInInterface || !descriptor.isCompanionObject)) {<|endoftext|>"} {"prompt":"return C.MyWithL()\n }\n}\n\n\/\/ FILE: repro\/Repro.kt\n\npackage repro\n\nimport lib.R\nimport lib.a.C\nimport lib.Ke\nimport lib.Pr\nimport lib.En\n\nabstract class Repro {\n abstract fun f(r: R): T","completion":"abstract fun

> g(p: P): R.FMR\n private fun isTableValid(c: Class>, key: Pr, b: Boolean) {\n if (b) {\n f(g(key))\n } else {\n f(C.from(c).withL(1))\n }\n }\n}<|endoftext|>"} {"prompt":"yield(arg)\n }\n checkExactType Unit>>(buildee)\n }\n\n fun testLiterals() {\n fun test1() {\n val buildee = build {\n yield { -> }\n }\n checkExactType Unit>>(buildee)\n }\n fun test2() {","completion":"val buildee = build {\n yield(fun() {})\n }\n checkExactType Unit>>(buildee)\n }\n fun test3() {\n val buildee = build {\n yield {}\n }\n checkExactType Unit>>(buildee)\n }\n\n test1()\n test2()<|endoftext|>"} {"prompt":"additionalImports(emptyArgumentListType)\n }\n\n builder(whileLoop) {\n parents += loopBuilder\n defaultNull(\"label\")\n }\n\n builder(doWhileLoop) {\n parents += loopBuilder\n defaultNull(\"label\")\n }\n\n builder(errorExpression) {\n defaultNull(\"expression\")\n }\n\n builder(errorLoop) {","completion":"defaultNull(\"label\")\n }\n\n builder(delegatedConstructorCall, type = \"FirDelegatedConstructorCallImpl\") {\n parents += callBuilder\n default(\"argumentList\") {\n value = \"FirEmptyArgumentList\"\n }\n defaultNull(\"dispatchReceiver\")\n additionalImports(emptyArgumentListType)\n }<|endoftext|>"} {"prompt":"@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"SequencesKt\")\n\npackage kotlin.sequences\n\n\/\/\n\/\/ NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n\/\/ See: https:\/\/github.com\/JetBrains\/kotlin\/tree\/master\/libraries\/stdlib\n\/\/","completion":"import kotlin.contracts.*\nimport kotlin.random.*\n\n\/**\n * Returns `true` if [element] is found in the sequence.\n *\n * The operation is _terminal_.\n *\/\npublic operator fun <@kotlin.internal.OnlyInputTypes T> Sequence.contains(element: T): Boolean {\n return indexOf(element) >= 0\n}\n\n\/**<|endoftext|>"} {"prompt":"if (context is JsIrBackendContext && declaration.isExported(context)) {\n context.additionalExportedDeclarations.add(declaration)\n }\n var extractedUnder = declaration\n var newContainer = declaration.parent\n while (newContainer is IrDeclaration && newContainer != irClass.file) {\n extractedUnder = newContainer\n newContainer = newContainer.parent\n }","completion":"val insertBefore = irClass.file.declarations.indexOf(extractedUnder)\n if (insertBefore >= 0) {\n irClass.file.declarations.add(insertBefore, declaration)\n } else {\n irClass.file.declarations += declaration\n }\n declaration.parent = irClass.file\n return listOf()\n }\n }\n\n return null\n }\n}<|endoftext|>"} {"prompt":"override fun getCallableSymbols(nameFilter: KtScopeNameFilter): Sequence = withValidityAssertion {\n firScope.getCallableSymbols(getPossibleCallableNames().filter(nameFilter), builder)\n }","completion":"override fun getCallableSymbols(names: Collection): Sequence = withValidityAssertion {\n firScope.getCallableSymbols(names, builder)\n }\n\n override fun getClassifierSymbols(nameFilter: KtScopeNameFilter): Sequence = withValidityAssertion {<|endoftext|>"} {"prompt":"propertyAnnotations: List = property.annotations,\n backingFieldAnnotations: List = property.backingField?.annotations.orEmpty(),\n ): AnnotationsPosition?\n\n object Default : FirAnnotationsPlatformSpecificSupportComponent() {\n override val requiredAnnotationsWithArguments = setOf(\n StandardClassIds.Annotations.Deprecated,","completion":"StandardClassIds.Annotations.Target,\n )\n\n override val requiredAnnotations = requiredAnnotationsWithArguments + setOf(\n StandardClassIds.Annotations.DeprecatedSinceKotlin,\n StandardClassIds.Annotations.SinceKotlin,\n StandardClassIds.Annotations.WasExperimental,\n )\n\n override val volatileAnnotations = setOf(<|endoftext|>"} {"prompt":"irIfThenElse(context.irBuiltIns.intType, value, irInt(1), irInt(0))\n } else {\n val conversion = parcelType.classOrNull!!.functions.first { function ->\n function.owner.name.asString() == \"toInt\"\n }\n irCall(conversion).apply { dispatchReceiver = value }\n }\n )\n}","completion":"\/\/ Wraps a non-null aware parceler to handle nullable types.\nclass IrNullAwareParcelSerializer(private val serializer: IrParcelSerializer) : IrParcelSerializer {\n override fun AndroidIrBuilder.readParcel(parcel: IrValueDeclaration): IrExpression {\n val nonNullResult = readParcelWith(serializer, parcel)\n return irIfThenElse(<|endoftext|>"} {"prompt":"\/\/ TODO change scope according to the bound value in the when header\n\n val subjectExpression = expression.subjectExpression\n val subjectVariable = expression.subjectVariable\n\n val subject = when {\n subjectVariable != null ->\n processVariableSubject(subjectVariable, contextBeforeSubject)\n\n subjectExpression != null ->\n Subject.Expression(\n subjectExpression,","completion":"facade.getTypeInfo(subjectExpression, contextBeforeSubject),\n components.dataFlowValueFactory\n )\n\n else ->\n Subject.None()\n }\n\n val contextAfterSubject = run {\n var result = contextBeforeSubject\n subject.scopeWithSubject?.let { result = result.replaceScope(it) }<|endoftext|>"} {"prompt":"returnType = oldConstructor.returnType\n }.apply {\n parent = oldConstructor.parent\n returnType = oldConstructor.returnType\n copyAnnotationsFrom(oldConstructor)\n copyTypeParametersFrom(oldConstructor)\n\n val outerThisValueParameter = buildValueParameter(this) {\n origin = JvmLoweredDeclarationOrigin.FIELD_FOR_OUTER_THIS","completion":"name = Name.identifier(AsmUtil.CAPTURED_THIS_FIELD)\n index = 0\n type = oldConstructor.parentAsClass.parentAsClass.defaultType\n }\n valueParameters = listOf(outerThisValueParameter) + oldConstructor.valueParameters.map { it.copyTo(this, index = it.index + 1) }\n metadata = oldConstructor.metadata\n }<|endoftext|>"} {"prompt":"return when (branchExpr) {\n is IrWhen -> checkForPrimitiveOrPattern(branchExpr, constants)\n is IrCall -> when (val constant = tryToExtractEqeqeqConst(branchExpr)) {\n null -> false\n else -> {\n constants += constant\n true\n }\n }\n else -> false\n }\n }","completion":"if (!checkBranchIsOrPattern(thenBranch.result, thenBranch.condition)) return false\n if (!checkBranchIsOrPattern(elseBranch.condition, elseBranch.result)) return false\n\n return true\n }\n\n var caseCount = 0\n\n l@ for (branch in expression.branches) {\n when (val condition = branch.condition) {<|endoftext|>"} {"prompt":"if (!(0F in 1.0F..3.0F) != !range0.contains(0F)) throw AssertionError()\n if (!(0F !in 1.0F..3.0F) != range0.contains(0F)) throw AssertionError()\n \/\/ no local optimizations","completion":"if (element2 in 1.0F..3.0F != range0.contains(element2)) throw AssertionError()\n if (element2 !in 1.0F..3.0F != !range0.contains(element2)) throw AssertionError()<|endoftext|>"} {"prompt":"fun deserializeAnnotation(proto: ProtoConstructorCall): IrConstructorCall {\n val irType = IrAnnotationType()\n \/\/ TODO: use real coordinates\n return deserializeConstructorCall(proto, 0, 0, irType).also { irType.irConstructorCall = it }\n }","completion":"private fun deserializeConstructorCall(proto: ProtoConstructorCall, start: Int, end: Int, type: IrType): IrConstructorCall {\n val symbol = deserializeTypedSymbol(proto.symbol, CONSTRUCTOR_SYMBOL)\n return IrConstructorCallImpl(\n start, end, type,<|endoftext|>"} {"prompt":"val targetSymbol = candidate?.symbol\n ?: calleeReference.toResolvedBaseSymbol()\n ?: return null\n if (targetSymbol !is FirCallableSymbol<*>) return null\n if (targetSymbol is FirErrorFunctionSymbol || targetSymbol is FirErrorPropertySymbol) return null\n val unsubstitutedKtSignature = targetSymbol.toKtSignature()","completion":"handleCompoundAccessCall(psi, fir, resolveFragmentOfCall)?.let { return it }\n\n var firstArgIsExtensionReceiver = false\n var isImplicitInvoke = false\n\n \/\/ TODO: Ideally, we should get the substitutor from the candidate. But it seems there is no way to get the substitutor from the<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.expressions.FirExpression\nimport org.jetbrains.kotlin.fir.render\nimport org.jetbrains.kotlin.fir.types.ConeTypeVariable\nimport org.jetbrains.kotlin.fir.types.FirTypeProjection","completion":"import org.jetbrains.kotlin.resolve.calls.inference.model.*\nimport org.jetbrains.kotlin.types.model.TypeVariableMarker\n\nclass ConeDeclaredUpperBoundConstraintPosition : DeclaredUpperBoundConstraintPosition(null) {\n override fun toString(): String = \"DeclaredUpperBound\"\n}<|endoftext|>"} {"prompt":"import kotlin.io.path.extension\nimport kotlin.streams.asSequence\nimport org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles\nimport org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment\nimport org.jetbrains.kotlin.config.CompilerConfiguration","completion":"import org.jetbrains.kotlin.idea.KotlinLanguage\nimport kotlin.io.path.name\nimport kotlin.io.path.readText\n\nobject ExperimentalOptInUsageInSourceChecker {\n fun checkExperimentalOptInUsage(srcRoots: List): List {\n val project = createProjectForParsing()\n try {<|endoftext|>"} {"prompt":"assertEquals(true, isInstance(0.toLong()))\n assertEquals(true, isInstance(0.toDouble()))\n assertEquals(true, isInstance(0.toFloat()))\n\n assertEquals(true, isInstance(0))\n assertEquals(true, isInstance(0.toLong()))","completion":"assertEquals(true, isInstance(0.0))\n assertEquals(false, isInstance(\"0\"))\n\n assertEquals(true, isInstance(0), \"isInstance(0)\")\n assertEquals(true, isInstance(null), \"isInstance(null)\")<|endoftext|>"} {"prompt":"package androidx.compose.compiler.plugins.kotlin\n\nimport androidx.compose.runtime.Applier\nimport androidx.compose.runtime.Composer\nimport androidx.compose.runtime.Composition\nimport androidx.compose.runtime.MonotonicFrameClock\nimport androidx.compose.runtime.Recomposer\nimport kotlinx.coroutines.CoroutineScope","completion":"import kotlinx.coroutines.CoroutineStart\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.NonCancellable\nimport kotlinx.coroutines.delay\nimport kotlinx.coroutines.launch\nimport org.intellij.lang.annotations.Language<|endoftext|>"} {"prompt":"override fun getReferencedClass(symbol: IrClassSymbol): IrClassSymbol = symbol\n\n override fun getReferencedScript(symbol: IrScriptSymbol): IrScriptSymbol = symbol\n\n override fun getReferencedClassOrNull(symbol: IrClassSymbol?): IrClassSymbol? = symbol","completion":"override fun getReferencedEnumEntry(symbol: IrEnumEntrySymbol): IrEnumEntrySymbol = symbol\n\n override fun getReferencedVariable(symbol: IrVariableSymbol): IrVariableSymbol = symbol\n\n override fun getReferencedLocalDelegatedProperty(symbol: IrLocalDelegatedPropertySymbol): IrLocalDelegatedPropertySymbol = symbol<|endoftext|>"} {"prompt":"get() = tasks.withType(KonanCompileTask::class.java).filter { it.enableMultiplatform }\n\n open class RequestedCommonSourceSet @Inject constructor(private val name: String): Named {\n override fun getName() = name\n }\n\n override fun addCommonSourceSetToPlatformSourceSet(commonSourceSet: Named, platformProject: Project) {","completion":"val commonSourceSetName = commonSourceSet.name\n\n platformProject.konanMultiplatformTasks\n .filter { it.commonSourceSets.contains(commonSourceSetName) }\n .forEach { task: KonanCompileTask ->\n getKotlinSourceDirectorySetSafe(commonSourceSet)!!.srcDirs.forEach {\n task.commonSrcDir(it)\n }<|endoftext|>"} {"prompt":"fun bar(p: Int): Int\n}\n\n\/\/ MODULE: m1-jvm()()(m1-common)\n\/\/ FILE: jvm.kt\nactual tailrec fun foo(p: Int): Int = foo(p)\nactual tailrec fun bar(p: Int): Int = bar(p)\n\nactual val notReport: String = \"123\"\n\nactual class A {","completion":"actual tailrec fun foo(p: Int): Int = foo(p)\n actual tailrec fun bar(p: Int): Int = bar(p)\n}<|endoftext|>"} {"prompt":"}\n\n\/\/ TESTCASE NUMBER: 6\nfun case_6() {\n checkSubtype(-100000000000000000000000000000000)","completion":"checkSubtype(-100000000000000000000000000000000)\n checkSubtype(-100000000000000000000000000000000)<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.metadata.jvm.serialization\n\nimport org.jetbrains.kotlin.metadata.deserialization.NameResolver\nimport org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf\nimport org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf.StringTableTypes.Record","completion":"import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver\nimport org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolverBase\nimport org.jetbrains.kotlin.metadata.jvm.deserialization.toExpandedRecordsList\nimport org.jetbrains.kotlin.metadata.serialization.StringTable<|endoftext|>"} {"prompt":"val usedLabels = HashSet()\n val first = insnList.first\n if (first is LabelNode) {\n usedLabels.add(first)\n }\n val last = insnList.last\n if (last is LabelNode) {\n usedLabels.add(last)\n }","completion":"fun addCfgEdgeToLabel(from: AbstractInsnNode, label: LabelNode) {\n usedLabels.add(label)\n cfg.addNonTrivialPredecessor(label, from)\n }\n\n fun addCfgEdgesToLabels(from: AbstractInsnNode, labels: Collection) {\n usedLabels.addAll(labels)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.util.addBuildEventsListenerRegistryMock\nimport org.jetbrains.kotlin.gradle.util.checkDiagnostics\nimport org.jetbrains.kotlin.gradle.util.setMultiplatformAndroidSourceSetLayoutVersion\nimport kotlin.test.*\n\nclass MultiplatformAndroidSourceSetLayoutV1Test {","completion":"private lateinit var project: ProjectInternal\n private lateinit var kotlin: KotlinMultiplatformExtension\n private lateinit var android: LibraryExtension\n\n @BeforeTest\n fun setup() {\n project = ProjectBuilder.builder().build() as ProjectInternal\n addBuildEventsListenerRegistryMock(project)\n project.setMultiplatformAndroidSourceSetLayoutVersion(1)<|endoftext|>"} {"prompt":"tree.annotations().map { TreeBasedAnnotation(it, compilationUnit, javac, containingClass) } }\n\n override fun findAnnotation(fqName: FqName) =\n annotations\n .filter { it.annotation.annotationType.toString().endsWith(fqName.shortName().asString()) }","completion":".find { it.classId.asSingleFqName() == fqName }\n\n}<|endoftext|>"} {"prompt":"val result = copyOfUninitializedElements(index + 1)\n result[index] = element\n return result\n}\n\n\/**\n * Returns an array containing all elements of the original array and then the given [element].\n *\/\npublic actual operator fun ByteArray.plus(element: Byte): ByteArray {\n val index = size\n val result = copyOfUninitializedElements(index + 1)","completion":"result[index] = element\n return result\n}\n\n\/**\n * Returns an array containing all elements of the original array and then the given [element].\n *\/\npublic actual operator fun ShortArray.plus(element: Short): ShortArray {\n val index = size\n val result = copyOfUninitializedElements(index + 1)\n result[index] = element\n return result\n}\n\n\/**<|endoftext|>"} {"prompt":"* Rotates the binary representation of this [UShort] number left by the specified [bitCount] number of bits.\n * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.\n *\n * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:","completion":"* `number.rotateLeft(-n) == number.rotateRight(n)`\n *\n * Rotating by a multiple of [UShort.SIZE_BITS] (16) returns the same number, or more generally\n * `number.rotateLeft(n) == number.rotateLeft(n % 16)`\n *\/\n@SinceKotlin(\"1.6\")<|endoftext|>"} {"prompt":"import java.io.File\nimport java.util.*\nimport java.util.regex.MatchResult\n\nabstract class AbstractWriteSignatureTest : CodegenTestCase() {\n override fun doMultiFileTest(wholeFile: File, files: List) {\n val isIgnored = InTextDirectivesUtils.isIgnoredTarget(backend, wholeFile)\n compile(files)","completion":"try {\n parseExpectations(wholeFile).check()\n } catch (e: Throwable) {\n if (!isIgnored) {\n println(classFileFactory.createText())\n }\n throw e\n }\n }\n\n private class SignatureExpectation(\n val header: String,\n val name: String,\n val expectedJvmSignature: String?,<|endoftext|>"} {"prompt":"inline class SomeIC(val a: Int)\n\nexternal val l: SomeIC\n\nexternal val ll\n get(): SomeIC = definedExternally","completion":"external var r: SomeIC\n\nexternal var rr: SomeIC\n get() = definedExternally<|endoftext|>"} {"prompt":"if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n\/**\n * Returns a set containing all elements that are contained by both this collection and the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n *\/","completion":"public infix fun Iterable.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n\/**\n * Returns a set containing all elements that are contained by this collection and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.<|endoftext|>"} {"prompt":"suspend inline fun test(controller: Controller, c: () -> Unit = { controller.res = \"OK\" }) {\n c()\n}\n\n\/\/ FILE: box.kt\nimport kotlin.coroutines.*\nimport helpers.*\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\n\nfun box() : String {\n builder() {","completion":"test(defaultController)\n }\n return defaultController.res\n}<|endoftext|>"} {"prompt":"\/\/ WITH_STDLIB\n\ninterface Wrapper { fun runBlock() }\n\ninline fun crossInlineBuildWrapper(crossinline block: () -> Unit) = object : Wrapper {\n override fun runBlock() {\n block()\n }\n}\n\nclass Container {\n val wrapper = crossInlineBuildWrapper {\n object { }\n }\n}\n\nfun box(): String {","completion":"Container().wrapper.runBlock()\n return \"OK\"\n}<|endoftext|>"} {"prompt":"override fun replaceDeprecationsProvider(newDeprecationsProvider: DeprecationsProvider) {\n notSupported()\n }\n\n override fun replaceValueParameters(newValueParameters: List) {\n notSupported()\n }\n\n override fun replaceContractDescription(newContractDescription: FirContractDescription?) {\n notSupported()\n }","completion":"override fun replaceControlFlowGraphReference(newControlFlowGraphReference: FirControlFlowGraphReference?) {\n notSupported()\n }\n\n override fun replaceContextReceivers(newContextReceivers: List) {\n notSupported()\n }\n\n override fun replaceAnnotations(newAnnotations: List) {\n notSupported()\n }<|endoftext|>"} {"prompt":"override fun lower(irBody: IrBody, container: IrDeclaration) {\n if (!skip(container)) {\n irBody.transformChildrenVoid(Transformer(container.symbol))\n }\n }\n\n private inner class Transformer(val parent: IrSymbol) : IrElementTransformerVoid() {\n override fun visitBody(body: IrBody): IrBody = body","completion":"override fun visitCall(expression: IrCall): IrExpression =\n if (expression.type.isNothing()) {\n \/\/ Replace call 'foo' of type 'kotlin.Nothing' with a block:\n \/\/\n \/\/ {\n \/\/ [ call 'foo' with type: 'kotlin.Unit' ]\n \/\/ call ThrowKotlinNothingValueException(): Nothing\n \/\/ }: Nothing<|endoftext|>"} {"prompt":"@JvmField\n val LOCAL = Name.special(\"\")\n\n @JvmField\n val UNDERSCORE_FOR_UNUSED_VAR = Name.special(\"\")\n\n @JvmField\n val IMPLICIT_SET_PARAMETER = Name.special(\"\")\n\n @JvmField","completion":"val ARRAY = Name.special(\"\")\n\n @JvmField\n val RECEIVER = Name.special(\"\")\n\n \/**\n * Kotlin-generated `entries` read-only property\n *\/\n @JvmField\n val ENUM_GET_ENTRIES = Name.special(\"\")\n\n \/**<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.lifetime.withValidityAssertion\nimport org.jetbrains.kotlin.analysis.api.symbols.KtClassKind\nimport org.jetbrains.kotlin.analysis.api.symbols.markers.KtSymbolKind\nimport org.jetbrains.kotlin.descriptors.Modality","completion":"import org.jetbrains.kotlin.descriptors.Visibilities\nimport org.jetbrains.kotlin.descriptors.Visibility\nimport org.jetbrains.kotlin.fir.declarations.FirDeclarationStatus\nimport org.jetbrains.kotlin.fir.declarations.utils.*\nimport org.jetbrains.kotlin.fir.extensions.extensionService<|endoftext|>"} {"prompt":"\/\/ TODO(174715171): capture actual values for testing\n .replace(\n Regex(\n \"traceEventStart\\\\(-?\\\\d+, (%dirty|%changed|-1), (%dirty1|%changed1|-1), (.*)\"\n )\n ) {\n when (truncateTracingInfoMode) {\n TruncateTracingInfoMode.TRUNCATE_KEY ->","completion":"\"traceEventStart(<>, ${it.groupValues[1]}, ${it.groupValues[2]}, <>)\"\n\n TruncateTracingInfoMode.KEEP_INFO_STRING ->\n \"traceEventStart(<>, ${it.groupValues[1]}, ${it.groupValues[2]}, \" +\n it.groupValues[3]\n }\n }<|endoftext|>"} {"prompt":"*\/\npublic fun FloatArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n\/**\n * Returns a new [MutableList] filled with all elements of this array.\n *\/\npublic fun DoubleArray.toMutableList(): MutableList {","completion":"val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n\/**\n * Returns a new [MutableList] filled with all elements of this array.\n *\/\npublic fun BooleanArray.toMutableList(): MutableList {\n val list = ArrayList(size)<|endoftext|>"} {"prompt":"val i = 348\n}\n\nfun foo() {\n if (i == 3) f()\n}\n\n\/\/FILE:d.kt\npackage d\n\nimport d.A.Companion.B","completion":"import d.A.Companion.C\n\nval b : B = B()\nval c : B = C\n\nclass A() {\n companion object {\n open class B() {}\n object C : B() {}\n }\n}<|endoftext|>"} {"prompt":"0xbff921fb54442d18UL, 0xbff921fb54442d18UL, 0xbff921fb54437d2cUL, 0xbff921fb5444dd05UL,","completion":"0xbff921fb54442d18UL, 0xbff921fb54442d18UL, 0xbff921fb54442d18UL, 0xbff921fb54442d18UL,<|endoftext|>"} {"prompt":"open fun isOverlyWide(): Boolean = function?.isOverlyWide() == true\n\n override fun hashCode() = element.hashCode() * 31\n override fun equals(other: Any?) = other is InferenceNode && other.element == element\n}\n\nval IrSimpleFunctionSymbol.isGenericFunction get(): Boolean =","completion":"owner.typeParameters.isNotEmpty() || owner.dispatchReceiverParameter?.type?.let {\n it is IrSimpleType && it.arguments.isNotEmpty()\n } == true\n\n\/**\n * An [InferenceCallTargetNode] is a wrapper around an [IrCall] which represents the target of\n * the call, not the call itself. That its type is the type of the target of the call not the<|endoftext|>"} {"prompt":"constructor(name: JsNameRef, alias: JsName? = null) : this(Element(name, alias))\n\n sealed class Subject {\n class Elements(val elements: List) : Subject()\n object All : Subject()\n }\n\n class Element(val name: JsNameRef, val alias: JsName? = null)","completion":"override fun accept(visitor: JsVisitor) {\n visitor.visitExport(this)\n }\n\n override fun acceptChildren(visitor: JsVisitor) {\n if (subject is Subject.Elements) {\n subject.elements.forEach {\n visitor.accept(it.name)\n }\n }\n }<|endoftext|>"} {"prompt":"superMethod.valueParameters.mapTo(lambdaParameters) { superValueParameter ->\n superValueParameter.copySubstituted(lambda, typeSubstitutor, index++)\n }\n return lambdaParameters\n }\n\n private fun IrValueParameter.copySubstituted(\n function: IrSimpleFunction,\n substitutor: IrTypeSubstitutor,\n newIndex: Int,","completion":"newName: Name = name\n ) =\n buildValueParameter(function) {\n name = newName\n index = newIndex\n type = substitutor.substitute(this@copySubstituted.type)\n }\n\n private fun JvmIrBuilder.createDelegatingLambdaReference(expression: IrExpression, lambda: IrSimpleFunction): IrFunctionReference {\n return IrFunctionReferenceImpl(<|endoftext|>"} {"prompt":"@CompileTimeCalculation\nopen class A {\n open fun String.getSize() = this.length\n\n fun returnSizeOf(str: String) = str.getSize()\n}\n\n@CompileTimeCalculation\nclass B : A() {\n override fun String.getSize() = -1\n}","completion":"const val a = A().returnSizeOf(\"1234\")\nconst val b = B().returnSizeOf(\"1234\")<|endoftext|>"} {"prompt":"val CXPrintingPolicy_SuppressInitializers: CXPrintingPolicyProperty get() = 6\n\nval CXPrintingPolicy_ConstantArraySizeAsWritten: CXPrintingPolicyProperty get() = 7\n\nval CXPrintingPolicy_AnonymousTagLocations: CXPrintingPolicyProperty get() = 8\n\nval CXPrintingPolicy_SuppressStrongLifetime: CXPrintingPolicyProperty get() = 9","completion":"val CXPrintingPolicy_SuppressLifetimeQualifiers: CXPrintingPolicyProperty get() = 10\n\nval CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors: CXPrintingPolicyProperty get() = 11\n\nval CXPrintingPolicy_Bool: CXPrintingPolicyProperty get() = 12\n\nval CXPrintingPolicy_Restrict: CXPrintingPolicyProperty get() = 13<|endoftext|>"} {"prompt":"private fun StringReader(string: String, offset: Int): Reader {\n val reader = StringReader(string)\n reader.skip(offset.toLong())\n return reader\n}\n\nprivate class AccumulatingReporter : ErrorReporter {\n var hasErrors = false\n val warnings = mutableListOf()","completion":"override fun warning(message: String, startPosition: CodePosition, endPosition: CodePosition) {\n warnings += Warning(message, startPosition, endPosition)\n }\n\n override fun error(message: String, startPosition: CodePosition, endPosition: CodePosition) {\n hasErrors = true\n }<|endoftext|>"} {"prompt":"\/\/ test 1: PTV is in consuming position (yield-case)\n fun testYield() {\n val buildee = build {\n yield(this@ENUM_ENTRY)\n }\n checkTypeEquality(this@ENUM_ENTRY, buildee.typeArgumentValue)\n }\n\n \/\/ test 2: PTV is in producing position (materialize-case)","completion":"fun testMaterialize() {\n val buildee = build {\n fun shareTypeInfo(from: T, to: T) {}\n shareTypeInfo(this@ENUM_ENTRY, materialize())\n }\n checkTypeEquality(this@ENUM_ENTRY, buildee.typeArgumentValue)\n }\n\n init {\n reference = this@ENUM_ENTRY<|endoftext|>"} {"prompt":"fun skipCheckingAnnotationsOfActualClassMember(actualMember: DeclarationSymbolMarker): Boolean\n\n fun findPotentialExpectClassMembersForActual(\n expectClass: RegularClassSymbolMarker,\n actualClass: RegularClassSymbolMarker,\n actualMember: DeclarationSymbolMarker,\n ): Map","completion":"fun DeclarationSymbolMarker.getSourceElement(): SourceElementMarker\n\n fun TypeRefMarker.getClassId(): ClassId?\n\n \/**\n * Callback interface to be implemented by caller of [checkAnnotationsOnTypeRefAndArguments].\n *\/\n fun interface AnnotationsCheckerCallback {\n \/**\n * Implementation must check `expect` and `actual` annotations and report diagnostic in case of incompatibility.<|endoftext|>"} {"prompt":"fun setReturnType(type: CType) {\n require(!::returnType.isInitialized)\n returnType = type\n }\n\n fun addParameter(type: CType): CVariable {\n val result = CVariable(type, \"p${counter++}\")\n parameters += result\n return result\n }\n\n val numberOfParameters: Int get() = parameters.size","completion":"private var counter = 1\n\n fun getType(): CType = CTypes.function(returnType, parameters.map { it.type }, variadic)\n\n fun buildSignature(name: String, language: String): String =\n (if (language == \"C++\") \"extern \\\"C\\\" const \" else \"\") +\n returnType.render(buildString {\n append(name)\n append('(')<|endoftext|>"} {"prompt":"topLevelAtoms,\n postponedArguments,\n completionMode,\n topLevelType\n ) != null\n\n \/\/ If there aren't any postponed arguments and ready for fixation variables, then completion isn't needed: nothing to do\n if (postponedArguments.isEmpty() && !isThereAnyReadyForFixationVariable)\n break\n\n val postponedArgumentsWithRevisableType = postponedArguments","completion":".filterIsInstanceWithChecker {\n \/\/ NB: FE 1.0 does not perform this check\n it.revisedExpectedType == null\n }\n val dependencyProvider =\n TypeVariableDependencyInformationProvider(notFixedTypeVariables, postponedArguments, topLevelType, this)\n\n \/\/ Stage 2: collect parameter types for postponed arguments<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.visitors.FirVisitor\n\nclass FirOuterClassTypeParameterRefImpl @FirImplementationDetail constructor(\n override val source: KtSourceElement?,\n override val symbol: FirTypeParameterSymbol,\n) : FirOuterClassTypeParameterRef() {","completion":"override fun acceptChildren(visitor: FirVisitor, data: D) {}\n\n override fun transformChildren(transformer: FirTransformer, data: D): FirOuterClassTypeParameterRefImpl {\n return this\n }\n}<|endoftext|>"} {"prompt":"suspend fun suspendHere(r: LongRange): Long = suspendCoroutineUninterceptedOrReturn { x ->\n x.resume(r.start + r.endInclusive)\n COROUTINE_SUSPENDED\n}\n\nfun builder(c: suspend () -> Unit) {\n c.startCoroutine(EmptyContinuation)\n}\n\nfun box(): String {\n var result = 0L","completion":"builder {\n result = suspendHere(1L..getLong())\n }\n\n if (result != 1234567890124L) return \"fail 1: $result\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"private const val serialVersionUID: Long = 0L\n }\n\n private fun readResolve(): Any = Distribution(this)\n }\n}\n\n\/\/ TODO: Move into K\/N?\nfun buildDistribution(konanHome: String, konanDataDir: String? = null) = Distribution(konanHome,true, null, konanDataDir = konanDataDir)","completion":"fun customerDistribution(konanHome: String, konanDataDir: String? = null) = Distribution(konanHome,false, null, konanDataDir = konanDataDir)<|endoftext|>"} {"prompt":"c?.resume(Unit)\n if (spilledVariables != setOf(\"label\" to \"3\", \"Z$0\" to \"false\", \"L$0\" to continuationName, \"L$1\" to \"a2\", \"L$2\" to \"b2\")) return \"FAIL 5: $spilledVariables\"\n c?.resume(Unit)","completion":"if (spilledVariables != setOf(\"label\" to \"3\", \"Z$0\" to \"false\", \"L$0\" to continuationName, \"L$1\" to \"a2\", \"L$2\" to \"b2\")) return \"FAIL 6: $spilledVariables\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) {\n x\n x.prop_8","completion":"x.prop_8.prop_8\n x.prop_8.prop_8.prop_8\n x.prop_8.prop_8.prop_8.prop_8<|endoftext|>"} {"prompt":"\/\/ FIR_DUMP\n\n\/\/ explicit types\nclass A(t: T) {\n private val t: T = t \/\/ PRIVATE_TO_THIS\n\n private val i: B = B()\n\n fun test() {\n val x: T = t \/\/ Ok\n val y: T = this.t \/\/ Ok\n }\n\n fun foo(a: A) {","completion":"val x: String = a.t \/\/ Invisible!\n }\n\n fun bar(a: A<*>) {\n a.t \/\/ Invisible!\n }\n\n inner class B {\n fun baz(a: A<*>) {\n a.i\n }\n }\n}<|endoftext|>"} {"prompt":"get() = storage.mapTo(ArrayList()) { Z(it) }\n\n override fun containsKey(key: Z): Boolean = key.x in (0 until size)\n\n override fun containsValue(value: Z): Boolean = storage.contains(value.x)\n\n override fun get(key: Z) = storage.getOrNull(key.x)?.let { Z(it) }","completion":"override fun isEmpty(): Boolean = size > 0\n}\n\nfun box(): String {\n val zm = ZArrayMap(IntArray(5))\n\n zm.containsKey(Z(0))\n zm.containsValue(Z(0))\n zm[Z(0)]\n\n zm.containsKey(object {} as Any)<|endoftext|>"} {"prompt":"foldTo( destination = mutableMapOf(),\n initialValueSelector = { _, _ -> kotlin.jvm.internal.Ref.IntRef() },\n operation = { _, acc, e -> acc.apply { element += valueSelector(e) } })\n .mapValuesInPlace { it.value.element }\n*\/\n\n\n\n@PublishedApi\n@kotlin.internal.InlineOnly","completion":"@Suppress(\"UNCHECKED_CAST\") \/\/ tricks with erased generics go here, do not repeat on reified platforms\ninternal inline fun MutableMap.mapValuesInPlace(f: (Map.Entry) -> R): MutableMap {\n entries.forEach {<|endoftext|>"} {"prompt":"llFirComputationSession.recordThatAnnotationsAreResolved(target)\n\n \/\/ 3. Create annotation transformer for targets we want to transform (under read lock)\n \/\/ Exit if another thread is already resolved this target\n val annotationTransformer = target.createAnnotationTransformer() ?: return\n\n \/\/ 4. Exit if there are no applicable annotations, so we can just update the phase","completion":"if (annotationTransformer.isNothingToResolve()) {\n return performCustomResolveUnderLock(target) {\n \/\/ just update deprecations\n annotationTransformer.publishResult(target)\n }\n }\n\n \/\/ 5. Transform annotations in the air\n annotationTransformer.transformAnnotations()\n\n \/\/ 6. Move some annotations to the proper positions<|endoftext|>"} {"prompt":"is KtValueParameterSymbol -> variable.generatedPrimaryConstructorProperty\n else -> null\n }\n\n override fun pointsToTheSameSymbolAs(other: KtSymbolPointer): Boolean = this === other ||\n other is KtFirPsiBasedPropertySymbolPointer &&","completion":"other.variableSymbolPointer.pointsToTheSameSymbolAs(variableSymbolPointer)\n}<|endoftext|>"} {"prompt":"val expectedNullableUnitExplicitReturnString: () -> Unit? = l@ {\n return@l \"\"\n}\n\nfun expectedFlexibleUnitExplicitReturnString() {\n A.foo = l@ {\n return@l \"\"\n }\n}","completion":"val expectedNullableUnitExplicitReturnNull: () -> Unit? = l@ {\n return@l null\n}\n\nfun expectedFlexibleUnitExplicitReturnNull() {\n A.foo = l@ {\n return@l null\n }\n}\n\n\/\/ ============== Lambdas passed as function argument ===============\n\nfun test() {<|endoftext|>"} {"prompt":"if (androidVersion != null) {\n arguments.add(\"-Pandroid_tools_version=${androidVersion}\")\n }\n arguments.add(\"-Ptest_fixes_version=${TestVersions.Kotlin.CURRENT}\")\n\n if (buildReport.isNotEmpty()) {","completion":"arguments.add(\"-Pkotlin.build.report.output=${buildReport.joinToString()}\")\n }\n\n if (usePreciseJavaTracking != null) {\n arguments.add(\"-Pkotlin.incremental.usePreciseJavaTracking=$usePreciseJavaTracking\")\n }\n\n if (statisticsForceValidation) {<|endoftext|>"} {"prompt":"configurationTimeMetrics.put(NumericalMetrics.STATISTICS_VISIT_ALL_PROJECTS_OVERHEAD, statisticOverhead)\n\n return configurationTimeMetrics\n}\n\nprivate fun addTaskMetrics(\n project: Project,\n configurationTimeMetrics: MetricContainer,\n) {\n try {\n val taskNames = project.tasks.names.toList()","completion":"configurationTimeMetrics.put(NumericalMetrics.GRADLE_NUMBER_OF_TASKS, taskNames.size.toLong())\n configurationTimeMetrics.put(\n NumericalMetrics.GRADLE_NUMBER_OF_UNCONFIGURED_TASKS,\n taskNames.count { name ->\n try {<|endoftext|>"} {"prompt":"if (getPackageWithoutDependencies(StandardClassIds.BASE_KOTLIN_PACKAGE) != null\n || moduleData is LLFirModuleData && moduleData.ktModule is KtBuiltinsModule\n ) {\n return dependencyProvider.providers.find { it.session is LLFirBuiltinsAndCloneableSession }\n }\n\n return null\n }","completion":"private fun ExceptionAttachmentBuilder.withCandidates(candidates: List>) {\n withEntry(\"Candidates count\", candidates.size.toString())\n for ((index, candidate) in candidates.withIndex()) {\n val ktModule = candidate.llFirModuleData.ktModule\n withEntryGroup(index.toString()) {\n withClassEntry(\"candidateClass\", candidate)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.jps.model.platform\nimport org.jetbrains.kotlin.jps.statistic.JpsBuilderMetricReporter\nimport org.jetbrains.kotlin.platform.idePlatformKind\n\nclass KotlinUnsupportedModuleBuildTarget(\n kotlinContext: KotlinCompileContext,\n jpsModuleBuildTarget: ModuleBuildTarget","completion":") : KotlinModuleBuildTarget(kotlinContext, jpsModuleBuildTarget) {\n val kind = module.platform?.idePlatformKind?.name\n\n private fun shouldNotBeCalled(): Nothing = error(\"Should not be called\")\n\n override fun isEnabled(chunkCompilerArguments: Lazy): Boolean {\n return false\n }<|endoftext|>"} {"prompt":"fun getPerFileCachedLibraryName(library: KotlinLibrary): String = \"${library.uniqueName}-per-file-cache\"\n fun getCachedLibraryName(library: KotlinLibrary): String = getCachedLibraryName(library.uniqueName)\n fun getCachedLibraryName(libraryName: String): String = \"$libraryName-cache\"","completion":"private fun computeLibraryHash(library: KotlinLibrary, librariesHashes: MutableMap) =\n librariesHashes.getOrPut(library.uniqueName) {\n val hashComputer = LibraryHashComputer()\n hashComputer.digestLibrary(library)\n hashComputer.digest()\n }\n\n fun computeVersionedCacheDirectory(\n baseCacheDirectory: File,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.lazy.data.KtClassLikeInfo\n\ninterface ClassMemberDeclarationProvider : DeclarationProvider {\n val ownerInfo: KtClassLikeInfo? \/\/ is null for synthetic classes\/object that don't present in the source code\n\n val correspondingClassOrObject: KtPureClassOrObject? get() = ownerInfo?.correspondingClassOrObject","completion":"val primaryConstructorParameters: List get() = ownerInfo?.primaryConstructorParameters ?: emptyList()\n val companionObjects: List get() = ownerInfo?.companionObjects ?: emptyList()\n}<|endoftext|>"} {"prompt":"0xe0001, 0xe0020, 0xe0100, \n)\nprivate val caseIgnorableEnd = intArrayOf(","completion":"0x0027, 0x002e, 0x003a, 0x00b7, 0x0387, 0x055f, 0x05f4, 0x2018, 0x2019, 0x2024, 0x2027, 0xfe13, 0xfe52, 0xfe55, 0xff07, 0xff0e, 0xff1a, 0x101fd, 0x102e0,<|endoftext|>"} {"prompt":"firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.AccessorForDelegatedProperty\n\ninternal class PropertyInitializerWithExplicitFieldDeclarationImpl(\n firDiagnostic: KtPsiDiagnostic,","completion":"token: KtLifetimeToken,\n) : KtAbstractFirDiagnostic(firDiagnostic, token), KtFirDiagnostic.PropertyInitializerWithExplicitFieldDeclaration\n\ninternal class PropertyFieldDeclarationMissingInitializerImpl(\n firDiagnostic: KtPsiDiagnostic,\n token: KtLifetimeToken,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.serialization.constant.toConstantValue\nimport org.jetbrains.kotlin.metadata.ProtoBuf\nimport org.jetbrains.kotlin.metadata.ProtoBuf.Class.Builder\nimport org.jetbrains.kotlin.metadata.deserialization.Flags","completion":"import org.jetbrains.kotlin.metadata.serialization.MutableVersionRequirementTable\nimport org.jetbrains.kotlin.name.FqName\nimport org.jetbrains.kotlin.protobuf.GeneratedMessageLite\nimport org.jetbrains.kotlin.serialization.SerializerExtensionProtocol\n\nabstract class FirSerializerExtensionBase(<|endoftext|>"} {"prompt":"CreateDecoysTransformer(\n pluginContext,\n symbolRemapper,\n idSignatureBuilder,\n stabilityInferencer,\n metrics,\n ).lower(moduleFragment)\n\n SubstituteDecoyCallsTransformer(\n pluginContext,\n symbolRemapper,\n idSignatureBuilder,\n stabilityInferencer,\n metrics,","completion":").lower(moduleFragment)\n }\n\n \/\/ transform all composable functions to have an extra synthetic composer\n \/\/ parameter. this will also transform all types and calls to include the extra\n \/\/ parameter.\n ComposerParamTransformer(\n pluginContext,\n symbolRemapper,\n stabilityInferencer,\n decoysEnabled,\n metrics,\n ).lower(moduleFragment)<|endoftext|>"} {"prompt":"fun doIn(i: In) { throw Exception(\"$i\") }\nfun doA(i: A) { throw Exception(\"$i\") }\n\nfun test(out: Out, i: In, inv: A) {\n \/\/ T? >: Int => T = Int\n doT(1)","completion":"val r = doOut(out)\n r checkType { _() }\n\n \/\/ T? <: Int => error\n doIn(i)\n\n \/\/ T? >: Int => error<|endoftext|>"} {"prompt":"?.let { replacements.getMfvcPropertyNode(it.owner.correspondingPropertySymbol!!.owner) }\n\nprivate fun IrProperty.getterIfDeclared(parent: IrDeclarationContainer): IrSimpleFunction? =\n getter?.takeIf { it in parent.declarations || this in parent.declarations }","completion":"private val IrProperty.backingFieldIfNotDelegate get() = backingField?.takeUnless { isDelegated }<|endoftext|>"} {"prompt":"val groupedSources = collectSources(configuration, input.project, messageCollector)\n\n val ktSourceFiles = mutableListOf().apply {\n addAll(groupedSources.commonSources)\n addAll(groupedSources.platformSources)\n }\n\n return firFrontend(\n input,\n ktSourceFiles,\n fileHasSyntaxErrors = { false },","completion":"isCommonSource = { groupedSources.isCommonSourceForLt(it) },\n fileBelongsToModule = { file, it -> groupedSources.fileBelongsToModuleForLt(file, it) },\n buildResolveAndCheckFir = { session, files, diagnosticsReporter ->\n buildResolveAndCheckFirViaLightTree(session, files, diagnosticsReporter, null)\n },\n )\n}<|endoftext|>"} {"prompt":"}.outerFoo()\n}\n\nsealed class CaseOuter {\n val v = \"v\"\n abstract fun outerFoo();\n\n abstract class CaseBase() : CaseOuter() {\n abstract fun foo(): String\n }\n\n class A() : CaseBase() {\n override fun foo(): String {\n return \"A\"\n }","completion":"override fun outerFoo() {\n println(\"outerFoo\")\n }\n }\n}\n\nclass B() : CaseOuter.CaseBase() {\n override fun foo(): String {\n return \"\"\n }\n\n override fun outerFoo() {\n }\n}<|endoftext|>"} {"prompt":"add(FirJvmErrors.CONCURRENT_HASH_MAP_CONTAINS_OPERATOR.warningFactory) { firDiagnostic ->\n ConcurrentHashMapContainsOperatorWarningImpl(\n firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }","completion":"add(FirJvmErrors.SPREAD_ON_SIGNATURE_POLYMORPHIC_CALL.errorFactory) { firDiagnostic ->\n SpreadOnSignaturePolymorphicCallErrorImpl(\n firDiagnostic as KtPsiDiagnostic,\n token,\n )\n }<|endoftext|>"} {"prompt":"val x: Int = definedExternally\n\n fun foo(y: Int): Int = definedExternally\n}\n\nexternal fun foo(y: Int): Int = definedExternally\n\nexternal val bar: Int = definedExternally\n\nexternal var mbar: Int = definedExternally\n\n\/\/ FILE: b.kt\npackage foo\n\nfun box(): String {\n val a = A(23)","completion":"assertEquals(23, a.x)\n assertEquals(65, a.foo(42))\n\n val nested = A.Nested()\n assertEquals(55, nested.y)\n\n assertEquals(123, B.x)\n assertEquals(265, B.foo(142))\n\n assertEquals(365, foo(42))\n assertEquals(423, bar)<|endoftext|>"} {"prompt":".mapNotNull { generatorExtension ->\n generatorExtension.generateTopLevelClassLikeDeclaration(classId)?.also { symbol ->\n symbol.fir.ownerGenerator = generatorExtension\n }\n }\n .onEach { it.fir.validate() }\n when (generatedClasses.size) {\n 0 -> null\n 1 -> generatedClasses.first()","completion":"else -> error(\"Multiple plugins generated classes with same classId $classId\\n${generatedClasses.joinToString(\"\\n\") { it.fir.render() }}\")\n }\n }\n }\n }\n\n private fun generateTopLevelFunctions(callableId: CallableId): List {<|endoftext|>"} {"prompt":"assertEquals(4321L, sumL)\n\n var sumC = 0\n for (i in charRange().reversed().reversed().reversed()) {\n sumC = sumC * 10 + i.toInt() - '0'.toInt()\n }\n assertEquals(4321, sumC)\n\n return \"OK\"\n}\n\n\/\/ 0 reversed\n\/\/ 0 iterator","completion":"\/\/ 0 getStart\n\/\/ 0 getEnd\n\/\/ 3 getFirst\n\/\/ 3 getLast\n\n\/\/ JVM_IR_TEMPLATES\n\/\/ 15 ILOAD\n\/\/ 9 ISTORE\n\/\/ 3 IADD\n\/\/ 1 ISUB\n\/\/ 1 IINC<|endoftext|>"} {"prompt":"\/\/ it should be published in common sources. more details: KT-54413\n \"iosMain\" to rootModuleSources and iosX64ModuleSources and iosArm64ModuleSources,\n \"iosX64Main\" to iosX64ModuleSources,\n \"iosArm64Main\" to iosArm64ModuleSources,\n \"linuxX64Main\" to linuxX64ModuleSources,","completion":"\"linuxArm64Main\" to linuxArm64ModuleSources,\n )\n\n val expectedSourcePublicationLayoutBySourcesFile: Map> = expectedSourcePublicationLayout\n .flatMap { (sourceSet, sources) -> sources.map { sourceSet to it } }\n .groupBy(\n keySelector = { it.second },\n valueTransform = { it.first }\n )<|endoftext|>"} {"prompt":"val mask = \"0x${List(byteSize) { \"FF\" }.chunked(2).joinToString(\"_\") { it.joinToString(\"\") }}\"\n}\n\nenum class ProgressionKind {\n CHAR,\n INT,\n LONG;\n\n val capitalized: String get() = name.lowercase().replaceFirstChar(Char::uppercase)\n}","completion":"fun progressionIncrementType(kind: ProgressionKind) = when (kind) {\n CHAR -> \"Int\"\n else -> kind.capitalized\n}\n\nfun areEqualNumbers(v: String) = \"$v == other.$v\"\n\nfun hashLong(v: String) = \"($v xor ($v ushr 32))\"<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun > testTypeParameterWithVarianceDifferentUpperBoundsE() {}\n fun > testTypeParameterWithVarianceDifferentUpperBoundsE() {}","completion":"fun > testTypeParameterWithVarianceDifferentUpperBoundsEReverse() {}\n @Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun > testTypeParameterWithVarianceDifferentUpperBoundsEReverse() {}<|endoftext|>"} {"prompt":"{ document.getElementsByTagName(ROOT_NODE_NAME).elements.single() },\n valueNamed,\n multiObjects,\n multiValues\n )\n}\n\ninternal fun parseKotlinSourceSetMetadata(\n getRoot: () -> ParsingContext,\n valueNamed: ParsingContext.(key: String) -> String?,","completion":"multiObjects: ParsingContext.(named: String) -> Iterable,\n multiValues: ParsingContext.(named: String) -> Iterable,\n): KotlinProjectStructureMetadata {\n val projectStructureNode = getRoot()\n\n val formatVersion = checkNotNull(projectStructureNode.valueNamed(FORMAT_VERSION_NODE_NAME))<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.expressions.toReference\nimport org.jetbrains.kotlin.fir.java.JavaBinarySourceElement\nimport org.jetbrains.kotlin.fir.modules.javaModuleResolverProvider\nimport org.jetbrains.kotlin.fir.packageFqName","completion":"import org.jetbrains.kotlin.fir.references.toResolvedCallableSymbol\nimport org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.symbols.SymbolInternals\nimport org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.compose.compiler.gradle.testUtils\n\nimport org.jetbrains.kotlin.gradle.tasks.BaseKotlinCompile\nimport org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile\n\nfun BaseKotlinCompile.composeOptions() = pluginOptions.get()","completion":".flatMap { compilerPluginConfig ->\n compilerPluginConfig.allOptions().filter { it.key == \"androidx.compose.compiler.plugins.kotlin\" }.values\n }\n .flatten()\n .map { it.key to it.value }\n\nfun KotlinNativeCompile.composeOptions() = compilerPluginOptions\n .allOptions()<|endoftext|>"} {"prompt":"irCall(getValueGetter(enumClass).symbol, enumClass.defaultType).apply {\n putValueArgument(0, irInt(enumEntriesMap(enumClass).getValue(name).getterId))\n }\n }\n\n}\n\ninternal class EnumClassLowering(val context: Context) : FileLoweringPass {\n private val enumsSupport = context.enumsSupport","completion":"private val symbols = context.ir.symbols\n private val createUninitializedInstance = symbols.createUninitializedInstance\n private val createEnumEntries = symbols.createEnumEntries\n private val initInstance = symbols.initInstance\n private val arrayGet = symbols.array.owner.functions.single { it.name == KonanNameConventions.getWithoutBoundCheck }.symbol<|endoftext|>"} {"prompt":"override val calleeDescriptor: PropertySetterDescriptor\n get() = (correspondingProperty as AccessorForPropertyDescriptor).calleeDescriptor.setter!!\n\n override val superCallTarget: ClassDescriptor?\n get() = (correspondingProperty as AccessorForPropertyDescriptor).superCallTarget\n\n init {\n initializeDefault()\n }\n }","completion":"}<|endoftext|>"} {"prompt":"fun (vararg v: Foo) {}\n }\n}\n\nclass B(vararg val s: Foo) {","completion":"constructor(a: Int, vararg s: Foo) : this(*s)\n}<|endoftext|>"} {"prompt":"val thisValue = createThisValueForDelegate(thisClass, ktDelegate)\n BackingFieldLValue(\n context,\n ktDelegate.startOffsetSkippingComments, ktDelegate.endOffset,\n irDelegateField.owner.type,\n irDelegateField,\n thisValue,\n null\n )\n }\n }","completion":"private fun createThisValueForDelegate(thisClass: ClassDescriptor?, ktDelegate: KtPropertyDelegate): IntermediateValue? =\n thisClass?.let {\n generateExpressionValue(it.thisAsReceiverParameter.type.toIrType()) {\n val thisAsReceiverParameter = thisClass.thisAsReceiverParameter\n IrGetValueImpl(<|endoftext|>"} {"prompt":"RENDER_TYPE,\n RENDER_TYPE,\n NOT_RENDERED\n )\n map.put(\n ASSIGNMENT_TYPE_MISMATCH,\n \"Assignment type mismatch: actual type is ''{1}'', but ''{0}'' was expected.\",\n RENDER_TYPE,\n RENDER_TYPE,\n NOT_RENDERED\n )","completion":"map.put(\n RESULT_TYPE_MISMATCH,\n \"Function return type mismatch: actual type is ''{1}'', but ''{0}'' was expected.\",\n RENDER_TYPE,\n RENDER_TYPE,\n )\n\n map.put(ITERATOR_MISSING, \"For-loop range must have an 'iterator()' method.\")<|endoftext|>"} {"prompt":"expectedType.coneType.arrayElementType()?.toFirResolvedTypeRef()\n }\n\n \/\/ Enabling expectedTypeMismatchIsReportedInChecker clarifies error messages:\n \/\/ It will be reported single ARGUMENT_TYPE_MISMATCH on the array literal in checkApplicabilityForArgumentType\n \/\/ instead of several TYPE_MISMATCH for every mismatched argument.","completion":"ResolutionMode.WithExpectedType(\n expectedType,\n forceFullCompletion = false,\n expectedTypeMismatchIsReportedInChecker = true\n )\n } else {\n ResolutionMode.ContextDependent\n }\n\n return@mapTo arg.transformSingle(transformer, resolutionMode)\n }\n }\n )\n }<|endoftext|>"} {"prompt":"* Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character.\n *\/\npublic inline fun CharSequence.single(predicate: (Char) -> Boolean): Char {\n var single: Char? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {","completion":"if (found) throw IllegalArgumentException(\"Char sequence contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Char sequence contains no character matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Char\n}\n\n\/**<|endoftext|>"} {"prompt":"contextReceiverParametersCount = declaration.contextReceiverParametersCount\n processAttributes(declaration)\n transformFunctionChildren(declaration)\n }\n\n override fun visitConstructor(declaration: IrConstructor): IrConstructor =\n declaration.factory.createConstructor(\n startOffset = declaration.startOffset,\n endOffset = declaration.endOffset,","completion":"origin = mapDeclarationOrigin(declaration.origin),\n name = declaration.name,\n visibility = declaration.visibility,\n isInline = declaration.isInline,\n isExpect = declaration.isExpect,\n returnType = declaration.returnType,\n symbol = symbolRemapper.getDeclaredConstructor(declaration.symbol),\n isPrimary = declaration.isPrimary,<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.expressions.IrTypeOperator\nimport org.jetbrains.kotlin.ir.expressions.impl.*\nimport org.jetbrains.kotlin.ir.symbols.IrValueSymbol\nimport org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl","completion":"import org.jetbrains.kotlin.ir.types.classOrFail\nimport org.jetbrains.kotlin.ir.types.defaultType\nimport org.jetbrains.kotlin.ir.util.constructors\nimport org.jetbrains.kotlin.ir.util.defaultType\nimport org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance<|endoftext|>"} {"prompt":"\/\/ !LANGUAGE: +SoundSmartcastForEnumEntries\n\/\/ !DIAGNOSTICS: -UNUSED_VARIABLE\n\/\/ SKIP_TXT\n\nenum class Message(val text: String?) {\n HELLO(\"hello\"),\n WORLD(\"world\"),\n NOTHING(null)\n}\n\nfun printMessages() {\n Message.HELLO.text!!","completion":"Message.HELLO.text.length\n\n Message.NOTHING.text.length\n\n Message.NOTHING.text!!\n Message.NOTHING.text.length\n}<|endoftext|>"} {"prompt":"visitBreakContinue(jump)\n }\n\n override fun visitCall(expression: IrCall, data: Nothing?) {\n visitCall(expression)\n }\n\n fun visitCall(expression: IrCall) {\n visitFunctionAccess(expression)\n }\n\n override fun visitCallableReference(expression: IrCallableReference<*>, data: Nothing?) {","completion":"visitCallableReference(expression)\n }\n\n fun visitCallableReference(expression: IrCallableReference<*>) {\n visitMemberAccess(expression)\n }\n\n override fun visitFunctionReference(expression: IrFunctionReference, data: Nothing?) {\n visitFunctionReference(expression)\n }\n\n fun visitFunctionReference(expression: IrFunctionReference) {<|endoftext|>"} {"prompt":"headerPaths?.let { appendText(\"$HEADER_SEARCH_PATHS=$it\\n\") }\n publicHeadersFolderPath?.let { appendText(\"$PUBLIC_HEADERS_FOLDER_PATH=$it\\n\") }\n frameworkPaths?.let { appendText(\"$FRAMEWORK_SEARCH_PATHS=$it\") }\n }\n }","completion":"companion object {\n const val BUILD_DIR = \"BUILD_DIR\"\n const val CONFIGURATION = \"CONFIGURATION\"\n const val CONFIGURATION_BUILD_DIR = \"CONFIGURATION_BUILD_DIR\"\n const val PODS_TARGET_SRCROOT = \"PODS_TARGET_SRCROOT\"<|endoftext|>"} {"prompt":"* Returns `true` if all elements match the given [predicate].\n * \n * Note that if the array contains no elements, the function returns `true`\n * because there are no elements in it that _do not_ match the predicate.\n * See a more detailed explanation of this logic concept in [\"Vacuous truth\"](https:\/\/en.wikipedia.org\/wiki\/Vacuous_truth) article.\n *","completion":"* @sample samples.collections.Collections.Aggregates.all\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.all(predicate: (UShort) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n\/**<|endoftext|>"} {"prompt":"inline fun case_12(x: Any?) {\n if (x is T) {\n if (x is T is K) {\n x\n }\n }\n}","completion":"\/\/ TESTCASE NUMBER: 13\ninline fun case_13(x: Any?) {\n if (x is T) {\n if (x is K) {\n x\n }\n }\n}\n\n\/\/ TESTCASE NUMBER: 14<|endoftext|>"} {"prompt":"descriptor in resolverByModuleDescriptor\n }\n\n override fun descriptorForModule(moduleInfo: M): ModuleDescriptorImpl {\n checkValid()\n checkModuleIsCorrect(moduleInfo)\n return doGetDescriptorForModule(moduleInfo)\n }\n\n override fun moduleInfoForModuleDescriptor(moduleDescriptor: ModuleDescriptor): M {\n checkValid()","completion":"return moduleInfoByDescriptor[moduleDescriptor] ?: delegateResolver.moduleInfoForModuleDescriptor(moduleDescriptor)\n }\n\n override fun diagnoseUnknownModuleInfo(infos: List): Nothing {\n DiagnoseUnknownModuleInfoReporter.report(name, infos, allModules)\n }\n\n private fun checkModuleIsCorrect(moduleInfo: M) {<|endoftext|>"} {"prompt":"override val packageProvider: KotlinPackageProvider get() = providerHelper.packageProvider\n\n override val symbolNamesProvider: FirSymbolNamesProvider get() = providerHelper.symbolNameCache\n\n override val allowKotlinPackage get() = providerHelper.allowKotlinPackage\n\n override fun getClassLikeSymbolByClassId(classId: ClassId): FirClassLikeSymbol<*>? {","completion":"if (!providerHelper.symbolNameCache.mayHaveTopLevelClassifier(classId)) return null\n return getFirClassifierByFqName(classId)?.symbol\n }\n\n @FirSymbolProviderInternals\n override fun getClassLikeSymbolByClassId(classId: ClassId, classLikeDeclaration: KtClassLikeDeclaration): FirClassLikeSymbol<*>? {<|endoftext|>"} {"prompt":"\/\/ CHECK-WINDOWSX64: invoke i16 [[SHORT_ID_BRIDGE:@_.*_knbridge[0-9]+]](i16 {{.*}})\n short_id(0.toShort())","completion":"\/\/ CHECK-DEFAULTABI: invoke zeroext i16 [[UNSIGNED_SHORT_ID_BRIDGE:@_.*_knbridge[0-9]+]](i16 zeroext {{.*}})\n \/\/ CHECK-AAPCS: invoke i16 [[UNSIGNED_SHORT_ID_BRIDGE:@_.*_knbridge[0-9]+]](i16 {{.*}})<|endoftext|>"} {"prompt":"7705, 7706, 7707, 7708, 7709, 7710, 7711, 7712, 7713, 7714, 7715, 7716, 7717, 7718, 7719, 7720, 7721, 7722, 7723,","completion":"7724, 7725, 7726, 7727, 7728, 7729, 7730, 7731, 7732, 7733, 7734, 7735, 7736, 7737, 7738, 7739, 7740, 7741, 7742,<|endoftext|>"} {"prompt":"@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"byteRangeContains\")\npublic operator fun ClosedRange.contains(value: Double): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}","completion":"\/**\n * Checks if the specified [value] belongs to this range.\n *\/\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"shortRangeContains\")<|endoftext|>"} {"prompt":"assertEquals(\"odd\", js(\"(1 % 2 === 0)?'even':'odd'\"), \"?:\")\n assertEquals(\"even\", js(\"(4 % 2 === 0)?'even':'odd'\"), \"?:\")\n assertEquals(3, js(\"1,2,3\"), \", (comma)\")\n\n if (testUtils.isLegacyBackend()) {\n var j = 0","completion":"assertEquals(1, js(\"j = 1\"), \"=\")\n assertEquals(3, js(\"j += 2\"), \"+=\")\n assertEquals(2, js(\"j -= 1\"), \"-=\")\n assertEquals(14, js(\"j *= 7\"), \"*=\")\n assertEquals(7, js(\"j \/= 2\"), \"\/=\")<|endoftext|>"} {"prompt":"val result_2 = select(A(B()), A(x), A(if (true) B() else null))\n val result_3 = select(A(x), A(if (true) B() else null))\n\n \")!>result_1","completion":"\")!>result_2\n \")!>result_3\n}\n\nfun case_2() {\n val x = Test.bar() \/\/ Any!\n val y: Any? = null<|endoftext|>"} {"prompt":"gradleVersion,\n buildOptions = defaultBuildOptions.copy(\n androidVersion = agpVersion,\n ),\n buildJdk = jdkVersion.location\n ) {\n removeDependencies(buildGradle)\n checkTaskCompileClasspath(\n \"compileDebugKotlin\",\n listOf(\"kotlin-stdlib\"),","completion":"listOf(\"kotlin-stdlib-jdk7\", \"kotlin-stdlib-jdk8\")\n )\n }\n }\n\n @AndroidGradlePluginTests\n @DisplayName(\"Android: kotlin-stdlib dependency is not added when disabled via properties\")\n @GradleAndroidTest\n fun testStdlibDisabledAndroid(\n gradleVersion: GradleVersion,<|endoftext|>"} {"prompt":"override fun createDelegatingTestReportProcessor(origin: TestResultProcessor, targetName: String) =\n object : TestResultProcessor by origin {\n override fun started(test: TestDescriptorInternal, event: TestStartEvent) {\n val myTest = object : TestDescriptorInternal by test {\n override fun getDisplayName(): String = \"${test.displayName}[$targetName]\"","completion":"override fun getClassName(): String? = test.className?.replace('$', '.')\n override fun getClassDisplayName(): String? = test.classDisplayName?.replace('$', '.')\n }\n origin.started(myTest, event)\n }\n }\n}<|endoftext|>"} {"prompt":"require(firSymbol is FirConstructorSymbol)\n val constructor = firSymbol.unwrapCallRepresentative(c).fir as FirConstructor\n val totalTypeParametersCount = constructor.typeParameters.size\n val constructorTypeParametersCount = constructor.typeParameters.count { it is FirTypeParameter }\n IrConstructorCallImpl(\n startOffset,\n endOffset,\n irType,","completion":"symbol,\n typeArgumentsCount = totalTypeParametersCount,\n valueArgumentsCount = firSymbol.valueParametersSize(),\n constructorTypeArgumentsCount = constructorTypeParametersCount,\n )\n }\n is IrSimpleFunctionSymbol -> {\n require(firSymbol is FirCallableSymbol<*>) { \"Illegal symbol: ${firSymbol!!::class}\" }<|endoftext|>"} {"prompt":"return testDataFile.withExtension(IrTextDumpHandler.DUMP_EXTENSION).takeIf { it.exists() }\n }\n\n override fun getFirFileToCompare(testDataFile: File): File? {\n return testDataFile.withExtension(\"fir.${IrTextDumpHandler.DUMP_EXTENSION}\").takeIf { it.exists() }\n }","completion":"}\n\n private val prettyDumpChecker = object : FirIdenticalCheckerHelper(testServices) {\n override fun getClassicFileToCompare(testDataFile: File): File? {\n return testDataFile.withExtension(IrPrettyKotlinDumpHandler.DUMP_EXTENSION).takeIf { it.exists() }\n }<|endoftext|>"} {"prompt":"fun three(p1: F, p2: N, p3: I) = Unit\n fun three(p1: F, p2: I, p3: N) = Unit\n }\n }\n\n inner class Inner(p1: O, p2: I) {","completion":"inner class TypeParameterInSuperTypes : Interface>, Map, Triple>\n\n var O.property: O get() = TODO()\n set(_) = kotlin.Unit\n var I.property: I get() = TODO()\n set(_) = kotlin.Unit<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.ir.interpreter.checker\n\nimport org.jetbrains.kotlin.ir.IrElement\nimport org.jetbrains.kotlin.ir.IrStatement\nimport org.jetbrains.kotlin.ir.declarations.*\nimport org.jetbrains.kotlin.ir.expressions.*","completion":"import org.jetbrains.kotlin.ir.interpreter.*\nimport org.jetbrains.kotlin.ir.interpreter.preprocessor.IrInterpreterKCallableNamePreprocessor.Companion.isEnumName\nimport org.jetbrains.kotlin.ir.interpreter.preprocessor.IrInterpreterKCallableNamePreprocessor.Companion.isKCallableNameCall<|endoftext|>"} {"prompt":"assertEquals(\"lang\", reconstructed.language)\n\n val info = Project2.serializer().descriptor.annotations.filterIsInstance().first()\n assertEquals(123, info.value)\n assertEquals(String::class, info.kclass)\n}\n\nfun testMetaSerializableOnProperty() {","completion":"val info = Wrapper.serializer().descriptor.getElementAnnotations(0).filterIsInstance().first()\n assertEquals(234, info.value)\n assertEquals(Int::class, info.kclass)\n}\n\nfun testSerializableAndMetaAnnotation() {<|endoftext|>"} {"prompt":"newFunExperimentalInThePast()\n newValExperimentalInThePast\n NewClassExperimentalInThePast()\n}\n\n@OptIn(Marker::class)\nfun use2(","completion":"c2: NewClassExperimentalInThePast,\n t2: TypeAliasToNewClass\n) {\n newPublishedFun()\n newFunExperimentalInThePast()\n newValExperimentalInThePast\n NewClassExperimentalInThePast()\n}\n\n@Marker\nfun use3(<|endoftext|>"} {"prompt":"if (value_8 != 0b110001 || value_8 != 49) return null\n if (value_9 != 0b01100011 || value_9 != 99) return null\n if (value_10 != 0B0 || value_10 != 0) return null\n if (value_11 != 0b1 || value_11 != 1) return null","completion":"if (value_12 != 0b100000 || value_12 != 32) return null\n if (value_13 != 0B1000001 || value_13 != 65) return null\n if (value_14 != 0B0000000 || value_14 != 0) return null\n if (value_15 != 0b0000001000000 || value_15 != 64) return null<|endoftext|>"} {"prompt":"if (scope.isScopeForClass() && base.isScopeForClass()) {\n val classContainingFrom = from.findClassOrObjectParent() ?: return@any false\n return@any scope.isScopeForClassCloserThanAnotherScopeForClass(base, classContainingFrom)\n }\n base.isWiderThan(scope)\n }\n\n \/**","completion":"* Returns true if [containingFile] has a [KtImportDirective] whose imported FqName is the same as [classId] but references a different\n * symbol.\n *\/\n private fun importDirectiveForDifferentSymbolWithSameNameIsPresent(classId: ClassId): Boolean {<|endoftext|>"} {"prompt":"assertFalse(data.remove(\"foo\"))\n assertEquals(1, data.size)\n assertTrue(data.contains(\"bar\"))\n\n val nullableSet = createEmptyMutableSetWithNullableValues()\n nullableSet.add(null)\n\n assertTrue(nullableSet.remove(null))\n assertFalse(nullableSet.remove(null))\n }\n\n @Test","completion":"fun addAll() {\n val data = createTestMutableSet()\n assertTrue(data.addAll(arrayListOf(\"foo\", \"bar\", \"baz\", \"boo\")))\n assertEquals(4, data.size)\n assertFalse(data.addAll(arrayListOf(\"foo\", \"bar\", \"baz\", \"boo\")))\n assertEquals(4, data.size)<|endoftext|>"} {"prompt":"if (!iterator.hasNext()) return maxElem\n var maxValue = selector(maxElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n } while (iterator.hasNext())\n return maxElem\n}\n\n\/**","completion":"* Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n *\/\n@SinceKotlin(\"1.4\")<|endoftext|>"} {"prompt":"private val parentLoopResolver: LoopResolver?\n) : GeneratorWithScope, LoopResolver {\n\n val scopeOwner: DeclarationDescriptor get() = scopeOwnerSymbol.descriptor\n\n private val typeTranslator = context.typeTranslator\n private fun KotlinType.toIrType() = typeTranslator.translateType(this)\n\n override val scope = Scope(scopeOwnerSymbol)","completion":"private val loopTable = HashMap()\n\n fun generateFunctionBody(ktBody: KtExpression): IrBody {\n val irBlockBody = context.irFactory.createBlockBody(ktBody.startOffsetSkippingComments, ktBody.endOffset)\n\n if (context.configuration.skipBodies) {\n val irBody =<|endoftext|>"} {"prompt":"private set\n\n var z6: Private = Private(35, 36)\n internal set\n\n companion object {\n var staticX1: Public = Public(-1, -2)\n internal var staticX2: Public = Public(-3, -4)\n private var staticX3: Public = Public(-5, -6)\n\n var staticX4: Public = Public(-7, -8)","completion":"private set\n internal var staticX5: Public = Public(-9, -10)\n private set\n\n var staticX6: Public = Public(-11, -12)\n internal set\n\n\n var staticY1: Internal = Internal(-13, -14)\n internal var staticY2: Internal = Internal(-15, -16)\n private var staticY3: Internal = Internal(-17, -18)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.ir.builders.declarations.*\nimport org.jetbrains.kotlin.ir.declarations.*\nimport org.jetbrains.kotlin.ir.expressions.*\nimport org.jetbrains.kotlin.ir.expressions.impl.IrDelegatingConstructorCallImpl","completion":"import org.jetbrains.kotlin.ir.symbols.IrClassSymbol\nimport org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol\nimport org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol\nimport org.jetbrains.kotlin.ir.types.*\nimport org.jetbrains.kotlin.ir.util.*<|endoftext|>"} {"prompt":"* Outputs are written as json and protobufs\n *\/\n@DisableCachingByDefault(because = \"Used for debugging\/diagnostic purpose.\")\ninternal open class IdeResolveDependenciesTask : DefaultTask() {\n\n @TaskAction\n fun resolveDependencies() {\n val outputDirectory = project.layout.buildDirectory.dir(\"ide\/dependencies\").get().asFile\n outputDirectory.deleteRecursively()","completion":"val gson = GsonBuilder().setLenient().setPrettyPrinting()\n .registerTypeHierarchyAdapter(IdeDependencyResolver::class.java, IdeDependencyResolverAdapter)\n .registerTypeHierarchyAdapter(Extras::class.java, ExtrasAdapter)<|endoftext|>"} {"prompt":"override val shouldGenerateClassSyntheticPartsInLightClassesMode: Boolean\n get() = true\n\n override fun generateClassSyntheticParts(codegen: ImplementationBodyCodegen) {\n\n val parcelableClass = codegen.descriptor\n\n if (!parcelableClass.isParcelableClassDescriptor) return","completion":"val propertiesToSerialize = getPropertiesToSerialize(codegen, parcelableClass)\n\n val parcelerObject = parcelableClass.companionObjectDescriptor?.takeIf {\n TypeUtils.getAllSupertypes(it.defaultType).any { it.isParceler }\n }\n\n with (parcelableClass) {\n if (hasSyntheticDescribeContents()) {<|endoftext|>"} {"prompt":"nullTask?.input[0, 0, 0] = StringProperty(\"Fail\")\n\n \/\/ a?.b[c] += d","completion":"task.input[0] += StringProperty(\"Fail\")<|endoftext|>"} {"prompt":"assertTrue(jsBoolTrue != false.toJsBoolean())\n assertTrue(jsRepresentation(jsBoolTrue) == \"boolean:true\")\n\n \/\/ JsArray\n val jsArray: JsArray = JsArray()\n repeat(3) {\n jsArray[it] = \"element$it\".toJsString()\n }","completion":"assertTrue(jsArray.length == 3)\n assertTrue(jsArray[1] == \"element1\".toJsString())\n assertTrue(jsRepresentation(jsArray) == \"object:element0,element1,element2\")\n\n \/\/ JsReference\n val jsReference: JsReference = 10.toJsReference()\n assertTrue(jsReference.get() == 10)<|endoftext|>"} {"prompt":"\/\/ Otherwise it may result in performance regression due to missing HotSpot optimizations.\n\/\/ Run Kotlin compiler benchmarks (https:\/\/github.com\/Kotlin\/kotlin-benchmarks)\n\/\/ with compiler built from your changes if you are not sure.\n\nfun test(uis: UIntArray): UInt {\n var s = 0U\n for (ui in uis) {\n s += ui\n }\n return s","completion":"}\n\n\/\/ 0 iterator\n\/\/ 0 getStart\n\/\/ 0 getEnd\n\/\/ 0 getFirst\n\/\/ 0 getLast\n\/\/ 1 IF_ICMPGE\n\/\/ 0 IF_ICMPGT\n\/\/ 0 IF_ICMPLE\n\/\/ 1 IF\n\n\/\/ JVM_IR_TEMPLATES\n\/\/ 6 ILOAD\n\/\/ 5 ISTORE\n\/\/ 1 IADD\n\/\/ 0 ISUB\n\/\/ 1 IINC<|endoftext|>"} {"prompt":"private val classifierIds = CommonizerSet(initialCapacity)\n\n operator fun invoke(tree: CirTreeRoot) {\n tree.modules.forEach { module -> this(module) }\n }\n\n operator fun invoke(module: CirTreeModule) {\n module.packages.forEach { pkg -> this(pkg) }\n }","completion":"operator fun invoke(pkg: CirTreePackage) {\n pkg.typeAliases.forEach { typeAlias -> this(typeAlias) }\n pkg.classes.forEach { clazz -> this(clazz) }\n }\n\n operator fun invoke(typeAlias: CirTreeTypeAlias) {\n classifierIds.add(typeAlias.id)<|endoftext|>"} {"prompt":"\/\/ TARGET_BACKEND: JVM\n\/\/ LAMBDAS: CLASS\n\nimport java.util.Date\n\nfun assertGenericSuper(expected: String, function: Any?) {\n val clazz = (function as java.lang.Object).getClass()!!\n val genericSuper = clazz.getGenericInterfaces()[0]!!\n if (\"$genericSuper\" != expected)","completion":"throw AssertionError(\"Fail, expected: $expected, actual: $genericSuper\")\n}\n\n\nval unitFun = { }\nval intFun = { 42 }\nval stringParamFun = { x: String -> }\nval listFun = { l: List -> l }\nval mutableListFun = fun (l: MutableList): MutableList = null!!<|endoftext|>"} {"prompt":"} catch (e: NullPointerException) {\n \"Null\"\n }\n}\n\nconst val a1 = notNullAssertion(1)\nconst val a2 = notNullAssertion(null)","completion":"const val b1 = notNullAssertionForObject(A())\nconst val b2 = notNullAssertionForObject(null)<|endoftext|>"} {"prompt":"fun testReadOnlyInterfaceProperties() {\n val o = makeTestInterfaceInstance()\n\n o.intWrapper = IntWrapper(42)\n assertEquals(42, o.readOnlyIntWrapper.value)\n\n assertEquals(null, o.readOnlyIntWrapperN?.value)\n o.intWrapperN = IntWrapper(100)","completion":"assertEquals(100, o.readOnlyIntWrapperN?.value)\n\n o.intNWrapper = IntNWrapper(23)\n assertEquals(23, o.readOnlyIntNWrapper.value)\n o.intNWrapper = IntNWrapper(null)\n assertEquals(null, o.readOnlyIntNWrapper.value)<|endoftext|>"} {"prompt":"if (!(4.toShort() in emptyIntArray.indices) != !range2.contains(4.toShort())) throw AssertionError()\n if (!(4.toShort() !in emptyIntArray.indices) != range2.contains(4.toShort())) throw AssertionError()\n \/\/ no local optimizations","completion":"if (element21 in emptyIntArray.indices != range2.contains(element21)) throw AssertionError()\n if (element21 !in emptyIntArray.indices != !range2.contains(element21)) throw AssertionError()\n if (!(element21 in emptyIntArray.indices) != !range2.contains(element21)) throw AssertionError()<|endoftext|>"} {"prompt":"val commonizedClassifier = classifiers.commonizedNodes.classNode(classifierId)?.commonDeclaration?.invoke()\n ?: classifiers.commonizedNodes.typeAliasNode(classifierId)?.commonDeclaration?.invoke()\n\n return when (commonizedClassifier) {\n is CirClass -> CirClassType.createInterned(\n classId = classifierId,","completion":"outerType = outerType,\n arguments = arguments,\n isMarkedNullable = isMarkedNullable\n )\n\n is CirTypeAlias -> CirTypeAliasType.createInterned(\n typeAliasId = classifierId,\n arguments = arguments,\n isMarkedNullable = isMarkedNullable,\n underlyingType = commonizedClassifier.underlyingType<|endoftext|>"} {"prompt":"override fun get(index: Int): Z = Z(storage[index])\n\n override fun indexOf(element: Z): Int = storage.indexOf(element.x)\n\n override fun lastIndexOf(element: Z): Int = storage.lastIndexOf(element.x)\n\n override fun listIterator(): ListIterator = ZArrayIterator(storage)","completion":"override fun listIterator(index: Int): ListIterator = ZArrayIterator(storage, index)\n\n override fun subList(fromIndex: Int, toIndex: Int): List = TODO()\n\n private class ZArrayIterator(val storage: IntArray, var index: Int = 0): ListIterator {\n override fun hasNext(): Boolean = index < storage.size<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.analysis.project.structure\n\nimport org.jetbrains.kotlin.extensions.ProjectExtensionDescriptor\n\n\/**\n * A service which can return extensions which are registered for some module\n *\/\npublic abstract class KtCompilerPluginsProvider {\n\n public enum class CompilerPluginType {\n ASSIGNMENT\n }\n\n \/**","completion":"* Returns a list of extensions of a base [extensionType] which are registered for [module]\n *\n * These extensions are used in addition to those provided by the extension descriptor's [ProjectExtensionDescriptor.getInstances].\n *\/\n public abstract fun getRegisteredExtensions(module: KtSourceModule, extensionType: ProjectExtensionDescriptor): List<|endoftext|>"} {"prompt":"val stubs = preComputedStubs.filter {\n irClass.symbol.isStrictSubtypeOfClass(it.readOnlyClass) && !irClass.symbol.isSubtypeOfClass(it.mutableClass)\n }\n return stubs.filter {","completion":"stubs.none { other -> it.readOnlyClass != other.readOnlyClass && other.readOnlyClass.isSubtypeOfClass(it.readOnlyClass) }\n }\n }\n}\n\ninterface StubsForCollectionClass {\n val readOnlyClass: IrClassSymbol\n val mutableClass: IrClassSymbol\n val candidatesForStubs: Collection\n}<|endoftext|>"} {"prompt":"assertPrints(array.contentEquals(doubleArrayOf(1.0, 0.0, Double.NaN)), \"false\")\n }\n\n @Sample\n fun contentDeepEquals() {\n val identityMatrix = arrayOf(\n intArrayOf(1, 0),\n intArrayOf(0, 1)\n )\n val reflectionMatrix = arrayOf(\n intArrayOf(1, 0),","completion":"intArrayOf(0, -1)\n )\n\n \/\/ the elements at index [1][1] are not equal\n assertPrints(identityMatrix.contentDeepEquals(reflectionMatrix), \"false\")\n\n reflectionMatrix[1][1] = 1\n assertPrints(identityMatrix.contentDeepEquals(reflectionMatrix), \"true\")\n }\n }<|endoftext|>"} {"prompt":"package kotlin.collections\n\n\/**\n * Returns the array if it's not `null`, or an empty array otherwise.\n * @sample samples.collections.Arrays.Usage.arrayOrEmpty\n *\/\npublic actual inline fun Array?.orEmpty(): Array = this ?: emptyArray()","completion":"internal fun checkCopyOfRangeArguments(fromIndex: Int, toIndex: Int, size: Int) {\n if (toIndex > size)\n throw IndexOutOfBoundsException(\"toIndex ($toIndex) is greater than size ($size).\")\n if (fromIndex > toIndex)\n throw IllegalArgumentException(\"fromIndex ($fromIndex) is greater than toIndex ($toIndex).\")\n}<|endoftext|>"} {"prompt":"public fun ByteArray.toHexString(format: HexFormat = HexFormat.Default): String = toHexString(0, size, format)\n\n\/**\n * Formats bytes in this array using the specified [HexFormat].\n *\n * Note that only [HexFormat.upperCase] and [HexFormat.BytesHexFormat] affect formatting.\n *","completion":"* @param startIndex the beginning (inclusive) of the subrange to format, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to format, size of this array by default.\n * @param format the [HexFormat] to use for formatting, [HexFormat.Default] by default.\n *<|endoftext|>"} {"prompt":"builder.multiLineComment = JsAstProtoBuf.MultiLineComment.newBuilder().setMessage(comment.text).build()\n }\n }\n\n withComments(statement, { visitor.builder.addBeforeComments(it) }, { visitor.builder.addAfterComments(it) }) {\n withLocation(statement, { visitor.builder.fileId = it }, { visitor.builder.location = it }) {","completion":"statement.accept(visitor)\n }\n }\n\n if (statement is HasMetadata && statement.synthetic) {\n visitor.builder.synthetic = true\n }\n\n if (visitor.builder.statementCase == JsAstProtoBuf.Statement.StatementCase.STATEMENT_NOT_SET) {\n error(\"Unknown statement type: ${statement::class.qualifiedName}\")<|endoftext|>"} {"prompt":"inv()\n }\n}\n\nfun poll16(flag: Boolean): Flow {\n return flow {","completion":"val inv = if (flag) { ::Foo6<|endoftext|>"} {"prompt":"@Suppress(\"DEPRECATION\")\n curChar = high.toInt()\n }\n } else {\n @Suppress(\"DEPRECATION\")\n curChar = testString[index].toInt()\n }\n\n return curChar\n }\n\n override fun first(set: AbstractSet): Boolean {\n return if (set is DecomposedCharSet)","completion":"set.decomposedChar.contentEquals(decomposedChar)\n else\n true\n }\n\n override fun hasConsumed(matchResult: MatchResultImpl): Boolean = true\n}<|endoftext|>"} {"prompt":"}\n\n override fun visitFile(file: FirFile, data: Nothing?) {\n withAnnotationContainer(file) {\n visitWithFile(file)\n }\n }\n\n override fun visitAnonymousInitializer(anonymousInitializer: FirAnonymousInitializer, data: Nothing?) {\n withElement(anonymousInitializer) {\n visitWithDeclaration(anonymousInitializer)\n }","completion":"}\n\n override fun visitBlock(block: FirBlock, data: Nothing?) {\n if (block is FirContractCallBlock) {\n insideContractBody {\n visitExpression(block, data)\n }\n } else {\n visitExpression(block, data)\n }\n }\n\n override fun visitContractDescription(contractDescription: FirContractDescription, data: Nothing?) {<|endoftext|>"} {"prompt":"tailrec fun h2(x : Any) {\n this@B.h2(\"no recursion\") \/\/ keep vigilance\n }\n\n }\n\n fun makeC() : C = C()\n\n fun h2(x : Any) {\n }\n}\n\nfun box() : String {","completion":"B().makeC().h(1000000)\n B().makeC().h2(0)\n return \"OK\"\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTestFramework\nimport org.jetbrains.kotlin.gradle.targets.js.testing.KotlinTestRunnerCliArgs\nimport org.jetbrains.kotlin.gradle.utils.getFile\nimport org.jetbrains.kotlin.gradle.utils.getValue","completion":"import java.nio.file.Path\n\nclass KotlinMocha(@Transient override val compilation: KotlinJsIrCompilation, private val basePath: String) :\n KotlinJsTestFramework {\n @Transient\n private val project: Project = compilation.target.project\n private val npmProject = compilation.npmProject<|endoftext|>"} {"prompt":"* Returns the single element, or throws an exception if the array is empty or has more than one element.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.single(): UInt {\n return storage.single().toUInt()\n}\n\n\/**","completion":"* Returns the single element, or throws an exception if the array is empty or has more than one element.\n *\/\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.single(): ULong {\n return storage.single().toULong()\n}\n\n\/**<|endoftext|>"} {"prompt":"val (allExportStatements, restStatements) = allExportRelatedStatements.partitionIsInstance()\n val (currentModuleExportStatements, restExportStatements) = allExportStatements.partition { it.fromModule == null }\n val exportedElements = currentModuleExportStatements.takeIf { it.isNotEmpty() }\n ?.asSequence()","completion":"?.flatMap { (it.subject as JsExport.Subject.Elements).elements }\n ?.distinctBy { it.alias?.ident ?: it.name.ident }\n ?.toList()\n\n val oneLargeExportStatement = exportedElements?.let { JsExport(JsExport.Subject.Elements(it)) }<|endoftext|>"} {"prompt":"val nested1 = CirName.create(\"Nested1\")\n val nested2 = CirName.create(\"Nested2\")\n\n listOf(\n \"\",\n \"\/\",\n \"foo\/\",\n \"foo\/bar\/\",\n \"Outer\",\n \"\/Outer\",\n \"foo\/Outer\",\n \"foo\/bar\/Outer\",\n \"Outer.Nested\",","completion":"\"\/Outer.Nested\",\n \"foo\/Outer.Nested\",\n \"foo\/bar\/Outer.Nested\"\n ).forEach { rawEntityId ->\n val entityId = CirEntityId.create(rawEntityId)\n val n1 = entityId.createNestedEntityId(nested1)\n assertSame(entityId.packageName, n1.packageName)<|endoftext|>"} {"prompt":"memScoped {\n return interpretCPointer(kniBridge296(C.getPointer(memScope).rawValue))\n }\n}\n\nfun clang_EvalResult_getKind(E: CXEvalResult?): CXEvalResultKind {\n return CXEvalResultKind.byValue(kniBridge297(E.rawValue))\n}","completion":"fun clang_EvalResult_getAsInt(E: CXEvalResult?): Int {\n return kniBridge298(E.rawValue)\n}\n\nfun clang_EvalResult_getAsLongLong(E: CXEvalResult?): Long {\n return kniBridge299(E.rawValue)\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.stringRepresentation\nimport org.jetbrains.kotlin.analysis.api.renderer.declarations.impl.KtDeclarationRendererForSource\nimport org.jetbrains.kotlin.analysis.api.renderer.declarations.modifiers.renderers.KtRendererKeywordFilter","completion":"import org.jetbrains.kotlin.analysis.api.scopes.KtScope\nimport org.jetbrains.kotlin.analysis.api.scopes.KtTypeScope\nimport org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRenderer\nimport org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest<|endoftext|>"} {"prompt":"\/\/ \"ℳ\" to 8499,\n\/\/ \"∾\" to 8766,\n\/\/ \"Μ\" to 924,\n\/\/ \"μ\" to 956,\n\/\/ \"⊸\" to 8888,\n\/\/ \"⊸\" to 8888,\n\/\/ \"∇\" to 8711,\n\/\/ \"Ń\" to 323,","completion":"\/\/ \"ń\" to 324,\n\/\/ \"∠⃒\" to 8736,\n\/\/ \"≉\" to 8777,\n\/\/ \"⩰̸\" to 10864,\n\/\/ \"≋̸\" to 8779,\n\/\/ \"ʼn\" to 329,\n\/\/ \"≉\" to 8777,\n\/\/ \"♮\" to 9838,<|endoftext|>"} {"prompt":"@JvmStatic fun test1() = b\n\n @JvmStatic fun test2() = b\n\n @JvmStatic fun String.test3() = this + b\n }\n}\n\nfun box(): String {\n if (Test.test1() != \"OK\") return \"fail 1\"\n\n if (Test.test2() != \"OK\") return \"fail 2\"","completion":"if (Test.test3() != \"JAVAOK\") return \"fail 3\"\n\n if (Test.test4() != \"OK\") return \"fail 4\"\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"directLibsSequence(givenPath) + repoLibs\n }\n }\n return sequence.filterNotNull()\n }\n\n private fun Sequence.filterOutPre_1_4_libraries(): Sequence = this.filter {\n if (it.isPre_1_4_Library) {","completion":"logger.warning(\"KLIB resolver: Skipping '$it'. This is a pre 1.4 library.\")\n false\n } else {\n true\n }\n }\n\n \/\/ Default libraries could be resolved several times during findLibraries and resolveDependencies.\n \/\/ Store already resolved libraries.\n private inner class ResolvedLibrary(val library: L?)<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.codegen.range.forLoop.ForInDefinitelySafeSimpleProgressionLoopGenerator\nimport org.jetbrains.kotlin.codegen.range.forLoop.ForLoopGenerator\nimport org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator","completion":"import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator\nimport org.jetbrains.kotlin.codegen.range.inExpression.InFloatingPointRangeLiteralExpressionGenerator\nimport org.jetbrains.kotlin.codegen.range.inExpression.InIntegralContinuousRangeExpressionGenerator<|endoftext|>"} {"prompt":"package Jet87\n\nopen class A() {\n fun foo() : Int = 1\n}\n\ninterface B {\n fun bar() : Double = 1.0;\n}\n\ninterface G {\n val <X> boo: Double where X : A, X : B","completion":"val <A> bal: Double where A : B<|endoftext|>"} {"prompt":"}\n }\n\n override fun processPackagePart(sourceFile: File, packagePartMetadata: ByteArray, binaryAst: ByteArray, inlineData: ByteArray) {\n rpcProfiler.withMeasure(this) {\n facade.incrementalResultsConsumer_processPackagePart(sourceFile.path, packagePartMetadata, binaryAst, inlineData)\n }\n }","completion":"private class JsInlineFunction(val sourceFilePath: String, val fqName: String, val inlineFunction: FunctionWithSourceInfo)\n\n private val deferInlineFuncs = mutableListOf()\n\n override fun processInlineFunction(sourceFile: File, fqName: String, inlineFunction: Any, line: Int, column: Int) {<|endoftext|>"} {"prompt":"* - `truncate(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n *\/\n@SinceKotlin(\"1.2\")\npublic actual fun truncate(x: Float): Float = when {\n x.isNaN() || x.isInfinite() -> x\n x > 0 -> floor(x)","completion":"else -> ceil(x)\n}\n\n\/**\n * Rounds the given value [x] towards the closest integer with ties rounded towards even integer.\n *\n * Special cases:\n * - `round(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n *\/\n@SinceKotlin(\"1.2\")<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression\nimport org.jetbrains.kotlin.fir.psi\nimport org.jetbrains.kotlin.fir.analysis.checkers.fullyExpandedClassId\nimport org.jetbrains.kotlin.fir.types.ConeFlexibleType","completion":"import org.jetbrains.kotlin.fir.types.classId\nimport org.jetbrains.kotlin.fir.types.isMarkedNullable\nimport org.jetbrains.kotlin.fir.types.resolvedType\nimport org.jetbrains.kotlin.name.ClassId\nimport org.jetbrains.kotlin.name.StandardClassIds<|endoftext|>"} {"prompt":"internal open class CategoryRangesWriter(protected val strategy: RangesWritingStrategy) : RangesWriter {\n\n override fun write(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) {\n beforeWritingRanges(writer)\n\n writeRangeStart(rangeStart, writer)\n writeRangeCategory(rangeCategory, writer)","completion":"writeInit(rangeStart, rangeEnd, rangeCategory, writer)\n\n afterWritingRanges(writer)\n }\n\n protected open fun beforeWritingRanges(writer: FileWriter) {\n strategy.beforeWritingRanges(writer)\n }\n\n protected open fun afterWritingRanges(writer: FileWriter) {\n strategy.afterWritingRanges(writer)\n\n writer.appendLine()<|endoftext|>"} {"prompt":"val LINEAR_MIPMAP_NEAREST: Int\n val NEAREST_MIPMAP_LINEAR: Int\n val LINEAR_MIPMAP_LINEAR: Int\n val TEXTURE_MAG_FILTER: Int\n val TEXTURE_MIN_FILTER: Int\n val TEXTURE_WRAP_S: Int\n val TEXTURE_WRAP_T: Int","completion":"val TEXTURE_2D: Int\n val TEXTURE: Int\n val TEXTURE_CUBE_MAP: Int\n val TEXTURE_BINDING_CUBE_MAP: Int\n val TEXTURE_CUBE_MAP_POSITIVE_X: Int\n val TEXTURE_CUBE_MAP_NEGATIVE_X: Int<|endoftext|>"} {"prompt":"+JsEnvironmentConfigurationDirectives.NO_COMMON_FILES\n }\n useAdditionalSourceProviders(::JsSteppingTestAdditionalSourceProvider)\n jsArtifactsHandlersStep {\n useHandlers(::JsDebugRunner.bind(false))\n }\n}\n\nfun TestConfigurationBuilder.configureJsTypeScriptExportTest() {\n defaultDirectives {","completion":"+JsEnvironmentConfigurationDirectives.GENERATE_DTS\n if (getBoolean(\"kotlin.js.updateReferenceDtsFiles\")) +JsEnvironmentConfigurationDirectives.UPDATE_REFERENCE_DTS_FILES\n }\n configureJsArtifactsHandlersStep {\n useHandlers(::JsDtsHandler)\n }\n}<|endoftext|>"} {"prompt":"\/\/ CHECK_BREAKS_COUNT: function=localWithoutCapture count=0 TARGET_BACKENDS=JS_IR\n\/\/ CHECK_LABELS_COUNT: function=localWithoutCapture name=$l$block count=0 TARGET_BACKENDS=JS_IR\ninternal fun localWithoutCapture(a: Int, b: Int): Int {\n var mult = 0\n\n repeatAction(a) {","completion":"inline fun inc(x: Int): Int {\n return x + 1\n }\n\n repeatAction(b) {\n mult = inc(mult)\n }\n }\n\n return mult\n}\n\n\/\/ CHECK_BREAKS_COUNT: function=localWithCapture count=0 TARGET_BACKENDS=JS_IR<|endoftext|>"} {"prompt":"\/\/ !DIAGNOSTICS:-USELESS_CAST\n\/\/ !MARK_DYNAMIC_CALLS\n\nfun test(d: dynamic) {\n d.onAnyVal\n d.onAnyVal = 1","completion":"d?.onAnyVal\n d?.onAnyVal = 1\n\n run {\n d!!.onAnyVal\n }\n run {<|endoftext|>"} {"prompt":"if (e != null) this.e.propNullableAny\n if (e != null) this.e.funT()","completion":"if (e != null) this.e.funAny()\n if (e != null) this.e.funNullableT()<|endoftext|>"} {"prompt":"var insnNode: AbstractInsnNode? = instructions.first\n while (insnNode != null) {\n if (isReturnOpcode(insnNode.opcode)) {\n val labelName = getMarkedReturnLabelOrNull(insnNode)\n val returnType = getReturnType(insnNode.opcode)\n\n val isLocalReturn = labelName == null || labelName in returnLabels","completion":"val jumpTarget = returnLabels[labelName] ?: endLabel\n\n if (isLocalReturn && labelName != null) {\n \/\/ remove non-local return flag\n instructions.remove(insnNode.previous)\n }\n\n if (isLocalReturn && jumpTarget != null) {<|endoftext|>"} {"prompt":"public operator fun JsArray.set(index: Int, value: T) {\n jsArraySet(this, index, value)\n}\n\n@Suppress(\"RedundantNullableReturnType\", \"UNUSED_PARAMETER\")\nprivate fun jsArrayGet(array: JsArray, index: Int): T? =","completion":"js(\"array[index]\")\n\n@Suppress(\"UNUSED_PARAMETER\")\nprivate fun jsArraySet(array: JsArray, index: Int, value: T) {\n js(\"array[index] = value\")\n}<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY","completion":"import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.BREAK_OR_CONTINUE_OUTSIDE_A_LOOP\nimport org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.BUILDER_INFERENCE_MULTI_LAMBDA_RESTRICTION<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.fir.analysis.jvm.checkers.declaration\n\nimport org.jetbrains.kotlin.builtins.StandardNames\nimport org.jetbrains.kotlin.descriptors.Modality\nimport org.jetbrains.kotlin.diagnostics.DiagnosticReporter\nimport org.jetbrains.kotlin.diagnostics.reportOn","completion":"import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind\nimport org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext\nimport org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker<|endoftext|>"} {"prompt":"if (!(4uL in 1uL..3uL) != !range0.contains(4uL)) throw AssertionError()\n if (!(4uL !in 1uL..3uL) != range0.contains(4uL)) throw AssertionError()\n \/\/ no local optimizations","completion":"if (element4 in 1uL..3uL != range0.contains(element4)) throw AssertionError()\n if (element4 !in 1uL..3uL != !range0.contains(element4)) throw AssertionError()\n if (!(element4 in 1uL..3uL) != !range0.contains(element4)) throw AssertionError()<|endoftext|>"} {"prompt":"val nativeTarget = metadata.projectTargets.single { it.platformType == \"native\" }\n assertEquals(\"org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithHostTests\", nativeTarget.target)\n val nativeExtras = assertNotNull(nativeTarget.extras.native)","completion":"assertEquals(\"linux_x64\", nativeExtras.konanTarget)\n assertEquals(\"1.5-dev-17775\", nativeExtras.konanVersion)\n assertEquals(\"1.4.2\", nativeExtras.konanAbiVersion)\n assertNull(nativeTarget.extras.android)\n assertNull(nativeTarget.extras.jvm)<|endoftext|>"} {"prompt":"e + (e - acc)\n }\n }\n\n expect(null, { arg1(\"\").reduceIndexedOrNull { _, _, _ -> '\\n' } })\n }\n\n @Test fun reduceRightIndexed() = withOneCharSequenceArg { arg1 ->\n \/\/ get the 3rd character","completion":"assertEquals('c', arg1(\"bacfd\").reduceRightIndexed { index, c, v -> if (index == 2) c else v })\n\n expect('c') {\n \"ab\".reduceRightIndexed { index, e, acc ->\n assertEquals(0, index)\n assertEquals('b', acc)\n assertEquals('a', e)<|endoftext|>"} {"prompt":"val prefix = (projectName + \"Project_\" + taskName + \"_\").takeUnless { shortenTempRootName }\n subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), prefix)\n systemProperty(\"java.io.tmpdir\", subProjectTempRoot.toString())\n }\n }\n\n val fs = project.serviceOf()\n doLast {","completion":"subProjectTempRoot?.let {\n try {\n fs.delete {\n delete(it)\n }\n } catch (e: Exception) {\n logger.warn(\"Can't delete test temp root folder $it\", e.printStackTrace())\n }\n }\n }\n\n if (parallel && jUnitMode != JUnitMode.JUnit5) {<|endoftext|>"} {"prompt":"if (v != null || this.v != null) v.funNullableAny()","completion":"if (v != null || this.v != null) v<|endoftext|>"} {"prompt":"val VAL_WITH_SETTER by error()\n val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error(PositioningStrategy.CONST_MODIFIER)\n val CONST_VAL_WITH_GETTER by error()","completion":"val CONST_VAL_WITH_DELEGATE by error()\n val TYPE_CANT_BE_USED_FOR_CONST_VAL by error(PositioningStrategy.CONST_MODIFIER) {\n parameter(\"constValType\")\n }<|endoftext|>"} {"prompt":"assertEquals(true, 65.0f == shortX.toFloat())\n assertEquals(true, 65L == shortX.toLong())\n assertEquals(true, 65 == shortX.toInt())\n assertEquals(true, 65.toShort() == shortX.toShort())\n assertEquals(true, 65.toByte() == shortX.toByte())","completion":"assertEquals(true, 'A' == shortX.toChar())\n\n val byteX: Byte = 65.toByte()\n assertEquals(true, 65.0 == byteX.toDouble())\n assertEquals(true, 65.0f == byteX.toFloat())\n assertEquals(true, 65L == byteX.toLong())<|endoftext|>"} {"prompt":"PropertyLine(line.split(\"; \").map { it.trim() })\n }\n\n val derivedCorePropertiesLines = readLines(derivedCorePropertiesUrl).filterNot(String::isEmptyOrComment).map { line ->\n PropertyLine(line.split(\"; \").map { it.trim() })\n }","completion":"val categoryRangesGenerators = mutableListOf()\n val otherLowercaseGenerators = mutableListOf()\n val otherUppercaseGenerators = mutableListOf()\n\n fun addRangesGenerators(generatedDir: File, target: KotlinTarget) {<|endoftext|>"} {"prompt":"package samples.random\n\nimport samples.*\nimport kotlin.math.sin\nimport kotlin.random.Random\nimport kotlin.test.assertTrue\n\nclass Randoms {\n @Sample\n fun defaultRandom() {\n val randomValues = List(10) { Random.nextInt(0, 100) }\n \/\/ prints new sequence every time\n println(randomValues)","completion":"val nextValues = List(10) { Random.nextInt(0, 100) }\n println(nextValues)\n assertTrue(randomValues != nextValues)\n }\n\n @Sample\n fun seededRandom() {\n fun getRandomList(random: Random): List =\n List(10) { random.nextInt(0, 100) }<|endoftext|>"} {"prompt":"OperatorNameConventions.GET_VALUE,\n Checks.memberOrExtension,\n Checks.noDefaultAndVarargs, Checks.ValueParametersCount.atLeast(2),\n Checks.isKProperty,\n Checks.nonSuspend,\n )\n checkFor(\n OperatorNameConventions.SET_VALUE,\n Checks.memberOrExtension,","completion":"Checks.noDefaultAndVarargs, Checks.ValueParametersCount.atLeast(3),\n Checks.isKProperty,\n Checks.nonSuspend,\n )\n checkFor(\n OperatorNameConventions.PROVIDE_DELEGATE,\n Checks.memberOrExtension,\n Checks.noDefaultAndVarargs, Checks.ValueParametersCount.exactly(2),<|endoftext|>"} {"prompt":"public open override fun subSequence(startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.CharSequence\n\n @kotlin.internal.IntrinsicConstEvaluation\n public open override fun toString(): kotlin.String\n\n public companion object of String {\n }\n}","completion":"@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS})\n@kotlin.annotation.Retention(value = AnnotationRetention.BINARY)\n@kotlin.SinceKotlin(version = \"1.8\")\n@kotlin.ExperimentalSubclassOptIn\npublic final annotation class SubclassOptInRequired : kotlin.Annotation {<|endoftext|>"} {"prompt":"val inv = ::bar3!!\n inv()\n }\n}\n\nfun poll73(): Flow {\n return flow {\n val inv = ::bar4!!\n inv\n }\n}","completion":"fun poll74(): Flow {\n return flow {\n val inv = ::bar5!!\n inv\n }\n}\n\nfun poll75(): Flow {\n return flow {<|endoftext|>"} {"prompt":"val x: Out = materializeOutOfAAndB() \/\/ OI: inferred type A is not a subtype of B; `F` is instantiated as `A`, so upper bounds was violated\n val y: Inv = materializeInvOfAAndB() \/\/ OI and NI: required B, found A","completion":"val z: Out = wrapAAndBToOut(a) \/\/ OI and NI: required B, found A\n}<|endoftext|>"} {"prompt":"\/\/ library.kt:27 box: xFoo$iv:int=1:int, $i$f$foo:int=0:int, xBar1\\5$iv:int=1:int, xBar2\\5$iv:int=2:int, xBar3\\5$iv:int=3:int, $i$f$bar\\5\\8:int=0:int,","completion":"xBaz1\\6$iv:int=100:int, xBaz2\\6$iv:int=101:int, xBaz3\\6$iv:int=102:int, $i$f$baz\\6\\46:int=0:int, $i$f$x2\\8\\51:int=0:int<|endoftext|>"} {"prompt":"getNonTrivialComputation(rightExpression, bindingTrace, moduleDescriptor) ?: return ConditionalDataFlowInfo.EMPTY\n\n val effects = EqualsFunctor(false).invokeWithArguments(leftComputation, rightComputation)\n\n val equalsContextInfo = InfoCollector(ESReturns(ESConstants.trueValue), builtIns).collectFromSchema(effects)","completion":"val notEqualsContextInfo = InfoCollector(ESReturns(ESConstants.falseValue), builtIns).collectFromSchema(effects)\n\n return ConditionalDataFlowInfo(\n equalsContextInfo.toDataFlowInfo(languageVersionSettings, builtIns),\n notEqualsContextInfo.toDataFlowInfo(languageVersionSettings, builtIns)\n )\n }<|endoftext|>"} {"prompt":"levelAdjustment = if (!flags.isInner && parentTypeParameterResolver != null) parentTypeParameterResolver.level + 1 else 0\n )\n\n val memberDeclarations = proto.declarationList.memoryOptimizedMapNotNull { declaration ->\n deserializeDeclaration(declaration, containingEntity = thisClassEntity, thisClassTypeParameterResolver)\n }\n\n return AbiClassImpl(","completion":"qualifiedName = qualifiedName,\n signatures = deserializeIdSignature(proto.base.symbol).toAbiSignatures(),\n annotations = annotations,\n modality = modality,\n kind = when (val kind = flags.kind) {\n ClassKind.CLASS -> AbiClassKind.CLASS\n ClassKind.INTERFACE -> AbiClassKind.INTERFACE<|endoftext|>"} {"prompt":"public inline val SelectionMode.Companion.PRESERVE: SelectionMode get() = \"preserve\".toJsString().unsafeCast()\n\n\/* please, don't implement this interface! *\/\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanvasFillRule : JsAny {\n companion object\n}","completion":"public inline val CanvasFillRule.Companion.NONZERO: CanvasFillRule get() = \"nonzero\".toJsString().unsafeCast()\n\npublic inline val CanvasFillRule.Companion.EVENODD: CanvasFillRule get() = \"evenodd\".toJsString().unsafeCast()\n\n\/* please, don't implement this interface! *\/<|endoftext|>"} {"prompt":"\"allExceptVarargConversionInlineReified\" to allExceptVarargConversion(::inlineReifiedF),\n \"allExceptDefaultConversionInlineReified\" to allExceptDefaultConversion(::inlineReifiedF),\n \"allConversionsInlineReified\" to allConversions(::inlineReifiedF),\n )\n\n for ((name1, ref1) in allRefs) {","completion":"for ((name2, ref2) in allRefs) {\n if (name1 != name2) {\n if (ref1 == ref2) {\n return \"$name1 and $name2 wrappers should not be equal\"\n }\n }\n }\n }\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"expectFailure(linkage(\"Reference to class 'ClassThatBecomesPrivate' can not be evaluated: Private class declared in module can not be accessed in module \")) { getAnnotationClassWithParameterOfParameterThatBecomesPrivate2() }","completion":"expectFailure(linkage(\"Reference to class 'ClassThatBecomesPrivate' can not be evaluated: Private class declared in module can not be accessed in module \")) { getAnnotationClassWithParameterOfParameterThatBecomesPrivate2Inline() }<|endoftext|>"} {"prompt":"fun render(effectDeclaration: FirEffectDeclaration) {\n printer.newLine()\n printer.println(\"[Effect declaration] <\")\n effectDeclaration.effect.accept(this, null)\n printer.println()\n printer.println(\">\")\n }\n\n internal fun render(legacyRawContractDescription: FirLegacyRawContractDescription) {","completion":"printer.renderInBraces(\"<\", \">\") {\n legacyRawContractDescription.contractCall.accept(visitor)\n printer.newLine()\n }\n }\n\n internal fun render(rawContractDescription: FirRawContractDescription) {\n printer.renderInBraces(\"<\", \">\") {<|endoftext|>"} {"prompt":"assertEquals(30L, 10L + 20.toByte())\n\n assertEquals(30.0, 20.0 + 10L)\n assertEquals(30.0f, 20.0f + 10L)\n assertEquals(20L, 10 + 10L)\n assertEquals(20L, 10.toShort() + 10L)","completion":"assertEquals(20L, 10.toByte() + 10L)\n\n assertEquals(20L, 30 - 10L)\n\n assertEquals(100L, 10 * 10L)\n assertEquals(100.0, 10.0 * 10L)\n\n assertEquals(100L, 10L * 10)\n assertEquals(100.0, 10L * 10.0)<|endoftext|>"} {"prompt":"val dummyArgumentExpressions = dummyExpressionFactory.createDummyExpressions(parameters.size)\n\n val bindingTrace = DelegatingBindingTrace(\n bindingContext, \"Temporary trace for filtering shadowed declarations\",\n filter = NO_DIAGNOSTICS\n )\n for ((expression, parameter) in dummyArgumentExpressions.zip(parameters)) {","completion":"bindingTrace.recordType(expression, parameter.varargElementType ?: parameter.type)\n bindingTrace.record(BindingContext.PROCESSED, expression, true)\n }\n\n val firstVarargIndex = parameters.withIndex().firstOrNull { it.value.varargElementType != null }?.index\n val useNamedFromIndex =<|endoftext|>"} {"prompt":"if (-1 in 3..1 != range1.contains(-1)) throw AssertionError()\n if (-1 !in 3..1 != !range1.contains(-1)) throw AssertionError()\n if (!(-1 in 3..1) != !range1.contains(-1)) throw AssertionError()","completion":"if (!(-1 !in 3..1) != range1.contains(-1)) throw AssertionError()\n \/\/ no local optimizations\n if (element2 in 3..1 != range1.contains(element2)) throw AssertionError()\n if (element2 !in 3..1 != !range1.contains(element2)) throw AssertionError()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource\n\n@FirBuilderDsl\ninterface FirVariableBuilder : FirDeclarationBuilder {\n abstract override var source: KtSourceElement?\n abstract override var resolvePhase: FirResolvePhase\n abstract override val annotations: MutableList","completion":"abstract override var moduleData: FirModuleData\n abstract override var origin: FirDeclarationOrigin\n abstract override var attributes: FirDeclarationAttributes\n abstract var status: FirDeclarationStatus\n abstract var returnTypeRef: FirTypeRef\n abstract var receiverParameter: FirReceiverParameter?\n abstract var deprecationsProvider: DeprecationsProvider\n abstract var containerSource: DeserializedContainerSource?<|endoftext|>"} {"prompt":"reporter.reportOn(superTypeRef.source, FirErrors.CLASS_INHERITS_JAVA_SEALED_CLASS, context)\n continue\n }\n val superClassPackage = superClass.classId.packageFqName\n if (superClassPackage != subclassPackage) {","completion":"reporter.reportOn(superTypeRef.source, FirErrors.SEALED_INHERITOR_IN_DIFFERENT_PACKAGE, context)\n }\n if (superClass.moduleData != declaration.moduleData && !superClass.isExpect) {<|endoftext|>"} {"prompt":"* Returns `this` value if it _does not_ satisfy the given [predicate] or `null`, if it does.\n *\n * For detailed usage information see the documentation for [scope functions](https:\/\/kotlinlang.org\/docs\/reference\/scope-functions.html#takeif-and-takeunless).\n *\/\n@kotlin.internal.InlineOnly\n@SinceKotlin(\"1.1\")","completion":"public inline fun T.takeUnless(predicate: (T) -> Boolean): T? {\n contract {\n callsInPlace(predicate, InvocationKind.EXACTLY_ONCE)\n }\n return if (!predicate(this)) this else null\n}\n\n\/**\n * Executes the given function [action] specified number of [times].\n *<|endoftext|>"} {"prompt":"LLVMWriteBitcodeToFile(llvmModule, outputFile.canonicalPath)\n}\n\ninternal val CheckExternalCallsPhase = createSimpleNamedCompilerPhase(\n name = \"CheckExternalCalls\",\n description = \"Check external calls\",\n postactions = getDefaultLlvmModuleActions(),\n) { context, _ ->","completion":"checkLlvmModuleExternalCalls(context)\n}\n\ninternal val RewriteExternalCallsCheckerGlobals = createSimpleNamedCompilerPhase(\n name = \"RewriteExternalCallsCheckerGlobals\",\n description = \"Rewrite globals for external calls checker after optimizer run\",\n postactions = getDefaultLlvmModuleActions(),<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.resolve.calls.inference.BuilderInferenceSession\nimport org.jetbrains.kotlin.resolve.calls.inference.ComposedSubstitutor\nimport org.jetbrains.kotlin.resolve.calls.inference.components.EmptySubstitutor","completion":"import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor\nimport org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutorByConstructorMap\nimport org.jetbrains.kotlin.resolve.calls.model.*<|endoftext|>"} {"prompt":"CompilerSystemProperties.COMPILE_DAEMON_LOG_PATH_PROPERTY.value?.let { opts.jvmParams.add(\"D${CompilerSystemProperties.COMPILE_DAEMON_LOG_PATH_PROPERTY.property}=\\\"$it\\\"\") }","completion":"CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.value?.let { opts.jvmParams.add(\"D${CompilerSystemProperties.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY.property}\") }\n }<|endoftext|>"} {"prompt":"public inline fun kotlin.UByteArray.onEachIndexed(action: (index: kotlin.Int, kotlin.UByte) -> kotlin.Unit): kotlin.UByteArray\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly","completion":"public inline fun kotlin.UIntArray.onEachIndexed(action: (index: kotlin.Int, kotlin.UInt) -> kotlin.Unit): kotlin.UIntArray\n\n@kotlin.SinceKotlin(version = \"1.4\")\n@kotlin.ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly<|endoftext|>"} {"prompt":"package org.jetbrains.kotlin.backend.jvm.intrinsics\n\nimport org.jetbrains.kotlin.backend.jvm.codegen.ClassCodegen\nimport org.jetbrains.kotlin.builtins.StandardNames.COLLECTIONS_PACKAGE_FQ_NAME\nimport org.jetbrains.kotlin.codegen.AsmUtil","completion":"import org.jetbrains.kotlin.fileClasses.internalNameWithoutInnerClasses\nimport org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression\nimport org.jetbrains.kotlin.name.Name\nimport org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType<|endoftext|>"} {"prompt":"\"https:\/\/maven.pkg.jetbrains.space\/kotlin\/p\/kotlin\/eap\", root,\n setOf(\"repo\/scripts\/cache-redirector.settings.gradle.kts\")\n ),\n RepoAllowList(","completion":"\"https:\/\/cache-redirector.jetbrains.com\/maven.pkg.jetbrains.space\/kotlin\/p\/kotlin\/dev\", root,\n setOf(\"repo\/scripts\/cache-redirector.settings.gradle.kts\")\n ),\n RepoAllowList(\n \"kotlin\/ktor\", root,<|endoftext|>"} {"prompt":"useDirectives(Directives)\n }\n }\n\n override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {\n val provider = FileBasedKotlinDeclarationProvider(mainFile)\n assertContains(provider.findFilesForFacadeByPackage(mainFile.packageFqName), mainFile)","completion":"checkByDirectives(testServices.moduleStructure, provider)\n checkByVisitor(mainFile, provider)\n }\n\n private fun checkByDirectives(moduleStructure: TestModuleStructure, provider: FileBasedKotlinDeclarationProvider) {\n for (directive in moduleStructure.allDirectives[Directives.CLASS]) {\n val classId = ClassId.fromString(directive)<|endoftext|>"} {"prompt":"c, d, e)","completion":"} } } } }<|endoftext|>"} {"prompt":"}\n\n @Test\n fun testValuesGenerics() {\n Assumptions.assumeTrue(targets.testTarget.family.isAppleFamily)\n val testName = \"values_generics\"\n\n val testCase = generateObjCFrameworkTestCase(\n TestKind.STANDALONE_NO_TR, extras, \"ValuesGenerics\",\n listOf(","completion":"testSuiteDir.resolve(testName).resolve(\"$testName.kt\"),\n testSuiteDir.resolve(\"objcexport\/values.kt\"),\n ),\n freeCompilerArgs = TestCompilerArgs(listOf(\"-opt-in=kotlinx.cinterop.ExperimentalForeignApi\"))\n )<|endoftext|>"} {"prompt":"@Suppress(\"MUST_BE_INITIALIZED\")\nprivate var symbolMap: dynamic\n\nprivate fun getSymbolWeakMap(): dynamic {\n if (symbolWeakMap === VOID) {\n symbolWeakMap = js(\"new WeakMap()\")\n }\n return symbolWeakMap\n}\n\nprivate fun getSymbolMap(): dynamic {\n if (symbolMap === VOID) {","completion":"symbolMap = js(\"new Map()\")\n }\n return symbolMap\n}\n\n@Suppress(\"UNUSED_PARAMETER\")\nprivate fun symbolIsSharable(symbol: dynamic) = js(\"Symbol.keyFor(symbol)\") != VOID\n\nprivate fun getSymbolHashCode(value: dynamic): Int {<|endoftext|>"} {"prompt":"package kotlin\n\n\/**\n * Returns the detailed description of this throwable with its stack trace.\n *\n * The detailed description includes:\n * - the short description (see [Throwable.toString]) of this throwable;\n * - the complete stack trace;\n * - detailed descriptions of the exceptions that were [suppressed][suppressedExceptions] in order to deliver this exception;","completion":"* - the detailed description of each throwable in the [Throwable.cause] chain.\n *\/\n@SinceKotlin(\"1.4\")\npublic actual fun Throwable.stackTraceToString(): String = ExceptionTraceBuilder().buildFor(this)\n\n\/**\n * Prints the [detailed description][Throwable.stackTraceToString] of this throwable to console error output.\n *\/<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.IGNORE_LEAKED_INTERNAL_TYPES\nimport org.jetbrains.kotlin.test.directives.model.DirectivesContainer\nimport org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact","completion":"import org.jetbrains.kotlin.test.model.TestModule\nimport org.jetbrains.kotlin.test.services.TestServices\n\nclass FirResolvedTypesVerifier(testServices: TestServices) : FirAnalysisHandler(testServices, failureDisablesNextSteps = true) {\n override val directiveContainers: List<|endoftext|>"} {"prompt":"if (funWithReturnsNotNull(value_1 != null) == null) println(value_1.length)\n if (funWithReturnsNotNullAndInvertCondition(value_1 == null) == null) println(value_1.length)","completion":"if (funWithReturnsNull(value_1 != null) != null) println(value_1.length)\n if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1.length)\n}\n\n\/\/ TESTCASE NUMBER: 10<|endoftext|>"} {"prompt":"typeOf(),\n typeOf(),\n possibleValues = listOf(\n K2JsArgumentConstants.SOURCE_MAP_SOURCE_CONTENT_NEVER,\n K2JsArgumentConstants.SOURCE_MAP_SOURCE_CONTENT_ALWAYS,\n K2JsArgumentConstants.SOURCE_MAP_SOURCE_CONTENT_INLINING","completion":").map { \"\\\"$it\\\"\" },\n fromKotlinOptionConverterProp = \"\"\"\n this?.let { ${typeOf()}.fromMode(it) }\n \"\"\".trimIndent(),\n toKotlinOptionConverterProp = \"\"\"\n this?.mode\n \"\"\".trimIndent()\n )<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.test.services.assertions\n\nabstract class AbstractAnalysisApiExpressionPsiTypeProviderTest : AbstractAnalysisApiBasedTest() {\n override fun doTestByMainFile(mainFile: KtFile, mainModule: KtTestModule, testServices: TestServices) {","completion":"val declarationAtCaret = when (val element = testServices.expressionMarkerProvider.getSelectedElement(mainFile)) {\n is KtExpression -> element\n is KtValueArgument -> element.getArgumentExpression()!!\n else -> error(\"Unexpected element: $element of ${element::class}\")\n }<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.declarations.*\nimport org.jetbrains.kotlin.fir.resolve.ResolutionMode\nimport org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirAbstractBodyResolveTransformerDispatcher\nimport org.jetbrains.kotlin.fir.visitors.transformSingle","completion":"internal sealed class LLFirAbstractBodyTargetResolver(\n resolveTarget: LLFirResolveTarget,\n resolvePhase: FirResolvePhase,\n protected val llImplicitBodyResolveComputationSession: LLImplicitBodyResolveComputationSession = LLImplicitBodyResolveComputationSession(),\n) : LLFirTargetResolver(resolveTarget, resolvePhase) {<|endoftext|>"} {"prompt":"if (!(element0 !in 3L until 1L) != range1.contains(element0)) throw AssertionError()\n}\n\nfun testR1xE1() {\n \/\/ with possible local optimizations\n if ((-1).toShort() in 3L until 1L != range1.contains((-1).toShort())) throw AssertionError()","completion":"if ((-1).toShort() !in 3L until 1L != !range1.contains((-1).toShort())) throw AssertionError()\n if (!((-1).toShort() in 3L until 1L) != !range1.contains((-1).toShort())) throw AssertionError()<|endoftext|>"} {"prompt":"import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind\nimport org.jetbrains.kotlin.fir.resolve.fullyExpandedType\nimport org.jetbrains.kotlin.fir.resolve.toFirRegularClassSymbol\nimport org.jetbrains.kotlin.fir.resolve.withCombinedAttributesFrom","completion":"import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol\nimport org.jetbrains.kotlin.fir.types.*\nimport org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl\nimport org.jetbrains.kotlin.fir.utils.exceptions.withConeTypeEntry<|endoftext|>"} {"prompt":"fun T.case_11_1(): Boolean? {\n contract { returns(null) implies (this@case_11_1 != null) }\n return if (this@case_11_1 != null) null else true\n}\nfun T.case_11_2(): Boolean? {\n contract { returns(null) implies (this@case_11_2 != null) }","completion":"return if (this@case_11_2 != null) null else true\n}\n\n\/\/ FILE: main.kt\n\nimport contracts.*\n\n\/\/ TESTCASE NUMBER: 1\nfun case_1(value_1: Any?) {\n value_1.case_1()<|endoftext|>"} {"prompt":"fun testUnreachableExtensionValPropertyDeclaration() {\n val (output, exitCode) = compileKotlin(\"source.kt\", tmpdir, expectedFileName = null)\n assertEquals(\"Output:\\n$output\", ExitCode.COMPILATION_ERROR, exitCode)\n }\n\n fun testAnonymousObjectTypeMetadata() = doTestAnonymousObjectTypeMetadata()","completion":"fun testAnonymousObjectTypeMetadataKlib() = doTestAnonymousObjectTypeMetadata(listOf(\"-Xmetadata-klib\"))\n\n \/**\n * This test does exactly the same as [testAnonymousObjectTypeMetadataKlib] but using the old (now deprecated)\n * CLI argument `-Xexpect-actual-linker` instead of its successor `-Xmetadata-klib`.\n *<|endoftext|>"} {"prompt":"if (fnNStr.invoke(NStr(\"nstr\")).string != \"nstr\") throw AssertionError()\n\n val fnNStr2: (NStr2) -> NStr2 = ::fooNStr2\n if (fnNStr2.invoke(NStr2(null)).string != null) throw AssertionError()","completion":"if (fnNStr2.invoke(NStr2(\"nstr2\")).string != \"nstr2\") throw AssertionError()\n\n return \"OK\"\n}<|endoftext|>"} {"prompt":"return getFunctionalClassKindWithArity(packageFqName, className)?.kind\n }\n\n fun getFunctionalClassKindWithArity(packageFqName: FqName, className: String): KindWithArity? {\n val kinds = knownKindsByPackageFqName[packageFqName] ?: return null\n for (kind in kinds) {","completion":"if (!className.startsWith(kind.classNamePrefix)) continue\n val arity = toInt(className.substring(kind.classNamePrefix.length)) ?: continue\n return KindWithArity(kind, arity)\n }\n return null\n }\n\n fun hasKindWithSpecificPackage(packageFqName: FqName): Boolean {<|endoftext|>"} {"prompt":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) constructor()\n}\ninline fun TestInlineFunctionVsConstructor() {}\n\nclass TestInlineFunctionVsConstructorReverse {","completion":"constructor()\n}\n@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) inline fun TestInlineFunctionVsConstructorReverse() {}\n\n\nclass TestTailrecFunctionVsConstructor {<|endoftext|>"} {"prompt":"fun localFun() = x\n y3 = localFun()\n }\n\n fun method() = x\n val y4 = method()\n\n val anonObject = object {\n override fun toString() = x\n }\n val y5 = anonObject.toString()\n\n init {\n assertEquals(x, y1)\n assertEquals(x, y2)","completion":"assertEquals(x, y3)\n assertEquals(x, y4)\n assertEquals(x, y5)\n }\n }\n}\n\nfun box() = Test.x + Anno.x<|endoftext|>"} {"prompt":"if (!descriptor.isTopLevelInPackage(\"contains\", \"kotlin.ranges\")) return false\n\n val extensionReceiverType = descriptor.extensionReceiverParameter?.type ?: return false\n\n val rangeElementType = getRangeOrProgressionElementType(extensionReceiverType) ?: return false\n if (!isPrimitiveNumberType(rangeElementType)) return false","completion":"val argumentType = descriptor.valueParameters.singleOrNull()?.type ?: return false\n if (!isPrimitiveNumberType(argumentType)) return false\n\n return true\n}\n\nfun isPrimitiveProgressionReverse(descriptor: CallableDescriptor) =\n descriptor.isTopLevelExtensionOnType(\"reversed\", \"kotlin.ranges\") {<|endoftext|>"} {"prompt":"import kotlin.io.path.*\nimport kotlin.test.assertContains\nimport kotlin.test.assertEquals\nimport kotlin.test.assertTrue\n\n@OsCondition(supportedOn = [OS.MAC], enabledOnCI = [OS.MAC])\n@DisplayName(\"CocoaPods plugin tests\")\n@NativeGradlePluginTests","completion":"@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_0)\n@OptIn(EnvironmentalVariablesOverride::class)\nclass CocoaPodsIT : KGPBaseTest() {\n\n private val podfileImportPodPlaceholder = \"#import_pod_directive\"\n\n private val cocoapodsSingleKtPod = \"native-cocoapods-single\"<|endoftext|>"} {"prompt":"scope: IrDeclaration,\n ) = onLambda(argument, callee, parameter, scope)\n },\n null,\n)\n\n\/**\n * Runs [IrInlineScopeResolver] on this [IrFile] and returns the scope resolver instance.\n *\/\nfun IrFile.findInlineCallSites(context: JvmBackendContext) =","completion":"IrInlineScopeResolver(context).apply { accept(this, null) }<|endoftext|>"} {"prompt":"\/*\n * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)\n *\n * SPEC VERSION: 0.1-100\n * MAIN LINK: expressions, constant-literals, integer-literals, hexadecimal-integer-literals -> paragraph 1 -> sentence 2\n * NUMBER: 4\n * DESCRIPTION: Hexadecimal integer literals with an underscore in the last position.\n *\/","completion":"\/\/ TESTCASE NUMBER: 1\nval value_1 = 0x3_4_5_6_7_8_____\n\n\/\/ TESTCASE NUMBER: 2\nval value_2 = 0X4_______5_______6_______7_\n\n\/\/ TESTCASE NUMBER: 3<|endoftext|>"} {"prompt":"override fun acceptChildren(visitor: FirVisitor, data: D) {}\n\n override fun transformChildren(transformer: FirTransformer, data: D): FirDeclarationStatusImpl {\n return this\n }\n\n fun resolved(\n visibility: Visibility,\n modality: Modality,\n effectiveVisibility: EffectiveVisibility","completion":"): FirResolvedDeclarationStatusImpl {\n return FirResolvedDeclarationStatusImpl(visibility, modality, effectiveVisibility, flags)\n }\n}\n\n@OptIn(FirImplementationDetail::class)\nval FirDeclarationStatus.modifiersRepresentation: Any\n get() = when (this) {\n is FirDeclarationStatusImpl -> rawFlags<|endoftext|>"} {"prompt":"changedFiles.forEach { configuration.report(CompilerMessageSeverity.LOGGING, \" $it\") }\n\n val dirtyFiles = mutableSetOf()\n\n fun dfs(libraryFile: LibraryFile) {\n dirtyFiles += libraryFile\n reversedPerFileDependencies[libraryFile]?.forEach {\n if (it !in dirtyFiles) dfs(it)","completion":"}\n }\n\n removedFiles.forEach {\n if (it !in dirtyFiles) dfs(it)\n }\n changedFiles.forEach {\n if (it !in dirtyFiles) dfs(it)\n }\n dirtyFiles.addAll(addedFiles)\n\n removedFiles.forEach {\n dirtyFiles.remove(it)<|endoftext|>"} {"prompt":"file?.let(visitor::visitFile)\n }\n}\n\ninternal class KlibClassExtension : KlibClassExtensionVisitor(), KmClassExtension {\n\n val annotations: MutableList = mutableListOf()\n val enumEntries: MutableList = mutableListOf()\n var uniqId: UniqId? = null","completion":"var file: KlibSourceFile? = null\n\n override fun visitAnnotation(annotation: KmAnnotation) {\n annotations += annotation\n }\n\n override fun visitUniqId(uniqId: UniqId) {\n this.uniqId = uniqId\n }\n\n override fun visitFile(file: KlibSourceFile) {\n this.file = file\n }<|endoftext|>"} {"prompt":"class M {\n operator fun Int.component1() = this + 1\n operator fun Int.component2() = this + 2\n}\n\nfun M.doTest(): String {\n var s = \"\"\n for ((a, b) in 0.rangeTo(2)) {\n s += \"$a:$b;\"\n }\n return s\n}\n\nfun box(): String {\n val s = M().doTest()","completion":"return if (s == \"1:2;2:3;3:4;\") \"OK\" else \"fail: $s\"\n}<|endoftext|>"} {"prompt":"actualAsInner.append(n.toString() + \" \")\n }\n\n if (actualAsInt.toString() != resultAsInt) {\n throw IllegalStateException(\"wrong result as int (actual): $actualAsInt ; expected: $resultAsInt\")\n }\n\n if (actualAsInner.toString() != resultAsInner) {","completion":"throw IllegalStateException(\"wrong result as inner (actual): $actualAsInner ; expected: $resultAsInner\")\n }\n}\n\nfun box(): String {\n val a1 = uIntArrayOf(1, 2, 3)\n a1.quickSort()\n\n check(a1, \"1 2 3 \", \"1 2 3 \")\n\n val a2 = uIntArrayOf(-1)<|endoftext|>"} {"prompt":"var hit = false\n call { hit = true; false }\n return hit\n }\n}\n\nclass ShouldBeEnabled : Checker {\n override fun checkTrue(): Boolean {\n var hit = false\n call { hit = true; true }\n return hit\n }\n\n override fun checkFalse(): Boolean {\n var hit = false\n call { hit = true; false }\n return hit","completion":"}\n}\n\nfun setDesiredAssertionStatus(v: Boolean): Checker {\n val loader = Checker::class.java.classLoader\n loader.setDefaultAssertionStatus(v)\n val c = loader.loadClass(if (v) \"ShouldBeEnabled\" else \"ShouldBeDisabled\")\n return c.newInstance() as Checker\n}\n\nfun box(): String {<|endoftext|>"} {"prompt":"* Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].","completion":"* - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n *\/\npublic expect fun LongArray.copyOf(newSize: Int): LongArray\n\n\/**<|endoftext|>"} {"prompt":"isExpect: Boolean = baseFunction.isExpect,\n callableCopySubstitutionForTypeUpdater: DeferredCallableCopyReturnType?,\n origin: FirDeclarationOrigin.SubstitutionOverride,\n ): FirSimpleFunction {\n \/\/ TODO: consider using here some light-weight functions instead of pseudo-real FirMemberFunctionImpl\n \/\/ As second alternative, we can invent some light-weight kind of FirRegularClass","completion":"return createCopyForFirFunction(\n fakeOverrideSymbol,\n baseFunction,\n derivedClassLookupTag = derivedClassLookupTag,\n session,\n origin,\n isExpect,\n newDispatchReceiverType,\n newParameterTypes,\n newTypeParameters,\n newReceiverType,\n newContextReceiverTypes,\n newReturnType,<|endoftext|>"} {"prompt":"upperMain.onlyNativeDistributionDependencies(konanDataDirProperty).assertNotEmpty()\n\n val commonMain = getCommonizerDependencies(\"commonMain\")\n commonMain.withoutNativeDistributionDependencies(konanDataDirProperty).assertDependencyFilesMatches(\".*cinterop-dummy\")","completion":"commonMain.onlyNativeDistributionDependencies(konanDataDirProperty).assertNotEmpty()\n }\n\n build(\":compileCommonMainKotlinMetadata\")\n\n build(\":compileUpperMainKotlinMetadata\")\n }\n }\n\n @DisplayName(\"KT-47641 commonizing c-interops does not depend on any source compilation\")\n @GradleTest<|endoftext|>"} {"prompt":"* MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 4\n * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6\n * NUMBER: 4","completion":"* DESCRIPTION: Top-level non-extension functions named f: callables implicitly imported into the current file;\n *\/\n\n\/\/ FILE: TestCase1.kt\n\/\/ TESTCASE NUMBER: 1\n\npackage tests.case1\n\nimport lib.case1.*\n\ninterface I\n\/\/class A : I\nclass B : I\n\nfun case1(){<|endoftext|>"} {"prompt":"\"LATEINIT_NULLABLE_BACKING_FIELD\",\n \"BACKING_FIELD_FOR_DELEGATED_PROPERTY\",\n \"PROPERTY_MUST_HAVE_GETTER\",\n \"PROPERTY_MUST_HAVE_SETTER\",\n \"EXPLICIT_BACKING_FIELD_IN_INTERFACE\",","completion":"\"EXPLICIT_BACKING_FIELD_IN_ABSTRACT_PROPERTY\",\n \"EXPLICIT_BACKING_FIELD_IN_EXTENSION\",\n \"ABSTRACT_PROPERTY_IN_PRIMARY_CONSTRUCTOR_PARAMETERS\",\n \"LOCAL_VARIABLE_WITH_TYPE_PARAMETERS\",<|endoftext|>"} {"prompt":"* [ComposerParamTransformer] or it still has the @Composable annotation which\n * can be because it is external and hasn't been transformed as the symbol remapper\n * only remaps what is referenced as a symbol this method might not have been\n * referenced directly in this module.\n *\/\n private val IrFunction.isComposable get() =","completion":"valueParameters.any { it.name == KtxNameConventions.COMPOSER_PARAMETER } ||\n annotations.hasAnnotation(ComposeFqNames.Composable)\n\n private val IrType.isSamComposable get() =\n samOwnerOrNull()?.isComposable == true\n\n private val IrType.isComposableLambda get() =<|endoftext|>"} {"prompt":"lazyResolveToPhase(FirResolvePhase.BODY_RESOLVE)\n return fir.hasBackingField\n }\n\nfun FirDeclaration.getDanglingTypeConstraintsOrEmpty(): List {\n return when (this) {\n is FirRegularClass -> danglingTypeConstraints\n is FirSimpleFunction -> danglingTypeConstraints","completion":"is FirProperty -> danglingTypeConstraints\n else -> null\n } ?: emptyList()\n}\n\nval FirPropertySymbol.correspondingValueParameterFromPrimaryConstructor: FirValueParameterSymbol?\n get() = fir.correspondingValueParameterFromPrimaryConstructor\n\nval FirProperty.correspondingValueParameterFromPrimaryConstructor: FirValueParameterSymbol?\n get() {<|endoftext|>"} {"prompt":"\/\/ \"⧄\" to 10692,\n\/\/ \"/\" to 47,\n\/\/ \"𝕊\" to 120138,\n\/\/ \"𝕤\" to 120164,\n\/\/ \"♠\" to 9824,\n\/\/ \"♠\" to 9824,\n\/\/ \"∥\" to 8741,\n\/\/ \"⊓\" to 8851,","completion":"\/\/ \"⊓︀\" to 8851,\n\/\/ \"⊔\" to 8852,\n\/\/ \"⊔︀\" to 8852,\n\/\/ \"√\" to 8730,\n\/\/ \"⊏\" to 8847,\n\/\/ \"⊑\" to 8849,\n\/\/ \"⊏\" to 8847,<|endoftext|>"} {"prompt":"buildJvm\n .map { jvm ->\n jvm.javaVersion\n ?: throw GradleException(\n \"Kotlin could not get java version for the JDK installation: \" +\n jvm.javaHome?.let { \"'$it' \" }.orEmpty()\n )\n }\n )\n .chainedFinalizeValueOnRead()\n\n @get:Internal","completion":"internal val javaExecutable: RegularFileProperty = objects\n .fileProperty()\n .value(\n buildJvm.flatMap { jvm ->\n projectLayout.file(\n objects.property(\n jvm.javaExecutable\n ?: throw GradleException(\n \"Kotlin could not find 'java' executable in the JDK installation: \" +<|endoftext|>"} {"prompt":"if (!original.isEnhanceable()) {\n return original\n }\n\n val firMethod = original.fir\n val enhancedParameters = enhanceTypeParameterBoundsForMethod(firMethod)\n return enhanceMethod(\n firMethod,\n original.callableId,\n name,\n enhancedParameters,\n original is FirIntersectionOverrideFunctionSymbol,\n precomputedOverridden\n )","completion":"}\n\n private fun FirCallableSymbol<*>.isEnhanceable(): Boolean {\n return origin is FirDeclarationOrigin.Java || isEnhanceableIntersection()\n }\n\n \/**\n * Intersection overrides with Java and Kotlin overridden symbols need to be enhanced so that we get non-flexible types\n * in the signature.<|endoftext|>"} {"prompt":"if (first.keyAt(i) != second.keyAt(i)) return false\n if (first.valueAt(i) != second.valueAt(i)) return false\n }\n\n return true\n}\n\nprivate fun compareSparseArrays(first: SparseArray<*>?, second: SparseArray<*>?): Boolean {\n if (first === second) return true","completion":"if (first == null || second == null) return false\n if (first.size() != second.size()) return false\n\n for (i in 0 until first.size()) {\n if (first.keyAt(i) != second.keyAt(i)) return false\n if (first.valueAt(i) != second.valueAt(i)) return false\n }\n\n return true\n}<|endoftext|>"} {"prompt":"abstract class Test11 : IInt, IStr by CStr(), IAny by CAny()","completion":"abstract class Test12 : IInt, IStr, IAny by CAny()<|endoftext|>"} {"prompt":"$this$mapTo\\88:java.lang.Object[]=java.lang.Integer[], destination\\88:java.util.Collection=java.util.ArrayList, $i$f$mapTo\\88\\553:int=0:int","completion":"\/\/ _Arrays.kt:... box: $i$f$foo\\56\\65:int=0:int, array\\56:java.lang.Integer[]=java.lang.Integer[], myClass\\56:MyClass=MyClass, $this$map\\87:java.lang.Object[]=java.lang.Integer[], $i$f$map\\87\\552:int=0:int,<|endoftext|>"} {"prompt":"\"ALWAYS\", null -> NullabilityQualifier.NOT_NULL\n \"MAYBE\", \"NEVER\" -> NullabilityQualifier.NULLABLE\n \"UNKNOWN\" -> NullabilityQualifier.FORCE_FLEXIBILITY\n else -> return null\n }\n else -> return null\n }\n return NullabilityQualifierWithMigrationStatus(nullability, reportLevel.isWarning || forceWarning)\n }","completion":"private companion object {\n val JAVA_APPLICABILITY_TYPES = mutableMapOf().apply {\n for (type in AnnotationQualifierApplicabilityType.values()) {\n getOrPut(type.javaTarget) { type }\n }\n }\n }\n}<|endoftext|>"} {"prompt":"}\n\n \/\/ not nullable variable\n val en1: Any = En.A\n if (en1 is En) {\n when (en1) {\n En.A -> {}\n En.B -> {}\n En.\u0421 -> {}\n }\n }\n}\n\nenum class En2 { D, E, F }","completion":"fun useEn(x: En) = x\nfun useEn2(x: En2) = x\n\nfun bar(x: Any) {\n if (x is En && x is En2) {\n when (x) {<|endoftext|>"} {"prompt":"value_1 is Any -> {}\n }\n}\n\n\/*\n * TESTCASE NUMBER: 8\n * NOTE: for a potential analysys of exhaustiveness by enums in whens without a bound value.\n *\/\nfun case_8(value_1: SealedClass) {\n when {\n value_1 is SealedChild1 -> {}","completion":"value_1 is SealedChild2 -> {}\n value_1 is SealedChild3 -> {}\n }\n}\n\n\/\/ TESTCASE NUMBER: 9\nfun case_9(value_1: Int, value_2: IntRange) {\n when {\n value_1 in -10..100L -> {}\n value_1 in value_2 -> {}<|endoftext|>"} {"prompt":"require(complexInlineFun(2.0, DPoint(3.0, 5.0), a4 = DPoint(11.0, 13.0)) == \"2.0, ${DPoint(3.0, 5.0)}, 30.0, ${DPoint(11.0, 13.0)}\") {","completion":"complexInlineFun(2.0, DPoint(3.0, 5.0), a4 = DPoint(11.0, 13.0))\n }<|endoftext|>"} {"prompt":"* The list of actual script implicit receiver object, in the same order as specified in {@link ScriptCompilationConfigurationKeys#implicitReceivers}\n *\/\nval ScriptEvaluationConfigurationKeys.implicitReceivers by PropertiesCollection.key>()\n\n\/**\n * The map of names to actual provided properties objects, according to the properties specified in\n * {@link ScriptCompilationConfigurationKeys#providedProperties}\n *\/","completion":"val ScriptEvaluationConfigurationKeys.providedProperties by PropertiesCollection.key>() \/\/ external variables\n\n\/**\n * The link to the actual {@link ScriptCompilationConfiguration} object that contains properties used for compiling the script\n *\/\nval ScriptEvaluationConfigurationKeys.compilationConfiguration by PropertiesCollection.key(isTransient = true)\n\n\/**<|endoftext|>"} {"prompt":"visitStarProjection(starProjection)\n }\n\n open fun visitStarProjection(starProjection: FirStarProjection) {\n visitElement(starProjection)\n }\n\n final override fun visitPlaceholderProjection(placeholderProjection: FirPlaceholderProjection, data: Nothing?) {\n visitPlaceholderProjection(placeholderProjection)\n }","completion":"open fun visitPlaceholderProjection(placeholderProjection: FirPlaceholderProjection) {\n visitElement(placeholderProjection)\n }\n\n final override fun visitTypeProjectionWithVariance(typeProjectionWithVariance: FirTypeProjectionWithVariance, data: Nothing?) {\n visitTypeProjectionWithVariance(typeProjectionWithVariance)\n }<|endoftext|>"} {"prompt":"is KtTypeReference -> unwrapType(type.typeElement)\n is KtNullableType -> type.innerType\n is KtTypeElement -> type\n is KtNameReferenceExpression -> unwrapType(type.parent)\n else -> unexpectedElementError(type)\n } ?: unexpectedElementError(type)","completion":"val ktTypeElementFromFirType = unwrapType(fir.psi)\n\n val classifiersToSkip = expression.parents.takeWhile { it != ktTypeElementFromFirType }.count()\n var classifier: FirClassLikeSymbol<*>? = fir.type.toRegularClassSymbol(session)\n repeat(classifiersToSkip) {<|endoftext|>"} {"prompt":"val UNSUPPORTED_FEATURE: KtDiagnosticFactory1> by error1>()\n val UNSUPPORTED_SUSPEND_TEST: KtDiagnosticFactory0 by error0()","completion":"val NEW_INFERENCE_ERROR: KtDiagnosticFactory1 by error1()\n\n \/\/ Miscellaneous\n val OTHER_ERROR: KtDiagnosticFactory0 by error0()\n\n \/\/ General syntax\n val ILLEGAL_CONST_EXPRESSION: KtDiagnosticFactory0 by error0()<|endoftext|>"} {"prompt":"model(\"incremental\/changeIncrementalOption\", extension = null, excludeParentDirs = true)\n }\n\n testClass {\n model(\"incremental\/cacheVersionChanged\", extension = null, excludeParentDirs = true)\n }\n\n testClass {","completion":"model(\"incremental\/cacheVersionChanged\", extension = null, excludeParentDirs = true)\n }\n }\n\n testGroup(\"jps\/jps-plugin\/jps-tests\/test\", \"jps\/jps-plugin\/testData\") {\n fun TestGroup.TestClass.commonProtoComparisonTests() {<|endoftext|>"} {"prompt":"val x1: suspend (Int) -> Unit = takeSuspend(\")!>id { it","completion":"}, \")!>{ x -> x })<|endoftext|>"} {"prompt":"fun kotlinTestSingleDependencyJvm(gradleVersion: GradleVersion) {\n project(\"simpleProject\", gradleVersion) {\n assertKotlinTestDependency(\n listOf(\"testImplementation\"),\n mapOf(\"compileTestKotlin\" to listOf(\"kotlin-test-${defaultBuildOptions.kotlinVersion}.jar\", \"kotlin-test-testng\"))","completion":")\n }\n }\n\n @JsGradlePluginTests\n @DisplayName(\"JS: Kotlin test single dependency\")\n @GradleTest\n fun kotlinTestSingleDependencyJs(gradleVersion: GradleVersion) {\n project(\n \"kotlin-js-plugin-project\",\n gradleVersion,\n ) {\n assertKotlinTestDependency(<|endoftext|>"} {"prompt":"assertEquals(result, lazy.value, \"Value must not change after isInitialized is set: $lazy, runs: $runs\")\n assertTrue(runs.any { it.value == result }, \"Unexpected lazy result value: $result, runs: $runs\")\n }\n\n @Test fun publishOnceLazyRace() {","completion":"racyTest(initialize = { lazy(LazyThreadSafetyMode.PUBLICATION) { Thread.currentThread().id } },\n access = { lazy, _ -> lazy.value },\n validate = { result -> result.all { v -> v == result[0] } })\n }\n\n @Test fun lazyInitializationForcedOnSerialization() {<|endoftext|>"} {"prompt":"@TypedIntrinsic(IntrinsicType.IDENTITY)\npublic external fun NativePointed.getRawPointer(): NativePtr\n\n@ExperimentalForeignApi\n@TypedIntrinsic(IntrinsicType.IDENTITY)\npublic external fun CPointer<*>.getRawValue(): NativePtr\n\n@ExperimentalForeignApi","completion":"internal fun CPointer<*>.cPointerToString() = \"CPointer(raw=$rawValue)\"\n\n\/**\n * Returns a pointer to C function which calls given Kotlin *static* function.\n *\n * @param function must be *static*, i.e. an (unbound) reference to a Kotlin function or\n * a closure which doesn't capture any variable\n *\/\n@ExperimentalForeignApi<|endoftext|>"} {"prompt":"$i$a$-filter-LibraryKt$foo$7\\30\\465\\1:int=0:int","completion":"\/\/ _Collections.kt:... box: $i$f$foo\\1\\64:int=0:int, array\\1:java.lang.Integer[]=java.lang.Integer[], myClass\\1:MyClass=MyClass, $this$filter\\28:java.lang.Iterable=java.util.ArrayList, $i$f$filter\\28\\463:int=0:int,<|endoftext|>"} {"prompt":"constructor(values: Collection) : this() {\n myValues.addAll(values)\n }\n\n override fun addValue(t: String, weight: Long?) {\n myValues.add(t.replace(SEPARATOR, \",\"))\n }\n\n override fun toStringRepresentation(): String {\n return myValues.sorted().joinToString(SEPARATOR)\n }","completion":"override fun getValue() = toStringRepresentation()\n}<|endoftext|>"} {"prompt":"fun > testTypeParameterWithVarianceDifferentUpperBoundsCReverse() {}","completion":"@Deprecated(message = \"\", level = DeprecationLevel.HIDDEN) fun > testTypeParameterWithVarianceDifferentUpperBoundsCReverse() {}<|endoftext|>"} {"prompt":"private fun generateCandidate(callInfo: CallInfo, function: FirSimpleFunction, context: ResolutionContext): Candidate {\n val candidateFactory = CandidateFactory(context, callInfo)\n return candidateFactory.createCandidate(\n callInfo,\n symbol = function.symbol,\n explicitReceiverKind = ExplicitReceiverKind.NO_EXPLICIT_RECEIVER,\n scope = null\n )\n }","completion":"private fun generateCallInfo(\n callSite: FirExpression,\n name: Name,\n argumentList: FirArgumentList,\n callKind: CallKind,\n resolutionMode: ResolutionMode,\n ) = CallInfo(\n callSite = callSite,\n callKind = callKind,\n name = name,\n explicitReceiver = null,\n argumentList = argumentList,<|endoftext|>"}