prompt
stringlengths
1
924
completion
stringlengths
14
937
<!METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE!>override <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun hashCode(): Int = 2<!> } interface D { override <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun toString(): String
override operator fun equals(other: Any?): Boolean override <!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun hashCode(): Int }<|endoftext|>
import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyBackingField import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter import org.jetbrains.kotlin.fir.expressions.FirPropertyAccessExpression
import org.jetbrains.kotlin.fir.references.impl.FirPropertyFromParameterResolvedNamedReference import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase<|endoftext|>
// Pass (SKIP_CODE, SKIP_DEBUG) to improve performance as method bodies and debug info are not important when we're not analyzing // inline functions/accessors ClassReader.SKIP_CODE or ClassReader.SKIP_DEBUG } classReader.accept(selectiveClassVisitor, parsingOptions) // 3. Sort fields and methods as their order is not important
sortClassMembers(classNode) // 4. Snapshot the class val classSnapshotExcludingMembers = if (classHeader.kind == KotlinClassHeader.Kind.CLASS) { // Also exclude Kotlin metadata (see `ExtraInfo.classSnapshotExcludingMembers`'s kdoc) snapshotClassExcludingMembers(classNode, alsoExcludeKotlinMetaData = true) } else null<|endoftext|>
sourceSetModuleDependencies = mapOf( "commonMain" to emptySet(), "sourceSetA" to setOf(ModuleDependencyIdentifier("aa", "bb")), "sourceSetB" to setOf(ModuleDependencyIdentifier("cc", "dd"), ModuleDependencyIdentifier("ee", "ff")), "sourceSetC" to emptySet() ),
sourceSetCInteropMetadataDirectory = mapOf("sourceSetB" to "xx/cinterop/", "sourceSetC" to "cinterops/C"), hostSpecificSourceSets = setOf("sourceSetC"), isPublishedAsRoot = true, sourceSetNames = setOf("commonMain", "sourceSetA", "sourceSetB", "sourceSetC"), ) @Test<|endoftext|>
import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType import org.jetbrains.kotlin.gradle.plugin.mpp.NativeOutputKind import org.jetbrains.kotlin.gradle.plugin.mpp.apple.AppleTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFrameworkTaskHolder import org.jetbrains.kotlin.gradle.tasks.FrameworkDescriptor import org.jetbrains.kotlin.gradle.tasks.dependsOn import org.jetbrains.kotlin.gradle.tasks.registerTask<|endoftext|>
<!DUPLICATE_LABEL_IN_WHEN!>false<!> -> { } } } // TESTCASE NUMBER: 3 fun case3() { val a = false val when2: Any = <!NO_ELSE_IN_WHEN!>when<!> (a) { true -> { }
<!DUPLICATE_LABEL_IN_WHEN!>true<!> -> { } } } // TESTCASE NUMBER: 4 fun case4() { val x: SClass = SClass.B() val when2 = <!NO_ELSE_IN_WHEN!>when<!> (x){ is SClass.A ->{ }<|endoftext|>
package org.jetbrains.kotlin.fir.analysis.collectors.components import org.jetbrains.kotlin.diagnostics.DiagnosticContext import org.jetbrains.kotlin.fir.FirElement import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.visitors.FirVisitor abstract class AbstractDiagnosticCollectorComponent( protected val session: FirSession, protected val reporter: DiagnosticReporter,<|endoftext|>
// LANGUAGE: +MultiPlatformProjects, +ValueClasses // TARGET_BACKEND: JVM_IR // WITH_STDLIB // MODULE: common // TARGET_PLATFORM: Common // FILE: expect.kt expect value class ExpectValue(val x: String, val y: String) { constructor(x: Int, y: Int) }
// MODULE: main()()(common) // TARGET_PLATFORM: JVM // FILE: actual.kt @JvmInline actual value class ExpectValue actual constructor(actual val x: String, actual val y: String) {<|endoftext|>
psi2Ir.addPostprocessingStep { module -> val old = stubGenerator?.unboundSymbolGeneration try { stubGenerator?.unboundSymbolGeneration = true extension.generate(module, pluginContext) } finally { stubGenerator?.unboundSymbolGeneration = old!! } } } }
return psi2Ir.generateModuleFragment( this, files, listOf(stubGenerator ?: irLinker), extensions ) to pluginContext } private fun createBuiltIns(storageManager: StorageManager) = object : KotlinBuiltIns(storageManager) {} public val JsFactories = KlibMetadataFactories(::createBuiltIns, DynamicTypeDeserializer)<|endoftext|>
import org.jetbrains.kotlin.fir.types.builder.buildUserTypeRef import org.jetbrains.kotlin.fir.types.impl.FirQualifierPartImpl import org.jetbrains.kotlin.fir.types.impl.FirTypeArgumentListImpl import org.jetbrains.kotlin.name.Name
class QualifierPartBuilder(internal val destination: MutableList<FirQualifierPart>) { fun part(name: Name, argumentsBuilder: TypeArgumentsBuilder.() -> Unit = {}) { val typeArgumentList = FirTypeArgumentListImpl(source = null) TypeArgumentsBuilder(typeArgumentList).argumentsBuilder()<|endoftext|>
val sourceFile = buildDir.resolve("source.kt").apply { writeText("fun foo() = Unit") } val libraryFile = compileToLibrary(sourceFile).klibFile val libraryAbi = LibraryAbiReader.readAbiInfo(libraryFile) val mostRecentSupportedSignatureVersion = libraryAbi.signatureVersions .filter { it.isSupportedByAbiReader }
.maxByOrNull { it.versionNumber }!! val abiDumpWithoutManifest = LibraryAbiRenderer.render( libraryAbi, AbiRenderingSettings( renderedSignatureVersion = mostRecentSupportedSignatureVersion, renderManifest = false ) ).filterOutShowManifestPropertiesFlag()<|endoftext|>
package org.jetbrains.kotlin.assignment.plugin.gradle import org.gradle.api.Project import org.gradle.api.provider.Provider import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry import org.jetbrains.kotlin.assignment.plugin.gradle.model.builder.AssignmentModelBuilder
import org.jetbrains.kotlin.gradle.plugin.* import javax.inject.Inject class AssignmentSubplugin @Inject internal constructor( private val registry: ToolingModelBuilderRegistry ) : KotlinCompilerPluginSupportPlugin { companion object {<|endoftext|>
// ISSUE: KT-59664 // LANGUAGE: +ProhibitInlineModifierOnPrimaryConstructorParameters // WITH_STDLIB enum class Foo(open inline /* no effect */ val bar: String) { A("super") { override val bar: String get() = super.bar + " overridden" }; } enum class Bar() { A {
override val bar: String get() = super.bar + " overridden" }; open <!DECLARATION_CANT_BE_INLINED_WARNING!>inline<!> val bar: String get() = "puper" } fun main() { println(Foo.A.bar) }<|endoftext|>
arePropertyGetterAndSetterAnnotationsCompatible(expectSymbol, actualSymbol)?.let { return it } } areAnnotationsSetOnTypesCompatible( expectSymbol, actualSymbol, expectSymbol.extensionReceiverTypeRef, actualSymbol.extensionReceiverTypeRef )?.let { return it }
areAnnotationsSetOnTypesCompatible(expectSymbol, actualSymbol, expectSymbol.returnTypeRef, actualSymbol.returnTypeRef) ?.let { return it } return null } private fun ExpectActualMatchingContext<*>.arePropertyGetterAndSetterAnnotationsCompatible( expectSymbol: PropertySymbolMarker,<|endoftext|>
import org.jetbrains.kotlin.test.backend.ir.IrBackendInput import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.builders.configureKlibArtifactsHandlersStep import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.FIR_PARSER
import org.jetbrains.kotlin.test.frontend.fir.Fir2IrResultsConverter import org.jetbrains.kotlin.test.frontend.fir.FirFrontendFacade import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact import org.jetbrains.kotlin.test.model.*<|endoftext|>