{ <EOL> runInteractive ( * replOutHeader , "<STR_LIT>" to "<STR_LIT:true>" , compilationClasspath = KotlinPathsFromHomeDir ( PathUtil . kotlinPathsForDistDirectory . homePath ) . classPath ( KotlinPaths . Jar . AllOpenPlugin ) ) <EOL> }


suspend operator fun component1 ( ) : String

= "<STR_LIT:K>"


{ <EOL> foo { <EOL> ( x ) -> <EOL> x . length <EOL> } <EOL> }


= <EOL> Outer ( "<STR_LIT:K>" ) :: Inner . invoke ( "<STR_LIT:O>" ) . yx


@ JvmStatic <EOL> fun getByShortName ( name : String ) : PrimitiveType ?

= when ( name ) { <EOL> "<STR_LIT>" -> BOOLEAN <EOL> "<STR_LIT>" -> CHAR <EOL> "<STR_LIT>" -> BYTE <EOL> "<STR_LIT>" -> SHORT <EOL> "<STR_LIT:Int>" -> INT <EOL> "<STR_LIT>" -> FLOAT <EOL> "<STR_LIT>" -> LONG <EOL> "<STR_LIT>" -> DOUBLE <EOL> else -> null <EOL> }


@ JvmStatic <EOL> fun getByShortArrayName ( name : String ) : PrimitiveType ?

= when ( name ) { <EOL> "<STR_LIT>" -> BOOLEAN <EOL> "<STR_LIT>" -> CHAR <EOL> "<STR_LIT>" -> BYTE <EOL> "<STR_LIT>" -> SHORT <EOL> "<STR_LIT>" -> INT <EOL> "<STR_LIT>" -> FLOAT <EOL> "<STR_LIT>" -> LONG <EOL> "<STR_LIT>" -> DOUBLE <EOL> else -> null <EOL> }


= <NUM_LIT:23>


= <NUM_LIT:42>


{ <EOL> assertEquals ( <NUM_LIT:23> , A ( ) . foo ( ) ) <EOL> assertEquals ( <NUM_LIT:42> , A . foo ( ) ) <EOL> assertEquals ( <NUM_LIT> , A ( ) . bar ) <EOL> assertEquals ( <NUM_LIT> , A . bar ) <EOL> return "<STR_LIT:OK>" <EOL> }


{ <EOL> assertEquals ( "<STR_LIT>" , Klass :: class . qualifiedName ) <EOL> assertEquals ( "<STR_LIT>" , Klass . Nested :: class . qualifiedName ) <EOL> assertEquals ( "<STR_LIT>" , Klass . `Nested$With$Dollars` :: class . qualifiedName ) <EOL> assertEquals ( "<STR_LIT>" , Klass . Companion :: class . qualifiedName ) <EOL> assertEquals ( "<STR_LIT>" , java . util . Date :: class . qualifiedName ) <EOL> assertEquals ( "<STR_LIT>" , kotlin . jvm . internal . Ref . ObjectRef :: class . qualifiedName ) <EOL> class Local <EOL> assertEquals ( null , Local :: class . qualifiedName ) <EOL> val o = object { } <EOL> assertEquals ( null , o . javaClass . kotlin . qualifiedName ) <EOL> return "<STR_LIT:OK>" <EOL> }


override fun < T , R > accept ( visitor : CirNodeVisitor < T , R > , data : T )

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


= CirNode . toString ( this )


override fun analyzeWithAllCompilerChecks ( elements : Collection < KtElement > , callback : DiagnosticSink . DiagnosticsCallback ? <EOL> ) : AnalysisResult

{ <EOL> throw UnsupportedOperationException ( ) <EOL> }


@ OptIn ( FrontendInternals :: class ) <EOL> override fun < T : Any > tryGetFrontendService ( element : PsiElement , serviceClass : Class < T > ) : T ?

{ <EOL> return resolverForModule . componentProvider . tryGetService ( serviceClass ) <EOL> }


override fun resolveToDescriptor ( declaration : KtDeclaration , bodyResolveMode : BodyResolveMode ) : DeclarationDescriptor

{ <EOL> return resolveSession . resolveToDescriptor ( declaration ) <EOL> }


override fun analyze ( elements : Collection < KtElement > , bodyResolveMode : BodyResolveMode ) : BindingContext


override fun analyze ( element : KtElement , bodyResolveMode : BodyResolveMode ) : BindingContext

{ <EOL> if ( element is KtDeclaration ) { <EOL> val descriptor = resolveToDescriptor ( element ) <EOL> return object : BindingContext { <EOL> override fun < K : Any ? , V : Any ? > getKeys ( p0 : WritableSlice < K , V > ? ) : Collection < K > { <EOL> throw UnsupportedOperationException ( ) <EOL> } <EOL> override fun getType ( p0 : KtExpression ) : KotlinType ? { <EOL> throw UnsupportedOperationException ( ) <EOL> } <EOL> override fun < K : Any ? , V : Any ? > get ( slice : ReadOnlySlice < K , V > ? , key : K ) : V ? { <EOL> if ( key != element ) { <EOL> throw UnsupportedOperationException ( ) <EOL> } <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return when { <EOL> slice == BindingContext . DECLARATION_TO_DESCRIPTOR -> descriptor as V <EOL> slice == BindingContext . PRIMARY_CONSTRUCTOR_PARAMETER && ( element as KtParameter ) . hasValOrVar ( ) -> descriptor as V <EOL> else -> null <EOL> } <EOL> } <EOL> override fun getProject ( ) : Project ? { <EOL> throw UnsupportedOperationException ( ) <EOL> } <EOL> override fun getDiagnostics ( ) : Diagnostics { <EOL> throw UnsupportedOperationException ( ) <EOL> } <EOL> override fun addOwnDataTo ( p0 : BindingTrace , p1 : Boolean ) { <EOL> throw UnsupportedOperationException ( ) <EOL> } <EOL> override fun < K : Any ? , V : Any ? > getSliceContents ( p0 : ReadOnlySlice < K , V > ) : ImmutableMap < K , V > { <EOL> throw UnsupportedOperationException ( ) <EOL> } <EOL> } <EOL> } <EOL> throw UnsupportedOperationException ( ) <EOL> }


override fun < T : Any > getFrontendService ( element : PsiElement , serviceClass : Class < T > ) : T


override fun < T : Any > getFrontendService ( serviceClass : Class < T > ) : T

{ <EOL> return resolverForModule . componentProvider . getService ( serviceClass ) <EOL> }


@ Deprecated ( "<STR_LIT>" ) <EOL> override fun < T : Any > getFrontendService ( moduleDescriptor : ModuleDescriptor , serviceClass : Class < T > ) : T


override fun < T : Any > getIdeService ( serviceClass : Class < T > ) : T


override fun getResolverForProject ( ) : ResolverForProject < out ModuleInfo >


override fun deserialize ( decoder : Decoder ) : ThirdPartyBox < T >

{ <EOL> return ThirdPartyBox ( decoder . decodeSerializableValue ( strategy ) . contents ) <EOL> }


override fun serialize ( encoder : Encoder , value : ThirdPartyBox < T > )

{ <EOL> encoder . encodeSerializableValue ( strategy , BoxSurrogate ( value . contents ) ) <EOL> }


@ Test <EOL> fun testSurrogateSerializerFoundForGenericWithKotlinType ( )

{ <EOL> val serializer = serializersModuleStatic . serializer < ThirdPartyBox < Item > > ( ) <EOL> assertEquals ( boxWithItemSerializer . descriptor , serializer . descriptor ) <EOL> }


@ Test <EOL> fun testSerializerFoundForContextualGeneric ( )

{ <EOL> val serializerA = serializersModuleWithProvider . serializer < ThirdPartyBox < Item > > ( ) <EOL> assertEquals ( Item . serializer ( ) . descriptor , serializerA . descriptor . getElementDescriptor ( <NUM_LIT:0> ) ) <EOL> val serializerB = serializersModuleWithProvider . serializer < ThirdPartyBox < AnotherItem > > ( ) <EOL> assertEquals ( AnotherItem . serializer ( ) . descriptor , serializerB . descriptor . getElementDescriptor ( <NUM_LIT:0> ) ) <EOL> }


@ Test <EOL> fun testModuleProvidesMultipleGenericSerializers ( )

{ <EOL> fun checkFor ( serial : KSerializer < * > ) { <EOL> val serializer = serializersModuleWithProvider . getContextual ( ThirdPartyBox :: class , listOf ( serial ) ) ? . descriptor <EOL> assertEquals ( serial . descriptor , serializer ? . getElementDescriptor ( <NUM_LIT:0> ) ) <EOL> } <EOL> checkFor ( Item . serializer ( ) ) <EOL> checkFor ( AnotherItem . serializer ( ) ) <EOL> }


fun usage ( instance : one . SimpleClass )

{ <EOL> instance . const < caret > ructorPropertyWithAnnotations <EOL> }


fun postMessage ( message : JsAny ? , transfer : JsArray < JsAny > = definedExternally )


fun update ( ) : Promise < Nothing ? >


fun unregister ( ) : Promise < JsBoolean >


fun showNotification ( title : String , options : NotificationOptions = definedExternally ) : Promise < Nothing ? >


fun getNotifications ( filter : GetNotificationOptions = definedExternally ) : Promise < JsArray < Notification > >


fun methodName ( ) : Promise < JsAny ? >


fun register ( scriptURL : String , options : RegistrationOptions = definedExternally ) : Promise < ServiceWorkerRegistration >


fun getRegistration ( clientURL : String = definedExternally ) : Promise < JsAny ? >


fun getRegistrations ( ) : Promise < JsArray < ServiceWorkerRegistration > >


fun startMessages ( )


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun RegistrationOptions ( scope : String ? = undefined , type : WorkerType ? = WorkerType . CLASSIC ) : RegistrationOptions

{ js ( "<STR_LIT>" ) }


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun ServiceWorkerMessageEventInit ( data : JsAny ? = undefined , origin : String ? = undefined , lastEventId : String ? = undefined , source : UnionMessagePortOrServiceWorker ? = undefined , ports : JsArray < MessagePort > ? = undefined , bubbles : Boolean ? = false , cancelable : Boolean ? = false , composed : Boolean ? = false ) : ServiceWorkerMessageEventInit

{ js ( "<STR_LIT>" ) }


fun skipWaiting ( ) : Promise < Nothing ? >


fun focus ( ) : Promise < WindowClient >


fun navigate ( url : String ) : Promise < WindowClient >


fun get ( id : String ) : Promise < JsAny ? >


fun matchAll ( options : ClientQueryOptions = definedExternally ) : Promise < JsArray < Client > >


fun openWindow ( url : String ) : Promise < WindowClient ? >


fun claim ( ) : Promise < Nothing ? >


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun ClientQueryOptions ( includeUncontrolled : Boolean ? = false , type : ClientType ? = ClientType . WINDOW ) : ClientQueryOptions

{ js ( "<STR_LIT>" ) }


fun waitUntil ( f : Promise < JsAny ? > )


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun ExtendableEventInit ( bubbles : Boolean ? = false , cancelable : Boolean ? = false , composed : Boolean ? = false ) : ExtendableEventInit

{ js ( "<STR_LIT>" ) }


fun registerForeignFetch ( options : ForeignFetchOptions )


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun ForeignFetchOptions ( scopes : JsArray < JsString > ? , origins : JsArray < JsString > ? ) : ForeignFetchOptions

{ js ( "<STR_LIT>" ) }


fun respondWith ( r : Promise < Response > )


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun FetchEventInit ( request : Request ? , clientId : String ? = null , isReload : Boolean ? = false , bubbles : Boolean ? = false , cancelable : Boolean ? = false , composed : Boolean ? = false ) : FetchEventInit

{ js ( "<STR_LIT>" ) }


fun respondWith ( r : Promise < ForeignFetchResponse > )


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun ForeignFetchEventInit ( request : Request ? , origin : String ? = "<STR_LIT:null>" , bubbles : Boolean ? = false , cancelable : Boolean ? = false , composed : Boolean ? = false ) : ForeignFetchEventInit

{ js ( "<STR_LIT>" ) }


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun ForeignFetchResponse ( response : Response ? , origin : String ? = undefined , headers : JsArray < JsString > ? = undefined ) : ForeignFetchResponse

{ js ( "<STR_LIT>" ) }


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun ExtendableMessageEventInit ( data : JsAny ? = undefined , origin : String ? = undefined , lastEventId : String ? = undefined , source : UnionClientOrMessagePortOrServiceWorker ? = undefined , ports : JsArray < MessagePort > ? = undefined , bubbles : Boolean ? = false , cancelable : Boolean ? = false , composed : Boolean ? = false ) : ExtendableMessageEventInit

{ js ( "<STR_LIT>" ) }


fun match ( request : Request , options : CacheQueryOptions = definedExternally ) : Promise < JsAny ? >


fun match ( request : String , options : CacheQueryOptions = definedExternally ) : Promise < JsAny ? >


fun matchAll ( request : Request , options : CacheQueryOptions = definedExternally ) : Promise < JsArray < Response > >


fun matchAll ( request : String , options : CacheQueryOptions = definedExternally ) : Promise < JsArray < Response > >


fun matchAll ( ) : Promise < JsArray < Response > >


fun add ( request : Request ) : Promise < Nothing ? >


fun add ( request : String ) : Promise < Nothing ? >


fun addAll ( requests : JsArray < JsAny ? > ) : Promise < Nothing ? >


fun put ( request : Request , response : Response ) : Promise < Nothing ? >


fun put ( request : String , response : Response ) : Promise < Nothing ? >


fun delete ( request : Request , options : CacheQueryOptions = definedExternally ) : Promise < JsBoolean >


fun delete ( request : String , options : CacheQueryOptions = definedExternally ) : Promise < JsBoolean >


fun keys ( request : Request , options : CacheQueryOptions = definedExternally ) : Promise < JsArray < Request > >


fun keys ( request : String , options : CacheQueryOptions = definedExternally ) : Promise < JsArray < Request > >


fun keys ( ) : Promise < JsArray < Request > >


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun CacheQueryOptions ( ignoreSearch : Boolean ? = false , ignoreMethod : Boolean ? = false , ignoreVary : Boolean ? = false , cacheName : String ? = undefined ) : CacheQueryOptions

{ js ( "<STR_LIT>" ) }


