fun Project . checkExpectedGradlePropertyValues ( )

{ <EOL> val expectSuffix = "<STR_LIT>" <EOL> val expectKeys = properties . keys . filter { it . endsWith ( expectSuffix ) } <EOL> val issues = expectKeys . mapNotNull { expectKey -> <EOL> val actualKey = expectKey . removeSuffix ( expectSuffix ) <EOL> val expectedValue = properties [ expectKey ] ? . toString ( ) ? : return@mapNotNull null <EOL> if ( ! properties . containsKey ( actualKey ) ) <EOL> return@mapNotNull MissingProperty ( actualKey , expectedValue ) <EOL> val actualValue = properties [ actualKey ] . toString ( ) <EOL> if ( expectedValue != actualValue ) <EOL> return@mapNotNull UnexpectedPropertyValue ( actualKey , expectedValue , actualValue ) <EOL> null <EOL> } . toSet ( ) <EOL> if ( issues . isEmpty ( ) ) { <EOL> return <EOL> } <EOL> val unexpectedPropertyValues = issues . filterIsInstance < UnexpectedPropertyValue > ( ) <EOL> val missingProperties = issues . filterIsInstance < MissingProperty > ( ) <EOL> throw IllegalArgumentException ( buildString { <EOL> if ( unexpectedPropertyValues . isNotEmpty ( ) ) { <EOL> appendLine ( "<STR_LIT>" ) <EOL> unexpectedPropertyValues . forEach { issue -> <EOL> appendLine ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> if ( missingProperties . isNotEmpty ( ) ) { <EOL> if ( unexpectedPropertyValues . isNotEmpty ( ) ) appendLine ( ) <EOL> appendLine ( "<STR_LIT>" ) <EOL> missingProperties . forEach { issue -> <EOL> appendLine ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } ) <EOL> }

/**
 * Mechanism to warn developers when a given Gradle property does not match the developer's expectation.
 *
 * There may be some Gradle properties, that are defined in the project and will change over time (e.g. defaultSnapshotVersion).
 * Some developers (and QA) will need to be very clear about the value of this property.
 *
 * In order to get notified about the value of the property changing, it is possible to define the same property in
 * ~/.gradle/gradle.properties with a given `.kotlin_build.expected_value` suffix to ensure the value.
 *
 * e.g. if a developer set's
 *
 * `defaultSnapshotVersion.kotlin_build.expected_value=1.6.255-SNAPSHOT` and the value gets bumped to `2.0.255-SNAPSHOT` after pulling from master,
 * the developer will notice this during project configuration phase.
 */


fun matchIrFileWithTestFile ( irModuleFragment : IrModuleFragment , module : TestModule ) : List < Pair < IrFile , TestFile > >

{ <EOL> val irFileWithTestFile = irModuleFragment . files . map { irFile -> <EOL> irFile to module . files . firstOrNull { testFile -> testFile . relativePath == irFile . fileEntry . name . drop ( <NUM_LIT:1> ) } <EOL> } <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return irFileWithTestFile . filterNot { ( _ , testFile ) -> testFile == null || testFile . isAdditional } as List < Pair < IrFile , TestFile > > <EOL> }


override fun processAfterAllModules ( someAssertionWasFailed : Boolean )


override fun processModule ( module : TestModule , info : IrBackendInput )

{ <EOL> val evaluator = Evaluator ( IrInterpreter ( info . irModuleFragment . irBuiltins ) , globalMetadataInfoHandler ) <EOL> for ( ( irFile , testFile ) in matchIrFileWithTestFile ( info . irModuleFragment , module ) ) { <EOL> evaluator . evaluate ( irFile , testFile ) <EOL> } <EOL> }


fun evaluate ( irFile : IrFile , testFile : TestFile )

{ <EOL> object : IrElementTransformerVoid ( ) { <EOL> private fun IrExpression . report ( original : IrExpression , startOffsetForDiagnostic : Int ? = null ) : IrExpression { <EOL> if ( this == original ) return this <EOL> val isError = this is IrErrorExpression <EOL> val message = when ( this ) { <EOL> is IrConst < * > -> this . value . toString ( ) <EOL> is IrErrorExpression -> this . description <EOL> else -> TODO ( "<STR_LIT>" ) <EOL> } <EOL> val startOffset = when { <EOL> startOffsetForDiagnostic != null -> startOffsetForDiagnostic <EOL> original is IrCall && original . symbol . owner . fqNameWhenAvailable ? . asString ( ) == "<STR_LIT>" -> endOffset - <NUM_LIT:2> <EOL> else -> original . startOffset <EOL> } <EOL> val metaInfo = IrInterpreterCodeMetaInfo ( startOffset , this . endOffset , message , isError ) <EOL> globalMetadataInfoHandler . addMetadataInfosForFile ( testFile , listOf ( metaInfo ) ) <EOL> return if ( this !is IrErrorExpression ) this else original <EOL> } <EOL> override fun visitCall ( expression : IrCall ) : IrExpression { <EOL> expression . symbol . owner . valueParameters . forEachIndexed { index , parameter -> <EOL> if ( expression . getValueArgument ( index ) != null || ! expression . symbol . owner . isInline ) return@forEachIndexed <EOL> val default = parameter . defaultValue ? . expression as? IrCall ? : return@forEachIndexed <EOL> val callWithNewOffsets = IrCallImpl ( expression . startOffset , expression . endOffset , default . type , default . symbol , default . typeArgumentsCount , default . valueArgumentsCount , default . origin , default . superQualifierSymbol ) <EOL> callWithNewOffsets . copyTypeAndValueArgumentsFrom ( default ) <EOL> interpreter . interpret ( callWithNewOffsets , irFile ) <EOL> . report ( callWithNewOffsets ) <EOL> . takeIf { it != callWithNewOffsets } <EOL> ? . apply { expression . putArgument ( parameter , this ) } <EOL> } <EOL> return super . visitCall ( expression ) <EOL> } <EOL> override fun visitField ( declaration : IrField ) : IrStatement { <EOL> val initializer = declaration . initializer <EOL> val expression = initializer ? . expression ? : return declaration <EOL> if ( expression is IrConst < * > ) return declaration <EOL> val isConst = declaration . correspondingPropertySymbol ? . owner ? . isConst == true <EOL> if ( isConst ) { <EOL> val startOffsetForDiagnostic = declaration . startOffset + "<STR_LIT>" . length + declaration . name . asString ( ) . length <EOL> initializer . expression = interpreter . interpret ( expression , irFile ) . report ( expression , startOffsetForDiagnostic ) <EOL> } <EOL> return declaration <EOL> } <EOL> } . visitFile ( irFile ) <EOL> }


operator fun A ? . get ( i : Int ) : A ?

= this


operator fun A ? . set ( i : Int , v : A ? ) : A ?

{ <EOL> cnt ++ <EOL> return this <EOL> }


= this


{ <EOL> a ? . b += null <EOL> a ? . b ? . c += null <EOL> a ? . b . c += null <EOL> a ? . b [ <NUM_LIT:0> ] += null <EOL> a ? . b ? . c [ <NUM_LIT:0> ] += null <EOL> a ? . b . c [ <NUM_LIT:0> ] += null <EOL> a ? . b [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] += null <EOL> a ? . b ? . c [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] += null <EOL> a ? . b . c [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] += null <EOL> }


{ <EOL> test ( null ) <EOL> if ( cnt != <NUM_LIT:3> ) return "<STR_LIT>" <EOL> cnt = <NUM_LIT:0> <EOL> test ( A ( ) ) <EOL> if ( cnt != <NUM_LIT:9> ) return "<STR_LIT>" <EOL> return "<STR_LIT:OK>" <EOL> }


private fun stringifyTree ( builder : StringBuilder , node : KotlinParseTree , depth : Int = <NUM_LIT:1> ) : StringBuilder

= <EOL> builder . apply { <EOL> node . children . forEach { child -> <EOL> when ( child . type ) { <EOL> KotlinParseTreeNodeType . RULE -> append ( "<STR_LIT>" . repeat ( depth ) + child . name + ls ) <EOL> KotlinParseTreeNodeType . TERMINAL -> append ( "<STR_LIT>" . repeat ( depth ) + child . name + "<STR_LIT>" + child . text ! ! . replace ( ls , Pattern . quote ( ls ) ) + "<STR_LIT>" + ls ) <EOL> } <EOL> stringifyTree ( builder , child , depth + <NUM_LIT:1> ) <EOL> } <EOL> }


= root + ls + stringifyTree ( StringBuilder ( ) , this )


{ <EOL> stdinSocket . sendMessage ( messageFactory . makeReplyMessage ( MessageType . INPUT_REQUEST , content = InputRequest ( "<STR_LIT>" ) ) , ) <EOL> val msg = stdinSocket . receiveMessage ( ) <EOL> val content = msg ? . data ? . content as? InputReply <EOL> return content ? . value ? : throw UnsupportedOperationException ( "<STR_LIT>" ) <EOL> }


private fun initializeCurrentBuf ( ) : ByteArray

{ <EOL> val buf = currentBuf <EOL> return if ( buf != null ) { <EOL> buf <EOL> } else { <EOL> val newBuf = getInput ( ) . toByteArray ( ) <EOL> currentBuf = newBuf <EOL> currentBufPos = <NUM_LIT:0> <EOL> newBuf <EOL> } <EOL> }


@ Synchronized <EOL> override fun read ( ) : Int

{ <EOL> val buf = initializeCurrentBuf ( ) <EOL> if ( currentBufPos >= buf . size ) { <EOL> currentBuf = null <EOL> return - <NUM_LIT:1> <EOL> } <EOL> return buf [ currentBufPos ++ ] . toInt ( ) <EOL> }


@ Synchronized <EOL> override fun read ( b : ByteArray , off : Int , len : Int , ) : Int

{ <EOL> val buf = initializeCurrentBuf ( ) <EOL> val lenLeft = buf . size - currentBufPos <EOL> if ( lenLeft <= <NUM_LIT:0> ) { <EOL> currentBuf = null <EOL> return - <NUM_LIT:1> <EOL> } <EOL> val lenToRead = min ( len , lenLeft ) <EOL> for ( i in <NUM_LIT:0> until lenToRead ) { <EOL> b [ off + i ] = buf [ currentBufPos + i ] <EOL> } <EOL> currentBufPos += lenToRead <EOL> return lenToRead <EOL> }


= runBlocking < Unit > { <EOL> log ( "<STR_LIT>" ) <EOL> coroutineScope { <EOL> log ( "<STR_LIT>" ) <EOL> log ( "<STR_LIT>" ) <EOL> launch { <EOL> log ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> }


@ Anno ( "<STR_LIT:foo>" ) <EOL> fun foo ( ) : Array < Array < Array < T > > >


@ JsName ( "<STR_LIT>" ) <EOL> abstract fun testFunction ( ) : String


abstract fun testFunction ( x : String ) : String


override abstract fun testFunction ( ) : String


override abstract fun testFunction ( x : String ) : String


= "<STR_LIT>"


override fun testFunction ( x : String ) : String

= "<STR_LIT>"


fun testTestOpenClass1 ( x : TestOpenClass )

= x . testFunction ( )


fun testTestOpenClass2 ( x : TestOpenClass )

= x . testFunction ( "<STR_LIT:OK>" )


fun testTestOpenClassA1 ( x : TestOpenClassA )

= x . testFunction ( )


fun testTestOpenClassA2 ( x : TestOpenClassA )

= x . testFunction ( "<STR_LIT:OK>" )


= x . testFunction ( )


= x . testFunction ( "<STR_LIT:OK>" )


{ <EOL> assertEquals ( "<STR_LIT>" , testTestOpenClass1 ( TestClassA ( ) ) ) <EOL> assertEquals ( "<STR_LIT>" , testTestOpenClass2 ( TestClassA ( ) ) ) <EOL> assertEquals ( "<STR_LIT>" , testTestOpenClassA1 ( TestClassA ( ) ) ) <EOL> assertEquals ( "<STR_LIT>" , testTestOpenClassA2 ( TestClassA ( ) ) ) <EOL> assertEquals ( "<STR_LIT>" , testTestClassA1 ( TestClassA ( ) ) ) <EOL> assertEquals ( "<STR_LIT>" , testTestClassA2 ( TestClassA ( ) ) ) <EOL> return "<STR_LIT:OK>" <EOL> }


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> fun getAllPossibleNames ( subScopes : List < List < String > > ) : Set < String >

= withValidityAssertion { <EOL> buildSet { <EOL> subScopes . flatMapTo ( this ) { it } <EOL> } <EOL> }


inline fun < R > withValidityAssertion ( action : ( ) -> R ) : R

{ <EOL> return action ( ) <EOL> }


{ <EOL> return getAllPossibleNames ( listOf ( listOf ( "<STR_LIT:O>" ) , listOf ( "<STR_LIT:K>" ) ) ) . joinToString ( "<STR_LIT>" ) <EOL> }


= "<STR_LIT:K>"


{ <EOL> val clazz = Class . forName ( "<STR_LIT>" ) <EOL> assertEquals ( <NUM_LIT:2> , clazz . declaredMethods . size , "<STR_LIT>" ) <EOL> val methods = clazz . declaredMethods . map { it . name } <EOL> assertTrue ( methods . contains ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> assertTrue ( methods . contains ( "<STR_LIT>" ) , "<STR_LIT>" ) <EOL> return { <EOL> prop = "<STR_LIT:O>" <EOL> prop + test ( ) <EOL> } . let { it ( ) } <EOL> }


public fun extensionReceiverType ( type : ConeKotlinType )

{ <EOL> extensionReceiverType { type } <EOL> }

/**
 * Sets [type] as extension receiver type of constructed property
 */


public fun extensionReceiverType ( typeProvider : ( List < FirTypeParameter > ) -> ConeKotlinType )

{ <EOL> extensionReceiverTypeProvider = typeProvider <EOL> }

/**
 * Sets type, provided by [typeProvider], as extension receiver type of constructed property
 *
 * Use this overload when extension receiver type uses type parameters of constructed property
 */


public fun setter ( visibility : Visibility )

{ <EOL> setterVisibility = visibility <EOL> }

/**
 * Declares [visibility] of property setter if property marked as var
 * If this function is not called then setter will have same visibility
 * as property itself
 */


{ <EOL> return buildProperty { <EOL> resolvePhase = FirResolvePhase . BODY_RESOLVE <EOL> moduleData = session . moduleData <EOL> origin = key . origin <EOL> source = owner ? . source ? . fakeElement ( KtFakeSourceElementKind . PluginGenerated ) <EOL> symbol = FirPropertySymbol ( callableId ) <EOL> name = callableId . callableName <EOL> val resolvedStatus = generateStatus ( ) <EOL> status = resolvedStatus <EOL> dispatchReceiverType = owner ? . defaultType ( ) <EOL> this@PropertyBuildingContext . typeParameters . mapTo ( typeParameters ) { <EOL> generateTypeParameter ( it , symbol ) <EOL> } <EOL> initTypeParameterBounds ( typeParameters , typeParameters ) <EOL> returnTypeRef = returnTypeProvider . invoke ( typeParameters ) . toFirResolvedTypeRef ( ) <EOL> extensionReceiverTypeProvider ? . invoke ( typeParameters ) ? . let { <EOL> receiverParameter = buildReceiverParameter { <EOL> typeRef = it . toFirResolvedTypeRef ( ) <EOL> } <EOL> } <EOL> produceContextReceiversTo ( contextReceivers , typeParameters ) <EOL> isVar = ! isVal <EOL> getter = FirDefaultPropertyGetter ( source = null , session . moduleData , key . origin , returnTypeRef , status . visibility , symbol , Modality . FINAL , resolvedStatus . effectiveVisibility , resolvePhase = FirResolvePhase . BODY_RESOLVE , ) <EOL> if ( isVar ) { <EOL> setter = FirDefaultPropertySetter ( source = null , session . moduleData , key . origin , returnTypeRef , setterVisibility ? : status . visibility , symbol , Modality . FINAL , resolvedStatus . effectiveVisibility , resolvePhase = FirResolvePhase . BODY_RESOLVE , ) <EOL> } else { <EOL> require ( setterVisibility == null ) { "<STR_LIT>" } <EOL> } <EOL> if ( hasBackingField ) { <EOL> backingField = FirDefaultPropertyBackingField ( session . moduleData , key . origin , source = null , mutableListOf ( ) , returnTypeRef , isVar , symbol , status , resolvePhase = FirResolvePhase . BODY_RESOLVE , ) <EOL> } <EOL> isLocal = false <EOL> bodyResolveState = FirPropertyBodyResolveState . ALL_BODIES_RESOLVED <EOL> } <EOL> }


public fun FirExtension . createMemberProperty ( owner : FirClassSymbol < * > , key : GeneratedDeclarationKey , name : Name , returnType : ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> return createMemberProperty ( owner , key , name , { returnType } , isVal , hasBackingField , config ) <EOL> }

/**
 * Creates a member property for [owner] class with [returnType] return type
 */


public fun FirExtension . createMemberProperty ( owner : FirClassSymbol < * > , key : GeneratedDeclarationKey , name : Name , returnTypeProvider : ( List < FirTypeParameterRef > ) -> ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> val callableId = CallableId ( owner . classId , name ) <EOL> return PropertyBuildingContext ( session , key , owner , callableId , returnTypeProvider , isVal , hasBackingField ) . apply ( config ) . apply { <EOL> status { <EOL> isExpect = owner . isExpect <EOL> } <EOL> } . build ( ) <EOL> }

/**
 * Creates a member property for [owner] class with return type provided by [returnTypeProvider]
 * Use this overload when those types use type parameters of constructed property
 */


@ ExperimentalTopLevelDeclarationsGenerationApi <EOL> public fun FirExtension . createTopLevelProperty ( key : GeneratedDeclarationKey , callableId : CallableId , returnType : ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> return createTopLevelProperty ( key , callableId , { returnType } , isVal , hasBackingField , config ) <EOL> }

/**
 * Creates a top-level property class with [returnType] return type
 *
 * If you create top-level extension property don't forget to set [hasBackingField] to false,
 * since such properties never have backing fields
 */


@ ExperimentalTopLevelDeclarationsGenerationApi <EOL> public fun FirExtension . createTopLevelProperty ( key : GeneratedDeclarationKey , callableId : CallableId , returnTypeProvider : ( List < FirTypeParameterRef > ) -> ConeKotlinType , isVal : Boolean = true , hasBackingField : Boolean = true , config : PropertyBuildingContext . ( ) -> Unit = { } ) : FirProperty

{ <EOL> require ( callableId . classId == null ) <EOL> return PropertyBuildingContext ( session , key , owner = null , callableId , returnTypeProvider , isVal , hasBackingField ) . apply ( config ) . build ( ) <EOL> }

/**
 * Creates a top-level property with return type provided by [returnTypeProvider]
 *
 * If you create top-level extension property don't forget to set [hasBackingField] to false,
 * since such properties never have backing fields
 *
 * Use this overload when those types use type parameters of constructed property
 */


fun webpackConfigApplier ( body : Action < KotlinWebpackConfig > )

{ <EOL> webpackConfigAppliers . add ( body ) <EOL> }


private fun createWebpackConfig ( forNpmDependencies : Boolean = false )

= KotlinWebpackConfig ( npmProjectDir = npmProjectDir , mode = mode , entry = if ( forNpmDependencies ) null else entry . get ( ) . asFile , output = output , outputPath = if ( forNpmDependencies ) null else outputDirectory . getOrNull ( ) ? . asFile , outputFileName = mainOutputFileName . get ( ) , configDirectory = configDirectory , rules = rules , devServer = devServerProperty . orNull , devtool = devtool , sourceMaps = sourceMaps , resolveFromModulesFirst = resolveFromModulesFirst , )

/**
 * [forNpmDependencies] is used to avoid querying [outputDirectory] before task execution.
 * Otherwise, Gradle will fail the build.
 */


private fun createRunner ( ) : KotlinWebpackRunner

{ <EOL> val config = createWebpackConfig ( ) <EOL> if ( platformType == KotlinPlatformType . wasm ) { <EOL> config . experiments += listOf ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> } <EOL> webpackConfigAppliers <EOL> . forEach { it . execute ( config ) } <EOL> val webpackArgs = args . run { <EOL> val port = devServerProperty . orNull ? . port <EOL> if ( debug && port != null ) plus ( listOf ( "<STR_LIT>" , port . toString ( ) ) ) <EOL> else this <EOL> } <EOL> return KotlinWebpackRunner ( npmProject , logger , configFile . get ( ) , execHandleFactory , bin , webpackArgs , nodeArgs , config ) <EOL> }


{ <EOL> val runner = createRunner ( ) <EOL> if ( generateConfigOnly ) { <EOL> runner . config . save ( configFile . get ( ) ) <EOL> return <EOL> } <EOL> if ( isContinuous ) { <EOL> val deploymentRegistry = services . get ( DeploymentRegistry :: class . java ) <EOL> val deploymentHandle = deploymentRegistry . get ( "<STR_LIT>" , Handle :: class . java ) <EOL> if ( deploymentHandle == null ) { <EOL> deploymentRegistry . start ( "<STR_LIT>" , DeploymentRegistry . ChangeBehavior . BLOCK , Handle :: class . java , runner ) <EOL> } <EOL> } else { <EOL> runner . copy ( config = runner . config . copy ( progressReporter = true , progressReporterPathFilter = rootPackageDir . getFile ( ) ) ) . execute ( services ) <EOL> val buildMetrics = metrics . get ( ) <EOL> outputDirectory . get ( ) . asFile . walkTopDown ( ) <EOL> . filter { it . isFile } <EOL> . filter { it . extension == "<STR_LIT:js>" } <EOL> . map { it . length ( ) } <EOL> . sum ( ) <EOL> . let { <EOL> buildMetrics . addMetric ( GradleBuildPerformanceMetric . BUNDLE_SIZE , it ) <EOL> } <EOL> buildMetricsService . orNull ? . also { it . addTask ( path , this . javaClass , buildMetrics ) } <EOL> } <EOL> }


= process != null


override fun start ( deployment : Deployment )

{ <EOL> process = runner . start ( ) <EOL> }


{ <EOL> process ? . abort ( ) <EOL> }


override fun resumeWith ( result : Result < Any ? > )

{ result . getOrThrow ( ) }


= suspendCoroutineUninterceptedOrReturn { x -> <EOL> sb . appendLine ( "<STR_LIT>" ) <EOL> x . resume ( <NUM_LIT:42> ) <EOL> COROUTINE_SUSPENDED <EOL> }


{ <EOL> c . startCoroutine ( EmptyContinuation ) <EOL> }


{ <EOL> var x = s1 ( ) <EOL> return x <EOL> }


{ <EOL> var result = <NUM_LIT:0> <EOL> builder { <EOL> result = inline_s2 ( ) <EOL> } <EOL> sb . appendLine ( result ) <EOL> assertEquals ( """<STR_LIT>""" . trimIndent ( ) , sb . toString ( ) ) <EOL> return "<STR_LIT:OK>" <EOL> }


override fun accept ( visitor : InstructionVisitor )

{ <EOL> visitor . visitSubroutineSink ( this ) <EOL> }


override fun < R > accept ( visitor : InstructionVisitorWithResult < R > ) : R

= visitor . visitSubroutineSink ( this )


= debugLabel


override fun createCopy ( ) : InstructionImpl

= <EOL> SubroutineSinkInstruction ( subroutine , blockScope , debugLabel )


{ <EOL> curl_easy_setopt ( curl , CURLOPT_NOBODY , <NUM_LIT:1L> ) <EOL> }


{ <EOL> val res = curl_easy_perform ( curl ) <EOL> if ( res != CURLE_OK ) <EOL> println ( "<STR_LIT>" ) <EOL> }


{ <EOL> curl_easy_cleanup ( curl ) <EOL> stableRef . dispose ( ) <EOL> }


fun CPointer < ByteVar > . toKString ( length : Int ) : String

{ <EOL> val bytes = this . readBytes ( length ) <EOL> return bytes . decodeToString ( ) <EOL> }


fun header_callback ( buffer : CPointer < ByteVar > ? , size : size_t , nitems : size_t , userdata : COpaquePointer ? ) : size_t

{ <EOL> if ( buffer == null ) return <NUM_LIT> <EOL> if ( userdata != null ) { <EOL> val header = buffer . toKString ( ( size * nitems ) . toInt ( ) ) . trim ( ) <EOL> val curl = userdata . asStableRef < CUrl > ( ) . get ( ) <EOL> curl . header ( header ) <EOL> } <EOL> return size * nitems <EOL> }


fun write_callback ( buffer : CPointer < ByteVar > ? , size : size_t , nitems : size_t , userdata : COpaquePointer ? ) : size_t

{ <EOL> if ( buffer == null ) return <NUM_LIT> <EOL> if ( userdata != null ) { <EOL> val data = buffer . toKString ( ( size * nitems ) . toInt ( ) ) . trim ( ) <EOL> val curl = userdata . asStableRef < CUrl > ( ) . get ( ) <EOL> curl . body ( data ) <EOL> } <EOL> return size * nitems <EOL> }


{ <EOL> var result = <NUM_LIT:0> <EOL> for ( arg in args ) <EOL> result += arg <EOL> return result <EOL> }


= sum ( * IntArray ( args . size ) { args [ it ] . toInt ( ) } )


fun zap ( vararg b : String , k : Int = <NUM_LIT:42> )


fun usePlainArgs ( fn : ( Int , Int ) -> Int )


fun usePrimitiveArray ( fn : ( IntArray ) -> Int )


fun useArray ( fn : ( Array < Int > ) -> Int )


fun useStringArray ( fn : ( Array < String > ) -> Unit )


{ usePlainArgs ( :: sum ) }


{ usePrimitiveArray ( :: sum ) }


{ useArray ( :: nsum ) }


{ useStringArray ( :: zap ) }


= zoneOffset . hashCode ( )


override fun equals ( other : Any ? ) : Boolean

= other is UtcOffset && this . zoneOffset == other . zoneOffset


actual override fun toString ( ) : String

= zoneOffset . toString ( )


public actual fun parse ( input : CharSequence , format : DateTimeFormat < UtcOffset > ) : UtcOffset

= when { <EOL> format === Formats . ISO -> parseWithFormat ( input , isoFormat ) <EOL> format === Formats . ISO_BASIC -> parseWithFormat ( input , isoBasicFormat ) <EOL> format === Formats . FOUR_DIGITS -> parseWithFormat ( input , fourDigitsFormat ) <EOL> else -> format . parse ( input ) <EOL> }


@ Deprecated ( "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) <EOL> public fun parse ( offsetString : String ) : UtcOffset

= parse ( input = offsetString )


@ Suppress ( "<STR_LIT:FunctionName>" ) <EOL> public actual fun Format ( block : DateTimeFormatBuilder . WithUtcOffset . ( ) -> Unit ) : DateTimeFormat < UtcOffset >

= <EOL> UtcOffsetFormat . build ( block )


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun UtcOffset ( hours : Int ? = null , minutes : Int ? = null , seconds : Int ? = null ) : UtcOffset

= <EOL> try { <EOL> when { <EOL> hours != null -> <EOL> UtcOffset ( ZoneOffset . ofHoursMinutesSeconds ( hours , minutes ? : <NUM_LIT:0> , seconds ? : <NUM_LIT:0> ) ) <EOL> minutes != null -> <EOL> UtcOffset ( ZoneOffset . ofHoursMinutesSeconds ( minutes / <NUM_LIT> , minutes % <NUM_LIT> , seconds ? : <NUM_LIT:0> ) ) <EOL> else -> { <EOL> UtcOffset ( ZoneOffset . ofTotalSeconds ( seconds ? : <NUM_LIT:0> ) ) <EOL> } <EOL> } <EOL> } catch ( e : DateTimeException ) { <EOL> throw IllegalArgumentException ( e ) <EOL> }


private fun parseWithFormat ( input : CharSequence , format : DateTimeFormatter )

= try { <EOL> format . parse ( input , ZoneOffset :: from ) . let ( :: UtcOffset ) <EOL> } catch ( e : DateTimeException ) { <EOL> throw DateTimeFormatException ( e ) <EOL> }


= "<STR_LIT:OK>"


{ <EOL> val i = object : I { } <EOL> var res = IC ( i ) . ok ( ) <EOL> if ( res != "<STR_LIT:OK>" ) return "<STR_LIT>" <EOL> val ic : I = IC ( i ) <EOL> res = ic . ok ( ) <EOL> return res <EOL> }


private fun createFile ( shortName : String , text : String , project : Project ) : KtFile

{ <EOL> val virtualFile = object : LightVirtualFile ( shortName , KotlinLanguage . INSTANCE , text ) { <EOL> override fun getPath ( ) : String { <EOL> return "<STR_LIT:/>" + name <EOL> } <EOL> } <EOL> virtualFile . charset = StandardCharsets . UTF_8 <EOL> val factory = PsiFileFactory . getInstance ( project ) as PsiFileFactoryImpl <EOL> return factory . trySetupPsiForFile ( virtualFile , KotlinLanguage . INSTANCE , true , false ) as KtFile <EOL> }


private fun newConfiguration ( useNewInference : Boolean ) : CompilerConfiguration

{ <EOL> val configuration = CompilerConfiguration ( ) <EOL> configuration . put ( CommonConfigurationKeys . MODULE_NAME , "<STR_LIT>" ) <EOL> configuration . put ( CLIConfigurationKeys . INTELLIJ_PLUGIN_ROOT , "<STR_LIT>" ) <EOL> configuration . addJvmClasspathRoot ( JDK_PATH ) <EOL> configuration . addJvmClasspathRoot ( RUNTIME_JAR ) <EOL> configuration . configureJdkClasspathRoots ( ) <EOL> configuration . put ( CLIConfigurationKeys . MESSAGE_COLLECTOR_KEY , MessageCollector . NONE ) <EOL> val newInferenceState = if ( useNewInference ) LanguageFeature . State . ENABLED else LanguageFeature . State . DISABLED <EOL> configuration . languageVersionSettings = LanguageVersionSettingsImpl ( LanguageVersion . KOTLIN_1_3 , ApiVersion . KOTLIN_1_3 , specificFeatures = mapOf ( LanguageFeature . NewInference to newInferenceState ) ) <EOL> return configuration <EOL> }


@ Setup ( Level . Trial ) <EOL> fun setUp ( )

{ <EOL> if ( isIR && ! useNewInference ) error ( "<STR_LIT>" ) <EOL> env = KotlinCoreEnvironment . createForTests ( myDisposable , newConfiguration ( useNewInference ) , EnvironmentConfigFiles . JVM_CONFIG_FILES ) <EOL> if ( isIR ) { <EOL> PsiElementFinder . EP . getPoint ( env . project ) . unregisterExtension ( JavaElementFinder :: class . java ) <EOL> } <EOL> file = createFile ( "<STR_LIT>" , buildText ( ) , env . project ) <EOL> }


protected fun analyzeGreenFile ( bh : Blackhole )

{ <EOL> if ( isIR ) { <EOL> analyzeGreenFileIr ( bh ) <EOL> } else { <EOL> analyzeGreenFileFrontend ( bh ) <EOL> } <EOL> }


private fun analyzeGreenFileFrontend ( bh : Blackhole )

{ <EOL> val tracker = ExceptionTracker ( ) <EOL> val storageManager : StorageManager = <EOL> LockBasedStorageManager . createWithExceptionHandling ( "<STR_LIT>" , tracker ) <EOL> val context = SimpleGlobalContext ( storageManager , tracker ) <EOL> val module = <EOL> ModuleDescriptorImpl ( Name . special ( "<STR_LIT>" ) , storageManager , JvmBuiltIns ( storageManager , JvmBuiltIns . Kind . FROM_DEPENDENCIES ) ) <EOL> val moduleContext = context . withProject ( env . project ) . withModule ( module ) <EOL> val result = TopDownAnalyzerFacadeForJVM . analyzeFilesWithJavaIntegration ( moduleContext . project , listOf ( file ) , NoScopeRecordCliBindingTrace ( env . project ) , env . configuration , { scope -> JvmPackagePartProvider ( LANGUAGE_FEATURE_SETTINGS , scope ) } ) <EOL> assert ( result . bindingContext . diagnostics . none { it . severity == Severity . ERROR } ) <EOL> bh . consume ( result . shouldGenerateCode ) <EOL> }


@ OptIn ( ObsoleteTestInfrastructure :: class ) <EOL> private fun analyzeGreenFileIr ( bh : Blackhole )

{ <EOL> val scope = GlobalSearchScope . filesScope ( env . project , listOf ( file . virtualFile ) ) <EOL> . uniteWith ( TopDownAnalyzerFacadeForJVM . AllJavaSourcesInProjectScope ( env . project ) ) <EOL> val session = FirTestSessionFactoryHelper . createSessionForTests ( env . toAbstractProjectEnvironment ( ) , scope . toAbstractProjectFileSearchScope ( ) ) <EOL> val firProvider = session . firProvider as FirProviderImpl <EOL> val builder = PsiRawFirBuilder ( session , firProvider . kotlinScopeProvider ) <EOL> val totalTransformer = FirTotalResolveProcessor ( session ) <EOL> val firFile = builder . buildFirFile ( file ) . also ( firProvider :: recordFile ) <EOL> totalTransformer . process ( listOf ( firFile ) ) <EOL> bh . consume ( firFile . hashCode ( ) ) <EOL> env . project . extensionArea <EOL> . getExtensionPoint < PsiElementFinder > ( PsiElementFinder . EP . name ) <EOL> . unregisterExtension ( FirJavaElementFinder :: class . java ) <EOL> }


protected abstract fun buildText ( ) : String


public fun renderType ( analysisSession : KtAnalysisSession , type : KtType , printer : PrettyPrinter )

{ <EOL> when ( type ) { <EOL> is KtCapturedType -> capturedTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtFunctionalType -> functionalTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtUsualClassType -> usualClassTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtDefinitelyNotNullType -> definitelyNotNullTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtDynamicType -> dynamicTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtFlexibleType -> flexibleTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtIntegerLiteralType -> integerLiteralTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtIntersectionType -> intersectionTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtTypeParameterType -> typeParameterTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtClassErrorType -> unresolvedClassErrorTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> is KtTypeErrorType -> typeErrorTypeRenderer . renderType ( analysisSession , type , this , printer ) <EOL> } <EOL> }


public fun with ( action : Builder . ( ) -> Unit ) : KtTypeRenderer

{ <EOL> val renderer = this <EOL> return KtTypeRenderer { <EOL> this . capturedTypeRenderer = renderer . capturedTypeRenderer <EOL> this . definitelyNotNullTypeRenderer = renderer . definitelyNotNullTypeRenderer <EOL> this . dynamicTypeRenderer = renderer . dynamicTypeRenderer <EOL> this . flexibleTypeRenderer = renderer . flexibleTypeRenderer <EOL> this . functionalTypeRenderer = renderer . functionalTypeRenderer <EOL> this . integerLiteralTypeRenderer = renderer . integerLiteralTypeRenderer <EOL> this . intersectionTypeRenderer = renderer . intersectionTypeRenderer <EOL> this . typeErrorTypeRenderer = renderer . typeErrorTypeRenderer <EOL> this . typeParameterTypeRenderer = renderer . typeParameterTypeRenderer <EOL> this . unresolvedClassErrorTypeRenderer = renderer . unresolvedClassErrorTypeRenderer <EOL> this . usualClassTypeRenderer = renderer . usualClassTypeRenderer <EOL> this . classIdRenderer = renderer . classIdRenderer <EOL> this . typeNameRenderer = renderer . typeNameRenderer <EOL> this . typeApproximator = renderer . typeApproximator <EOL> this . typeProjectionRenderer = renderer . typeProjectionRenderer <EOL> this . annotationsRenderer = renderer . annotationsRenderer <EOL> this . contextReceiversRenderer = renderer . contextReceiversRenderer <EOL> this . keywordsRenderer = renderer . keywordsRenderer <EOL> action ( ) <EOL> } <EOL> }


public operator fun invoke ( action : Builder . ( ) -> Unit ) : KtTypeRenderer

= <EOL> Builder ( ) . apply ( action ) . build ( )


= KtTypeRenderer ( capturedTypeRenderer , definitelyNotNullTypeRenderer , dynamicTypeRenderer , flexibleTypeRenderer , functionalTypeRenderer , integerLiteralTypeRenderer , intersectionTypeRenderer , typeErrorTypeRenderer , typeParameterTypeRenderer , unresolvedClassErrorTypeRenderer , usualClassTypeRenderer , classIdRenderer , typeNameRenderer , typeApproximator , typeProjectionRenderer , annotationsRenderer , contextReceiversRenderer , keywordsRenderer , )


override fun < R , D > accept ( visitor : FirVisitor < R , D > , data : D ) : R

= <EOL> visitor . visitAnnotationCall ( this , data )


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> override fun < E : FirElement , D > transform ( transformer : FirTransformer < D > , data : D ) : E

= <EOL> transformer . transformAnnotationCall ( this , data ) as E


abstract override fun replaceConeTypeOrNull ( newConeTypeOrNull : ConeKotlinType ? )


abstract override fun replaceAnnotations ( newAnnotations : List < FirAnnotation > )


abstract override fun replaceUseSiteTarget ( newUseSiteTarget : AnnotationUseSiteTarget ? )


abstract override fun replaceAnnotationTypeRef ( newAnnotationTypeRef : FirTypeRef )


abstract override fun replaceTypeArguments ( newTypeArguments : List < FirTypeProjection > )


abstract override fun replaceArgumentList ( newArgumentList : FirArgumentList )


abstract override fun replaceCalleeReference ( newCalleeReference : FirReference )


abstract override fun replaceArgumentMapping ( newArgumentMapping : FirAnnotationArgumentMapping )


abstract fun replaceAnnotationResolvePhase ( newAnnotationResolvePhase : FirAnnotationResolvePhase )


abstract override fun < D > transformAnnotations ( transformer : FirTransformer < D > , data : D ) : FirAnnotationCall


abstract override fun < D > transformAnnotationTypeRef ( transformer : FirTransformer < D > , data : D ) : FirAnnotationCall


abstract override fun < D > transformTypeArguments ( transformer : FirTransformer < D > , data : D ) : FirAnnotationCall


abstract override fun < D > transformCalleeReference ( transformer : FirTransformer < D > , data : D ) : FirAnnotationCall


= bar


{ <EOL> use ( G ( ) . foo { it + <NUM_LIT:11> } ) <EOL> use ( G ( ) foo { it + <NUM_LIT:11> } ) <EOL> use ( G ( ) foo ( { it + <NUM_LIT:1> } ) ) <EOL> }


= a


fun runGradleBuild ( task : String , @ Language ( "<STR_LIT:kts>" ) settingsGradle : ( File ) -> String = { "<STR_LIT>" } , @ Language ( "<STR_LIT:kts>" ) build : ( File ) -> String , ) : Build

{ <EOL> val buildDir = Files . createTempDirectory ( "<STR_LIT:test>" ) . toFile ( ) <EOL> val buildFile = File ( buildDir , "<STR_LIT>" ) <EOL> buildFile . writeText ( build ( buildDir ) ) <EOL> val settingsFile = File ( buildDir , "<STR_LIT>" ) <EOL> settingsFile . writeText ( settingsGradle ( buildDir ) ) <EOL> return Build ( buildDir , gradleRunner ( buildDir , task ) . build ( ) ) <EOL> }


fun gradleRunner ( buildDir : File , task : String ) : GradleRunner

= GradleRunner . create ( ) <EOL> . withProjectDir ( buildDir ) <EOL> . withPluginClasspath ( ) <EOL> . withArguments ( task , "<STR_LIT>" , "<STR_LIT>" ) <EOL> . withDebug ( true )


fun case_1 ( value_1 : EnumClass ? ) : String

= when ( value_1 ) { <EOL> EnumClass . EAST -> "<STR_LIT>" <EOL> EnumClass . NORTH -> "<STR_LIT>" <EOL> EnumClass . SOUTH -> "<STR_LIT>" <EOL> EnumClass . WEST -> "<STR_LIT>" <EOL> null -> "<STR_LIT>" <EOL> }


fun case_2 ( value_1 : EnumClassSingle ? ) : String

= when ( value_1 ) { <EOL> EnumClassSingle . EVERYTHING -> "<STR_LIT>" <EOL> null -> "<STR_LIT>" <EOL> }


fun case_3 ( value_1 : EnumClassEmpty ? ) : String

= when ( value_1 ) { <EOL> null -> "<STR_LIT>" <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun < T > Array < out T > . elementAt ( index : Int ) : T

{ <EOL> return get ( index ) <EOL> }

/**
 * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.
 *
 * @sample samples.collections.Collections.Elements.elementAt
 */


@ kotlin . internal . InlineOnly <EOL> public actual inline fun ByteArray . elementAt ( index : Int ) : Byte

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun ShortArray . elementAt ( index : Int ) : Short

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun IntArray . elementAt ( index : Int ) : Int

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun LongArray . elementAt ( index : Int ) : Long

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun FloatArray . elementAt ( index : Int ) : Float

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun DoubleArray . elementAt ( index : Int ) : Double

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun BooleanArray . elementAt ( index : Int ) : Boolean

{ <EOL> return get ( index ) <EOL> }


@ kotlin . internal . InlineOnly <EOL> public actual inline fun CharArray . elementAt ( index : Int ) : Char

{ <EOL> return get ( index ) <EOL> }


public actual fun < T > Array < out T > . asList ( ) : List < T >

{ <EOL> return object : AbstractList < T > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : T ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : T = this@asList [ index ] <EOL> override fun indexOf ( element : T ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : T ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }

/**
 * Returns a [List] that wraps the original array.
 */


public actual fun ByteArray . asList ( ) : List < Byte >

{ <EOL> return object : AbstractList < Byte > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Byte ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Byte = this@asList [ index ] <EOL> override fun indexOf ( element : Byte ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Byte ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun ShortArray . asList ( ) : List < Short >

{ <EOL> return object : AbstractList < Short > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Short ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Short = this@asList [ index ] <EOL> override fun indexOf ( element : Short ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Short ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun IntArray . asList ( ) : List < Int >

{ <EOL> return object : AbstractList < Int > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Int ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Int = this@asList [ index ] <EOL> override fun indexOf ( element : Int ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Int ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun LongArray . asList ( ) : List < Long >

{ <EOL> return object : AbstractList < Long > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Long ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Long = this@asList [ index ] <EOL> override fun indexOf ( element : Long ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Long ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun FloatArray . asList ( ) : List < Float >

{ <EOL> return object : AbstractList < Float > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Float ) : Boolean = this@asList . any { it . toBits ( ) == element . toBits ( ) } <EOL> override fun get ( index : Int ) : Float = this@asList [ index ] <EOL> override fun indexOf ( element : Float ) : Int = this@asList . indexOfFirst { it . toBits ( ) == element . toBits ( ) } <EOL> override fun lastIndexOf ( element : Float ) : Int = this@asList . indexOfLast { it . toBits ( ) == element . toBits ( ) } <EOL> } <EOL> }


public actual fun DoubleArray . asList ( ) : List < Double >

{ <EOL> return object : AbstractList < Double > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Double ) : Boolean = this@asList . any { it . toBits ( ) == element . toBits ( ) } <EOL> override fun get ( index : Int ) : Double = this@asList [ index ] <EOL> override fun indexOf ( element : Double ) : Int = this@asList . indexOfFirst { it . toBits ( ) == element . toBits ( ) } <EOL> override fun lastIndexOf ( element : Double ) : Int = this@asList . indexOfLast { it . toBits ( ) == element . toBits ( ) } <EOL> } <EOL> }


public actual fun BooleanArray . asList ( ) : List < Boolean >

{ <EOL> return object : AbstractList < Boolean > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Boolean ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Boolean = this@asList [ index ] <EOL> override fun indexOf ( element : Boolean ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Boolean ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


public actual fun CharArray . asList ( ) : List < Char >

{ <EOL> return object : AbstractList < Char > ( ) , RandomAccess { <EOL> override val size : Int get ( ) = this@asList . size <EOL> override fun isEmpty ( ) : Boolean = this@asList . isEmpty ( ) <EOL> override fun contains ( element : Char ) : Boolean = this@asList . contains ( element ) <EOL> override fun get ( index : Int ) : Char = this@asList [ index ] <EOL> override fun indexOf ( element : Char ) : Int = this@asList . indexOf ( element ) <EOL> override fun lastIndexOf ( element : Char ) : Int = this@asList . lastIndexOf ( element ) <EOL> } <EOL> }


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual infix fun < T > Array < out T > . contentDeepEquals ( other : Array < out T > ) : Boolean

{ <EOL> return this . contentDeepEquals ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *deeply* equal to one another.
 *
 * Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal.
 * That is, if two corresponding elements are nested arrays, they are also compared deeply.
 * Elements of other types are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * If any of the arrays contain themselves at any nesting level, the behavior is undefined.
 *
 * @param other the array to compare deeply with this array.
 * @return `true` if the two arrays are deeply equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun < T > Array < out T > ? . contentDeepEquals ( other : Array < out T > ? ) : Boolean

{ <EOL> return contentDeepEqualsImpl ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *deeply* equal to one another.
 *
 * Two arrays are considered deeply equal if they have the same size, and elements at corresponding indices are deeply equal.
 * That is, if two corresponding elements are nested arrays, they are also compared deeply.
 * Elements of other types are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered deeply equal if both are `null`.
 *
 * If any of the arrays contain themselves at any nesting level, the behavior is undefined.
 *
 * @param other the array to compare deeply with this array.
 * @return `true` if the two arrays are deeply equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepEquals
 */


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual fun < T > Array < out T > . contentDeepHashCode ( ) : Int

{ <EOL> return this . contentDeepHashCode ( ) <EOL> }

/**
 * Returns a hash code based on the contents of this array as if it is [List].
 * Nested arrays are treated as lists too.
 *
 * If any of arrays contains itself on any nesting level the behavior is undefined.
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentDeepHashCode ( ) : Int

{ <EOL> return contentDeepHashCodeImpl ( ) <EOL> }


@ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ kotlin . internal . LowPriorityInOverloadResolution <EOL> public actual fun < T > Array < out T > . contentDeepToString ( ) : String

{ <EOL> return this . contentDeepToString ( ) <EOL> }

/**
 * Returns a string representation of the contents of this array as if it is a [List].
 * Nested arrays are treated as lists too.
 *
 * If any of arrays contains itself on any nesting level that reference
 * is rendered as `"[...]"` to prevent recursion.
 *
 * @sample samples.collections.Arrays.ContentOperations.contentDeepToString
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentDeepToString ( ) : String

{ <EOL> return contentDeepToStringImpl ( ) <EOL> }


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun < T > Array < out T > . contentEquals ( other : Array < out T > ) : Boolean

{ <EOL> return this . contentEquals ( other ) <EOL> }

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * If the arrays contain nested arrays, use [contentDeepEquals] to recursively compare their elements.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.arrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun ByteArray . contentEquals ( other : ByteArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.intArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun ShortArray . contentEquals ( other : ShortArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun IntArray . contentEquals ( other : IntArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun LongArray . contentEquals ( other : LongArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun FloatArray . contentEquals ( other : FloatArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * This means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.doubleArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun DoubleArray . contentEquals ( other : DoubleArray ) : Boolean


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun BooleanArray . contentEquals ( other : BooleanArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public infix fun CharArray . contentEquals ( other : CharArray ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.charArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun < T > Array < out T > ? . contentEquals ( other : Array < out T > ? ) : Boolean

{ <EOL> if ( this === other ) return true <EOL> if ( this === null || other === null ) return false <EOL> if ( size != other . size ) return false <EOL> for ( i in indices ) { <EOL> if ( this [ i ] != other [ i ] ) return false <EOL> } <EOL> return true <EOL> }

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * If the arrays contain nested arrays, use [contentDeepEquals] to recursively compare their elements.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.arrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun ByteArray ? . contentEquals ( other : ByteArray ? ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.intArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun ShortArray ? . contentEquals ( other : ShortArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun IntArray ? . contentEquals ( other : IntArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun LongArray ? . contentEquals ( other : LongArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun FloatArray ? . contentEquals ( other : FloatArray ? ) : Boolean

{ <EOL> if ( this === other ) return true <EOL> if ( this === null || other === null ) return false <EOL> if ( size != other . size ) return false <EOL> for ( i in indices ) { <EOL> if ( ! this [ i ] . equals ( other [ i ] ) ) return false <EOL> } <EOL> return true <EOL> }

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 * Elements are compared for equality using the [equals][Any.equals] function.
 * This means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.doubleArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun DoubleArray ? . contentEquals ( other : DoubleArray ? ) : Boolean


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun BooleanArray ? . contentEquals ( other : BooleanArray ? ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.booleanArrayContentEquals
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual infix fun CharArray ? . contentEquals ( other : CharArray ? ) : Boolean

/**
 * Checks if the two specified arrays are *structurally* equal to one another.
 *
 * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
 *
 * The arrays are also considered structurally equal if both are `null`.
 *
 * @param other the array to compare with this array.
 * @return `true` if the two arrays are structurally equal, `false` otherwise.
 *
 * @sample samples.collections.Arrays.ContentOperations.charArrayContentEquals
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun < T > Array < out T > . contentHashCode ( ) : Int

{ <EOL> return this . contentHashCode ( ) <EOL> }

/**
 * Returns a hash code based on the contents of this array as if it is [List].
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ByteArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ShortArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun IntArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun LongArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun FloatArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun DoubleArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun BooleanArray . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun CharArray . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentHashCode ( ) : Int

{ <EOL> if ( this === null ) return <NUM_LIT:0> <EOL> var result = <NUM_LIT:1> <EOL> for ( element in this ) <EOL> result = <NUM_LIT:31> * result + element . hashCode ( ) <EOL> return result <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ByteArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ShortArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun IntArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun LongArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun FloatArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun DoubleArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun BooleanArray ? . contentHashCode ( ) : Int


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun CharArray ? . contentHashCode ( ) : Int


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun < T > Array < out T > . contentToString ( ) : String

{ <EOL> return this . contentToString ( ) <EOL> }

/**
 * Returns a string representation of the contents of the specified array as if it is [List].
 *
 * @sample samples.collections.Arrays.ContentOperations.contentToString
 */


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ByteArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun ShortArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun IntArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun LongArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun FloatArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun DoubleArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun BooleanArray . contentToString ( ) : String


@ Deprecated ( "<STR_LIT>" ) <EOL> @ SinceKotlin ( "<STR_LIT:1.1>" ) <EOL> @ DeprecatedSinceKotlin ( hiddenSince = "<STR_LIT:1.4>" ) <EOL> public fun CharArray . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun < T > Array < out T > ? . contentToString ( ) : String

{ <EOL> return this ? . joinToString ( "<STR_LIT:U+002CU+0020>" , "<STR_LIT:[>" , "<STR_LIT:]>" ) ? : "<STR_LIT:null>" <EOL> }


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ByteArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun ShortArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun IntArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun LongArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun FloatArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun DoubleArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun BooleanArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> public actual fun CharArray ? . contentToString ( ) : String


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun < T > Array < out T > . copyInto ( destination : Array < T > , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : Array < T >

{ <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> arrayCopy ( this as Array < Any ? > , startIndex , destination as Array < Any ? > , destinationOffset , endIndex - startIndex ) <EOL> return destination <EOL> }

/**
 * Copies this array or its subrange into the [destination] array and returns that array.
 *
 * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.
 *
 * @param destination the array to copy to.
 * @param destinationOffset the position in the [destination] array to copy to, 0 by default.
 * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.
 * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.
 *
 * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.
 * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],
 * or when that index is out of the [destination] array indices range.
 *
 * @return the [destination] array.
 */


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ByteArray . copyInto ( destination : ByteArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : ByteArray

{ <EOL> arrayCopy ( this , startIndex , destination , destinationOffset , endIndex - startIndex ) <EOL> return destination <EOL> }


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ShortArray . copyInto ( destination : ShortArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : ShortArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun IntArray . copyInto ( destination : IntArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : IntArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun LongArray . copyInto ( destination : LongArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : LongArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun FloatArray . copyInto ( destination : FloatArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : FloatArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun DoubleArray . copyInto ( destination : DoubleArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : DoubleArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun BooleanArray . copyInto ( destination : BooleanArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : BooleanArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun CharArray . copyInto ( destination : CharArray , destinationOffset : Int = <NUM_LIT:0> , startIndex : Int = <NUM_LIT:0> , endIndex : Int = size ) : CharArray


public actual fun < T > Array < T > . copyOf ( ) : Array < T >

{ <EOL> return this . copyOfUninitializedElements ( size ) <EOL> }

/**
 * Returns new array which is a copy of the original array.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.copyOf
 */


public actual fun ByteArray . copyOf ( ) : ByteArray


public actual fun ShortArray . copyOf ( ) : ShortArray


public actual fun IntArray . copyOf ( ) : IntArray


public actual fun LongArray . copyOf ( ) : LongArray


public actual fun FloatArray . copyOf ( ) : FloatArray


public actual fun DoubleArray . copyOf ( ) : DoubleArray


public actual fun BooleanArray . copyOf ( ) : BooleanArray


public actual fun CharArray . copyOf ( ) : CharArray


public actual fun ByteArray . copyOf ( newSize : Int ) : ByteArray

{ <EOL> return this . copyOfUninitializedElements ( newSize ) <EOL> }

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with zero values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf
 */


public actual fun ShortArray . copyOf ( newSize : Int ) : ShortArray


public actual fun IntArray . copyOf ( newSize : Int ) : IntArray


public actual fun LongArray . copyOf ( newSize : Int ) : LongArray


public actual fun FloatArray . copyOf ( newSize : Int ) : FloatArray


public actual fun DoubleArray . copyOf ( newSize : Int ) : DoubleArray


public actual fun BooleanArray . copyOf ( newSize : Int ) : BooleanArray

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with `false` values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `false` values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf
 */


public actual fun CharArray . copyOf ( newSize : Int ) : CharArray

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with null char (`\u0000`) values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with null char (`\u0000`) values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf
 */


public actual fun < T > Array < T > . copyOf ( newSize : Int ) : Array < T ? >

{ <EOL> return this . copyOfNulls ( newSize ) <EOL> }

/**
 * Returns new array which is a copy of the original array, resized to the given [newSize].
 * The copy is either truncated or padded at the end with `null` values if necessary.
 *
 * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].
 * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `null` values.
 *
 * @sample samples.collections.Arrays.CopyOfOperations.resizingCopyOf
 */


public actual fun < T > Array < T > . copyOfRange ( fromIndex : Int , toIndex : Int ) : Array < T >

{ <EOL> checkCopyOfRangeArguments ( fromIndex , toIndex , size ) <EOL> return copyOfUninitializedElements ( fromIndex , toIndex ) <EOL> }

/**
 * Returns a new array which is a copy of the specified range of the original array.
 *
 * @param fromIndex the start of the range (inclusive) to copy.
 * @param toIndex the end of the range (exclusive) to copy.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */


public actual fun ByteArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : ByteArray


public actual fun ShortArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : ShortArray


public actual fun IntArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : IntArray


public actual fun LongArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : LongArray


public actual fun FloatArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : FloatArray


public actual fun DoubleArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : DoubleArray


public actual fun BooleanArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : BooleanArray


public actual fun CharArray . copyOfRange ( fromIndex : Int , toIndex : Int ) : CharArray


internal fun < T > Array < T > . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : Array < T >

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = arrayOfUninitializedElements < T > ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }

/**
 * Returns new array which is a copy of the original array's range between [fromIndex] (inclusive)
 * and [toIndex] (exclusive) with new elements filled with **lateinit** _uninitialized_ values.
 * Attempts to read _uninitialized_ values from this array work in implementation-dependent manner,
 * either throwing exception or returning some kind of implementation-specific default value.
 */


internal fun ByteArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : ByteArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = ByteArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun ShortArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : ShortArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = ShortArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun IntArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : IntArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = IntArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun LongArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : LongArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = LongArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun FloatArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : FloatArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = FloatArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun DoubleArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : DoubleArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = DoubleArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun BooleanArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : BooleanArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = BooleanArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun CharArray . copyOfUninitializedElements ( fromIndex : Int , toIndex : Int ) : CharArray

{ <EOL> val newSize = toIndex - fromIndex <EOL> if ( newSize < <NUM_LIT:0> ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> val result = CharArray ( newSize ) <EOL> this . copyInto ( result , <NUM_LIT:0> , fromIndex , toIndex . coerceAtMost ( size ) ) <EOL> return result <EOL> }


internal fun < T > Array < T > . copyOfUninitializedElements ( newSize : Int ) : Array < T >

{ <EOL> return copyOfUninitializedElements ( <NUM_LIT:0> , newSize ) <EOL> }

/**
 * Returns new array which is a copy of the original array with new elements filled with **lateinit** _uninitialized_ values.
 * Attempts to read _uninitialized_ values from this array work in implementation-dependent manner,
 * either throwing exception or returning some kind of implementation-specific default value.
 */


internal fun ByteArray . copyOfUninitializedElements ( newSize : Int ) : ByteArray


internal fun ShortArray . copyOfUninitializedElements ( newSize : Int ) : ShortArray


internal fun IntArray . copyOfUninitializedElements ( newSize : Int ) : IntArray


internal fun LongArray . copyOfUninitializedElements ( newSize : Int ) : LongArray


internal fun FloatArray . copyOfUninitializedElements ( newSize : Int ) : FloatArray


internal fun DoubleArray . copyOfUninitializedElements ( newSize : Int ) : DoubleArray


internal fun BooleanArray . copyOfUninitializedElements ( newSize : Int ) : BooleanArray


internal fun CharArray . copyOfUninitializedElements ( newSize : Int ) : CharArray


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun < T > Array < T > . fill ( element : T , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> arrayFill ( this , fromIndex , toIndex , element ) <EOL> }

/**
 * Fills this array or its subrange with the specified [element] value.
 *
 * @param fromIndex the start of the range (inclusive) to fill, 0 by default.
 * @param toIndex the end of the range (exclusive) to fill, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ByteArray . fill ( element : Byte , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ShortArray . fill ( element : Short , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun IntArray . fill ( element : Int , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun LongArray . fill ( element : Long , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun FloatArray . fill ( element : Float , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun DoubleArray . fill ( element : Double , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun BooleanArray . fill ( element : Boolean , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.3>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun CharArray . fill ( element : Char , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


public actual operator fun < T > Array < T > . plus ( element : T ) : Array < T >

{ <EOL> val index = size <EOL> val result = copyOfUninitializedElements ( index + <NUM_LIT:1> ) <EOL> result [ index ] = element <EOL> return result <EOL> }

/**
 * Returns an array containing all elements of the original array and then the given [element].
 */


public actual operator fun ByteArray . plus ( element : Byte ) : ByteArray


public actual operator fun ShortArray . plus ( element : Short ) : ShortArray


public actual operator fun IntArray . plus ( element : Int ) : IntArray


public actual operator fun LongArray . plus ( element : Long ) : LongArray


public actual operator fun FloatArray . plus ( element : Float ) : FloatArray


public actual operator fun DoubleArray . plus ( element : Double ) : DoubleArray


public actual operator fun BooleanArray . plus ( element : Boolean ) : BooleanArray


public actual operator fun CharArray . plus ( element : Char ) : CharArray


public actual operator fun < T > Array < T > . plus ( elements : Collection < T > ) : Array < T >

{ <EOL> var index = size <EOL> val result = copyOfUninitializedElements ( index + elements . size ) <EOL> for ( element in elements ) result [ index ++ ] = element <EOL> return result <EOL> }

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.
 */


public actual operator fun ByteArray . plus ( elements : Collection < Byte > ) : ByteArray


public actual operator fun ShortArray . plus ( elements : Collection < Short > ) : ShortArray


public actual operator fun IntArray . plus ( elements : Collection < Int > ) : IntArray


public actual operator fun LongArray . plus ( elements : Collection < Long > ) : LongArray


public actual operator fun FloatArray . plus ( elements : Collection < Float > ) : FloatArray


public actual operator fun DoubleArray . plus ( elements : Collection < Double > ) : DoubleArray


public actual operator fun BooleanArray . plus ( elements : Collection < Boolean > ) : BooleanArray


public actual operator fun CharArray . plus ( elements : Collection < Char > ) : CharArray


public actual operator fun < T > Array < T > . plus ( elements : Array < out T > ) : Array < T >

{ <EOL> val thisSize = size <EOL> val arraySize = elements . size <EOL> val result = copyOfUninitializedElements ( thisSize + arraySize ) <EOL> elements . copyInto ( result , thisSize ) <EOL> return result <EOL> }

/**
 * Returns an array containing all elements of the original array and then all elements of the given [elements] array.
 */


public actual operator fun ByteArray . plus ( elements : ByteArray ) : ByteArray


public actual operator fun ShortArray . plus ( elements : ShortArray ) : ShortArray


public actual operator fun IntArray . plus ( elements : IntArray ) : IntArray


public actual operator fun LongArray . plus ( elements : LongArray ) : LongArray


public actual operator fun FloatArray . plus ( elements : FloatArray ) : FloatArray


public actual operator fun DoubleArray . plus ( elements : DoubleArray ) : DoubleArray


public actual operator fun BooleanArray . plus ( elements : BooleanArray ) : BooleanArray


public actual operator fun CharArray . plus ( elements : CharArray ) : CharArray


@ kotlin . internal . InlineOnly <EOL> public actual inline fun < T > Array < T > . plusElement ( element : T ) : Array < T >

{ <EOL> return plus ( element ) <EOL> }


public actual fun IntArray . sort ( ) : Unit

{ <EOL> if ( size > <NUM_LIT:1> ) sortArray ( this , <NUM_LIT:0> , size ) <EOL> }

/**
 * Sorts the array in-place.
 *
 * @sample samples.collections.Arrays.Sorting.sortArray
 */


public actual fun LongArray . sort ( ) : Unit


public actual fun ByteArray . sort ( ) : Unit


public actual fun ShortArray . sort ( ) : Unit


public actual fun DoubleArray . sort ( ) : Unit


public actual fun FloatArray . sort ( ) : Unit


public actual fun CharArray . sort ( ) : Unit


public actual fun < T : Comparable < T > > Array < out T > . sort ( ) : Unit

/**
 * Sorts the array in-place according to the natural order of its elements.
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 *
 * @sample samples.collections.Arrays.Sorting.sortArrayOfComparable
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun < T : Comparable < T > > Array < out T > . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> sortArray ( this , fromIndex , toIndex ) <EOL> }

/**
 * Sorts a range in the array in-place.
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 *
 * @param fromIndex the start of the range (inclusive) to sort, 0 by default.
 * @param toIndex the end of the range (exclusive) to sort, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 *
 * @sample samples.collections.Arrays.Sorting.sortRangeOfArrayOfComparable
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ByteArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

/**
 * Sorts a range in the array in-place.
 *
 * @param fromIndex the start of the range (inclusive) to sort, 0 by default.
 * @param toIndex the end of the range (exclusive) to sort, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 *
 * @sample samples.collections.Arrays.Sorting.sortRangeOfArray
 */


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun ShortArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun IntArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun LongArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun FloatArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun DoubleArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


@ SinceKotlin ( "<STR_LIT:1.4>" ) <EOL> @ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun CharArray . sort ( fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit


public actual fun < T > Array < out T > . sortWith ( comparator : Comparator < in T > ) : Unit

{ <EOL> if ( size > <NUM_LIT:1> ) sortArrayWith ( this , <NUM_LIT:0> , size , comparator ) <EOL> }

/**
 * Sorts the array in-place according to the order specified by the given [comparator].
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 */


@ Suppress ( "<STR_LIT:ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS>" ) <EOL> public actual fun < T > Array < out T > . sortWith ( comparator : Comparator < in T > , fromIndex : Int = <NUM_LIT:0> , toIndex : Int = size ) : Unit

{ <EOL> AbstractList . checkRangeIndexes ( fromIndex , toIndex , size ) <EOL> sortArrayWith ( this , fromIndex , toIndex , comparator ) <EOL> }

/**
 * Sorts a range in the array in-place with the given [comparator].
 *
 * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
 *
 * @param fromIndex the start of the range (inclusive) to sort, 0 by default.
 * @param toIndex the end of the range (exclusive) to sort, size of this array by default.
 *
 * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.
 * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].
 */


public actual fun ByteArray . toTypedArray ( ) : Array < Byte >

{ <EOL> return Array ( size ) { index -> this [ index ] } <EOL> }

/**
 * Returns a *typed* object array containing all of the elements of this primitive array.
 */


public actual fun ShortArray . toTypedArray ( ) : Array < Short >


public actual fun IntArray . toTypedArray ( ) : Array < Int >


public actual fun LongArray . toTypedArray ( ) : Array < Long >


public actual fun FloatArray . toTypedArray ( ) : Array < Float >


public actual fun DoubleArray . toTypedArray ( ) : Array < Double >


public actual fun BooleanArray . toTypedArray ( ) : Array < Boolean >


public actual fun CharArray . toTypedArray ( ) : Array < Char >


{ <EOL> return Wrapper ( Result . success ( "<STR_LIT:OK>" ) ) . response . getOrThrow ( ) <EOL> }


{ <EOL> ( fun Foo . ( ) { <EOL> bar ( ) <EOL> ( fun Barr . ( ) { <EOL> this . bar ( ) <EOL> bar ( ) <EOL> } ) <EOL> } ) <EOL> ( fun Barr . ( ) { <EOL> this . bar ( ) <EOL> bar ( ) <EOL> } ) <EOL> }


infix fun Any ? . equals ( other : Any ? )

{ <EOL> if ( this != other ) throw AssertionError ( "<STR_LIT>" ) <EOL> }


= "<STR_LIT>"


= <NUM_LIT:0>


{ <EOL> x equals <NUM_LIT:42> <EOL> null . toString ( ) <EOL> null . hashCode ( ) <EOL> return "<STR_LIT:OK>" <EOL> }


= C ( <NUM_LIT:42> ) . test ( )


{ <EOL> withTempDir { tempDir -> <EOL> runBlocking { <EOL> val srcDir = File ( TEST_DATA_DIR , "<STR_LIT>" ) <EOL> val destDir = File ( tempDir , "<STR_LIT>" ) . also { it . mkdir ( ) } <EOL> val javaRes = KotlinTestUtils . compileJavaFiles ( srcDir . listFiles { file : File -> file . extension == "<STR_LIT:java>" } ! ! . toMutableList ( ) , mutableListOf ( "<STR_LIT:-d>" , destDir . absolutePath ) ) <EOL> assertTrue ( javaRes ) <EOL> val baseConfig = ScriptCompilationConfiguration { <EOL> fileExtension ( "<STR_LIT>" ) <EOL> dependencies ( JvmDependency ( destDir ) ) <EOL> } <EOL> JvmScriptCompiler ( ) ( File ( srcDir , "<STR_LIT>" ) . toScriptSource ( ) , baseConfig ) . let { res -> <EOL> when ( res ) { <EOL> is ResultWithDiagnostics . Success -> fail ( "<STR_LIT>" ) <EOL> is ResultWithDiagnostics . Failure -> <EOL> if ( res . reports . none { it . message . contains ( "<STR_LIT>" ) || it . message . contains ( "<STR_LIT>" ) } ) { <EOL> fail ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> val configWithSwr = baseConfig . with { <EOL> annotationsForSamWithReceivers ( "<STR_LIT>" ) <EOL> } <EOL> JvmScriptCompiler ( ) ( File ( srcDir , "<STR_LIT>" ) . toScriptSource ( ) , configWithSwr ) . onFailure { res -> <EOL> fail ( "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> }


override fun transform ( module : TestModule , inputArtifact : ClassicBackendInput ) : BinaryArtifacts . Jvm

{ <EOL> val configuration = testServices . compilerConfigurationProvider . getCompilerConfiguration ( module ) <EOL> val ( psiFiles , analysisResult , project , _ ) = inputArtifact <EOL> val generationState = GenerationState . Builder ( project , ClassBuilderFactories . TEST , analysisResult . moduleDescriptor , analysisResult . bindingContext , configuration ) . build ( ) <EOL> KotlinCodegenFacade . compileCorrectFiles ( psiFiles , generationState , DefaultCodegenFactory ) <EOL> javaCompilerFacade . compileJavaFiles ( module , configuration , generationState . factory ) <EOL> return BinaryArtifacts . Jvm ( generationState . factory , psiFiles . map { SourceFileInfo ( KtPsiSourceFile ( it ) , JvmFileClassUtil . getFileClassInfoNoResolve ( it ) ) } ) <EOL> }


{ <EOL> var result : Result <EOL> try { <EOL> result = Result . Success ( "<STR_LIT:OK>" ) <EOL> } <EOL> catch ( e : Exception ) { <EOL> result = Result . Failure ( Exception ( ) ) <EOL> } <EOL> when ( result ) { <EOL> is Result . Failure -> throw result . exception <EOL> is Result . Success -> return result . message <EOL> } <EOL> }


public inline fun < reified T : Throwable > failsWith ( block : ( ) -> Any ) : T

{ <EOL> try { <EOL> block ( ) <EOL> } <EOL> catch ( e : Throwable ) { <EOL> if ( e is T ) return e <EOL> } <EOL> throw Exception ( "<STR_LIT>" ) <EOL> }


{ <EOL> val a = failsWith < Exception > { <EOL> throw Exception ( "<STR_LIT:OK>" ) <EOL> } <EOL> return a . message ! ! <EOL> }


@ DisabledOnOs ( OS . WINDOWS , disabledReason = "<STR_LIT>" ) <EOL> @ DisplayName ( "<STR_LIT>" ) <EOL> @ GradleTest <EOL> open fun afterChangeInPluginBuildDoesIncrementalProcessing ( gradleVersion : GradleVersion )

{ <EOL> project ( "<STR_LIT>" . prefix , gradleVersion ) { <EOL> val classesDirectory = subProject ( "<STR_LIT:library>" ) . kotlinClassesDir ( "<STR_LIT:main>" ) <EOL> build ( "<STR_LIT:assemble>" ) { <EOL> assertClassDeclarationsContain ( classesDirectory , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assertClassDeclarationsContain ( classesDirectory , "<STR_LIT>" , "<STR_LIT>" ) <EOL> } <EOL> subProject ( "<STR_LIT>" ) <EOL> . kotlinSourcesDir ( ) <EOL> . resolve ( "<STR_LIT>" ) <EOL> . modify { <EOL> it . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> } <EOL> build ( "<STR_LIT:assemble>" ) { <EOL> assertClassDeclarationsContain ( classesDirectory , "<STR_LIT>" , "<STR_LIT>" ) <EOL> assertClassDeclarationsContain ( classesDirectory , "<STR_LIT>" , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> }


{ <EOL> val a = if ( true ) { <EOL> val x = <NUM_LIT:1> <EOL> "<STR_LIT>" . length <EOL> :: foo <EOL> } else { <EOL> :: foo <EOL> } <EOL> a checkType { _ < KFunction0 < Int > > ( ) } <EOL> }


fun send ( e : T )


@ OptIn ( ExperimentalTypeInference :: class ) <EOL> fun < K > foo ( block : Inv < K > . ( ) -> Unit )


{ <EOL> foo { <EOL> val p = send ( i ) <EOL> } <EOL> }


{ <EOL> assertEquals ( <NUM_LIT:7> , fibi . take ( <NUM_LIT:3> ) . last ( ) ) <EOL> }


override fun < R , D > acceptChildren ( visitor : FirVisitor < R , D > , data : D )

{ <EOL> typeRef . accept ( visitor , data ) <EOL> }


override fun < D > transformChildren ( transformer : FirTransformer < D > , data : D ) : FirTypeProjectionWithVarianceImpl

{ <EOL> typeRef = typeRef . transform ( transformer , data ) <EOL> return this <EOL> }


{ <EOL> when ( true ) { <EOL> ( s != null ) -> s . length <EOL> else -> null <EOL> } <EOL> }


{ <EOL> when ( s != null ) { <EOL> true -> s . length <EOL> else -> null <EOL> } <EOL> }


{ <EOL> if ( true == ( s != null ) ) s . length <EOL> }


{ <EOL> val data = Project ( "<STR_LIT>" ) <EOL> println ( format . encodeToString ( data ) ) <EOL> }


override fun lower ( irBody : IrBody , container : IrDeclaration )

{ <EOL> val thisReceiver = ( container as? IrSimpleFunction ) ? . dispatchReceiverParameter <EOL> if ( thisReceiver == null || ! container . overrides ( invokeSuspendFunction . owner ) ) <EOL> return <EOL> val coroutineClass = container . parentAsClass <EOL> val localToPropertyMap = mutableMapOf < IrVariableSymbol , IrField > ( ) <EOL> fun getFieldForSpilling ( variable : IrVariable ) = localToPropertyMap . getOrPut ( variable . symbol ) { <EOL> variable . isVar = true <EOL> irFactory . buildField { <EOL> startOffset = coroutineClass . startOffset <EOL> endOffset = coroutineClass . endOffset <EOL> origin = DECLARATION_ORIGIN_COROUTINE_VAR_SPILLING <EOL> name = variable . name <EOL> type = variable . type <EOL> visibility = DescriptorVisibilities . PRIVATE <EOL> isFinal = false <EOL> } . apply { <EOL> coroutineClass . addChild ( this ) <EOL> } <EOL> } <EOL> val irBuilder = context . createIrBuilder ( container . symbol , container . startOffset , container . endOffset ) <EOL> irBody . transformChildren ( object : IrElementTransformer < List < IrVariable > > { <EOL> override fun visitSuspensionPoint ( expression : IrSuspensionPoint , data : List < IrVariable > ) : IrExpression { <EOL> val liveVariables = generationState . liveVariablesAtSuspensionPoints [ expression ] <EOL> ? : generationState . visibleVariablesAtSuspensionPoints [ expression ] <EOL> ? : error ( "<STR_LIT>" ) <EOL> expression . transformChildren ( this , liveVariables ) <EOL> return expression <EOL> } <EOL> override fun visitCall ( expression : IrCall , data : List < IrVariable > ) : IrExpression { <EOL> expression . transformChildren ( this , data ) <EOL> return when ( expression . symbol ) { <EOL> saveCoroutineState -> irBuilder . run { <EOL> irBlock ( expression ) { <EOL> for ( variable in data ) { <EOL> val field = getFieldForSpilling ( variable ) <EOL> + irSetField ( irGet ( thisReceiver ) , field , irGet ( variable ) ) <EOL> } <EOL> } <EOL> } <EOL> restoreCoroutineState -> irBuilder . run { <EOL> irBlock ( expression ) { <EOL> for ( variable in data ) { <EOL> val field = getFieldForSpilling ( variable ) <EOL> + irSet ( variable , irGetField ( irGet ( thisReceiver ) , field ) ) <EOL> } <EOL> } <EOL> } <EOL> else -> expression <EOL> } <EOL> } <EOL> } , data = emptyList ( ) ) <EOL> }


{ <EOL> if ( generationState . liveVariablesAtSuspensionPoints . isEmpty ( ) ) <EOL> irFile . acceptChildrenVoid ( this ) <EOL> }


override fun visitElement ( element : IrElement )

{ <EOL> element . acceptChildrenVoid ( this ) <EOL> }


override fun visitFunction ( declaration : IrFunction )

{ <EOL> val body = declaration . body <EOL> if ( body != null && declaration . dispatchReceiverParameter != null && ( declaration as? IrSimpleFunction ) ? . overrides ( invokeSuspendFunction . owner ) == true ) { <EOL> computeVisibleVariablesAtSuspensionPoints ( body ) <EOL> } <EOL> }


private fun computeVisibleVariablesAtSuspensionPoints ( body : IrBody )

{ <EOL> body . acceptChildrenVoid ( object : IrElementVisitorVoid { <EOL> val scopeStack = mutableListOf < MutableSet < IrVariable > > ( mutableSetOf ( ) ) <EOL> override fun visitElement ( element : IrElement ) { <EOL> element . acceptChildrenVoid ( this ) <EOL> } <EOL> override fun visitContainerExpression ( expression : IrContainerExpression ) { <EOL> if ( ! expression . isTransparentScope ) <EOL> scopeStack . push ( mutableSetOf ( ) ) <EOL> super . visitContainerExpression ( expression ) <EOL> if ( ! expression . isTransparentScope ) <EOL> scopeStack . pop ( ) <EOL> } <EOL> override fun visitCatch ( aCatch : IrCatch ) { <EOL> scopeStack . push ( mutableSetOf ( ) ) <EOL> super . visitCatch ( aCatch ) <EOL> scopeStack . pop ( ) <EOL> } <EOL> override fun visitVariable ( declaration : IrVariable ) { <EOL> super . visitVariable ( declaration ) <EOL> scopeStack . peek ( ) ! ! . add ( declaration ) <EOL> } <EOL> override fun visitSuspensionPoint ( expression : IrSuspensionPoint ) { <EOL> expression . result . acceptChildrenVoid ( this ) <EOL> expression . resumeResult . acceptChildrenVoid ( this ) <EOL> val visibleVariables = mutableListOf < IrVariable > ( ) <EOL> scopeStack . forEach { visibleVariables += it } <EOL> generationState . visibleVariablesAtSuspensionPoints [ expression ] = visibleVariables <EOL> } <EOL> } ) <EOL> }


= AtomicInt ( i )


private inline fun AtomicInt . extensionFun ( )

{ <EOL> if ( a == <NUM_LIT> ) throw IllegalStateException ( "<STR_LIT>" ) <EOL> value <EOL> }


private suspend inline fun suspendBar ( )

{ <EOL> state . extensionFun ( ) <EOL> suspendCoroutineUninterceptedOrReturn < Any ? > { ucont -> <EOL> Unit <EOL> } <EOL> }


{ <EOL> val a = suspendBar ( ) <EOL> }


{ <EOL> foo ( ) <EOL> foo ( ) <EOL> }


= "<STR_LIT>"


= this :: class . simpleName ! !


{ <EOL> val o = O ( ) <EOL> val k = K ( ) <EOL> return o . className ( ) + k . className ( ) <EOL> }


fun addDependsOnEdgeFromTemplate ( from : KotlinSourceSet , to : KotlinSourceSet )

{ <EOL> val edge = from to to <EOL> dependsOnEdgesAppliedThroughTemplates += edge <EOL> dontRemember { <EOL> from . dependsOn ( to ) <EOL> } <EOL> }


private fun dontRemember ( code : ( ) -> Unit )

{ <EOL> dontRemember = true <EOL> try { <EOL> code ( ) <EOL> } finally { <EOL> dontRemember = false <EOL> } <EOL> }


fun remember ( from : KotlinSourceSet , to : KotlinSourceSet )

{ <EOL> if ( dontRemember ) return <EOL> rememberedEdges . add ( from to to ) <EOL> }

/** Should be called from [KotlinSourceSet.dependsOn] method,
 * so depends on edges are tracked and can be distinguished when they added via [addDependsOnEdgeFromTemplate] */