@ Suppress ( "<STR_LIT:UNUSED_PARAMETER>" ) <EOL> public fun CacheBatchOperation ( type : String ? = undefined , request : Request ? = undefined , response : Response ? = undefined , options : CacheQueryOptions ? = undefined ) : CacheBatchOperation

{ js ( "<STR_LIT>" ) }


fun match ( request : Request , options : CacheQueryOptions = definedExternally ) : Promise < JsAny ? >


fun match ( request : String , options : CacheQueryOptions = definedExternally ) : Promise < JsAny ? >


fun has ( cacheName : String ) : Promise < JsBoolean >


fun open ( cacheName : String ) : Promise < Cache >


fun delete ( cacheName : String ) : Promise < JsBoolean >


fun keys ( ) : Promise < JsArray < JsString > >


= z . foo ( )


= z ? . foo ( )


= "<STR_LIT:O>"


= "<STR_LIT>"


= k


override fun createPointer ( ) : KtSymbolPointer < KtJavaFieldSymbol >

= withValidityAssertion { <EOL> KtFirJavaFieldSymbolPointer ( analysisSession . createOwnerPointer ( this ) , name , firSymbol . isStatic ) <EOL> }


override fun equals ( other : Any ? ) : Boolean

= symbolEquals ( other )


= symbolHashCode ( )


fun < T : Number > sin ( x : KtNDArray < T > ) : KtNDArray < Double >

= <EOL> callFunc ( nameMethod = arrayOf ( "<STR_LIT>" ) , args = arrayOf ( x ) , dtype = Double :: class )

/**
 * Trigonometric sine, element-wise.
 */


fun < T : Number > cos ( x : KtNDArray < T > ) : KtNDArray < Double >


fun < T : Number > tan ( x : KtNDArray < T > ) : KtNDArray < Double >

/**
 * Compute tangent element-wise.
 */


fun < T : Number > arcsin ( x : KtNDArray < T > ) : KtNDArray < Double >


fun < T : Number > arccos ( x : KtNDArray < T > ) : KtNDArray < Double >

/**
 * Trigonometric inverse cosine, element-wise.
 */


fun < T : Number > arctan ( x : KtNDArray < T > ) : KtNDArray < Double >

/**
 * Trigonometric inverse tangent, element-wise.
 */


fun < T : Number , E : Number > hypot ( x1 : KtNDArray < T > , x2 : KtNDArray < E > ) : KtNDArray < Double >

= <EOL> callFunc ( nameMethod = arrayOf ( "<STR_LIT>" ) , args = arrayOf ( x1 , x2 ) , dtype = Double :: class )


fun < T : Number , E : Number > arctan2 ( x1 : KtNDArray < T > , x2 : KtNDArray < E > ) : KtNDArray < Double >

/**
 * Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
 */


fun < T : Number > degrees ( x : KtNDArray < T > ) : KtNDArray < Double >

/**
 * Convert angles from radians to degrees.
 */


fun < T : Number > radians ( x : KtNDArray < T > ) : KtNDArray < Double >

/**
 * Convert angles from degrees to radians.
 */


fun < T : Number > unwrap ( p : KtNDArray < T > , discont : Double = PI , axis : Int = - <NUM_LIT:1> ) : KtNDArray < Double >

= <EOL> callFunc ( nameMethod = arrayOf ( "<STR_LIT>" ) , args = arrayOf ( p , discont , axis ) )

/**
 * Unwrap by changing deltas between values to 2*pi complement.
 */


fun < T : Number > deg2rad ( x : KtNDArray < T > ) : KtNDArray < Double >


fun < T : Number > rad2deg ( x : KtNDArray < T > ) : KtNDArray < Double >


= <EOL> put ( x , SIZE , isEmpty = { arr [ it ] < <NUM_LIT:0> } , equals = { x , y -> x == y } , fetch = { arr [ it ] } , store = { i , x -> arr [ i ] = x } )


inline fun < T > put ( x : T , maxExclusive : Int , isEmpty : ( Int ) -> Boolean , equals : ( T , T ) -> Boolean , fetch : ( Int ) -> T , store : ( Int , T ) -> Unit ) : Boolean

{ <EOL> var i = <NUM_LIT:0> <EOL> do { <EOL> if ( isEmpty ( i ) ) { <EOL> store ( i , x ) <EOL> return true <EOL> } <EOL> val y = fetch ( i ) <EOL> if ( equals ( x , y ) ) { <EOL> return false <EOL> } <EOL> i ++ <EOL> if ( i >= maxExclusive ) return false <EOL> } while ( true ) <EOL> }


inline fun run ( block : ( T ) -> Unit )

{ <EOL> block ( value ) <EOL> }


{ <EOL> var result : String = "<STR_LIT:fail>" <EOL> Box ( "<STR_LIT:OK>" ) . run { outer -> <EOL> val block = { result = outer } <EOL> block ( ) <EOL> } <EOL> return result <EOL> }


= :: f


{ <EOL> val input = floatArrayOf ( - <NUM_LIT> , <NUM_LIT:0.0f> , <NUM_LIT> ) <EOL> val expected = floatArrayOf ( - <NUM_LIT> , <NUM_LIT:0.0f> , <NUM_LIT> ) <EOL> assertActivationFunction ( SnakeActivation ( ) , input , expected ) <EOL> }


override fun getClassBuilderMode ( ) : ClassBuilderMode

= builderMode


override fun newClassBuilder ( origin : JvmDeclarationOrigin ) : AbstractClassBuilder . Concrete

{ <EOL> val classNode = ClassNode ( ) <EOL> compiledClasses += classNode <EOL> origins [ classNode ] = origin <EOL> return OriginCollectingClassBuilder ( classNode ) <EOL> }


override fun newField ( origin : JvmDeclarationOrigin , access : Int , name : String , desc : String , signature : String ? , value : Any ? <EOL> ) : FieldVisitor

{ <EOL> val fieldNode = super . newField ( origin , access , name , desc , signature , value ) as FieldNode <EOL> origins [ fieldNode ] = origin <EOL> return fieldNode <EOL> }


override fun newMethod ( origin : JvmDeclarationOrigin , access : Int , name : String , desc : String , signature : String ? , exceptions : Array < out String > ? <EOL> ) : MethodVisitor

{ <EOL> val methodNode = super . newMethod ( origin , access , name , desc , signature , exceptions ) as MethodNode <EOL> origins [ methodNode ] = origin <EOL> if ( ( access and Opcodes . ACC_ABSTRACT ) != <NUM_LIT:0> && methodNode . localVariables == null ) { <EOL> methodNode . localVariables = mutableListOf < LocalVariableNode > ( ) <EOL> } <EOL> return methodNode <EOL> }


override fun asBytes ( builder : ClassBuilder ) : ByteArray

{ <EOL> val classWriter = ClassWriter ( ClassWriter . COMPUTE_FRAMES or ClassWriter . COMPUTE_MAXS ) <EOL> ( builder as OriginCollectingClassBuilder ) . classNode . accept ( classWriter ) <EOL> return classWriter . toByteArray ( ) <EOL> }


override fun asText ( builder : ClassBuilder )

= throw UnsupportedOperationException ( )


= f ( )


{ <EOL> val obj = object { <EOL> fun sayOk ( ) = sb . append ( "<STR_LIT:OK>" ) <EOL> } <EOL> obj . sayOk ( ) <EOL> }


{ <EOL> exec { <EOL> test2 ( ) <EOL> } <EOL> noExec { <EOL> test2 ( ) <EOL> } <EOL> return sb . toString ( ) <EOL> }


operator fun getValue ( o : Nothing ? , desc : KProperty < * > ) : T

{ <EOL> return null as T <EOL> }


operator fun setValue ( o : Nothing ? , desc : KProperty < * > , value : T )

{ <EOL> }


{ <EOL> currentAccountId = <NUM_LIT:1> <EOL> if ( currentAccountId != null ) return "<STR_LIT:Fail>" <EOL> return "<STR_LIT:OK>" <EOL> }


override fun KtDeclaration . findDescriptor ( ) : DeclarationDescriptor ?

{ <EOL> return if ( this is KtParameter ) this . resolveToParameterDescriptorIfAny ( BodyResolveMode . FULL ) else this . resolveToDescriptorIfAny ( BodyResolveMode . FULL ) <EOL> }


{ <EOL> println ( listOf ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ) . penultimate ) <EOL> }


{ <EOL> if ( true ) a < caret > v else <NUM_LIT:1> <EOL> }


fun createIfNeeded ( session : FirSession ) : FirSwitchableExtensionDeclarationsSymbolProvider ?

= <EOL> FirExtensionDeclarationsSymbolProvider . createIfNeeded ( session ) ? . let { FirSwitchableExtensionDeclarationsSymbolProvider ( it ) }


override fun getPackageNames ( ) : Set < String > ?

= <EOL> if ( disabled ) null else delegate . symbolNamesProvider . getPackageNames ( )


override fun getPackageNamesWithTopLevelClassifiers ( ) : Set < String > ?

= <EOL> if ( disabled ) null else delegate . symbolNamesProvider . getPackageNamesWithTopLevelClassifiers ( )


override fun getPackageNamesWithTopLevelCallables ( ) : Set < String > ?

= <EOL> if ( disabled ) null else delegate . symbolNamesProvider . getPackageNamesWithTopLevelCallables ( )


override fun getTopLevelClassifierNamesInPackage ( packageFqName : FqName ) : Set < Name > ?

= <EOL> if ( disabled ) null else delegate . symbolNamesProvider . getTopLevelClassifierNamesInPackage ( packageFqName )


override fun getTopLevelCallableNamesInPackage ( packageFqName : FqName ) : Set < Name > ?

= <EOL> if ( disabled ) null else delegate . symbolNamesProvider . getTopLevelCallableNamesInPackage ( packageFqName )


override fun getClassLikeSymbolByClassId ( classId : ClassId ) : FirClassLikeSymbol < * > ?

{ <EOL> if ( disabled ) return null <EOL> return delegate . getClassLikeSymbolByClassId ( classId ) <EOL> }


@ FirSymbolProviderInternals <EOL> override fun getTopLevelCallableSymbolsTo ( destination : MutableList < FirCallableSymbol < * > > , packageFqName : FqName , name : Name )

{ <EOL> if ( disabled ) return <EOL> delegate . getTopLevelCallableSymbolsTo ( destination , packageFqName , name ) <EOL> }


@ FirSymbolProviderInternals <EOL> override fun getTopLevelFunctionSymbolsTo ( destination : MutableList < FirNamedFunctionSymbol > , packageFqName : FqName , name : Name )

{ <EOL> if ( disabled ) return <EOL> delegate . getTopLevelFunctionSymbolsTo ( destination , packageFqName , name ) <EOL> }


@ FirSymbolProviderInternals <EOL> override fun getTopLevelPropertySymbolsTo ( destination : MutableList < FirPropertySymbol > , packageFqName : FqName , name : Name )

{ <EOL> if ( disabled ) return <EOL> delegate . getTopLevelPropertySymbolsTo ( destination , packageFqName , name ) <EOL> }


override fun getPackage ( fqName : FqName ) : FqName ?

{ <EOL> if ( disabled ) return null <EOL> return delegate . getPackage ( fqName ) <EOL> }


@ FirSymbolProviderInternals <EOL> fun disable ( )

{ <EOL> disabled = true <EOL> }


@ FirSymbolProviderInternals <EOL> fun enable ( )

{ <EOL> disabled = false <EOL> }


fun getElements ( ) : List < JavaAnnotationArgument >


fun getReferencedType ( ) : JavaType


fun getAnnotation ( ) : JavaAnnotation


{ <EOL> val capture = "<STR_LIT>" <EOL> class Local { <EOL> val captured = capture <EOL> open inner class Inner ( val d : Double = - <NUM_LIT:1.0> , val s : String , vararg val y : Int ) { <EOL> open fun result ( ) = "<STR_LIT:Fail>" <EOL> } <EOL> val obj = object : Inner ( s = "<STR_LIT:OK>" ) { <EOL> override fun result ( ) = s <EOL> } <EOL> } <EOL> return Local ( ) . obj . result ( ) <EOL> }


fun KtAnalysisSession . findPsi ( ktSymbol : KtSymbol , project : Project ) : PsiElement ?

{ <EOL> return when ( ktSymbol ) { <EOL> is KtConstructorSymbol -> providePsiForConstructor ( ktSymbol , project ) <EOL> is KtFunctionLikeSymbol -> providePsiForFunction ( ktSymbol , project ) <EOL> is KtEnumEntrySymbol -> providePsiForEnumEntry ( ktSymbol , project ) <EOL> is KtVariableLikeSymbol -> providePsiForProperty ( ktSymbol , project ) <EOL> is KtClassLikeSymbol -> providePsiForClass ( ktSymbol , project ) <EOL> else -> null <EOL> } <EOL> }


private fun KtAnalysisSession . providePsiForConstructor ( constructorSymbol : KtConstructorSymbol , project : Project ) : PsiElement ?

{ <EOL> val classId = constructorSymbol . containingClassIdIfNonLocal ? : return null <EOL> val psiClass = project . createPsiDeclarationProvider ( constructorSymbol . scope ( project ) ) <EOL> ? . getClassesByClassId ( classId ) <EOL> ? . firstOrNull ( ) ? : return null <EOL> return psiClass . constructors . find { psiMethod -> <EOL> representsTheSameDeclaration ( psiMethod , constructorSymbol ) <EOL> } <EOL> }


private fun KtAnalysisSession . providePsiForFunction ( functionLikeSymbol : KtFunctionLikeSymbol , project : Project ) : PsiElement ?

{ <EOL> return functionLikeSymbol . callableIdIfNonLocal ? . let { <EOL> val candidates = project . createPsiDeclarationProvider ( functionLikeSymbol . scope ( project ) ) <EOL> ? . getFunctions ( it ) <EOL> if ( candidates ? . size == <NUM_LIT:1> ) <EOL> candidates . single ( ) <EOL> else <EOL> candidates ? . find { psiMethod -> <EOL> representsTheSameDeclaration ( psiMethod , functionLikeSymbol ) <EOL> } <EOL> } <EOL> }


private fun providePsiForProperty ( variableLikeSymbol : KtVariableLikeSymbol , project : Project ) : PsiElement ?

{ <EOL> return variableLikeSymbol . callableIdIfNonLocal ? . let { <EOL> val candidates = project . createPsiDeclarationProvider ( variableLikeSymbol . scope ( project ) ) <EOL> ? . getProperties ( it ) <EOL> if ( candidates ? . size == <NUM_LIT:1> ) <EOL> candidates . single ( ) <EOL> else { <EOL> candidates ? . firstOrNull { psiMember -> psiMember is PsiField } <EOL> ? : candidates ? . firstOrNull ( ) <EOL> } <EOL> } <EOL> }


private fun providePsiForClass ( classLikeSymbol : KtClassLikeSymbol , project : Project ) : PsiElement ?

{ <EOL> return classLikeSymbol . classIdIfNonLocal ? . let { <EOL> project . createPsiDeclarationProvider ( classLikeSymbol . scope ( project ) ) <EOL> ? . getClassesByClassId ( it ) <EOL> ? . firstOrNull ( ) <EOL> } <EOL> }


private fun providePsiForEnumEntry ( enumEntrySymbol : KtEnumEntrySymbol , project : Project ) : PsiElement ?

{ <EOL> val classId = enumEntrySymbol . containingEnumClassIdIfNonLocal ? : return null <EOL> val psiClass = project . createPsiDeclarationProvider ( enumEntrySymbol . scope ( project ) ) <EOL> ? . getClassesByClassId ( classId ) <EOL> ? . firstOrNull ( ) ? : return null <EOL> return psiClass . fields . find { <EOL> it . name == enumEntrySymbol . name . asString ( ) <EOL> } <EOL> }


private fun KtSymbol . scope ( project : Project ) : GlobalSearchScope

{ <EOL> return GlobalSearchScope . allScope ( project ) <EOL> }


fun createInterned ( isOperator : Boolean , isInfix : Boolean , isInline : Boolean , isSuspend : Boolean , ) : CirFunctionModifiers

= interner . intern ( CirFunctionModifiersInternedImpl ( isOperator = isOperator , isInfix = isInfix , isInline = isInline , isSuspend = isSuspend , ) )


@ OptIn ( ExperimentalTypeInference :: class ) <EOL> fun < K , V > buildMap ( @ BuilderInference builderAction : MutableMap < K , V > . ( ) -> Unit ) : Map < K , V >

= mapOf ( )


fun foo ( ) : MutableMap < CharSequence , * >

= mutableMapOf < CharSequence , String > ( )


fun < E > MutableMap < E , * > . swap ( x : MutableMap < E , * > )


@ OptIn ( ExperimentalStdlibApi :: class ) <EOL> fun box ( ) : String

{ <EOL> val x : Map < in String , String > = buildMap { <EOL> put ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> swap ( foo ( ) ) <EOL> } <EOL> return "<STR_LIT:OK>" <EOL> }


private fun ConeKotlinType . isBuiltinType ( classId : ClassId , isNullable : Boolean ? ) : Boolean

{ <EOL> if ( this !is ConeClassLikeType ) return false <EOL> return lookupTag . classId == classId && ( isNullable == null || type . isNullable == isNullable ) <EOL> }


private fun ConeKotlinType . isAnyOfBuiltinType ( classIds : Set < ClassId > ) : Boolean

{ <EOL> if ( this !is ConeClassLikeType ) return false <EOL> return lookupTag . classId in classIds <EOL> }


private fun ConeKotlinType . isArrayType ( isNullable : Boolean ? ) : Boolean

{ <EOL> return isBuiltinType ( StandardClassIds . Array , isNullable ) || <EOL> StandardClassIds . primitiveArrayTypeByElementType . values . any { isBuiltinType ( it , isNullable ) } || <EOL> StandardClassIds . unsignedArrayTypeByElementType . values . any { isBuiltinType ( it , isNullable ) } <EOL> }


fun < D : FirCallableSymbol < * > > extractBothWaysOverridable ( overrider : MemberWithBaseScope < D > , members : MutableCollection < MemberWithBaseScope < D > > , overrideChecker : FirOverrideChecker , ) : MutableList < MemberWithBaseScope < D > >

{ <EOL> val result = mutableListOf < MemberWithBaseScope < D > > ( ) . apply { add ( overrider ) } <EOL> val iterator = members . iterator ( ) <EOL> val overrideCandidate = overrider . member . fir <EOL> while ( iterator . hasNext ( ) ) { <EOL> val next = iterator . next ( ) <EOL> if ( next == overrider ) { <EOL> iterator . remove ( ) <EOL> continue <EOL> } <EOL> if ( overrideChecker . similarFunctionsOrBothProperties ( overrideCandidate , next . member . fir ) ) { <EOL> result . add ( next ) <EOL> iterator . remove ( ) <EOL> } <EOL> } <EOL> return result <EOL> }


fun < D : FirCallableSymbol < * > > selectMostSpecificMembers ( overridables : List < MemberWithBaseScope < D > > , returnTypeCalculator : ReturnTypeCalculator ) : List < MemberWithBaseScope < D > >

{ <EOL> require ( overridables . isNotEmpty ( ) ) { "<STR_LIT>" } <EOL> if ( overridables . size == <NUM_LIT:1> ) { <EOL> return overridables <EOL> } <EOL> val maximums : MutableList < MemberWithBaseScopeAndReturnType < D > > = ArrayList ( <NUM_LIT:2> ) <EOL> skipCandidate @ for ( candidate in overridables ) { <EOL> val withReturnType = MemberWithBaseScopeAndReturnType ( candidate , returnTypeCalculator ) <EOL> var skip = false <EOL> val toRemove = BooleanArray ( maximums . size ) { i -> <EOL> val c = maximums [ i ] . compareTo ( withReturnType ) ? : return@BooleanArray false <EOL> if ( c >= <NUM_LIT:0> ) { <EOL> skip = true <EOL> } <EOL> c < <NUM_LIT:0> <EOL> } <EOL> maximums . removeFlagged ( toRemove ) <EOL> if ( ! skip ) { <EOL> maximums . add ( withReturnType ) <EOL> } <EOL> } <EOL> return maximums . map { it . memberWithBaseScope } <EOL> }


private fun < E > MutableList < E > . removeFlagged ( flags : BooleanArray )

{ <EOL> var dest = <NUM_LIT:0> <EOL> for ( i in flags . indices ) { <EOL> if ( ! flags [ i ] ) { <EOL> this [ dest ++ ] = this [ i ] <EOL> } <EOL> } <EOL> while ( size > dest ) { <EOL> removeLast ( ) <EOL> } <EOL> }


private fun MemberWithBaseScopeAndReturnType < * > . compareTo ( other : MemberWithBaseScopeAndReturnType < * > ) : Int ?

{ <EOL> fun merge ( preferA : Boolean , preferB : Boolean , previous : Int ) : Int ? = when { <EOL> preferA == preferB -> previous <EOL> preferA && previous >= <NUM_LIT:0> -> <NUM_LIT:1> <EOL> preferB && previous <= <NUM_LIT:0> -> - <NUM_LIT:1> <EOL> else -> null <EOL> } <EOL> val aFir = memberWithBaseScope . member . fir <EOL> val bFir = other . memberWithBaseScope . member . fir <EOL> val byVisibility = Visibilities . compare ( aFir . visibility , bFir . visibility ) ? : <NUM_LIT:0> <EOL> val substitutor = buildSubstitutorForOverridesCheck ( aFir , bFir , session ) ? : return null <EOL> val aReturnType = returnType ? . let ( substitutor :: substituteOrSelf ) ? : return null <EOL> val bReturnType = other . returnType ? : return null <EOL> val typeCheckerState = session . typeContext . newTypeCheckerState ( errorTypesEqualToAnything = false , stubTypesEqualToAnything = false ) <EOL> val aSubtypesB = AbstractTypeChecker . isSubtypeOf ( typeCheckerState , aReturnType , bReturnType ) <EOL> val bSubtypesA = AbstractTypeChecker . isSubtypeOf ( typeCheckerState , bReturnType , aReturnType ) <EOL> val byVisibilityAndType = when { <EOL> aSubtypesB && bSubtypesA -> merge ( aReturnType !is ConeFlexibleType , bReturnType !is ConeFlexibleType , byVisibility ) <EOL> ? : return null <EOL> aSubtypesB && byVisibility >= <NUM_LIT:0> -> <NUM_LIT:1> <EOL> bSubtypesA && byVisibility <= <NUM_LIT:0> -> - <NUM_LIT:1> <EOL> else -> return null <EOL> } <EOL> return when ( aFir ) { <EOL> is FirSimpleFunction -> { <EOL> require ( bFir is FirSimpleFunction ) { "<STR_LIT>" + bFir . javaClass } <EOL> byVisibilityAndType <EOL> } <EOL> is FirProperty -> { <EOL> require ( bFir is FirProperty ) { "<STR_LIT>" + bFir . javaClass } <EOL> if ( aFir . isVar && ! aSubtypesB ) return null <EOL> if ( bFir . isVar && ! bSubtypesA ) return null <EOL> merge ( aFir . isVar , bFir . isVar , byVisibilityAndType ) <EOL> } <EOL> else -> throw IllegalArgumentException ( "<STR_LIT>" + aFir . javaClass ) <EOL> } <EOL> }


fun runCommonization ( parameters : CommonizerParameters )

{ <EOL> if ( ! parameters . containsCommonModuleNames ( ) ) { <EOL> parameters . resultsConsumer . allConsumed ( parameters , Status . NOTHING_TO_DO ) <EOL> return <EOL> } <EOL> CommonizerQueue ( parameters ) . invokeAll ( ) <EOL> parameters . resultsConsumer . allConsumed ( parameters , Status . DONE ) <EOL> }


internal fun deserializeTarget ( parameters : CommonizerParameters , target : TargetProvider ) : CirTreeRoot

{ <EOL> return parameters . logger . progress ( target . target , "<STR_LIT>" ) { <EOL> defaultCirTreeRootDeserializer ( parameters , target ) <EOL> } <EOL> }


internal fun deserializeTarget ( parameters : CommonizerParameters , target : CommonizerTarget ) : CirTreeRoot ?

{ <EOL> val targetProvider = parameters . targetProviders [ target ] ? : return null <EOL> return deserializeTarget ( parameters , targetProvider ) <EOL> }


internal fun commonizeTarget ( parameters : CommonizerParameters , inputs : TargetDependent < CirTreeRoot ? > , output : CommonizerTarget ) : CirRootNode ?

{ <EOL> val availableTrees = inputs . filterNonNull ( ) <EOL> if ( availableTrees . size == <NUM_LIT:0> ) return null <EOL> parameters . logger . progress ( output , "<STR_LIT>" ) { <EOL> val classifiers = CirKnownClassifiers ( classifierIndices = availableTrees . mapValue ( :: CirClassifierIndex ) , targetDependencies = availableTrees . mapValue ( CirTreeRoot :: dependencies ) , commonizedNodes = CirCommonizedClassifierNodes . default ( allowedDuplicates = allowedDuplicates ) , commonDependencies = parameters . dependencyClassifiers ( output ) ) <EOL> val mergedTree = mergeCirTree ( parameters . storageManager , classifiers , availableTrees , parameters . settings ) <EOL> InlineTypeAliasCirNodeTransformer ( parameters . storageManager , classifiers , parameters . settings ) . invoke ( mergedTree ) <EOL> ReApproximationCirNodeTransformer ( parameters . storageManager , classifiers , parameters . settings , SignatureBuildingContextProvider ( classifiers , typeAliasInvariant = true , skipArguments = false ) ) . invoke ( mergedTree ) <EOL> ReApproximationCirNodeTransformer ( parameters . storageManager , classifiers , parameters . settings , SignatureBuildingContextProvider ( classifiers , typeAliasInvariant = true , skipArguments = true ) ) . invoke ( mergedTree ) <EOL> mergedTree . accept ( CommonizationVisitor ( mergedTree ) , Unit ) <EOL> return mergedTree <EOL> } <EOL> }


internal fun serializeTarget ( parameters : CommonizerParameters , commonized : CirRootNode , outputTarget : SharedCommonizerTarget ) : Unit

= parameters . logger . progress ( outputTarget , "<STR_LIT>" ) { <EOL> CirTreeSerializer . serializeSingleTarget ( commonized , commonized . indexOfCommon , parameters . statsCollector ) { metadataModule -> <EOL> val libraryName = metadataModule . name <EOL> val serializedMetadata = with ( metadataModule . write ( ChunkedKlibModuleFragmentWriteStrategy ( ) ) ) { <EOL> SerializedMetadata ( header , fragments , fragmentNames ) <EOL> } <EOL> val manifestData = parameters . manifestProvider [ outputTarget ] . buildManifest ( libraryName ) <EOL> parameters . resultsConsumer . consume ( parameters , outputTarget , ResultsConsumer . ModuleResult ( libraryName , serializedMetadata , manifestData ) ) <EOL> } <EOL> parameters . resultsConsumer . targetConsumed ( parameters , outputTarget ) <EOL> }


override fun lowerKeyOfTypeDeclaration ( declaration : KeyOfTypeDeclaration , owner : NodeOwner < ParameterOwnerDeclaration > ? <EOL> ) : ParameterValueDeclaration

{ <EOL> val type = super . lowerParameterValue ( declaration . type , owner . wrap ( declaration ) ) <EOL> if ( type is TypeDeclaration ) { <EOL> val reference = type . typeReference <EOL> if ( reference != null ) { <EOL> val namedMembers = context . getNamedMembers ( reference . uid ) <EOL> return UnionTypeDeclaration ( namedMembers . map { StringLiteralDeclaration ( it . name ) } ) <EOL> } <EOL> } <EOL> return declaration . copy ( type = type ) <EOL> }


private fun findPropertyTypeByString ( properties : List < PropertyDeclaration > , value : String ) : ParameterValueDeclaration ?

{ <EOL> return properties . find { it . name == value } ? . type <EOL> }


override fun lowerIndexTypeDeclaration ( declaration : IndexTypeDeclaration , owner : NodeOwner < ParameterOwnerDeclaration > ? <EOL> ) : ParameterValueDeclaration

{ <EOL> val objectType = super . lowerParameterValue ( declaration . objectType , owner . wrap ( declaration ) ) <EOL> val indexType = super . lowerParameterValue ( declaration . indexType , owner . wrap ( declaration ) ) <EOL> if ( objectType is TypeDeclaration ) { <EOL> val reference = objectType . typeReference <EOL> if ( reference != null ) { <EOL> val properties = context . getProperties ( reference . uid ) <EOL> val newType = when ( indexType ) { <EOL> is StringLiteralDeclaration -> findPropertyTypeByString ( properties , indexType . token ) <EOL> is UnionTypeDeclaration -> indexType . copy ( params = indexType . params . filterIsInstance < StringLiteralDeclaration > ( ) . mapNotNull { unionMember -> <EOL> findPropertyTypeByString ( properties , unionMember . token ) <EOL> } ) <EOL> else -> null <EOL> } <EOL> if ( newType != null ) { <EOL> return newType <EOL> } <EOL> } <EOL> } <EOL> return declaration . copy ( objectType = objectType , indexType = indexType ) <EOL> }


override fun lowerClassLikeDeclaration ( declaration : ClassLikeDeclaration , owner : NodeOwner < ModuleDeclaration > ? <EOL> ) : TopLevelDeclaration ?

{ <EOL> registeredMembers [ declaration . uid ] = declaration . members <EOL> return super . lowerClassLikeDeclaration ( declaration , owner ) <EOL> }


fun getProperties ( uid : String ) : List < PropertyDeclaration >

{ <EOL> return registeredMembers [ uid ] ? . filterIsInstance < PropertyDeclaration > ( ) ? : emptyList ( ) <EOL> }


fun getNamedMembers ( uid : String ) : List < NamedMemberDeclaration >

{ <EOL> return registeredMembers [ uid ] ? . filterIsInstance < NamedMemberDeclaration > ( ) ? : emptyList ( ) <EOL> }


override fun lower ( source : SourceSetDeclaration ) : SourceSetDeclaration

{ <EOL> val context = KeyOfAndLookupContext ( ) <EOL> source . sources . map { <EOL> context . lowerSourceDeclaration ( it . root ) <EOL> } <EOL> return source . copy ( sources = source . sources . map { sourceFileDeclaration -> <EOL> sourceFileDeclaration . copy ( root = KeyOfAndLookupLowering ( context ) . lowerSourceDeclaration ( sourceFileDeclaration . root ) ) <EOL> } ) <EOL> }


{ <EOL> assertEquals ( Second ( <NUM_LIT:42> ) . value . value , <NUM_LIT:42> ) <EOL> return "<STR_LIT:OK>" <EOL> }


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestBasicReverse ( )


fun TestIdenticalReturnTypes ( ) : TestIdenticalReturnTypes

= TestIdenticalReturnTypes ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestIdenticalReturnTypesReverse ( ) : TestIdenticalReturnTypesReverse

= TestIdenticalReturnTypesReverse ( )


inline fun < reified T > TestFunctionWithReifiedTypeParameterVsConstructorA ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) inline fun < reified T > TestFunctionWithReifiedTypeParameterVsConstructorAReverse ( )


inline fun < reified T > TestFunctionWithReifiedTypeParameterVsConstructorB ( arg : T )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) inline fun < reified T > TestFunctionWithReifiedTypeParameterVsConstructorBReverse ( arg : T )


inline fun < reified T > TestFunctionWithReifiedTypeParameterVsConstructorC ( arg : Invariant < T > )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) inline fun < reified T > TestFunctionWithReifiedTypeParameterVsConstructorCReverse ( arg : Invariant < T > )


inline fun TestInlineFunctionVsConstructor ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) inline fun TestInlineFunctionVsConstructorReverse ( )


tailrec fun TestTailrecFunctionVsConstructor ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) tailrec fun TestTailrecFunctionVsConstructorReverse ( )


fun TestFunctionVsPrimaryConstructor ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestFunctionVsPrimaryConstructorReverse ( )


fun TestFunctionVsDelegatedPrimaryConstructorCall ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestFunctionVsDelegatedPrimaryConstructorCallReverse ( )


fun TestFunctionVsDelegatedSuperConstructorCall ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestFunctionVsDelegatedSuperConstructorCallReverse ( )


fun TestIdenticalValueParameters ( arg : UserKlass )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestIdenticalValueParametersReverse ( arg : UserKlass )


fun TestDifferentlyNamedValueParameters ( argB : UserKlass )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestDifferentlyNamedValueParametersReverse ( argB : UserKlass )


fun TestTypeAliasedValueParameterTypesA ( arg : SameUserKlass )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestTypeAliasedValueParameterTypesAReverse ( arg : SameUserKlass )


fun TestTypeAliasedValueParameterTypesB ( arg : UserKlass )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestTypeAliasedValueParameterTypesBReverse ( arg : UserKlass )


fun TestMultipleIdenticalValueParameters ( arg1 : UserKlassA , arg2 : UserKlassB )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestMultipleIdenticalValueParametersReverse ( arg1 : UserKlassA , arg2 : UserKlassB )


fun TestMultipleDifferentlyNamedValueParametersA ( arg1 : UserKlassA , arg2B : UserKlassB )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestMultipleDifferentlyNamedValueParametersAReverse ( arg1 : UserKlassA , arg2B : UserKlassB )


fun TestMultipleDifferentlyNamedValueParametersB ( arg1B : UserKlassA , arg2B : UserKlassB )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestMultipleDifferentlyNamedValueParametersBReverse ( arg1B : UserKlassA , arg2B : UserKlassB )


fun TestMultipleTypeAliasedValueParameterTypesA ( arg1 : UserKlassA , arg2 : SameUserKlassB )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestMultipleTypeAliasedValueParameterTypesAReverse ( arg1 : UserKlassA , arg2 : SameUserKlassB )


fun TestMultipleTypeAliasedValueParameterTypesB ( arg1 : SameUserKlassA , arg2 : SameUserKlassB )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun TestMultipleTypeAliasedValueParameterTypesBReverse ( arg1 : SameUserKlassA , arg2 : SameUserKlassB )


fun < T > TestIdenticalTypeParametersA ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T > TestIdenticalTypeParametersAReverse ( )


fun < T > TestIdenticalTypeParametersB ( arg : T )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T > TestIdenticalTypeParametersBReverse ( arg : T )


fun < T > TestIdenticalTypeParametersC ( arg : Invariant < T > )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T > TestIdenticalTypeParametersCReverse ( arg : Invariant < T > )


fun < T1 , T2 > TestMultipleIdenticalTypeParameters ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T1 , T2 > TestMultipleIdenticalTypeParametersReverse ( )


fun < T : UserInterface > TestTypeParameterWithIdenticalUpperBoundsA ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T : UserInterface > TestTypeParameterWithIdenticalUpperBoundsAReverse ( )


fun < T : UserInterface > TestTypeParameterWithIdenticalUpperBoundsB ( arg : T )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T : UserInterface > TestTypeParameterWithIdenticalUpperBoundsBReverse ( arg : T )


fun < T : UserInterface > TestTypeParameterWithIdenticalUpperBoundsC ( arg : Invariant < T > )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T : UserInterface > TestTypeParameterWithIdenticalUpperBoundsCReverse ( arg : Invariant < T > )


fun < T > TestTypeParameterWithMultipleIdenticalUpperBoundsAA ( ) where T : UserInterfaceA , T : UserInterfaceB


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T > TestTypeParameterWithMultipleIdenticalUpperBoundsAAReverse ( ) where T : UserInterfaceA , T : UserInterfaceB


fun < T > TestTypeParameterWithMultipleIdenticalUpperBoundsAB ( arg : T ) where T : UserInterfaceA , T : UserInterfaceB


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T > TestTypeParameterWithMultipleIdenticalUpperBoundsABReverse ( arg : T ) where T : UserInterfaceA , T : UserInterfaceB


fun < T > TestTypeParameterWithMultipleIdenticalUpperBoundsAC ( arg : Invariant < T > ) where T : UserInterfaceA , T : UserInterfaceB


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T > TestTypeParameterWithMultipleIdenticalUpperBoundsACReverse ( arg : Invariant < T > ) where T : UserInterfaceA , T : UserInterfaceB


fun < T : UserInterfaceA > TestTypeParameterWithMultipleIdenticalUpperBoundsBA ( ) where T : UserInterfaceB


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T : UserInterfaceA > TestTypeParameterWithMultipleIdenticalUpperBoundsBAReverse ( ) where T : UserInterfaceB


fun < T : UserInterfaceA > TestTypeParameterWithMultipleIdenticalUpperBoundsBB ( arg : T ) where T : UserInterfaceB


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T : UserInterfaceA > TestTypeParameterWithMultipleIdenticalUpperBoundsBBReverse ( arg : T ) where T : UserInterfaceB


fun < T : UserInterfaceA > TestTypeParameterWithMultipleIdenticalUpperBoundsBC ( arg : Invariant < T > ) where T : UserInterfaceB


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) fun < T : UserInterfaceA > TestTypeParameterWithMultipleIdenticalUpperBoundsBCReverse ( arg : Invariant < T > ) where T : UserInterfaceB


private fun TestIdenticalPrivateVisibility ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) private fun TestIdenticalPrivateVisibilityReverse ( )


internal fun TestIdenticalInternalVisibility ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) internal fun TestIdenticalInternalVisibilityReverse ( )


public fun TestDifferencesInPrivateAndPublicVisibilitiesA ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) public fun TestDifferencesInPrivateAndPublicVisibilitiesAReverse ( )


private fun TestDifferencesInPrivateAndPublicVisibilitiesB ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) private fun TestDifferencesInPrivateAndPublicVisibilitiesBReverse ( )


public fun TestDifferencesInInternalAndPublicVisibilitiesA ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) public fun TestDifferencesInInternalAndPublicVisibilitiesAReverse ( )


internal fun TestDifferencesInInternalAndPublicVisibilitiesB ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) internal fun TestDifferencesInInternalAndPublicVisibilitiesBReverse ( )


internal fun TestDifferencesInPrivateAndInternalVisibilitiesA ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) internal fun TestDifferencesInPrivateAndInternalVisibilitiesAReverse ( )


private fun TestDifferencesInPrivateAndInternalVisibilitiesB ( )


@ Deprecated ( message = "<STR_LIT>" , level = DeprecationLevel . HIDDEN ) private fun TestDifferencesInPrivateAndInternalVisibilitiesBReverse ( )


override fun transformFlat ( declaration : IrDeclaration ) : List < IrDeclaration > ?

{ <EOL> if ( declaration is IrFunction && declaration . isInlineFunWithReifiedParameter ( ) || declaration is IrProperty && declaration . getter ? . isInlineFunWithReifiedParameter ( ) == true ) { <EOL> return emptyList ( ) <EOL> } <EOL> return null <EOL> }


{ <EOL> if ( declaration is IrFunction && declaration . isInline ) { <EOL> declaration . body ? . let { originalBody -> <EOL> declaration . body = context . irFactory . createBlockBody ( originalBody . startOffset , originalBody . endOffset ) { <EOL> statements += ( originalBody . deepCopyWithSymbols ( declaration ) as IrBlockBody ) . statements <EOL> } <EOL> } <EOL> } <EOL> if ( declaration is IrValueParameter && declaration . parent . let { it is IrFunction && it . isInline } ) { <EOL> declaration . defaultValue ? . let { originalDefault -> <EOL> declaration . defaultValue = <EOL> context . irFactory . createExpressionBody ( startOffset = originalDefault . startOffset , endOffset = originalDefault . endOffset , expression = originalDefault . expression . deepCopyWithSymbols ( declaration . parent ) , ) <EOL> } <EOL> } <EOL> return null <EOL> }


operator fun String ? . plus ( p : String ) : String

{ <EOL> return "<STR_LIT>" + this <EOL> }


fun test ( a : String ? , b : String ) : String

{ <EOL> return a + b <EOL> }


= test ( "<STR_LIT:OK>" , "<STR_LIT>" )


inline suspend fun suspendThere ( v : String ) : String

= suspendCoroutineUninterceptedOrReturn { x -> <EOL> TailCallOptimizationChecker . saveStackTrace ( x ) <EOL> x . resume ( v ) <EOL> COROUTINE_SUSPENDED <EOL> }


inline suspend fun suspendHere ( ) : String

= suspendThere ( "<STR_LIT:O>" ) + suspendThere ( "<STR_LIT:K>" )


= suspendHere ( )


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


{ <EOL> var result = "<STR_LIT>" <EOL> builder { <EOL> result = mainSuspend ( ) <EOL> } <EOL> TailCallOptimizationChecker . checkStateMachineIn ( "<STR_LIT>" ) <EOL> return result <EOL> }


fun String . toCamelCaseByDelimiters ( delimiters : Regex ) : String

{ <EOL> return split ( delimiters ) . joinToCamelCaseString ( ) . replaceFirstChar { it . lowercase ( Locale . getDefault ( ) ) } <EOL> }


fun List < String > . joinToCamelCaseString ( ) : String

{ <EOL> return joinToString ( separator = "<STR_LIT>" ) { s -> s . replaceFirstChar { if ( it . isLowerCase ( ) ) it . titlecase ( Locale . getDefault ( ) ) else it . toString ( ) } } <EOL> }


= foo ( )


{ <EOL> return "<STR_LIT>" <EOL> }


private fun sendMessage ( type : MessageType , content : DisplayDataResponse , )

{ <EOL> val messageFactory = communicationFacility . messageFactory <EOL> val message = messageFactory . makeReplyMessage ( type , content = content ) <EOL> socket . sendMessage ( message ) <EOL> }


override fun handleDisplay ( value : Any , host : ExecutionHost , id : String ? , )

{ <EOL> val display = renderValue ( notebook , host , value , id ) ? . let { if ( id != null ) it . withId ( id ) else it } ? : return <EOL> val json = display . toJson ( Json . EMPTY , null ) <EOL> notebook . currentCell ? . addDisplay ( display ) <EOL> val response : DisplayDataResponse = createResponse ( json ) <EOL> sendMessage ( MessageType . DISPLAY_DATA , response ) <EOL> }


override fun handleUpdate ( value : Any , host : ExecutionHost , id : String ? , )

{ <EOL> val display = renderValue ( notebook , host , value , id ) ? : return <EOL> val json = display . toJson ( Json . EMPTY , id ) <EOL> if ( id == null || ! json . containsDisplayId ( id ) ) { <EOL> throw RuntimeException ( "<STR_LIT>" ) <EOL> } <EOL> val container = notebook . displays <EOL> container . update ( id , display ) <EOL> container . getById ( id ) . distinctBy { it . cell . id } . forEach { <EOL> it . cell . displays . update ( id , display ) <EOL> } <EOL> val response = createResponse ( json ) <EOL> sendMessage ( MessageType . UPDATE_DISPLAY_DATA , response ) <EOL> }


private fun createResponse ( json : JsonObject ) : DisplayDataResponse

{ <EOL> val content = <EOL> DisplayDataResponse ( json [ "<STR_LIT>" ] , json [ "<STR_LIT>" ] , json [ "<STR_LIT>" ] , ) <EOL> return content <EOL> }


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


{ <EOL> println ( "<STR_LIT>" ) <EOL> }


abstract fun bar ( )


fun fail ( message : String ? = null ) : Nothing

{ <EOL> throw Throwable ( message ) <EOL> }


{ <EOL> val jobs = List ( <NUM_LIT> ) { <EOL> GlobalScope . launch { <EOL> Thread . sleep ( <NUM_LIT> ) <EOL> print ( "<STR_LIT:.>" ) <EOL> } <EOL> } <EOL> }


fun check ( expected : String , obj : Any ? )

{ <EOL> val actual = obj . toString ( ) <EOL> if ( actual != expected ) <EOL> throw AssertionError ( "<STR_LIT>" ) <EOL> }


{ <EOL> check ( "<STR_LIT>" , { -> } ) <EOL> check ( "<STR_LIT>" , { -> <NUM_LIT:42> } ) <EOL> check ( "<STR_LIT>" , fun ( s : String ) = <NUM_LIT:42> . toLong ( ) ) <EOL> check ( "<STR_LIT>" , { x : Int , y : Int -> } ) <EOL> check ( "<STR_LIT>" , fun Int . ( ) { } ) <EOL> check ( "<STR_LIT>" , fun Unit . ( ) : Int ? = <NUM_LIT:42> ) <EOL> check ( "<STR_LIT>" , fun String . ( s : String ? ) : Long = <NUM_LIT:42> . toLong ( ) ) <EOL> check ( "<STR_LIT>" , fun List < String > . ( x : MutableSet < * > , y : Nothing ) { } ) <EOL> check ( "<STR_LIT>" , fun ( ia : IntArray , ba : ByteArray , sa : ShortArray , ca : CharArray , la : LongArray , za : BooleanArray , fa : FloatArray , da : DoubleArray ) : Array < Int > = null ! ! ) <EOL> check ( "<STR_LIT>" , fun ( a : Array < Array < Array < List < String > > > > ) : Comparable < String > = null ! ! ) <EOL> return "<STR_LIT:OK>" <EOL> }


inline fun root ( operation : OperationIdentifier , actions : ( ) -> Unit )

{ <EOL> rootOperationId = operation <EOL> val tsStart = System . currentTimeMillis ( ) <EOL> val root = RootNode ( operation ) <EOL> open ( tsStart , root ) <EOL> actions ( ) <EOL> ensureNodesClosed ( root ) <EOL> }


override fun parseException ( e : ParseException , text : String )

{ <EOL> log . error ( "<STR_LIT>" , e ) <EOL> }


internal open fun testFailedMessage ( execHandle : ExecHandle , exitValue : Int ) : String

= <EOL> "<STR_LIT>"


override fun serviceMessage ( message : ServiceMessage )

{ <EOL> log . kotlinDebug { <EOL> val messageString = message . toString ( ) . replaceFirst ( "<STR_LIT>" . toRegex ( ) , "<STR_LIT>" ) <EOL> "<STR_LIT>" <EOL> } <EOL> when ( message ) { <EOL> is TestSuiteStarted -> open ( message . ts , SuiteNode ( requireLeafGroup ( ) , getSuiteName ( message ) ) ) <EOL> is TestStarted -> beginTest ( message . ts , message . testName ) <EOL> is TestStdOut -> requireLeafTest ( ) . output ( StdOut , message . stdOut ) <EOL> is TestStdErr -> requireLeafTest ( ) . output ( StdErr , message . stdErr ) <EOL> is TestFailed -> requireLeafTest ( ) . failure ( message ) <EOL> is TestFinished -> endTest ( message . ts , message . testName ) <EOL> is TestIgnored -> { <EOL> if ( message . attributes [ "<STR_LIT>" ] == "<STR_LIT:true>" ) { <EOL> SuiteNode ( requireLeafGroup ( ) , message . testName ) . open ( message . ts ) { message . ts } <EOL> } else { <EOL> beginTest ( message . ts , message . testName , isIgnored = true ) <EOL> endTest ( message . ts , message . testName ) <EOL> } <EOL> } <EOL> is TestSuiteFinished -> close ( message . ts , getSuiteName ( message ) ) <EOL> is Message -> printNonTestOutput ( message . text , LogType . byValueOrNull ( message . attributes [ "<STR_LIT:type>" ] ) ) <EOL> else -> Unit <EOL> } <EOL> afterMessage = true <EOL> }


protected open fun getSuiteName ( message : BaseTestSuiteMessage )

= message . suiteName


override fun regularText ( text : String )

{ <EOL> val actualText = if ( afterMessage && settings . ignoreLineEndingAfterMessage ) <EOL> when { <EOL> text . startsWith ( "<STR_LIT>" ) -> text . removePrefix ( "<STR_LIT>" ) <EOL> else -> text . removePrefix ( "<STR_LIT:\n>" ) <EOL> } <EOL> else text <EOL> if ( actualText . isNotEmpty ( ) ) { <EOL> log . kotlinDebug { "<STR_LIT>" } <EOL> val test = leaf as? TestNode <EOL> if ( test != null ) { <EOL> test . output ( StdOut , actualText ) <EOL> } else { <EOL> printNonTestOutput ( actualText ) <EOL> } <EOL> } <EOL> afterMessage = false <EOL> }


protected open fun printNonTestOutput ( text : String , type : LogType ? = null )

{ <EOL> print ( text ) <EOL> }


protected open fun processStackTrace ( stackTrace : String ) : String

= <EOL> stackTrace


private fun beginTest ( ts : Long , testName : String , isIgnored : Boolean = false )

{ <EOL> val parent = requireLeafGroup ( ) <EOL> parent . requireReportingNode ( ) <EOL> val finalTestName = testName . let { <EOL> if ( settings . prependSuiteName ) "<STR_LIT>" <EOL> else it <EOL> } <EOL> val parsedName = ParsedTestName ( finalTestName , parent . localId ) <EOL> val fullTestName = if ( testNameSuffix == null ) parsedName . methodName <EOL> else "<STR_LIT>" <EOL> open ( ts , TestNode ( parent , parsedName . className , parsedName . classDisplayName , parsedName . methodName , displayName = fullTestName , localId = testName , ignored = isIgnored ) ) <EOL> }


private fun endTest ( ts : Long , testName : String )

{ <EOL> close ( ts , testName ) <EOL> }


private fun TestNode . failure ( message : TestFailed , isAssertionFailure : Boolean = true , )

{ <EOL> hasFailures = true <EOL> val stacktrace = buildString { <EOL> if ( message . stacktrace != null ) { <EOL> append ( message . stacktrace ) <EOL> } <EOL> if ( settings . treatFailedTestOutputAsStacktrace ) { <EOL> append ( stackTraceOutput ) <EOL> stackTraceOutput . setLength ( <NUM_LIT:0> ) <EOL> } <EOL> } . let { processStackTrace ( it ) } <EOL> val parsedStackTrace = settings . stackTraceParser ( stacktrace ) <EOL> val failMessage = parsedStackTrace ? . message ? : message . failureMessage <EOL> val exceptionClassName = failMessage ? . let { extractExceptionClassName ( it ) } ? : "<STR_LIT>" <EOL> val rawFailure = KotlinTestFailure ( exceptionClassName , failMessage , stacktrace , patchStackTrace ( this , parsedStackTrace ? . stackTrace ) , message . expected , message . actual , ) <EOL> testReporter . reportFailure ( results , descriptor . id , rawFailure , isAssertionFailure ) <EOL> }


private fun extractExceptionClassName ( message : String ) : String

= <EOL> message . substringBefore ( '<CHAR_LIT::>' ) . trim ( )


private fun patchStackTrace ( node : TestNode , stackTrace : List < StackTraceElement > ? ) : List < StackTraceElement > ?

= <EOL> stackTrace ? . map { <EOL> if ( it . className == node . classDisplayName ) StackTraceElement ( node . className , it . methodName , it . fileName , it . lineNumber ) else it <EOL> }

/**
 * Required for org.gradle.api.internal.tasks.testing.logging.ShortExceptionFormatter.printException
 * In JS Stacktraces we have short class name, while filter using FQN
 * So, let replace short class name with FQN for current test
 */


private fun TestNode . output ( destination : TestOutputEvent . Destination , text : String )

{ <EOL> allOutput . append ( text ) <EOL> if ( settings . treatFailedTestOutputAsStacktrace ) { <EOL> stackTraceOutput . append ( text ) <EOL> } else { <EOL> results . output ( descriptor . id , DefaultTestOutputEvent ( destination , text ) ) <EOL> } <EOL> }


private inline fun < NodeType : Node > NodeType . open ( contents : ( NodeType ) -> Unit )

= open ( System . currentTimeMillis ( ) ) { <EOL> contents ( it ) <EOL> System . currentTimeMillis ( ) <EOL> }


private inline fun < NodeType : Node > NodeType . open ( tsStart : Long , contents : ( NodeType ) -> Long )

{ <EOL> val child = open ( tsStart , this @ open ) <EOL> val tsEnd = contents ( child ) <EOL> assert ( close ( tsEnd , child . localId ) === child ) <EOL> }


private fun < NodeType : Node > open ( ts : Long , new : NodeType ) : NodeType

= new . also { <EOL> log . kotlinDebug { "<STR_LIT>" } <EOL> it . markStarted ( ts ) <EOL> push ( it ) <EOL> }


private fun close ( ts : Long , assertLocalId : String ? )

= pop ( ) . also { <EOL> if ( assertLocalId != null ) { <EOL> if ( it . localId != assertLocalId && settings . ignoreOutOfRootNodes && it . parent == null ) { <EOL> push ( it ) <EOL> return it <EOL> } <EOL> check ( it . localId == assertLocalId ) { <EOL> "<STR_LIT>" <EOL> } <EOL> } <EOL> log . kotlinDebug { "<STR_LIT>" } <EOL> it . markCompleted ( ts ) <EOL> }


private fun Node ? . collectParents ( ) : MutableList < Node >

{ <EOL> var i = this <EOL> val items = mutableListOf < Node > ( ) <EOL> while ( i != null ) { <EOL> items . add ( i ) <EOL> i = i . parent <EOL> } <EOL> return items <EOL> }


private fun checkReportingNodeCreated ( )

{ <EOL> check ( descriptor != null ) <EOL> }


= id


abstract fun markStarted ( ts : Long )


abstract fun markCompleted ( ts : Long )


{ <EOL> check ( this . state == state ) { <EOL> "<STR_LIT>" <EOL> } <EOL> }


protected fun reportStarted ( ts : Long )

{ <EOL> checkState ( NodeState . created ) <EOL> reportingParent ? . checkState ( NodeState . started ) <EOL> results . started ( descriptor ! ! , TestStartEvent ( ts , descriptor ! ! . parent ? . id ) ) <EOL> state = NodeState . started <EOL> }


protected fun reportCompleted ( ts : Long )

{ <EOL> checkState ( NodeState . started ) <EOL> reportingParent ? . checkState ( NodeState . started ) <EOL> results . completed ( descriptor ! ! . id , TestCompleteEvent ( ts , resultType ) ) <EOL> state = NodeState . completed <EOL> }


abstract fun requireReportingNode ( ) : TestDescriptorInternal


override fun getOwnerBuildOperationId ( ) : Any ?

= this@RootNode . ownerBuildOperationId


override fun getParent ( ) : TestDescriptorInternal ?

= null


= name


override fun requireReportingNode ( ) : TestDescriptorInternal

= descriptor


{ <EOL> reportStarted ( ts ) <EOL> }


override fun markCompleted ( ts : Long )

{ <EOL> reportCompleted ( ts ) <EOL> }


fun cleanName ( parent : GroupNode , name : String ) : String

{ <EOL> val parentName = parent . fullNameWithoutRoot <EOL> return name . removePrefix ( "<STR_LIT>" ) <EOL> }


= descriptor ? : createReportingNode ( )


private fun createReportingNode ( ) : TestDescriptorInternal

{ <EOL> val parents = collectParents ( ) <EOL> val fullName = parents . reversed ( ) <EOL> . map { it . cleanName } <EOL> . filter { it . isNotBlank ( ) } <EOL> . joinToString ( "<STR_LIT:.>" ) <EOL> val reportingParent = parents . last ( ) as RootNode <EOL> this . reportingParent = reportingParent <EOL> descriptor = object : DefaultTestSuiteDescriptor ( id , fullName ) , LegacyTestDescriptorInternal { <EOL> override fun getDisplayName ( ) : String = fullNameWithoutRoot <EOL> override fun getClassName ( ) : String ? = fullNameWithoutRoot <EOL> override fun getOwnerBuildOperationId ( ) : Any ? = rootOperationId <EOL> override fun getParent ( ) : TestDescriptorInternal = reportingParent . descriptor <EOL> override fun toString ( ) : String = displayName <EOL> } <EOL> shouldReportComplete = true <EOL> check ( startedTs != <NUM_LIT:0L> ) <EOL> reportStarted ( startedTs ) <EOL> return descriptor ! ! <EOL> }

/**
 * Called when first test in suite started
 */


{ <EOL> check ( descriptor == null ) <EOL> startedTs = ts <EOL> }


{ <EOL> if ( shouldReportComplete ) { <EOL> check ( descriptor != null ) <EOL> reportCompleted ( ts ) <EOL> } <EOL> }


= rootOperationId


override fun getParent ( ) : TestDescriptorInternal

= parentDescriptor


{ <EOL> stackTraceOutput . setLength ( <NUM_LIT:0> ) <EOL> allOutput . setLength ( <NUM_LIT:0> ) <EOL> reportCompleted ( ts ) <EOL> }


= node . also { leaf = node }


= leaf ! ! . also { leaf = it . parent }


fun ensureNodesClosed ( root : RootNode ? = null , cause : Throwable ? = null , throwError : Boolean = true ) : Error ?

{ <EOL> val ts = System . currentTimeMillis ( ) <EOL> when ( leaf ) { <EOL> null -> return null <EOL> root -> close ( ts , leaf ! ! . localId ) <EOL> else -> { <EOL> val output = StringBuilder ( ) <EOL> var currentTest : TestNode ? = null <EOL> while ( leaf != null ) { <EOL> val currentLeaf = leaf ! ! <EOL> if ( currentLeaf is TestNode ) { <EOL> currentTest = currentLeaf <EOL> output . append ( currentLeaf . allOutput ) <EOL> currentLeaf . failure ( TestFailed ( currentLeaf . cleanName , null as Throwable ? ) , false ) <EOL> } <EOL> close ( ts , currentLeaf . localId ) <EOL> } <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> val error = Error ( buildString { <EOL> append ( "<STR_LIT>" ) <EOL> if ( currentTest != null ) { <EOL> append ( "<STR_LIT>" ) <EOL> } <EOL> if ( output . toString ( ) . isNotBlank ( ) ) { <EOL> append ( "<STR_LIT>" ) <EOL> } <EOL> } , cause ) <EOL> if ( throwError ) { <EOL> throw error <EOL> } else { <EOL> return error <EOL> } <EOL> } <EOL> } <EOL> return null <EOL> }


= leaf ? : error ( "<STR_LIT>" )


private fun requireLeafGroup ( ) : GroupNode

= requireLeaf ( ) . let { <EOL> it as? GroupNode ? : error ( "<STR_LIT>" ) <EOL> }


= leaf as? TestNode <EOL> ? : error ( "<STR_LIT>" )


{ <EOL> val result = StringBuilder ( ) <EOL> for ( letter in '<CHAR_LIT:A>' .. '<CHAR_LIT:Z>' ) { <EOL> result . append ( letter ) <EOL> } <EOL> result . append ( "<STR_LIT>" ) <EOL> return result . toString ( ) <EOL> }


{ <EOL> println ( alphabet ( ) ) <EOL> }


= runTest { <EOL> testResumeModeFastPath ( Dispatchers . Unconfined ) <EOL> }


@ Test <EOL> fun testNestedUnconfined ( )

= runTest { <EOL> withContext ( Dispatchers . Unconfined ) { <EOL> testResumeModeFastPath ( Dispatchers . Unconfined ) <EOL> } <EOL> }


@ Test <EOL> fun testNestedUnconfinedChangedContext ( )

= runTest { <EOL> withContext ( Dispatchers . Unconfined ) { <EOL> testResumeModeFastPath ( CoroutineName ( "<STR_LIT:Test>" ) ) <EOL> } <EOL> }


@ Test <EOL> fun testEventLoopDispatcher ( )

= runTest { <EOL> testResumeModeFastPath ( wrapperDispatcher ( ) ) <EOL> }


@ Test <EOL> fun testNestedEventLoopDispatcher ( )

= runTest { <EOL> val dispatcher = wrapperDispatcher ( ) <EOL> withContext ( dispatcher ) { <EOL> testResumeModeFastPath ( dispatcher ) <EOL> } <EOL> }


@ Test <EOL> fun testNestedEventLoopChangedContext ( )

= runTest { <EOL> withContext ( wrapperDispatcher ( ) ) { <EOL> testResumeModeFastPath ( CoroutineName ( "<STR_LIT:Test>" ) ) <EOL> } <EOL> }


private suspend fun testResumeModeFastPath ( context : CoroutineContext )

{ <EOL> try { <EOL> val channel = Channel < Int > ( ) <EOL> channel . close ( RecoverableTestException ( ) ) <EOL> doFastPath ( context , channel ) <EOL> } catch ( e : Throwable ) { <EOL> verifyStackTrace ( "<STR_LIT>" , e ) <EOL> } <EOL> }


private suspend fun doFastPath ( context : CoroutineContext , channel : Channel < Int > )

{ <EOL> yield ( ) <EOL> withContext ( context , channel ) <EOL> }


private suspend fun withContext ( context : CoroutineContext , channel : Channel < Int > )

{ <EOL> withContext ( context ) { <EOL> channel . receive ( ) <EOL> yield ( ) <EOL> } <EOL> }


@ Test <EOL> fun testUnconfinedSuspending ( )

= runTest { <EOL> testResumeModeSuspending ( Dispatchers . Unconfined ) <EOL> }


@ Test <EOL> fun testNestedUnconfinedSuspending ( )

= runTest { <EOL> withContext ( Dispatchers . Unconfined ) { <EOL> testResumeModeSuspending ( Dispatchers . Unconfined ) <EOL> } <EOL> }


@ Test <EOL> fun testNestedUnconfinedChangedContextSuspending ( )

= runTest { <EOL> withContext ( Dispatchers . Unconfined ) { <EOL> testResumeModeSuspending ( CoroutineName ( "<STR_LIT:Test>" ) ) <EOL> } <EOL> }


@ Test <EOL> fun testEventLoopDispatcherSuspending ( )

= runTest { <EOL> testResumeModeSuspending ( wrapperDispatcher ( ) ) <EOL> }


@ Test <EOL> fun testNestedEventLoopDispatcherSuspending ( )

= runTest { <EOL> val dispatcher = wrapperDispatcher ( ) <EOL> withContext ( dispatcher ) { <EOL> testResumeModeSuspending ( dispatcher ) <EOL> } <EOL> }


@ Test <EOL> fun testNestedEventLoopChangedContextSuspending ( )

= runTest { <EOL> withContext ( wrapperDispatcher ( ) ) { <EOL> testResumeModeSuspending ( CoroutineName ( "<STR_LIT:Test>" ) ) <EOL> } <EOL> }


private suspend fun testResumeModeSuspending ( context : CoroutineContext )

{ <EOL> try { <EOL> val channel = Channel < Int > ( ) <EOL> val latch = Channel < Int > ( ) <EOL> GlobalScope . launch ( coroutineContext ) { <EOL> latch . receive ( ) <EOL> expect ( <NUM_LIT:3> ) <EOL> channel . close ( RecoverableTestException ( ) ) <EOL> } <EOL> doSuspendingPath ( context , channel , latch ) <EOL> } catch ( e : Throwable ) { <EOL> finish ( <NUM_LIT:4> ) <EOL> verifyStackTrace ( "<STR_LIT>" , e ) <EOL> } <EOL> }


private suspend fun doSuspendingPath ( context : CoroutineContext , channel : Channel < Int > , latch : Channel < Int > )

{ <EOL> yield ( ) <EOL> withContext ( context , channel , latch ) <EOL> }


private suspend fun withContext ( context : CoroutineContext , channel : Channel < Int > , latch : Channel < Int > )

{ <EOL> withContext ( context ) { <EOL> expect ( <NUM_LIT:1> ) <EOL> latch . send ( <NUM_LIT:1> ) <EOL> expect ( <NUM_LIT:2> ) <EOL> channel . receive ( ) <EOL> yield ( ) <EOL> } <EOL> }


{ <EOL> print ( "<STR_LIT>" ) <EOL> println ( message ) <EOL> }


@ Ignore <EOL> @ Test <EOL> fun ignored ( )


= hook ( "<STR_LIT>" )


= renderConfiguration . asString ( this )


fun replaceRenderConfiguration ( renderConfiguration : FirDiagnosticCodeMetaRenderConfiguration )

{ <EOL> this . renderConfiguration = renderConfiguration <EOL> }


override fun asString ( codeMetaInfo : CodeMetaInfo ) : String

{ <EOL> if ( codeMetaInfo !is FirDiagnosticCodeMetaInfo ) return "<STR_LIT>" <EOL> return ( getTag ( codeMetaInfo ) + getAttributesString ( codeMetaInfo ) + getParamsString ( codeMetaInfo ) ) <EOL> . replace ( crossPlatformLineBreak , "<STR_LIT>" ) <EOL> }


private fun getParamsString ( codeMetaInfo : FirDiagnosticCodeMetaInfo ) : String

{ <EOL> if ( ! renderParams ) return "<STR_LIT>" <EOL> val params = mutableListOf < String > ( ) <EOL> val diagnostic = codeMetaInfo . diagnostic <EOL> val renderer = RootDiagnosticRendererFactory ( diagnostic ) <EOL> if ( renderer is AbstractKtDiagnosticWithParametersRenderer ) { <EOL> renderer . renderParameters ( diagnostic ) . mapTo ( params ) { <EOL> it . toString ( ) . replace ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> if ( renderSeverity ) <EOL> params . add ( "<STR_LIT>" ) <EOL> params . add ( getAdditionalParams ( codeMetaInfo ) ) <EOL> val nonEmptyParams = params . filter { it . isNotEmpty ( ) } <EOL> return if ( nonEmptyParams . isNotEmpty ( ) ) { <EOL> "<STR_LIT>" <EOL> } else { <EOL> "<STR_LIT>" <EOL> } <EOL> }


fun getTag ( codeMetaInfo : FirDiagnosticCodeMetaInfo ) : String

{ <EOL> return codeMetaInfo . diagnostic . factory . name <EOL> }


private fun < T > MutableMap < T , MutableList < JsKlibExport > > . addExport ( key : T , export : JsKlibExport )

{ <EOL> getOrPut ( key ) { mutableListOf ( ) } . add ( export ) <EOL> }


private fun collectClashesByFqNames ( declarations : List < JsKlibExportingDeclaration > ) : Map < String , List < JsKlibExport > >

{ <EOL> return buildMap < String , MutableList < JsKlibExport > > { <EOL> for ( declaration in declarations ) { <EOL> addExport ( declaration . fqName , declaration ) <EOL> var packageFqName = declaration . containingPackageFqName <EOL> while ( packageFqName . isNotEmpty ( ) ) { <EOL> addExport ( packageFqName , JsKlibExportingPackage ( declaration . containingFile , packageFqName ) ) <EOL> packageFqName = packageFqName . substringBeforeLast ( "<STR_LIT:.>" , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> }


private fun collectClashes ( declarations : List < JsKlibExportingDeclaration > ) : Map < JsKlibExportingDeclaration , List < JsKlibExport > >

{ <EOL> val clashesByFqNames = collectClashesByFqNames ( declarations ) <EOL> return buildMap { <EOL> for ( clashingExports in clashesByFqNames . values ) { <EOL> for ( ( index , export ) in clashingExports . withIndex ( ) ) { <EOL> if ( export is JsKlibExportingDeclaration ) { <EOL> val clashedWith = clashingExports . filterIndexed { i , _ -> i != index } <EOL> if ( clashedWith . isNotEmpty ( ) ) { <EOL> put ( export , clashedWith ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }


override fun check ( declarations : List < JsKlibExportingDeclaration > , context : JsKlibDiagnosticContext , reporter : IrDiagnosticReporter , )

{ <EOL> val clashes = collectClashes ( declarations ) <EOL> for ( ( declaration , clashedWith ) in clashes ) { <EOL> if ( declaration . declaration != null ) { <EOL> reporter . at ( declaration . declaration , context ) . report ( JsKlibErrors . EXPORTING_JS_NAME_CLASH , declaration . exportingName , clashedWith ) <EOL> } <EOL> } <EOL> }


fun foo ( ) : T


= this


{ <EOL> val arr = IntArray ( size ) <EOL> arr [ size - <NUM_LIT:1> ] = <NUM_LIT:42> <EOL> assertEquals ( <NUM_LIT:42> , arr [ size - <NUM_LIT:1> ] ) <EOL> }


{ <EOL> testArrayAllocation ( <NUM_LIT:1> shl <NUM_LIT:10> ) <EOL> }


{ <EOL> testArrayAllocation ( <NUM_LIT:1> shl <NUM_LIT> ) <EOL> }


fun foo ( @ ParameterAnnotation ( "<STR_LIT>" ) param1 : @ ParameterTypeAnnotation ( "<STR_LIT>" ) List < @ NestedParameterTypeAnnotation ( "<STR_LIT>" ) Collection < @ NestedNestedParameterTypeAnnotation ( "<STR_LIT>" ) String > > = @ DefaultValueAnnotation fun ( i : @ Anno ( "<STR_LIT>" ) Int ) : @ Anno ( "<STR_LIT>" ) Int )

= param1


= other is ReflectJavaTypeParameter && typeVariable == other . typeVariable


= typeVariable . hashCode ( )


= this :: class . java . name + "<STR_LIT::U+0020>" + typeVariable


public fun < DomainType : Comparable < DomainType > > PositionalMappingParametersContinuous < * > . continuous ( limits : ClosedRange < DomainType > , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType >

= PositionalContinuousScale ( limits . start , limits . endInclusive , null , transform )

/**
 * Creates a new continuous positional scale (with non-nullable domain).
 *
 * @param DomainType scale domain type.
 * @param limits [ClosedRange] defining the scale domain.
 * @param transform the transformation of scale.
 * @return new [PositionalContinuousScale] with given limits.
 */


public fun < DomainType : Comparable < DomainType > > Scale . Companion . continuousPos ( limits : ClosedRange < DomainType > , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType >


public fun < DomainType : Comparable < DomainType > > PositionalMappingParametersContinuous < * > . continuous ( limits : ClosedRange < DomainType > , nullValue : DomainType ? = null , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType ? >

= PositionalContinuousScale ( limits . start , limits . endInclusive , nullValue , transform )

/**
 * Creates a new continuous positional scale (with nullable domain).
 *
 * @param DomainType scale domain type.
 * @param limits [ClosedRange] defining the scale domain.
 * @param nullValue value which null is mapped to.
 * @param transform the transformation of scale.
 * @return new [PositionalContinuousScale] with given limits.
 */


public fun < DomainType : Comparable < DomainType > > Scale . Companion . continuousPos ( limits : ClosedRange < DomainType > , nullValue : DomainType ? = null , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType ? >


public fun < DomainType > PositionalMappingParametersContinuous < * > . continuous ( min : DomainType ? = null , max : DomainType ? = null , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType >

= PositionalContinuousScale ( min , max , null , transform )

/**
 * Creates a new continuous positional scale (with non-nullable domain).
 *
 * @param DomainType scale domain type.
 * @param min scale domain minimum.
 * @param max scale domain maximum.
 * @param transform the transformation of scale.
 * @return new [PositionalContinuousScale] with given limits.
 */


public fun < DomainType > Scale . Companion . continuousPos ( min : DomainType ? = null , max : DomainType ? = null , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType >


public fun < DomainType > PositionalMappingParametersContinuous < * > . continuous ( min : DomainType ? = null , max : DomainType ? = null , nullValue : DomainType ? = null , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType ? >

= PositionalContinuousScale ( min , max , nullValue , transform )

/**
 * Creates a new continuous positional scale (with nullable domain).
 *
 * @param DomainType scale domain type.
 * @param min scale domain minimum.
 * @param max scale domain maximum.
 * @param nullValue value which null is mapped to.
 * @param transform the transformation of scale.
 * @return new [PositionalContinuousScale] with given limits.
 */


public fun < DomainType > Scale . Companion . continuousPos ( min : DomainType ? = null , max : DomainType ? = null , nullValue : DomainType ? = null , transform : PositionalTransform ? = null ) : PositionalContinuousScale < DomainType ? >


public fun < DomainType > PositionalMappingParameters < * > . categorical ( categories : List < DomainType > ? = null , ) : PositionalCategoricalScale < DomainType >

= PositionalCategoricalScale ( categories )

/**
 * Creates a new categorical positional scale.
 *
 * @param DomainType scale domain type.
 * @param categories [List] defining the scale domain.
 * @return new [PositionalCategoricalScale] with given categories.
 */


public fun < DomainType > Scale . Companion . categoricalPos ( categories : List < DomainType > ? = null , ) : PositionalCategoricalScale < DomainType >


public fun < RangeType : Comparable < RangeType > , DomainType > NonPositionalMappingParametersContinuous < * , * > . continuous ( range : ClosedRange < RangeType > , nullValue : RangeType ? = null , transform : NonPositionalTransform ? = null ) : NonPositionalContinuousScale < DomainType , RangeType >

= <EOL> NonPositionalContinuousScale ( null , null , range . start , range . endInclusive , nullValue , transform )

/**
 * Creates a new continuous non-positional scale.
 *
 * @param DomainType scale domain type.
 * @param RangeType type of the scale range.
 * @param range [ClosedRange] defining the scale range.
 * @param nullValue value which null is mapped to.
 * @param transform scale transformation.
 * @return new [NonPositionalContinuousScale] with the given range.
 */


public fun < RangeType : Comparable < RangeType > , DomainType > Scale . Companion . continuous ( range : ClosedRange < RangeType > , nullValue : RangeType ? = null , transform : NonPositionalTransform ? = null ) : NonPositionalContinuousScale < DomainType , RangeType >


public fun < RangeType : Comparable < RangeType > , DomainType : Comparable < DomainType > > <EOL> NonPositionalMappingParametersContinuous < * , * > . continuous ( range : ClosedRange < RangeType > ? = null , domain : ClosedRange < DomainType > , nullValue : RangeType ? = null , transform : NonPositionalTransform ? = null ) : NonPositionalContinuousScale < DomainType , RangeType >

= <EOL> NonPositionalContinuousScale ( domain . start , domain . endInclusive , range ? . start , range ? . endInclusive , nullValue , transform )

/**
 * Creates a new continuous non-positional scale.
 *
 * @param DomainType scale domain type.
 * @param RangeType type of the scale range.
 * @param range [ClosedRange] defining the scale range.
 * @param domain [ClosedRange] defining the scale domain.
 * @param nullValue value which null is mapped to.
 * @param transform scale transformation.
 * @return new [NonPositionalContinuousScale] with the given domain and range.
 */


public fun < RangeType : Comparable < RangeType > , DomainType : Comparable < DomainType > > <EOL> Scale . Companion . continuous ( range : ClosedRange < RangeType > ? = null , domain : ClosedRange < DomainType > , nullValue : RangeType ? = null , transform : NonPositionalTransform ? = null ) : NonPositionalContinuousScale < DomainType , RangeType >


public fun < RangeType , DomainType > NonPositionalMappingParametersContinuous < * , * > . continuous ( rangeMin : RangeType ? = null , rangeMax : RangeType ? = null , domainMin : DomainType ? = null , domainMax : DomainType ? = null , nullValue : RangeType ? = null , transform : NonPositionalTransform ? = null ) : NonPositionalContinuousScale < DomainType , RangeType >

= <EOL> NonPositionalContinuousScale ( domainMin , domainMax , rangeMin , rangeMax , nullValue , transform )

/**
 * Creates a new continuous non-positional scale.
 *
 * @param DomainType scale domain type.
 * @param RangeType type of the scale range.
 * @param rangeMin scale range minimum.
 * @param rangeMax scale range maximum.
 * @param domainMin scale domain minimum.
 * @param domainMax scale domain maximum.
 * @param nullValue value which null is mapped to.
 * @param transform scale transformation.
 * @return new [NonPositionalContinuousScale] with the given domain and range.
 */


public fun < RangeType , DomainType > Scale . Companion . continuous ( rangeMin : RangeType ? = null , rangeMax : RangeType ? = null , domainMin : DomainType ? = null , domainMax : DomainType ? = null , nullValue : RangeType ? = null , transform : NonPositionalTransform ? = null ) : NonPositionalContinuousScale < DomainType , RangeType >


public inline fun < reified RangeType , reified DomainType > NonPositionalMappingParameters < * , * > . categorical ( range : List < RangeType > ? = null , domain : List < DomainType > ? = null , ) : NonPositionalCategoricalScale < DomainType , RangeType >

= <EOL> NonPositionalCategoricalScale ( domain , range )

/**
 * Creates a new categorical non-positional scale.
 *
 * @param DomainType scale domain type.
 * @param RangeType type of the scale range.
 * @param range [List] defining the scale range.
 * @param domain [List] defining the scale domain.
 * @return new [NonPositionalCategoricalScale] with given domain and range.
 */


public inline fun < reified RangeType , reified DomainType > Scale . Companion . categorical ( range : List < RangeType > ? = null , domain : List < DomainType > ? = null , ) : NonPositionalCategoricalScale < DomainType , RangeType >


public fun < DomainType , RangeType > NonPositionalMappingParameters < * , * > . categorical ( vararg categoriesToValues : Pair < DomainType , RangeType > , ) : NonPositionalCategoricalScale < DomainType , RangeType >

= <EOL> NonPositionalCategoricalScale ( categoriesToValues . map { it . first } , categoriesToValues . map { it . second } , )

/**
 * Creates a new categorical non-positional scale.
 *
 * @param DomainType scale domain type.
 * @param RangeType type of the scale range.
 * @param categoriesToValues [List] of pairs of category to corresponding value.
 * @return new [NonPositionalCategoricalScale] by domain-to-range correspondence.
 */


public fun < DomainType , RangeType > Scale . Companion . categorical ( vararg categoriesToValues : Pair < DomainType , RangeType > , ) : NonPositionalCategoricalScale < DomainType , RangeType >

/**
 * Creates a new categorical non-positional scale.
 *
 * @param DomainType scale domain type
 * @param RangeType type of the scale range
 * @param categoriesToValues [List] of pairs of category to corresponding value.
 * @return new [NonPositionalCategoricalScale] by domain-to-range correspondence.
 */


fun Receiver . method ( param : Parameter ) : LambdaWithReceiver

= TODO ( )


= x


fun assertEqualDirectoriesIgnoringDotFiles ( expected : File , actual : File , forgiveOtherExtraFiles : Boolean , )

= assertEqualDirectories ( expected , actual , forgiveExtraFiles = forgiveOtherExtraFiles , filter = { ! it . name . startsWith ( "<STR_LIT:.>" ) } , )


fun assertEqualDirectories ( expected : File , actual : File , forgiveExtraFiles : Boolean , filter : ( File ) -> ( Boolean ) = { true } , )

{ <EOL> val pathsInExpected = getAllRelativePaths ( expected ) <EOL> val pathsInActual = getAllRelativePaths ( actual ) <EOL> val commonPaths = pathsInExpected . intersect ( pathsInActual ) <EOL> val changedPaths = commonPaths <EOL> . filter { DUMP_ALL || ! Arrays . equals ( File ( expected , it ) . readBytes ( ) , File ( actual , it ) . readBytes ( ) ) } <EOL> . sorted ( ) <EOL> val expectedString = getDirectoryString ( expected , changedPaths , filter ) <EOL> val actualString = getDirectoryString ( actual , changedPaths , filter ) <EOL> if ( DUMP_ALL ) { <EOL> Assert . assertEquals ( expectedString , actualString + "<STR_LIT:U+0020>" ) <EOL> } <EOL> if ( forgiveExtraFiles ) { <EOL> if ( changedPaths . isEmpty ( ) ) { <EOL> val expectedListingLines = expectedString . split ( '<CHAR_LIT:\n>' ) . toList ( ) <EOL> val actualListingLines = actualString . split ( '<CHAR_LIT:\n>' ) . toList ( ) <EOL> if ( actualListingLines . containsAll ( expectedListingLines ) ) { <EOL> return <EOL> } <EOL> } <EOL> } <EOL> if ( expectedString != actualString ) { <EOL> val message : String ? = null <EOL> throw ComparisonFailure ( message , expectedString . replaceFirst ( DIR_ROOT_PLACEHOLDER , expected . canonicalPath ) , actualString . replaceFirst ( DIR_ROOT_PLACEHOLDER , actual . canonicalPath ) ) <EOL> } <EOL> }


private fun File . checksumString ( ) : String

{ <EOL> val crc32 = CRC32 ( ) <EOL> crc32 . update ( this . readBytes ( ) ) <EOL> return java . lang . Long . toHexString ( crc32 . value ) <EOL> }


private fun getDirectoryString ( dir : File , interestingPaths : List < String > , predicate : ( File ) -> ( Boolean ) , ) : String

{ <EOL> val buf = StringBuilder ( ) <EOL> val p = Printer ( buf ) <EOL> fun addDirContent ( dir : File ) { <EOL> p . pushIndent ( ) <EOL> val listFiles = dir . listFiles ( ) ? . filter ( predicate ) <EOL> assertNotNull ( "<STR_LIT>" , listFiles ) <EOL> val children = listFiles ! ! . sortedWith ( compareBy ( { it . isDirectory } , { it . name } ) ) <EOL> for ( child in children ) { <EOL> if ( child . isDirectory ) { <EOL> if ( ( child . list ( ) ? . isNotEmpty ( ) ? : false ) ) { <EOL> p . println ( child . name ) <EOL> addDirContent ( child ) <EOL> } <EOL> } <EOL> else { <EOL> p . println ( child . name , "<STR_LIT:U+0020>" , child . checksumString ( ) ) <EOL> } <EOL> } <EOL> p . popIndent ( ) <EOL> } <EOL> p . println ( DIR_ROOT_PLACEHOLDER ) <EOL> addDirContent ( dir ) <EOL> for ( path in interestingPaths ) { <EOL> p . println ( "<STR_LIT>" , path , "<STR_LIT>" ) <EOL> p . println ( fileToStringRepresentation ( File ( dir , path ) ) ) <EOL> p . println ( ) <EOL> p . println ( ) <EOL> } <EOL> return buf . toString ( ) <EOL> }


private fun getAllRelativePaths ( dir : File ) : Set < String >

{ <EOL> val result = HashSet < String > ( ) <EOL> FileUtil . processFilesRecursively ( dir ) { <EOL> if ( it ! ! . isFile ) { <EOL> result . add ( FileUtil . getRelativePath ( dir , it ) ! ! ) <EOL> } <EOL> true <EOL> } <EOL> return result <EOL> }


private fun classFileToString ( classFile : File ) : String

{ <EOL> val out = StringWriter ( ) <EOL> val traceVisitor = TraceClassVisitor ( PrintWriter ( out ) ) <EOL> ClassReader ( classFile . readBytes ( ) ) . accept ( traceVisitor , <NUM_LIT:0> ) <EOL> val classHeader = LocalFileKotlinClass . create ( classFile , JvmMetadataVersion . INSTANCE ) ? . classHeader ? : return "<STR_LIT>" <EOL> if ( ! classHeader . metadataVersion . isCompatibleWithCurrentCompilerVersion ( ) ) { <EOL> error ( "<STR_LIT>" ) <EOL> } <EOL> when ( classHeader . kind ) { <EOL> KotlinClassHeader . Kind . FILE_FACADE , KotlinClassHeader . Kind . CLASS , KotlinClassHeader . Kind . MULTIFILE_CLASS_PART -> { <EOL> ByteArrayInputStream ( BitEncoding . decodeBytes ( classHeader . data ! ! ) ) . use { input -> <EOL> out . write ( "<STR_LIT>" ) <EOL> when ( classHeader . kind ) { <EOL> KotlinClassHeader . Kind . FILE_FACADE -> <EOL> out . write ( "<STR_LIT>" ) <EOL> KotlinClassHeader . Kind . CLASS -> <EOL> out . write ( "<STR_LIT>" ) <EOL> KotlinClassHeader . Kind . MULTIFILE_CLASS_PART -> <EOL> out . write ( "<STR_LIT>" ) <EOL> else -> error ( classHeader . kind ) <EOL> } <EOL> } <EOL> } <EOL> KotlinClassHeader . Kind . MULTIFILE_CLASS -> { <EOL> out . write ( "<STR_LIT>" ) <EOL> out . write ( classHeader . data ! ! . joinToString ( "<STR_LIT:\n>" ) ) <EOL> } <EOL> KotlinClassHeader . Kind . SYNTHETIC_CLASS -> { <EOL> } <EOL> KotlinClassHeader . Kind . UNKNOWN -> error ( "<STR_LIT>" ) <EOL> } <EOL> return out . toString ( ) <EOL> }


private fun metaJsToString ( metaJsFile : File ) : String

{ <EOL> val out = StringWriter ( ) <EOL> val metadataList = arrayListOf < KotlinJavascriptMetadata > ( ) <EOL> KotlinJavascriptMetadataUtils . parseMetadata ( metaJsFile . readText ( ) , metadataList ) <EOL> for ( metadata in metadataList ) { <EOL> val ( header , content ) = GZIPInputStream ( ByteArrayInputStream ( metadata . body ) ) . use { stream -> <EOL> DebugJsProtoBuf . Header . parseDelimitedFrom ( stream , JsSerializerProtocol . extensionRegistry ) to <EOL> DebugJsProtoBuf . Library . parseFrom ( stream , JsSerializerProtocol . extensionRegistry ) <EOL> } <EOL> out . write ( "<STR_LIT>" ) <EOL> out . write ( "<STR_LIT>" ) <EOL> } <EOL> return out . toString ( ) <EOL> }


private fun kjsmToString ( kjsmFile : File ) : String

{ <EOL> val out = StringWriter ( ) <EOL> val stream = DataInputStream ( kjsmFile . inputStream ( ) ) <EOL> repeat ( stream . readInt ( ) ) { stream . readInt ( ) } <EOL> val ( header , content ) = <EOL> DebugJsProtoBuf . Header . parseDelimitedFrom ( stream , JsSerializerProtocol . extensionRegistry ) to <EOL> DebugJsProtoBuf . Library . parseFrom ( stream , JsSerializerProtocol . extensionRegistry ) <EOL> out . write ( "<STR_LIT>" ) <EOL> out . write ( "<STR_LIT>" ) <EOL> return out . toString ( ) <EOL> }


private fun sourceMapFileToString ( sourceMapFile : File , generatedJsFile : File ) : String

{ <EOL> val sourceMapParseResult = SourceMapParser . parse ( sourceMapFile . readText ( ) ) <EOL> return when ( sourceMapParseResult ) { <EOL> is SourceMapSuccess -> { <EOL> val bytesOut = ByteArrayOutputStream ( ) <EOL> PrintStream ( bytesOut ) . use { printStream -> <EOL> sourceMapParseResult . value . debugVerbose ( printStream , generatedJsFile ) <EOL> } <EOL> bytesOut . toString ( ) <EOL> } <EOL> is SourceMapError -> { <EOL> sourceMapParseResult . message <EOL> } <EOL> } <EOL> }


private fun getExtensionRegistry ( ) : ExtensionRegistry

{ <EOL> val registry = ExtensionRegistry . newInstance ( ) ! ! <EOL> DebugJvmProtoBuf . registerAllExtensions ( registry ) <EOL> return registry <EOL> }


private fun fileToStringRepresentation ( file : File ) : String

{ <EOL> return when { <EOL> file . name . endsWith ( "<STR_LIT>" ) -> { <EOL> classFileToString ( file ) <EOL> } <EOL> file . name . endsWith ( KotlinJavascriptMetadataUtils . META_JS_SUFFIX ) -> { <EOL> metaJsToString ( file ) <EOL> } <EOL> file . name . endsWith ( KotlinJavascriptSerializationUtil . CLASS_METADATA_FILE_EXTENSION ) -> { <EOL> kjsmToString ( file ) <EOL> } <EOL> file . name . endsWith ( "<STR_LIT>" ) -> { <EOL> val generatedJsPath = file . canonicalPath . removeSuffix ( "<STR_LIT>" ) <EOL> sourceMapFileToString ( file , File ( generatedJsPath ) ) <EOL> } <EOL> else -> { <EOL> file . readText ( ) <EOL> } <EOL> } <EOL> }


private fun transformMessage ( msg : String ) : String

{ <EOL> if ( prefix . isNullOrBlank ( ) ) return msg <EOL> return prefix + msg <EOL> }


{ <EOL> log . debug ( transformMessage ( msg ) ) <EOL> }


override fun error ( msg : String , throwable : Throwable ? )

{ <EOL> log . error ( transformMessage ( msg ) , throwable ) <EOL> }


{ <EOL> log . info ( transformMessage ( msg ) ) <EOL> }


{ <EOL> log . warn ( transformMessage ( msg ) ) <EOL> }


{ <EOL> log . lifecycle ( transformMessage ( msg ) ) <EOL> }


private fun ModuleDeclaration . renameStdLibEntities ( onRename : ( uid : String , newName : NameEntity ) -> Unit ) : ModuleDeclaration

{ <EOL> val declarationsResolved = declarations . map { declaration -> <EOL> when ( declaration ) { <EOL> is InterfaceDeclaration -> stdLibRenameMap . resolve ( declaration . name ) ? . let { <EOL> onRename ( declaration . uid , it ) <EOL> declaration . copy ( name = it ) <EOL> } ? : declaration <EOL> is ModuleDeclaration -> declaration . renameStdLibEntities ( onRename ) <EOL> else -> declaration <EOL> } <EOL> } <EOL> return copy ( declarations = declarationsResolved ) <EOL> }


fun SourceSetDeclaration . renameStdLibEntities ( onRename : ( uid : String , newName : NameEntity ) -> Unit ) : SourceSetDeclaration

{ <EOL> return copy ( sources = sources . map { source -> source . copy ( root = source . root . renameStdLibEntities ( onRename ) ) } ) <EOL> }


{ <EOL> baz = v <EOL> return v <EOL> }


{ <EOL> val al = ArrayList < Int > ( withSideEffect ( <NUM_LIT:2> ) ) <EOL> if ( al . size != <NUM_LIT:0> ) return "<STR_LIT>" <EOL> if ( baz != <NUM_LIT:2> ) return "<STR_LIT>" <EOL> return "<STR_LIT:OK>" <EOL> }


fun logged ( message : String , value : Int )

= <EOL> value . also { log . append ( message ) }


{ <EOL> var sum = <NUM_LIT:0> <EOL> for ( i in ( ( logged ( "<STR_LIT>" , <NUM_LIT:1> ) until logged ( "<STR_LIT>" , <NUM_LIT:11> ) ) . reversed ( ) step logged ( "<STR_LIT>" , <NUM_LIT:2> ) ) . reversed ( ) step logged ( "<STR_LIT>" , <NUM_LIT:3> ) ) { <EOL> sum = sum * <NUM_LIT:10> + i <EOL> } <EOL> assertEquals ( <NUM_LIT> , sum ) <EOL> assertEquals ( "<STR_LIT>" , log . toString ( ) ) <EOL> return "<STR_LIT:OK>" <EOL> }


fun updateAnnotations ( editor : AbstractTextEditor , annotations : List < DiagnosticAnnotation > )

{ <EOL> val annotationModel = editor . documentProvider . getAnnotationModel ( editor . editorInput ) <EOL> if ( annotationModel !is IAnnotationModelExtension ) return <EOL> val newAnnotations = annotations . associateBy ( { it } , { it . position } ) <EOL> val oldAnnotations = getLineMarkerAnnotations ( annotationModel ) <EOL> updateAnnotations ( annotationModel , newAnnotations , oldAnnotations ) <EOL> }


fun clearAllMarkersFromProject ( project : IProject )

{ <EOL> try { <EOL> KotlinPsiManager . getFilesByProject ( project ) . forEach { <EOL> it . removeMarkers ( ) <EOL> } <EOL> } catch ( e : CoreException ) { <EOL> KotlinLogger . logError ( e ) <EOL> } <EOL> }


fun addProblemMarker ( annotation : DiagnosticAnnotation , file : IFile )

= <EOL> with ( file . createMarker ( MARKER_PROBLEM_TYPE ) ) { <EOL> setAttribute ( IMarker . MESSAGE , annotation . text ) <EOL> setAttribute ( IMarker . SEVERITY , annotation . markerSeverity ) <EOL> setAttribute ( IMarker . CHAR_START , annotation . offset ) <EOL> setAttribute ( IMarker . CHAR_END , annotation . endOffset ) <EOL> setAttribute ( IMarker . LOCATION , "<STR_LIT>" ) <EOL> setAttribute ( IMarker . LINE_NUMBER , annotation . line ) <EOL> setAttribute ( MARKED_TEXT , annotation . markedText ) <EOL> annotation . diagnostic ? . let { <EOL> addDiagnostics ( it ) <EOL> } <EOL> val diagnostic = annotation . diagnostic <EOL> val isUnresolvedReference = if ( diagnostic != null ) { <EOL> DiagnosticAnnotationUtil . isUnresolvedReference ( diagnostic . factory ) <EOL> } else false <EOL> setAttribute ( IS_UNRESOLVED_REFERENCE , isUnresolvedReference ) <EOL> val canBeFixed = diagnostic ? . let { kotlinQuickFixes . containsKey ( it . factory ) } ? : false <EOL> setAttribute ( CAN_FIX_PROBLEM , canBeFixed ) <EOL> }


fun removeAnnotations ( editor : KotlinFileEditor , annotationType : String )

{ <EOL> updateAnnotations ( editor , emptyMap ( ) , annotationType ) <EOL> }


fun updateAnnotations ( editor : KotlinEditor , annotationMap : Map < Annotation , Position > , annotationType : String )

{ <EOL> val model = editor . javaEditor . documentProvider ? . getAnnotationModel ( editor . javaEditor . editorInput ) <EOL> if ( model != null ) { <EOL> updateAnnotations ( model , annotationMap , getAnnotations ( model , annotationType ) ) <EOL> } <EOL> }


private fun getAnnotations ( model : IAnnotationModel , annontationType : String ) : List < Annotation >

{ <EOL> val annotations = arrayListOf < Annotation > ( ) <EOL> for ( annotation in model . annotationIterator ) { <EOL> if ( annotation is Annotation && annotation . type == annontationType ) { <EOL> annotations . add ( annotation ) <EOL> } <EOL> } <EOL> return annotations <EOL> }


private fun < Ann : Annotation > updateAnnotations ( model : IAnnotationModel , annotationMap : Map < Ann , Position > , oldAnnotations : List < Annotation > )

{ <EOL> model . withLock { <EOL> ( model as IAnnotationModelExtension ) . replaceAnnotations ( oldAnnotations . toTypedArray ( ) , annotationMap ) <EOL> } <EOL> }


private fun getLineMarkerAnnotations ( model : IAnnotationModel ) : List < Annotation >

{ <EOL> fun isLineMarkerAnnotation ( ann : Annotation ) : Boolean { <EOL> return when ( ann ) { <EOL> is DiagnosticAnnotation -> true <EOL> is MarkerAnnotation -> MarkerUtilities . isMarkerType ( ann . marker , IMarker . PROBLEM ) <EOL> else -> false <EOL> } <EOL> } <EOL> return arrayListOf < Annotation > ( ) . apply { <EOL> model . annotationIterator . forEach { <EOL> if ( it is Annotation && isLineMarkerAnnotation ( it ) ) { <EOL> add ( it ) <EOL> } <EOL> } <EOL> } <EOL> }


override fun reconcile ( file : IFile , editor : KotlinEditor )

{ <EOL> val jetFile = <EOL> if ( editor . isScript ) editor . parsedFile else KotlinPsiManager . getKotlinFileIfExist ( file , editor . document . get ( ) ) <EOL> jetFile ? . let { <EOL> val diagnostics = KotlinAnalyzer . analyzeFile ( it ) . analysisResult . bindingContext . diagnostics <EOL> val annotations = DiagnosticAnnotationUtil . INSTANCE . handleDiagnostics ( diagnostics ) <EOL> DiagnosticAnnotationUtil . INSTANCE . addParsingDiagnosticAnnotations ( file , annotations ) <EOL> DiagnosticAnnotationUtil . INSTANCE . updateAnnotations ( editor . javaEditor , annotations ) <EOL> } <EOL> }


fun < T > IAnnotationModel . withLock ( action : ( ) -> T ) : T

{ <EOL> return if ( this is ISynchronizable ) { <EOL> synchronized ( this . lockObject ) { <EOL> action ( ) <EOL> } <EOL> } else { <EOL> synchronized ( this ) { <EOL> action ( ) <EOL> } <EOL> } <EOL> }


{ <EOL> val map = mapOf ( <NUM_LIT:1> to "<STR_LIT>" ) <EOL> val i = <NUM_LIT:1> <EOL> return when ( i ) { <EOL> in map -> "<STR_LIT:OK>" <EOL> else -> "<STR_LIT:fail>" <EOL> } <EOL> }


= <NUM_LIT:1>


= <NUM_LIT:2>


= <NUM_LIT:3>


{ <EOL> val ( x , _ , z ) = A <EOL> }


{ <EOL> class `A$B` { <EOL> inner class `C$D` <EOL> inner class `$$$$$$$` { <EOL> inner class `G$G$` <EOL> } <EOL> } <EOL> }


{ <EOL> "<STR_LIT:OK>" <EOL> fun bar ( ) { <EOL> "<STR_LIT:OK>" <EOL> } <EOL> "<STR_LIT:OK>" <EOL> bar ( ) <EOL> "<STR_LIT:OK>" <EOL> }


public fun foo ( p : MutableList < in String > )


public fun dummy ( )


override fun foo ( p : MutableList < in String > )


override fun sanitizeReturnType ( inferred : UnwrappedType , wrappedTypeFactory : WrappedTypeFactory , trace : BindingTrace , languageVersionSettings : LanguageVersionSettings ) : UnwrappedType

= <EOL> if ( languageVersionSettings . supportsFeature ( LanguageFeature . StrictJavaNullabilityAssertions ) ) { <EOL> inferred . replaceAttributes ( inferred . attributes . replaceAnnotations ( FilteredAnnotations ( inferred . annotations , languageVersionSettings . supportsFeature ( LanguageFeature . NewInference ) ) { <EOL> it != JvmAnnotationNames . ENHANCED_NULLABILITY_ANNOTATION <EOL> } ) ) <EOL> } else inferred


suspend fun suspendHere ( a : String , b : String = a , c : String = a + b ) : String

= suspendCoroutineUninterceptedOrReturn { x -> <EOL> x . resume ( "<STR_LIT>" ) <EOL> COROUTINE_SUSPENDED <EOL> }


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


{ <EOL> var result = "<STR_LIT>" <EOL> builder { <EOL> result = suspendHere ( "<STR_LIT>" ) <EOL> } <EOL> if ( result != "<STR_LIT>" ) return "<STR_LIT>" <EOL> builder { <EOL> result = suspendHere ( "<STR_LIT>" , c = "<STR_LIT>" ) <EOL> } <EOL> if ( result != "<STR_LIT>" ) return "<STR_LIT>" <EOL> builder { <EOL> result = suspendHere ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> } <EOL> if ( result != "<STR_LIT>" ) return "<STR_LIT>" <EOL> builder { <EOL> result = suspendHere ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> } <EOL> if ( result != "<STR_LIT>" ) return "<STR_LIT>" <EOL> return "<STR_LIT:OK>" <EOL> }