private fun assertModulesMatch ( expectedCommonizedModuleNames : Set < String > , expectedMissingModuleNames : Set < String > , actualModuleResults : Collection < ModuleResult > )

{ <EOL> val actualCommonizedModuleNames = mutableSetOf < String > ( ) <EOL> val actualMissingModuleNames = mutableSetOf < String > ( ) <EOL> actualModuleResults . forEach { moduleResult -> <EOL> actualCommonizedModuleNames += moduleResult . libraryName <EOL> } <EOL> assertEquals ( expectedCommonizedModuleNames . size + expectedMissingModuleNames . size , actualModuleResults . size ) <EOL> assertEquals ( expectedCommonizedModuleNames , actualCommonizedModuleNames ) <EOL> assertEquals ( expectedMissingModuleNames , actualMissingModuleNames ) <EOL> }


fun ClassLoader . forAllMatchingFiles ( namePattern : String , vararg keyResourcePaths : String , body : ( String , InputStream ) -> Unit )

{ <EOL> val processedDirs = HashSet < File > ( ) <EOL> val processedJars = HashSet < URL > ( ) <EOL> val nameRegex = namePatternToRegex ( namePattern ) <EOL> fun iterateResources ( keyResourcePaths : Array < out String > ) { <EOL> for ( keyResourcePath in keyResourcePaths ) { <EOL> val resourceRootCalc = ClassLoaderResourceRootFIlePathCalculator ( keyResourcePath ) <EOL> for ( url in getResources ( keyResourcePath ) ) { <EOL> if ( url . protocol == "<STR_LIT>" ) { <EOL> val jarConnection = url . openConnection ( ) as? JarURLConnection <EOL> val jarUrl = jarConnection ? . jarFileURL <EOL> if ( jarUrl != null && ! processedJars . contains ( jarUrl ) ) { <EOL> processedJars . add ( jarUrl ) <EOL> try { <EOL> jarConnection . jarFile <EOL> } catch ( _ : IOException ) { <EOL> null <EOL> } ? . let { <EOL> forAllMatchingFilesInJarFile ( it , nameRegex , body ) <EOL> } <EOL> } <EOL> } else { <EOL> val rootDir = url . toFileOrNull ( ) ? . let { resourceRootCalc ( it ) } <EOL> if ( rootDir != null && rootDir . isDirectory && ! processedDirs . contains ( rootDir ) ) { <EOL> processedDirs . add ( rootDir ) <EOL> forAllMatchingFilesInDirectory ( rootDir , namePattern , body ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> iterateResources ( if ( keyResourcePaths . isEmpty ( ) ) arrayOf ( "<STR_LIT>" , JAR_MANIFEST_RESOURCE_NAME ) else keyResourcePaths ) <EOL> }


= ( if ( this == '<CHAR_LIT:\\>' || patternCharsToEscape . contains ( this ) ) "<STR_LIT>" else "<STR_LIT>" ) + this


internal fun String . toUniversalSeparator ( ) : String

= if ( File . separatorChar == '<CHAR_LIT:/>' ) this else replace ( File . separatorChar , '<CHAR_LIT:/>' )


internal fun forAllMatchingFilesInDirectory ( baseDir : File , namePattern : String , body : ( String , InputStream ) -> Unit )

{ <EOL> val patternStart = namePattern . indexOfAny ( wildcardChars ) <EOL> if ( patternStart < <NUM_LIT:0> ) { <EOL> baseDir . resolve ( namePattern ) . takeIf { it . exists ( ) && it . isFile } ? . let { file -> <EOL> body ( file . relativeToOrSelf ( baseDir ) . path . toUniversalSeparator ( ) , file . inputStream ( ) ) <EOL> } <EOL> } else { <EOL> val patternDirStart = namePattern . lastIndexOfAny ( pathSeparatorChars , patternStart ) <EOL> val root = if ( patternDirStart <= <NUM_LIT:0> ) baseDir else baseDir . resolve ( namePattern . substring ( <NUM_LIT:0> , patternDirStart ) ) <EOL> if ( root . exists ( ) && root . isDirectory ) { <EOL> val re = namePatternToRegex ( namePattern . substring ( patternDirStart + <NUM_LIT:1> ) ) <EOL> root . walkTopDown ( ) . filter { <EOL> re . matches ( it . relativeToOrSelf ( root ) . path ) <EOL> } . forEach { file -> <EOL> body ( file . relativeToOrSelf ( baseDir ) . path . toUniversalSeparator ( ) , file . inputStream ( ) ) <EOL> } <EOL> } <EOL> } <EOL> }


internal fun forAllMatchingFilesInJarStream ( jarInputStream : JarInputStream , nameRegex : Regex , body : ( String , InputStream ) -> Unit )

{ <EOL> do { <EOL> val entry = jarInputStream . nextJarEntry <EOL> if ( entry != null ) { <EOL> try { <EOL> if ( ! entry . isDirectory && nameRegex . matches ( entry . name ) ) { <EOL> body ( entry . name , jarInputStream ) <EOL> } <EOL> } finally { <EOL> jarInputStream . closeEntry ( ) <EOL> } <EOL> } <EOL> } while ( entry != null ) <EOL> }


internal fun forAllMatchingFilesInJar ( jarFile : File , nameRegex : Regex , body : ( String , InputStream ) -> Unit )

{ <EOL> JarInputStream ( FileInputStream ( jarFile ) ) . use { <EOL> forAllMatchingFilesInJarStream ( it , nameRegex , body ) <EOL> } <EOL> }


internal fun forAllMatchingFilesInJarFile ( jarFile : JarFile , nameRegex : Regex , body : ( String , InputStream ) -> Unit )

{ <EOL> jarFile . entries ( ) . asSequence ( ) . forEach { entry -> <EOL> if ( ! entry . isDirectory && nameRegex . matches ( entry . name ) ) { <EOL> jarFile . getInputStream ( entry ) . use { stream -> <EOL> body ( entry . name , stream ) <EOL> } <EOL> } <EOL> } <EOL> }


internal fun namePatternToRegex ( pattern : String ) : Regex

= Regex ( buildString { <EOL> var current = <NUM_LIT:0> <EOL> loop @ while ( current < pattern . length ) { <EOL> val nextIndex = pattern . indexOfAny ( specialPatternChars , current ) <EOL> val next = if ( nextIndex < <NUM_LIT:0> ) pattern . length else nextIndex <EOL> append ( pattern . substring ( current , next ) ) <EOL> current = next + <NUM_LIT:1> <EOL> when { <EOL> next >= pattern . length -> break@loop <EOL> pathSeparatorChars . contains ( pattern [ next ] ) -> append ( pathSeparatorPattern ) <EOL> pattern [ next ] == '<CHAR_LIT>' -> append ( '<CHAR_LIT:.>' ) <EOL> pattern [ next ] == '<CHAR_LIT:*>' && next + <NUM_LIT:1> < pattern . length && pattern [ next + <NUM_LIT:1> ] == '<CHAR_LIT:*>' -> { <EOL> append ( "<STR_LIT>" ) <EOL> current ++ <EOL> } <EOL> pattern [ next ] == '<CHAR_LIT:*>' -> append ( pathElementPattern ) <EOL> else -> { <EOL> append ( '<CHAR_LIT:\\>' ) <EOL> append ( pattern [ next ] ) <EOL> } <EOL> } <EOL> } <EOL> } )


override fun conversionDefinitelyNotNeeded ( candidate : ResolutionCandidate , argument : KotlinCallArgument , expectedParameterType : UnwrappedType ) : Boolean

{ <EOL> if ( argument !is SimpleKotlinCallArgument ) return true <EOL> val argumentType = argument . receiver . stableType <EOL> if ( argumentType . isSuspendFunctionType ) return true <EOL> if ( ! expectedParameterType . isSuspendFunctionType ) return true <EOL> return false <EOL> }


override fun conversionIsNeededBeforeSubtypingCheck ( argument : KotlinCallArgument , areSuspendOnlySamConversionsSupported : Boolean ) : Boolean

= <EOL> argument is SimpleKotlinCallArgument && <EOL> ( argument . receiver . stableType . isFunctionType || argument . receiver . stableType . isKFunctionType )


override fun conversionIsNeededAfterSubtypingCheck ( argument : KotlinCallArgument ) : Boolean

= <EOL> argument is SimpleKotlinCallArgument && argument . receiver . stableType . isFunctionTypeOrSubtype


override fun convertParameterType ( candidate : ResolutionCandidate , argument : KotlinCallArgument , parameter : ParameterDescriptor , expectedParameterType : UnwrappedType ) : UnwrappedType

{ <EOL> val nonSuspendParameterType = createFunctionType ( candidate . callComponents . builtIns , expectedParameterType . annotations , expectedParameterType . getReceiverTypeFromFunctionType ( ) , expectedParameterType . getContextReceiverTypesFromFunctionType ( ) , expectedParameterType . getValueParameterTypesFromFunctionType ( ) . map { it . type } , parameterNames = null , expectedParameterType . getReturnTypeFromFunctionType ( ) , suspendFunction = false ) <EOL> candidate . resolvedCall . registerArgumentWithSuspendConversion ( argument , nonSuspendParameterType ) <EOL> candidate . markCandidateForCompatibilityResolve ( ) <EOL> return nonSuspendParameterType <EOL> }


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

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


override fun < D > acceptChildren ( visitor : IrElementVisitor < Unit , D > , data : D )

{ <EOL> suspensionPointIdParameter . accept ( visitor , data ) <EOL> result . accept ( visitor , data ) <EOL> resumeResult . accept ( visitor , data ) <EOL> }


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

{ <EOL> suspensionPointIdParameter = suspensionPointIdParameter . transform ( transformer , data ) as IrVariable <EOL> result = result . transform ( transformer , data ) <EOL> resumeResult = resumeResult . transform ( transformer , data ) <EOL> }


{ <EOL> return if ( A ( ) . run ( ) == "<STR_LIT>" ) "<STR_LIT:OK>" else "<STR_LIT:fail>" <EOL> }


= <EOL> with ( "<STR_LIT:abc>" ) { <EOL> show ( ) <EOL> }


private fun String . show ( p : Boolean = false ) : String

= getName ( ) + this


= "<STR_LIT:A>"


override fun shouldBeSuppressed ( d : Documentable ) : Boolean

{ <EOL> val annotations = ( d as? WithExtraProperties < * > ) ? . annotations ( ) ? : return false <EOL> if ( annotations . isEmpty ( ) ) <EOL> return false <EOL> val deprecatedAnnotations = filterDeprecatedAnnotations ( annotations ) <EOL> if ( deprecatedAnnotations . isEmpty ( ) ) <EOL> return false <EOL> val kotlinDeprecated = deprecatedAnnotations . find { it . dri . packageName == "<STR_LIT:kotlin>" } <EOL> if ( kotlinDeprecated ? . isHidden ( ) == true ) <EOL> return true <EOL> return perPackageOptions ( d ) ? . skipDeprecated ? : sourceSet ( d ) . skipDeprecated <EOL> }


private fun WithExtraProperties < * > . annotations ( ) : List < Annotations . Annotation >

{ <EOL> return this . extra . allOfType < Annotations > ( ) . flatMap { annotations -> <EOL> annotations . directAnnotations . values . singleOrNull ( ) ? : emptyList ( ) <EOL> } <EOL> }


private fun filterDeprecatedAnnotations ( annotations : List < Annotations . Annotation > ) : List < Annotations . Annotation >

{ <EOL> return annotations . filter { <EOL> ( it . dri . packageName == "<STR_LIT:kotlin>" && it . dri . classNames == "<STR_LIT>" ) || <EOL> ( it . dri . packageName == "<STR_LIT>" && it . dri . classNames == "<STR_LIT>" ) <EOL> } <EOL> }


private fun Annotations . Annotation . isHidden ( ) : Boolean

{ <EOL> val level = ( this . params [ "<STR_LIT>" ] as? EnumValue ) ? : return false <EOL> return level . enumName == "<STR_LIT>" <EOL> }


fun Project . setupHighestLanguageLevel ( )

{ <EOL> LanguageLevelProjectExtension . getInstance ( this ) . languageLevel = <EOL> LanguageLevel . entries . firstOrNull { it . name == "<STR_LIT>" } <EOL> ? : LanguageLevel . entries . firstOrNull { it . name == "<STR_LIT>" } <EOL> ? : LanguageLevel . JDK_X <EOL> }


override fun beginStructure ( descriptor : SerialDescriptor ) : CompositeEncoder

= this


override fun endStructure ( descriptor : SerialDescriptor )


public open fun encodeElement ( descriptor : SerialDescriptor , index : Int ) : Boolean

= true

/**
 * Invoked before writing an element that is part of the structure to determine whether it should be encoded.
 * Element information can be obtained from the [descriptor] by the given [index].
 *
 * @return `true` if the value should be encoded, false otherwise
 */


public open fun encodeValue ( value : Any ) : Unit

= <EOL> throw SerializationException ( "<STR_LIT>" )

/**
 * Invoked to encode a value when specialized `encode*` method was not overridden.
 */


{ <EOL> throw SerializationException ( "<STR_LIT>" ) <EOL> }


override fun encodeBoolean ( value : Boolean ) : Unit

= encodeValue ( value )


override fun encodeByte ( value : Byte ) : Unit

= encodeValue ( value )


override fun encodeShort ( value : Short ) : Unit

= encodeValue ( value )


override fun encodeInt ( value : Int ) : Unit

= encodeValue ( value )


override fun encodeLong ( value : Long ) : Unit

= encodeValue ( value )


override fun encodeFloat ( value : Float ) : Unit

= encodeValue ( value )


override fun encodeDouble ( value : Double ) : Unit

= encodeValue ( value )


override fun encodeChar ( value : Char ) : Unit

= encodeValue ( value )


override fun encodeString ( value : String ) : Unit

= encodeValue ( value )


override fun encodeEnum ( enumDescriptor : SerialDescriptor , index : Int ) : Unit

= encodeValue ( index )


override fun encodeInline ( descriptor : SerialDescriptor ) : Encoder

= this


final override fun encodeBooleanElement ( descriptor : SerialDescriptor , index : Int , value : Boolean )

{ if ( encodeElement ( descriptor , index ) ) encodeBoolean ( value ) }


final override fun encodeByteElement ( descriptor : SerialDescriptor , index : Int , value : Byte )

{ if ( encodeElement ( descriptor , index ) ) encodeByte ( value ) }


final override fun encodeShortElement ( descriptor : SerialDescriptor , index : Int , value : Short )

{ if ( encodeElement ( descriptor , index ) ) encodeShort ( value ) }


final override fun encodeIntElement ( descriptor : SerialDescriptor , index : Int , value : Int )

{ if ( encodeElement ( descriptor , index ) ) encodeInt ( value ) }


final override fun encodeLongElement ( descriptor : SerialDescriptor , index : Int , value : Long )

{ if ( encodeElement ( descriptor , index ) ) encodeLong ( value ) }


final override fun encodeFloatElement ( descriptor : SerialDescriptor , index : Int , value : Float )

{ if ( encodeElement ( descriptor , index ) ) encodeFloat ( value ) }


final override fun encodeDoubleElement ( descriptor : SerialDescriptor , index : Int , value : Double )

{ if ( encodeElement ( descriptor , index ) ) encodeDouble ( value ) }


final override fun encodeCharElement ( descriptor : SerialDescriptor , index : Int , value : Char )

{ if ( encodeElement ( descriptor , index ) ) encodeChar ( value ) }


final override fun encodeStringElement ( descriptor : SerialDescriptor , index : Int , value : String )

{ if ( encodeElement ( descriptor , index ) ) encodeString ( value ) }


final override fun encodeInlineElement ( descriptor : SerialDescriptor , index : Int ) : Encoder

= <EOL> if ( encodeElement ( descriptor , index ) ) encodeInline ( descriptor . getElementDescriptor ( index ) ) else NoOpEncoder


override fun < T : Any ? > encodeSerializableElement ( descriptor : SerialDescriptor , index : Int , serializer : SerializationStrategy < T > , value : T )

{ <EOL> if ( encodeElement ( descriptor , index ) ) <EOL> encodeSerializableValue ( serializer , value ) <EOL> }


override fun < T : Any > encodeNullableSerializableElement ( descriptor : SerialDescriptor , index : Int , serializer : SerializationStrategy < T > , value : T ? <EOL> )

{ <EOL> if ( encodeElement ( descriptor , index ) ) <EOL> encodeNullableSerializableValue ( serializer , value ) <EOL> }


{ <EOL> for ( ( delegatedFirDeclaration , delegatedIrDeclaration , irField , delegateToFirSymbol , delegateToLookupTag ) in bodiesInfo ) { <EOL> when ( delegatedIrDeclaration ) { <EOL> is IrSimpleFunction -> { <EOL> val delegateToIrFunctionSymbol = declarationStorage . getIrFunctionSymbol ( delegateToFirSymbol . unwrapCallRepresentative ( c , delegateToLookupTag ) as FirNamedFunctionSymbol , delegateToLookupTag ) as? IrSimpleFunctionSymbol ? : continue <EOL> val body = createDelegateBody ( irField , delegatedFirDeclaration , delegatedIrDeclaration , delegateToFirSymbol . fir , delegateToIrFunctionSymbol , isSetter = false ) <EOL> delegatedIrDeclaration . body = body <EOL> } <EOL> is IrProperty -> { <EOL> val delegateToIrPropertySymbol = declarationStorage . getIrPropertySymbol ( delegateToFirSymbol . unwrapCallRepresentative ( c , delegateToLookupTag ) as FirPropertySymbol , delegateToLookupTag ) as? IrPropertySymbol ? : continue <EOL> val delegateToGetterSymbol = declarationStorage . findGetterOfProperty ( delegateToIrPropertySymbol ) ! ! <EOL> val getter = delegatedIrDeclaration . getter ! ! <EOL> getter . body = createDelegateBody ( irField , delegatedFirDeclaration , getter , delegateToFirSymbol . fir , delegateToGetterSymbol , isSetter = false ) <EOL> if ( delegatedIrDeclaration . isVar ) { <EOL> val delegateToSetterSymbol = declarationStorage . findSetterOfProperty ( delegateToIrPropertySymbol ) ! ! <EOL> val setter = delegatedIrDeclaration . setter ! ! <EOL> setter . body = createDelegateBody ( irField , delegatedFirDeclaration , setter , delegateToFirSymbol . fir , delegateToSetterSymbol , isSetter = true ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> bodiesInfo . clear ( ) <EOL> }


fun generateWithBodiesIfNeeded ( firField : FirField , irField : IrField , firSubClass : FirClass , subClass : IrClass )

{ <EOL> delegatedMemberGenerator . generate ( irField , firField , firSubClass , subClass ) <EOL> if ( firSubClass . isLocalClassOrAnonymousObject ( ) ) { <EOL> delegatedMemberGenerator . generateBodies ( ) <EOL> } <EOL> }


fun generate ( irField : IrField , firField : FirField , firSubClass : FirClass , subClass : IrClass )

{ <EOL> val subClassScope = firSubClass . unsubstitutedScope ( c ) <EOL> val delegateToScope = firField . initializer ! ! . resolvedType <EOL> . fullyExpandedType ( session ) <EOL> . lowerBoundIfFlexible ( ) <EOL> . scope ( session , scopeSession , CallableCopyTypeCalculator . Forced , null ) ? : return <EOL> val subClassLookupTag = firSubClass . symbol . toLookupTag ( ) <EOL> subClassScope . processAllFunctions { functionSymbol -> <EOL> val unwrapped = <EOL> functionSymbol . unwrapDelegateTarget ( subClassLookupTag , firField ) <EOL> ? : return@processAllFunctions <EOL> val delegateToSymbol = findDelegateToSymbol ( unwrapped . symbol , delegateToScope :: processFunctionsByName , delegateToScope :: processOverriddenFunctions ) ? : return@processAllFunctions <EOL> val delegateToLookupTag = delegateToSymbol . dispatchReceiverClassLookupTagOrNull ( ) <EOL> ? : return@processAllFunctions <EOL> val delegatedFunction = functionSymbol . fir <EOL> val irSubFunction = generateDelegatedFunction ( subClass , firSubClass , delegatedFunction ) <EOL> bodiesInfo += DeclarationBodyInfo ( delegatedFunction , irSubFunction , irField , delegateToSymbol , delegateToLookupTag ) <EOL> declarationStorage . cacheDelegationFunction ( delegatedFunction , irSubFunction ) <EOL> } <EOL> subClassScope . processAllProperties { propertySymbol -> <EOL> if ( propertySymbol !is FirPropertySymbol ) return@processAllProperties <EOL> val unwrapped = propertySymbol . unwrapDelegateTarget ( subClassLookupTag , firField ) ? : return@processAllProperties <EOL> val delegateToSymbol = findDelegateToSymbol ( unwrapped . symbol , { name , processor -> <EOL> delegateToScope . processPropertiesByName ( name ) { <EOL> if ( it !is FirPropertySymbol ) return@processPropertiesByName <EOL> processor ( it ) <EOL> } <EOL> } , delegateToScope :: processOverriddenProperties ) ? : return@processAllProperties <EOL> val delegateToLookupTag = delegateToSymbol . dispatchReceiverClassLookupTagOrNull ( ) ? : return@processAllProperties <EOL> val delegatedProperty = propertySymbol . fir <EOL> val irSubProperty = generateDelegatedProperty ( subClass , firSubClass , delegatedProperty ) <EOL> bodiesInfo += DeclarationBodyInfo ( delegatedProperty , irSubProperty , irField , delegateToSymbol , delegateToLookupTag ) <EOL> declarationStorage . cacheDelegatedProperty ( delegatedProperty , irSubProperty ) <EOL> } <EOL> }


private inline fun < reified S : FirCallableSymbol < * > > findDelegateToSymbol ( symbol : S , processCallables : ( name : Name , processor : ( S ) -> Unit ) -> Unit , crossinline processOverridden : ( base : S , processor : ( S ) -> ProcessorAction ) -> ProcessorAction ) : S ?

{ <EOL> val unwrappedSymbol = symbol . unwrapUseSiteSubstitutionOverrides ( ) <EOL> var result : S ? = null <EOL> processCallables ( unwrappedSymbol . name ) { candidateSymbol -> <EOL> if ( result != null ) return@processCallables <EOL> val unwrappedCandidateSymbol = candidateSymbol . unwrapUseSiteSubstitutionOverrides ( ) <EOL> if ( unwrappedCandidateSymbol === unwrappedSymbol ) { <EOL> result = candidateSymbol <EOL> return@processCallables <EOL> } <EOL> processOverridden ( candidateSymbol ) { overriddenSymbol -> <EOL> val unwrappedOverriddenSymbol = overriddenSymbol . unwrapUseSiteSubstitutionOverrides ( ) <EOL> if ( unwrappedOverriddenSymbol === unwrappedSymbol ) { <EOL> result = candidateSymbol <EOL> ProcessorAction . STOP <EOL> } else { <EOL> ProcessorAction . NEXT <EOL> } <EOL> } <EOL> } <EOL> return result <EOL> }


@ OptIn ( FirBasedFakeOverrideGenerator :: class ) <EOL> fun bindDelegatedMembersOverriddenSymbols ( irClass : IrClass )

{ <EOL> if ( ! c . configuration . useFirBasedFakeOverrideGenerator ) return <EOL> val superClasses by lazy ( LazyThreadSafetyMode . NONE ) { <EOL> irClass . superTypes . mapNotNullTo ( mutableSetOf ( ) ) { <EOL> @ OptIn ( UnsafeDuringIrConstructionAPI :: class ) <EOL> it . classifierOrNull ? . owner as? IrClass <EOL> } <EOL> } <EOL> require ( irClass !is Fir2IrLazyClass ) <EOL> @ OptIn ( UnsafeDuringIrConstructionAPI :: class ) <EOL> val declarations = irClass . declarations <EOL> for ( declaration in declarations ) { <EOL> if ( declaration . origin != IrDeclarationOrigin . DELEGATED_MEMBER ) continue <EOL> when ( declaration ) { <EOL> is IrSimpleFunction -> { <EOL> val symbol = declaration . symbol <EOL> declaration . overriddenSymbols = baseFunctionSymbols [ declaration ] ? . flatMap { <EOL> fakeOverrideGenerator . getOverriddenSymbolsInSupertypes ( it , superClasses ) <EOL> } ? . filter { it != symbol } . orEmpty ( ) <EOL> } <EOL> is IrProperty -> { <EOL> val symbol = declaration . symbol <EOL> declaration . overriddenSymbols = basePropertySymbols [ declaration ] ? . flatMap { <EOL> fakeOverrideGenerator . getOverriddenSymbolsInSupertypes ( it , superClasses ) <EOL> } ? . filter { it != symbol } . orEmpty ( ) <EOL> declaration . getter ! ! . overriddenSymbols = declaration . overriddenSymbols . mapNotNull { <EOL> declarationStorage . findGetterOfProperty ( it ) <EOL> } <EOL> if ( declaration . isVar ) { <EOL> declaration . setter ! ! . overriddenSymbols = declaration . overriddenSymbols . mapNotNull { <EOL> declarationStorage . findSetterOfProperty ( it ) <EOL> } <EOL> } <EOL> } <EOL> else -> continue <EOL> } <EOL> } <EOL> }


private fun generateDelegatedFunction ( subClass : IrClass , firSubClass : FirClass , delegateOverride : FirSimpleFunction ) : IrSimpleFunction

{ <EOL> val delegateFunction = declarationStorage . createAndCacheIrFunction ( delegateOverride , subClass , predefinedOrigin = IrDeclarationOrigin . DELEGATED_MEMBER , fakeOverrideOwnerLookupTag = firSubClass . symbol . toLookupTag ( ) ) <EOL> val baseSymbols = mutableSetOf < FirNamedFunctionSymbol > ( ) <EOL> delegateOverride . processOverriddenFunctionSymbols ( firSubClass , c ) { <EOL> baseSymbols . add ( it ) <EOL> } <EOL> baseFunctionSymbols [ delegateFunction ] = baseSymbols <EOL> annotationGenerator . generate ( delegateFunction , delegateOverride ) <EOL> return delegateFunction <EOL> }


private fun createDelegateBody ( irField : IrField , delegatedFirDeclaration : FirCallableDeclaration , delegatedIrFunction : IrSimpleFunction , originalFirDeclaration : FirCallableDeclaration , originalFunctionSymbol : IrSimpleFunctionSymbol , isSetter : Boolean ) : IrBlockBody

{ <EOL> val startOffset = SYNTHETIC_OFFSET <EOL> val endOffset = SYNTHETIC_OFFSET <EOL> val body = irFactory . createBlockBody ( startOffset , endOffset ) <EOL> val typeOrigin = when { <EOL> originalFirDeclaration is FirPropertyAccessor && originalFirDeclaration . isSetter -> ConversionTypeOrigin . SETTER <EOL> else -> ConversionTypeOrigin . DEFAULT <EOL> } <EOL> val callTypeCanBeNullable : Boolean <EOL> val callReturnType = when ( isSetter ) { <EOL> false -> { <EOL> val substitution = originalFirDeclaration . typeParameters . zip ( delegatedFirDeclaration . typeParameters ) <EOL> . map { ( original , delegated ) -> <EOL> original . symbol to delegated . symbol . defaultType <EOL> } . toMap ( ) <EOL> val substitutor = substitutorByMap ( substitution , session ) <EOL> val substitutedType = substitutor . substituteOrSelf ( originalFirDeclaration . returnTypeRef . coneType ) <EOL> callTypeCanBeNullable = Fir2IrImplicitCastInserter . typeCanBeEnhancedOrFlexibleNullable ( substitutedType , session ) <EOL> substitutedType . toIrType ( c , typeOrigin ) <EOL> } <EOL> true -> { <EOL> callTypeCanBeNullable = false <EOL> irBuiltIns . unitType <EOL> } <EOL> } <EOL> val irCall = IrCallImpl ( startOffset , endOffset , callReturnType , originalFunctionSymbol , originalFirDeclaration . typeParameters . size , originalFirDeclaration . numberOfIrValueParameters ( isSetter ) ) . apply { <EOL> val getField = IrGetFieldImpl ( startOffset , endOffset , irField . symbol , irField . type , IrGetValueImpl ( startOffset , endOffset , delegatedIrFunction . dispatchReceiverParameter ? . type ! ! , delegatedIrFunction . dispatchReceiverParameter ? . symbol ! ! <EOL> ) ) <EOL> val superFunctionDispatchReceiverType = originalFirDeclaration . dispatchReceiverType <EOL> val superFunctionDispatchReceiverLookupTag = ( superFunctionDispatchReceiverType as? ConeClassLikeType ) ? . lookupTag <EOL> val superFunctionParentSymbol = superFunctionDispatchReceiverLookupTag ? . let { classifierStorage . getIrClassSymbol ( it ) } <EOL> dispatchReceiver = if ( superFunctionParentSymbol == null || irField . type . isSubtypeOfClass ( superFunctionParentSymbol ) ) { <EOL> getField <EOL> } else { <EOL> Fir2IrImplicitCastInserter . implicitCastOrExpression ( getField , superFunctionDispatchReceiverType . toIrType ( c ) ) <EOL> } <EOL> extensionReceiver = <EOL> delegatedIrFunction . extensionReceiverParameter ? . let { extensionReceiver -> <EOL> IrGetValueImpl ( startOffset , endOffset , extensionReceiver . type , extensionReceiver . symbol ) <EOL> } <EOL> delegatedIrFunction . valueParameters . forEach { <EOL> putValueArgument ( it . index , IrGetValueImpl ( startOffset , endOffset , it . type , it . symbol ) ) <EOL> } <EOL> for ( index in originalFirDeclaration . typeParameters . indices ) { <EOL> putTypeArgument ( index , IrSimpleTypeImpl ( delegatedIrFunction . typeParameters [ index ] . symbol , hasQuestionMark = false , arguments = emptyList ( ) , annotations = emptyList ( ) ) ) <EOL> } <EOL> } <EOL> val resultType = delegatedIrFunction . returnType <EOL> val irCastOrCall = <EOL> if ( callTypeCanBeNullable && ! resultType . isNullable ( ) ) Fir2IrImplicitCastInserter . implicitNotNullCast ( irCall ) <EOL> else irCall <EOL> val originalDeclarationReturnType = originalFirDeclaration . returnTypeRef . coneType <EOL> if ( isSetter || originalDeclarationReturnType . isUnit || originalDeclarationReturnType . isNothing ) { <EOL> body . statements . add ( irCastOrCall ) <EOL> } else { <EOL> val irReturn = IrReturnImpl ( startOffset , endOffset , irBuiltIns . nothingType , delegatedIrFunction . symbol , irCastOrCall ) <EOL> body . statements . add ( irReturn ) <EOL> } <EOL> return body <EOL> }

/**
 * interface Base {
 * fun foo(): String
 * }
 *
 * class Impl : Base {
 * override fun foo(): String { <-------------- [originalFirFunction], [originalFunctionSymbol]
 * return "OK"
 * }
 * }
 *
 * class Delegated(impl: Impl) : Base by impl {
 * private field delegate_xxx: Impl = impl <-------------- [irField]
 * generated override fun foo(): String <-------------- [delegateFunction]
 * }
 *
 */


private fun FirCallableDeclaration . numberOfIrValueParameters ( isSetter : Boolean ) : Int

{ <EOL> var result = contextReceivers . size <EOL> when { <EOL> this is FirFunction -> result += valueParameters . size <EOL> this is FirProperty && isSetter -> result += <NUM_LIT:1> <EOL> } <EOL> return result <EOL> }


private fun generateDelegatedProperty ( subClass : IrClass , firSubClass : FirClass , firDelegateProperty : FirProperty ) : IrProperty

{ <EOL> val delegateProperty = declarationStorage . createAndCacheIrProperty ( firDelegateProperty , subClass , predefinedOrigin = IrDeclarationOrigin . DELEGATED_MEMBER , fakeOverrideOwnerLookupTag = firSubClass . symbol . toLookupTag ( ) ) <EOL> val baseSymbols = mutableSetOf < FirPropertySymbol > ( ) <EOL> firDelegateProperty . processOverriddenPropertySymbols ( firSubClass , c ) { <EOL> baseSymbols . add ( it ) <EOL> } <EOL> basePropertySymbols [ delegateProperty ] = baseSymbols <EOL> firDelegateProperty . getter ? . let { firGetter -> <EOL> annotationGenerator . generate ( delegateProperty . getter ! ! , firGetter ) <EOL> } <EOL> firDelegateProperty . setter ? . let { firSetter -> <EOL> annotationGenerator . generate ( delegateProperty . setter ! ! , firSetter ) <EOL> } <EOL> return delegateProperty <EOL> }


private fun < S : FirCallableSymbol < D > , D : FirCallableDeclaration > S . unwrapDelegateTarget ( subClassLookupTag : ConeClassLikeLookupTag , firField : FirField , ) : D ?

{ <EOL> val callable = this . fir <EOL> val delegatedWrapperData = callable . delegatedWrapperData ? : return null <EOL> if ( delegatedWrapperData . containingClass != subClassLookupTag ) return null <EOL> if ( delegatedWrapperData . delegateField != firField ) return null <EOL> val wrapped = delegatedWrapperData . wrapped <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> val wrappedSymbol = wrapped . symbol as? S ? : return null <EOL> @ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> return ( wrappedSymbol . unwrapCallRepresentative ( c ) . fir as D ) . takeIf { ! shouldSkipDelegationFor ( it , session ) } <EOL> }


private fun shouldSkipDelegationFor ( unwrapped : FirCallableDeclaration , session : FirSession ) : Boolean

{ <EOL> return ( unwrapped is FirSimpleFunction && unwrapped . isDefaultJavaMethod ( ) ) || <EOL> unwrapped . hasAnnotation ( JVM_DEFAULT_CLASS_ID , session ) || <EOL> unwrapped . hasAnnotation ( PLATFORM_DEPENDENT_CLASS_ID , session ) <EOL> }


private fun FirSimpleFunction . isDefaultJavaMethod ( ) : Boolean

= <EOL> when { <EOL> isIntersectionOverride -> <EOL> baseForIntersectionOverride ! ! . isDefaultJavaMethod ( ) <EOL> isSubstitutionOverride -> <EOL> originalForSubstitutionOverride ! ! . isDefaultJavaMethod ( ) <EOL> else -> { <EOL> isJavaOrEnhancement && modality == Modality . OPEN <EOL> } <EOL> }


= value


{ <EOL> return X . fn ( ) <EOL> }


override fun configure ( builder : TestConfigurationBuilder )

{ <EOL> super . configure ( builder ) <EOL> builder . configureDumpHandlersForCodegenTest ( ) <EOL> }


{ <EOL> super . configure ( builder ) <EOL> builder . useIrInliner ( ) <EOL> }


{ <EOL> super . configure ( builder ) <EOL> builder . configureDumpHandlersForCodegenTest ( ) <EOL> builder . configureFirParser ( parser ) <EOL> }


public inline fun BarContext . background ( crossinline block : BackgroundStyle . ( ) -> Unit )

{ <EOL> BackgroundStyle ( this ) . apply ( block ) <EOL> }

/**
 * Sets background style for [bars][org.jetbrains.kotlinx.kandy.echarts.layers.bars].
 *
 * - [color][BackgroundStyle.color] - background [color][org.jetbrains.kotlinx.kandy.util.color.Color].
 * - [borderColor][BackgroundStyle.borderColor] -
 * background border [color][org.jetbrains.kotlinx.kandy.util.color.Color].
 * - [borderWidth][BackgroundStyle.borderWidth] - background border width.
 * By default `0`.
 * - [borderType][BackgroundStyle.borderType] - border [type][LineType].
 * By default `solid`.
 * - [borderRadius][BackgroundStyle.borderRadius] - background border radius.
 * By default `0`.
 * - [shadowBlur][BackgroundStyle.shadowBlur] - background shadow blur.
 * - [shadowColor][BackgroundStyle.shadowColor] -
 * background shadow [color][org.jetbrains.kotlinx.kandy.util.color.Color].
 * - [alpha][BackgroundStyle.alpha] - background opacity.
 *
 * ```kotlin
 * plot {
 * bars {
 * background {
 * color = Color.GREY
 * borderColor = Color.BLACK
 * borderWidth = 1.0
 * borderType = LineType.DASHED
 * borderRadius = 1.3
 * shadowBlur = 10.0
 * shadowColor = Color.GREEN
 * alpha = 0.7
 * }
 * }
 * }
 * ```
 *
 * @see org.jetbrains.kotlinx.kandy.echarts.layers.bars
 */


public fun < T > color ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_COLOR , column , params )


public fun < T > color ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >


public fun color ( column : String , params : EchartsNonPositionalMappingParameters < * , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < * , Color >


public fun < T > color ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_COLOR , values , name , params )


public fun < T > color ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_COLOR , values , params )


public fun < T > borderColor ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_BORDER_COLOR , column , params )


public fun < T > borderColor ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >


public fun borderColor ( column : String , params : EchartsNonPositionalMappingParameters < * , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < * , Color >


public fun < T > borderColor ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_BORDER_COLOR , values , name , params )


public fun < T > borderColor ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_BORDER_COLOR , values , params )


public fun < T > borderWidth ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_BORDER_WIDTH , column , params )


public fun < T > borderWidth ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >


public fun borderWidth ( column : String , params : EchartsNonPositionalMappingParameters < * , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < * , Color >


public fun < T > borderWidth ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_BORDER_WIDTH , values , name , params )


public fun < T > borderWidth ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_BORDER_WIDTH , values , params )


public fun < T > borderType ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , LineType > . ( ) -> Unit = { } ) : NonPositionalMapping < T , LineType >

= context . nonPosMappingCont ( BACKGROUND_BORDER_TYPE , column , params )


public fun < T > borderType ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , LineType > . ( ) -> Unit = { } ) : NonPositionalMapping < T , LineType >


public fun borderType ( column : String , params : EchartsNonPositionalMappingParameters < * , LineType > . ( ) -> Unit = { } ) : NonPositionalMapping < * , LineType >


public fun < T > borderType ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , LineType > . ( ) -> Unit = { } ) : NonPositionalMapping < T , LineType >

= context . nonPosMappingCont ( BACKGROUND_BORDER_TYPE , values , name , params )


public fun < T > borderType ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , LineType > . ( ) -> Unit = { } ) : NonPositionalMapping < T , LineType >

= context . nonPosMappingCont ( BACKGROUND_BORDER_TYPE , values , params )


public fun < T > borderRadius ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_BORDER_RADIUS , column , params )


public fun < T > borderRadius ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >


public fun borderRadius ( column : String , params : EchartsNonPositionalMappingParameters < * , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < * , Number >


public fun < T > borderRadius ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_BORDER_RADIUS , values , name , params )


public fun < T > borderRadius ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_BORDER_RADIUS , values , params )


public fun < T > shadowBlur ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_SHADOW_BLUR , column , params )


public fun < T > shadowBlur ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >


public fun shadowBlur ( column : String , params : EchartsNonPositionalMappingParameters < * , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < * , Number >


public fun < T > shadowBlur ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_SHADOW_BLUR , values , name , params )


public fun < T > shadowBlur ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_SHADOW_BLUR , values , params )


public fun < T > shadowColor ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_SHADOW_COLOR , column , params )


public fun < T > shadowColor ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >


public fun shadowColor ( column : String , params : EchartsNonPositionalMappingParameters < * , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < * , Color >


public fun < T > shadowColor ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_SHADOW_COLOR , values , name , params )


public fun < T > shadowColor ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , Color > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Color >

= context . nonPosMappingCont ( BACKGROUND_SHADOW_COLOR , values , params )


public fun < T > alpha ( column : ColumnReference < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_ALPHA , column , params )


public fun < T > alpha ( column : KProperty < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >


public fun alpha ( column : String , params : EchartsNonPositionalMappingParameters < * , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < * , Number >


public fun < T > alpha ( values : Iterable < T > , name : String ? = null , params : NonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_ALPHA , values , name , params )


public fun < T > alpha ( values : DataColumn < T > , params : EchartsNonPositionalMappingParameters < T , Number > . ( ) -> Unit = { } ) : NonPositionalMapping < T , Number >

= context . nonPosMappingCont ( BACKGROUND_ALPHA , values , params )


override fun equals ( other : Any ? ) : Boolean

= <EOL> other is KTypeImpl && <EOL> classifier == other . classifier && arguments == other . arguments && isMarkedNullable == other . isMarkedNullable


= <EOL> ( classifier . hashCode ( ) * <NUM_LIT:31> + arguments . hashCode ( ) ) * <NUM_LIT:31> + isMarkedNullable . hashCode ( )


{ <EOL> val kClass = ( classifier as? KClass < * > ) <EOL> val classifierName = when { <EOL> kClass == null -> classifier . toString ( ) <EOL> kClass . simpleName != null -> kClass . simpleName <EOL> else -> "<STR_LIT>" <EOL> } <EOL> val args = <EOL> if ( arguments . isEmpty ( ) ) "<STR_LIT>" <EOL> else arguments . joinToString ( "<STR_LIT:U+002CU+0020>" , "<STR_LIT:<>" , "<STR_LIT:>>" ) <EOL> val nullable = if ( isMarkedNullable ) "<STR_LIT:?>" else "<STR_LIT>" <EOL> return classifierName + args + nullable <EOL> }


abstract fun resolveToDescriptor ( declaration : KtDeclaration ) : DeclarationDescriptor ?


abstract fun analyze ( element : KtElement ) : BindingContext


abstract fun analyzeAnnotation ( element : KtAnnotationEntry ) : AnnotationDescriptor ?


abstract fun analyzeWithContent ( element : KtClassOrObject ) : BindingContext


protected abstract fun getUltraLightClassSupport ( element : KtElement ) : KtUltraLightSupport


fun createConstantEvaluator ( expression : KtExpression ) : ConstantExpressionEvaluator

= getUltraLightClassSupport ( expression ) . run { <EOL> ConstantExpressionEvaluator ( moduleDescriptor , languageVersionSettings ) <EOL> }


fun createUltraLightClassForFacade ( facadeClassFqName : FqName , files : Collection < KtFile > ) : KtUltraLightClassForFacade

{ <EOL> val filesToSupports : List < Pair < KtFile , KtUltraLightSupport > > = files . map { <EOL> it to getUltraLightClassSupport ( it ) <EOL> } <EOL> return KtUltraLightClassForFacade ( facadeClassFqName , files , filesToSupports ) <EOL> }


fun createUltraLightClass ( element : KtClassOrObject ) : KtUltraLightClass

= getUltraLightClassSupport ( element ) . let { support -> <EOL> if ( support . languageVersionSettings . getFlag ( AnalysisFlags . eagerResolveOfLightClasses ) ) { <EOL> val descriptor = resolveToDescriptor ( element ) <EOL> ( descriptor as? LazyClassDescriptor ) ? . forceResolveAllContents ( ) <EOL> } <EOL> when { <EOL> element is KtObjectDeclaration && element . isObjectLiteral ( ) -> <EOL> KtUltraLightClassForAnonymousDeclaration ( element , support ) <EOL> element . safeIsLocal ( ) -> <EOL> KtUltraLightClassForLocalDeclaration ( element , support ) <EOL> ( element . hasModifier ( KtTokens . INLINE_KEYWORD ) ) -> <EOL> KtUltraLightInlineClass ( element , support ) <EOL> else -> KtUltraLightClass ( element , support ) <EOL> } <EOL> }


fun createUltraLightClassForScript ( script : KtScript ) : KtUltraLightClassForScript

= <EOL> KtUltraLightClassForScript ( script , support = getUltraLightClassSupport ( script ) )


@ JvmStatic <EOL> fun getInstance ( project : Project ) : LightClassGenerationSupport

{ <EOL> return project . getService ( LightClassGenerationSupport :: class . java ) <EOL> }


= expectThrowableMessage { <EOL> assert ( "<STR_LIT:Hello>" !in listOf ( "<STR_LIT:Hello>" , "<STR_LIT>" ) ) <EOL> } + "<STR_LIT>" + expectThrowableMessage { <EOL> assert ( "<STR_LIT>" !in listOf ( "<STR_LIT>" ) ) <EOL> } + "<STR_LIT>" + expectThrowableMessage { <EOL> assert ( "<STR_LIT>" !in <EOL> listOf ( "<STR_LIT>" ) ) <EOL> } + "<STR_LIT>" + expectThrowableMessage { <EOL> assert ( "<STR_LIT:Hello>" !in/*!in*/ listOf ( "<STR_LIT:Hello>" , "<STR_LIT>" ) ) <EOL> } + "<STR_LIT>" + expectThrowableMessage { <EOL> assert ( ( "<STR_LIT:Hello>" !in listOf ( "<STR_LIT:Hello>" , "<STR_LIT>" ) ) !in listOf ( false ) ) <EOL> }


{ <EOL> val l = ArrayList < Int > ( ) <EOL> l . add ( <NUM_LIT:2> ) <EOL> val x = l [ <NUM_LIT:0> ] / <NUM_LIT:2> <EOL> if ( x != <NUM_LIT:1> ) return "<STR_LIT>" <EOL> return "<STR_LIT:OK>" <EOL> }


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UInt . countOneBits ( ) : Int

= toInt ( ) . countOneBits ( )

/**
 * Counts the number of set bits in the binary representation of this [UInt] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UInt . countLeadingZeroBits ( ) : Int

= toInt ( ) . countLeadingZeroBits ( )

/**
 * Counts the number of consecutive most significant bits that are zero in the binary representation of this [UInt] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UInt . countTrailingZeroBits ( ) : Int

= toInt ( ) . countTrailingZeroBits ( )

/**
 * Counts the number of consecutive least significant bits that are zero in the binary representation of this [UInt] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UInt . takeHighestOneBit ( ) : UInt

= toInt ( ) . takeHighestOneBit ( ) . toUInt ( )

/**
 * Returns a number having a single bit set in the position of the most significant set bit of this [UInt] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UInt . takeLowestOneBit ( ) : UInt

= toInt ( ) . takeLowestOneBit ( ) . toUInt ( )

/**
 * Returns a number having a single bit set in the position of the least significant set bit of this [UInt] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UInt . rotateLeft ( bitCount : Int ) : UInt

= toInt ( ) . rotateLeft ( bitCount ) . toUInt ( )

/**
 * Rotates the binary representation of this [UInt] number left by the specified [bitCount] number of bits.
 * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
 *
 * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:
 * `number.rotateLeft(-n) == number.rotateRight(n)`
 *
 * Rotating by a multiple of [UInt.SIZE_BITS] (32) returns the same number, or more generally
 * `number.rotateLeft(n) == number.rotateLeft(n % 32)`
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UInt . rotateRight ( bitCount : Int ) : UInt

= toInt ( ) . rotateRight ( bitCount ) . toUInt ( )

/**
 * Rotates the binary representation of this [UInt] number right by the specified [bitCount] number of bits.
 * The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
 *
 * Rotating the number right by a negative bit count is the same as rotating it left by the negated bit count:
 * `number.rotateRight(-n) == number.rotateLeft(n)`
 *
 * Rotating by a multiple of [UInt.SIZE_BITS] (32) returns the same number, or more generally
 * `number.rotateRight(n) == number.rotateRight(n % 32)`
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ULong . countOneBits ( ) : Int

= toLong ( ) . countOneBits ( )

/**
 * Counts the number of set bits in the binary representation of this [ULong] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ULong . countLeadingZeroBits ( ) : Int

= toLong ( ) . countLeadingZeroBits ( )

/**
 * Counts the number of consecutive most significant bits that are zero in the binary representation of this [ULong] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ULong . countTrailingZeroBits ( ) : Int

= toLong ( ) . countTrailingZeroBits ( )

/**
 * Counts the number of consecutive least significant bits that are zero in the binary representation of this [ULong] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ULong . takeHighestOneBit ( ) : ULong

= toLong ( ) . takeHighestOneBit ( ) . toULong ( )

/**
 * Returns a number having a single bit set in the position of the most significant set bit of this [ULong] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ULong . takeLowestOneBit ( ) : ULong

= toLong ( ) . takeLowestOneBit ( ) . toULong ( )

/**
 * Returns a number having a single bit set in the position of the least significant set bit of this [ULong] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ULong . rotateLeft ( bitCount : Int ) : ULong

= toLong ( ) . rotateLeft ( bitCount ) . toULong ( )

/**
 * Rotates the binary representation of this [ULong] number left by the specified [bitCount] number of bits.
 * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
 *
 * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:
 * `number.rotateLeft(-n) == number.rotateRight(n)`
 *
 * Rotating by a multiple of [ULong.SIZE_BITS] (64) returns the same number, or more generally
 * `number.rotateLeft(n) == number.rotateLeft(n % 64)`
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun ULong . rotateRight ( bitCount : Int ) : ULong

= toLong ( ) . rotateRight ( bitCount ) . toULong ( )

/**
 * Rotates the binary representation of this [ULong] number right by the specified [bitCount] number of bits.
 * The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
 *
 * Rotating the number right by a negative bit count is the same as rotating it left by the negated bit count:
 * `number.rotateRight(-n) == number.rotateLeft(n)`
 *
 * Rotating by a multiple of [ULong.SIZE_BITS] (64) returns the same number, or more generally
 * `number.rotateRight(n) == number.rotateRight(n % 64)`
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UByte . countOneBits ( ) : Int

= toUInt ( ) . countOneBits ( )

/**
 * Counts the number of set bits in the binary representation of this [UByte] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UByte . countLeadingZeroBits ( ) : Int

= toByte ( ) . countLeadingZeroBits ( )

/**
 * Counts the number of consecutive most significant bits that are zero in the binary representation of this [UByte] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UByte . countTrailingZeroBits ( ) : Int

= toByte ( ) . countTrailingZeroBits ( )

/**
 * Counts the number of consecutive least significant bits that are zero in the binary representation of this [UByte] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UByte . takeHighestOneBit ( ) : UByte

= toInt ( ) . takeHighestOneBit ( ) . toUByte ( )

/**
 * Returns a number having a single bit set in the position of the most significant set bit of this [UByte] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UByte . takeLowestOneBit ( ) : UByte

= toInt ( ) . takeLowestOneBit ( ) . toUByte ( )

/**
 * Returns a number having a single bit set in the position of the least significant set bit of this [UByte] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UByte . rotateLeft ( bitCount : Int ) : UByte

= toByte ( ) . rotateLeft ( bitCount ) . toUByte ( )

/**
 * Rotates the binary representation of this [UByte] number left by the specified [bitCount] number of bits.
 * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
 *
 * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:
 * `number.rotateLeft(-n) == number.rotateRight(n)`
 *
 * Rotating by a multiple of [UByte.SIZE_BITS] (8) returns the same number, or more generally
 * `number.rotateLeft(n) == number.rotateLeft(n % 8)`
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UByte . rotateRight ( bitCount : Int ) : UByte

= toByte ( ) . rotateRight ( bitCount ) . toUByte ( )

/**
 * Rotates the binary representation of this [UByte] number right by the specified [bitCount] number of bits.
 * The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
 *
 * Rotating the number right by a negative bit count is the same as rotating it left by the negated bit count:
 * `number.rotateRight(-n) == number.rotateLeft(n)`
 *
 * Rotating by a multiple of [UByte.SIZE_BITS] (8) returns the same number, or more generally
 * `number.rotateRight(n) == number.rotateRight(n % 8)`
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UShort . countOneBits ( ) : Int

= toUInt ( ) . countOneBits ( )

/**
 * Counts the number of set bits in the binary representation of this [UShort] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UShort . countLeadingZeroBits ( ) : Int

= toShort ( ) . countLeadingZeroBits ( )

/**
 * Counts the number of consecutive most significant bits that are zero in the binary representation of this [UShort] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UShort . countTrailingZeroBits ( ) : Int

= toShort ( ) . countTrailingZeroBits ( )

/**
 * Counts the number of consecutive least significant bits that are zero in the binary representation of this [UShort] number.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UShort . takeHighestOneBit ( ) : UShort

= toInt ( ) . takeHighestOneBit ( ) . toUShort ( )

/**
 * Returns a number having a single bit set in the position of the most significant set bit of this [UShort] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.5>" ) <EOL> @ WasExperimental ( ExperimentalUnsignedTypes :: class , ExperimentalStdlibApi :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UShort . takeLowestOneBit ( ) : UShort

= toInt ( ) . takeLowestOneBit ( ) . toUShort ( )

/**
 * Returns a number having a single bit set in the position of the least significant set bit of this [UShort] number,
 * or zero, if this number is zero.
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UShort . rotateLeft ( bitCount : Int ) : UShort

= toShort ( ) . rotateLeft ( bitCount ) . toUShort ( )

/**
 * Rotates the binary representation of this [UShort] number left by the specified [bitCount] number of bits.
 * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
 *
 * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:
 * `number.rotateLeft(-n) == number.rotateRight(n)`
 *
 * Rotating by a multiple of [UShort.SIZE_BITS] (16) returns the same number, or more generally
 * `number.rotateLeft(n) == number.rotateLeft(n % 16)`
 */


@ SinceKotlin ( "<STR_LIT:1.6>" ) <EOL> @ WasExperimental ( ExperimentalStdlibApi :: class , ExperimentalUnsignedTypes :: class ) <EOL> @ kotlin . internal . InlineOnly <EOL> public inline fun UShort . rotateRight ( bitCount : Int ) : UShort

= toShort ( ) . rotateRight ( bitCount ) . toUShort ( )

/**
 * Rotates the binary representation of this [UShort] number right by the specified [bitCount] number of bits.
 * The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
 *
 * Rotating the number right by a negative bit count is the same as rotating it left by the negated bit count:
 * `number.rotateRight(-n) == number.rotateLeft(n)`
 *
 * Rotating by a multiple of [UShort.SIZE_BITS] (16) returns the same number, or more generally
 * `number.rotateRight(n) == number.rotateRight(n % 16)`
 */


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

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


override fun isApplicable ( project : MavenProject , execution : MojoExecution ) : Boolean

{ <EOL> logger . info ( "<STR_LIT>" ) <EOL> return true <EOL> }


= TestCommandLineProcessor . TestPluginId


override fun getPluginOptions ( project : MavenProject , execution : MojoExecution ) : List < PluginOption >

{ <EOL> logger . info ( "<STR_LIT>" ) <EOL> return listOf ( PluginOption ( "<STR_LIT>" , TestCommandLineProcessor . TestPluginId , TestCommandLineProcessor . MyTestOption . optionName , "<STR_LIT>" ) ) <EOL> }


{ <EOL> return substitutor . isValid <EOL> }

/**
 * Checks if the [ResolutionResult] is valid.
 *
 * The [PsiSubstitutor] which is contained inside [ResolutionResult] might become
 * invalidated as it contains [PsiType]s inside
 *
 * @return true if the substitutor is valid, false otherwise.
 */


private fun resolve ( ) : ResolutionResult

{ <EOL> while ( true ) { <EOL> val snapshot = resolutionResult <EOL> @ Suppress ( "<STR_LIT>" ) <EOL> when { <EOL> snapshot != null && snapshot . isValid ( ) -> { <EOL> return snapshot <EOL> } <EOL> else -> { <EOL> val computedResult = computeResolveResult ( ) <EOL> if ( ! resolutionResultAtomicFieldUpdater . compareAndSet ( this , snapshot , computedResult ) ) { <EOL> continue <EOL> } <EOL> return computedResult <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Resolves the current [JavaClassifierType]
 *
 * The code is thread safe and the logic is the following:
 * 1. Try to get a cached resolution result and return it if it's not invalidated
 * 2. Otherwise, resolve the current [JavaClassifierType], update the cache and return the result.
 *
 * @returns [ResolutionResult] to which the [JavaClassifierType] resovled
 */


private fun computeResolveResult ( ) : ResolutionResult

{ <EOL> val result = psi . resolveGenerics ( ) <EOL> val psiClass = result . element <EOL> val substitutor = result . substitutor <EOL> return ResolutionResult ( psiClass ? . let { JavaClassifierImpl . create ( it , sourceFactory ) } , substitutor , PsiClassType . isRaw ( result ) ) <EOL> }


private fun getTypeParameters ( owner : PsiClass ) : List < PsiTypeParameter >

{ <EOL> var result : List < PsiTypeParameter > ? = null <EOL> var currentOwner : PsiTypeParameterListOwner ? = owner <EOL> while ( currentOwner != null ) { <EOL> val typeParameters = currentOwner . typeParameters <EOL> if ( typeParameters . isNotEmpty ( ) ) { <EOL> result = result ? . let { it + typeParameters } ? : typeParameters . toList ( ) <EOL> } <EOL> if ( currentOwner . hasModifierProperty ( PsiModifier . STATIC ) ) break <EOL> currentOwner = currentOwner . containingClass <EOL> } <EOL> return result ? : emptyList ( ) <EOL> }


@ Deprecated ( "<STR_LIT>" , ReplaceWith ( "<STR_LIT>" ) ) <EOL> fun FirFunctionSymbol < * > . getSingleExpectForActualOrNull ( ) : FirFunctionSymbol < * > ?

= <EOL> getSingleMatchedExpectForActualOrNull ( )


fun FirFunctionSymbol < * > . getSingleMatchedExpectForActualOrNull ( ) : FirFunctionSymbol < * > ?

= <EOL> ( this as FirBasedSymbol < * > ) . getSingleMatchedExpectForActualOrNull ( ) as? FirFunctionSymbol < * >


fun FirBasedSymbol < * > . getSingleMatchedExpectForActualOrNull ( ) : FirBasedSymbol < * > ?

= <EOL> expectForActual ? . get ( ExpectActualMatchingCompatibility . MatchedSuccessfully ) ? . singleOrNull ( )


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

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


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

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


abstract override fun replaceConeTypeOrNull ( newConeTypeOrNull : ConeKotlinType ? )


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


abstract fun replaceSelector ( newSelector : FirStatement )


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


abstract fun < D > transformReceiver ( transformer : FirTransformer < D > , data : D ) : FirSafeCallExpression


abstract fun < D > transformSelector ( transformer : FirTransformer < D > , data : D ) : FirSafeCallExpression


@ Test <EOL> fun `top-level functions should be generated` ( )

{ <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , cleanupOutput = true ) { <EOL> pagesGenerationStage = { root -> <EOL> val content = ( root . children . single ( ) . children . first { it . name == "<STR_LIT>" } as ContentPage ) . content <EOL> val functionRows = content . findTableWithKind ( kind = ContentKind . Functions ) . children <EOL> functionRows . assertCount ( <NUM_LIT:6> ) <EOL> val propRows = content . findTableWithKind ( kind = ContentKind . Properties ) . children <EOL> propRows . assertCount ( <NUM_LIT:1> ) <EOL> } <EOL> } <EOL> }


private fun ContentNode . findTableWithKind ( kind : ContentKind ) : ContentNode

= dfs { node -> <EOL> node is ContentTable && node . dci . kind === kind <EOL> } . let { assertNotNull ( it , "<STR_LIT>" ) }


@ Test <EOL> fun topLevelWithClassTest ( )

{ <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , cleanupOutput = true ) { <EOL> pagesGenerationStage = { root -> <EOL> val contentList = root . children <EOL> . flatMap { it . children < ContentPage > ( ) } <EOL> contentList . find { it . name == "<STR_LIT:Test>" } . apply { <EOL> assertNotNull ( this ) <EOL> content . findTableWithKind ( ContentKind . Functions ) . children . assertCount ( <NUM_LIT:2> ) <EOL> content . findTableWithKind ( ContentKind . Properties ) . children . assertCount ( <NUM_LIT:1> ) <EOL> } <EOL> contentList . find { it . name == "<STR_LIT>" } . apply { <EOL> assertNotNull ( this ) <EOL> content . findTableWithKind ( ContentKind . Functions ) . children . assertCount ( <NUM_LIT:2> ) <EOL> content . findTableWithKind ( ContentKind . Properties ) . children . assertCount ( <NUM_LIT:1> ) <EOL> } <EOL> } <EOL> } <EOL> }


{ <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , cleanupOutput = true ) { <EOL> pagesGenerationStage = { root -> <EOL> val classes = root . children . first ( ) . children . associateBy { it . name } <EOL> classes . values . assertCount ( <NUM_LIT:2> , "<STR_LIT>" ) <EOL> classes [ "<STR_LIT>" ] . let { <EOL> it ? . children . orEmpty ( ) . assertCount ( <NUM_LIT:1> , "<STR_LIT>" ) <EOL> it ! ! . children . first ( ) <EOL> . let { assertEquals ( "<STR_LIT>" , it . name , "<STR_LIT>" ) } <EOL> } <EOL> classes [ "<STR_LIT>" ] . let { <EOL> it ? . children . orEmpty ( ) . assertCount ( <NUM_LIT:2> , "<STR_LIT>" ) <EOL> it ! ! . children . map { it . name } <EOL> . let { <EOL> assertTrue ( it . containsAll ( setOf ( "<STR_LIT>" , "<STR_LIT>" ) ) , "<STR_LIT>" ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `public kotlin properties should have a getter with same visibilities` ( )

{ <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , cleanupOutput = true ) { <EOL> pagesTransformationStage = { rootPageNode -> <EOL> val propertyGetter = rootPageNode . dfs { it is MemberPageNode && it . name == "<STR_LIT>" } as? MemberPageNode <EOL> assertNotNull ( propertyGetter ) <EOL> propertyGetter . content . assertNode { <EOL> group { <EOL> header ( <NUM_LIT:1> ) { <EOL> + "<STR_LIT>" <EOL> } <EOL> } <EOL> divergentGroup { <EOL> divergentInstance { <EOL> divergent { <EOL> group { <EOL> + "<STR_LIT>" <EOL> group { <EOL> link { <EOL> + "<STR_LIT:String>" <EOL> } <EOL> } <EOL> link { <EOL> + "<STR_LIT>" <EOL> } <EOL> + "<STR_LIT>" <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `java properties should keep its modifiers` ( )

{ <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , cleanupOutput = true ) { <EOL> pagesGenerationStage = { root -> <EOL> val testClass = root . dfs { it . name == "<STR_LIT>" } as? ClasslikePageNode <EOL> assertNotNull ( testClass ) <EOL> ( testClass . content as ContentGroup ) . children . last ( ) . children . last ( ) . assertNode { <EOL> group { <EOL> header ( <NUM_LIT:2> ) { <EOL> + "<STR_LIT>" <EOL> } <EOL> table { <EOL> group { <EOL> link { <EOL> + "<STR_LIT>" <EOL> } <EOL> divergentGroup { <EOL> divergentInstance { <EOL> divergent { <EOL> group { <EOL> group { <EOL> + "<STR_LIT>" <EOL> link { <EOL> + "<STR_LIT>" <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `koltin interfaces and classes should be split to extends and implements` ( )

{ <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , cleanupOutput = true ) { <EOL> pagesGenerationStage = { root -> <EOL> val testClass = root . dfs { it . name == "<STR_LIT:C>" } as? ClasslikePageNode <EOL> assertNotNull ( testClass ) <EOL> testClass . content . assertNode { <EOL> group { <EOL> header ( expectedLevel = <NUM_LIT:1> ) { <EOL> + "<STR_LIT:C>" <EOL> } <EOL> platformHinted { <EOL> group { <EOL> + "<STR_LIT>" <EOL> link { <EOL> + "<STR_LIT:C>" <EOL> } <EOL> + "<STR_LIT>" <EOL> group { <EOL> link { <EOL> + "<STR_LIT:A>" <EOL> } <EOL> } <EOL> + "<STR_LIT>" <EOL> group { <EOL> link { <EOL> + "<STR_LIT:B>" <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> skipAllNotMatching ( ) <EOL> } <EOL> } <EOL> } <EOL> }


private fun < T > Collection < T > . assertCount ( n : Int , prefix : String = "<STR_LIT>" )

= <EOL> assertEquals ( n , count ( ) , "<STR_LIT>" )


{ <EOL> val writerPlugin = TestOutputWriterPlugin ( ) <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> externalDocumentationLinks = listOf ( DokkaConfiguration . ExternalDocumentationLink . jdk ( <NUM_LIT:8> ) ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , pluginOverrides = listOf ( writerPlugin ) , cleanupOutput = true ) { <EOL> renderingStage = { _ , _ -> <EOL> writerPlugin . writer . renderedContent ( "<STR_LIT>" ) . firstSignature ( ) . match ( "<STR_LIT>" , A ( "<STR_LIT>" ) , A ( "<STR_LIT>" ) , "<STR_LIT:(>" , Parameters ( Parameter ( A ( "<STR_LIT>" ) , "<STR_LIT>" ) ) , "<STR_LIT:)>" , ignoreSpanWithTokenStyle = true ) <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `typealias with generic` ( )

{ <EOL> val writerPlugin = TestOutputWriterPlugin ( ) <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> externalDocumentationLinks = listOf ( DokkaConfiguration . ExternalDocumentationLink . jdk ( <NUM_LIT:8> ) , stdlibExternalDocumentationLink ) <EOL> classpath = listOfNotNull ( jvmStdlibPath ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , pluginOverrides = listOf ( writerPlugin ) , cleanupOutput = true ) { <EOL> renderingStage = { _ , _ -> <EOL> writerPlugin . writer . renderedContent ( "<STR_LIT>" ) . firstSignature ( ) . match ( "<STR_LIT>" , A ( "<STR_LIT>" ) , A ( "<STR_LIT>" ) , "<STR_LIT:(>" , Parameters ( Parameter ( A ( "<STR_LIT>" ) , "<STR_LIT:<>" , A ( "<STR_LIT:String>" ) , "<STR_LIT:U+002CU+0020>" , A ( "<STR_LIT>" ) , "<STR_LIT>" ) , ) , "<STR_LIT:)>" , ignoreSpanWithTokenStyle = true ) <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `const in top level` ( )

{ <EOL> val writerPlugin = TestOutputWriterPlugin ( ) <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> externalDocumentationLinks = listOf ( DokkaConfiguration . ExternalDocumentationLink . jdk ( <NUM_LIT:8> ) , stdlibExternalDocumentationLink ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , pluginOverrides = listOf ( writerPlugin ) , cleanupOutput = true ) { <EOL> renderingStage = { _ , _ -> <EOL> assertNull ( writerPlugin . writer . contents [ "<STR_LIT>" ] ) <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `function in top level` ( )

{ <EOL> val writerPlugin = TestOutputWriterPlugin ( ) <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> externalDocumentationLinks = listOf ( DokkaConfiguration . ExternalDocumentationLink . jdk ( <NUM_LIT:8> ) , stdlibExternalDocumentationLink ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , pluginOverrides = listOf ( writerPlugin ) , cleanupOutput = true ) { <EOL> renderingStage = { _ , _ -> <EOL> writerPlugin . writer . renderedContent ( "<STR_LIT>" ) . firstSignature ( ) . match ( "<STR_LIT>" , A ( "<STR_LIT:String>" ) , A ( "<STR_LIT:sample>" ) , "<STR_LIT:(>" , Parameters ( Parameter ( A ( "<STR_LIT>" ) , "<STR_LIT:a>" ) , ) , "<STR_LIT:)>" , ignoreSpanWithTokenStyle = true ) <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `should render primary kotlin constructor as a java constructor` ( )

{ <EOL> val writerPlugin = TestOutputWriterPlugin ( ) <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> externalDocumentationLinks = listOf ( DokkaConfiguration . ExternalDocumentationLink . jdk ( <NUM_LIT:8> ) , stdlibExternalDocumentationLink ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , pluginOverrides = listOf ( writerPlugin ) , cleanupOutput = true ) { <EOL> pagesGenerationStage = { root -> <EOL> val content = root . children <EOL> . flatMap { it . children < ContentPage > ( ) } <EOL> . map { it . content } . single ( ) . mainContents <EOL> val text = content . single { it is ContentHeader } . children <EOL> . single ( ) as ContentText <EOL> assertEquals ( "<STR_LIT>" , text . text ) <EOL> } <EOL> renderingStage = { _ , _ -> <EOL> writerPlugin . writer . renderedContent ( "<STR_LIT>" ) . firstSignature ( ) . match ( A ( "<STR_LIT:Test>" ) , A ( "<STR_LIT:Test>" ) , "<STR_LIT:(>" , Parameters ( Parameter ( A ( "<STR_LIT>" ) , "<STR_LIT>" ) ) , "<STR_LIT:)>" , ignoreSpanWithTokenStyle = true ) <EOL> } <EOL> } <EOL> }


@ Test <EOL> fun `Java primitive annotations work` ( )

{ <EOL> val writerPlugin = TestOutputWriterPlugin ( ) <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> externalDocumentationLinks = listOf ( DokkaConfiguration . ExternalDocumentationLink . jdk ( <NUM_LIT:8> ) , stdlibExternalDocumentationLink ) <EOL> } <EOL> } <EOL> } <EOL> testInline ( """<STR_LIT>""" . trimMargin ( ) , configuration , pluginOverrides = listOf ( writerPlugin ) , cleanupOutput = true ) { <EOL> documentablesTransformationStage = { module -> <EOL> val type = module . packages . single ( ) <EOL> . classlikes . first { it . name == "<STR_LIT>" } <EOL> . functions . single ( ) <EOL> . type as GenericTypeConstructor <EOL> assertEquals ( Annotations . Annotation ( DRI ( "<STR_LIT>" , "<STR_LIT:Hello>" ) , emptyMap ( ) ) , type . extra [ Annotations ] ? . directAnnotations ? . values ? . single ( ) ? . single ( ) ) <EOL> assertEquals ( "<STR_LIT>" , type . dri . toString ( ) ) <EOL> } <EOL> } <EOL> }

/**
 * Kotlin Int becomes java int. Java int cannot be annotated in source, but Kotlin Int can be.
 * This is paired with DefaultDescriptorToDocumentableTranslatorTest.`Java primitive annotations work`()
 *
 * This test currently does not do anything because Kotlin.Int currently becomes java.lang.Integer not primitive int
 */


@ Test <EOL> fun `Java function should keep its access modifier` ( )

{ <EOL> val className = "<STR_LIT:Test>" <EOL> val accessModifier = "<STR_LIT>" <EOL> val methodName = "<STR_LIT>" <EOL> val testClassQuery = """<STR_LIT>""" . trimMargin ( ) <EOL> val configuration = dokkaConfiguration { <EOL> sourceSets { <EOL> sourceSet { <EOL> sourceRoots = listOf ( "<STR_LIT:src/>" ) <EOL> } <EOL> } <EOL> } <EOL> val writerPlugin = TestOutputWriterPlugin ( ) <EOL> testInline ( testClassQuery , configuration , pluginOverrides = listOf ( writerPlugin ) , cleanupOutput = true ) { <EOL> renderingStage = { _ , _ -> <EOL> val methodDocumentation = "<STR_LIT>" <EOL> writerPlugin . writer . renderedContent ( methodDocumentation ) <EOL> . firstSignature ( ) <EOL> . match ( "<STR_LIT>" , A ( methodName ) , "<STR_LIT>" , ignoreSpanWithTokenStyle = true ) <EOL> } <EOL> } <EOL> }


{ <EOL> val a = So < caret > <EOL> }


internal fun < T > Stack < T > . push ( item : T )

= add ( item )

/**
 * Pushes item to [Stack]
 * @param item Item to be pushed
 */


internal fun < T > Stack < T > . pop ( ) : T ?

= if ( isNotEmpty ( ) ) removeAt ( lastIndex ) else null

/**
 * Pops (removes and return) last item from [Stack]
 * @return item Last item if [Stack] is not empty, null otherwise
 */


internal fun < T > Stack < T > . peek ( ) : T ?

= if ( isNotEmpty ( ) ) this [ lastIndex ] else null

/**
 * Peeks (return) last item from [Stack]
 * @return item Last item if [Stack] is not empty, null otherwise
 */


@ Benchmark <EOL> fun channelPipeline ( ) : Int

= runBlocking { <EOL> run ( unconfined ) <EOL> }


@ Benchmark <EOL> fun channelPipelineOneThreadLocal ( ) : Int

= runBlocking { <EOL> run ( unconfinedOneElement ) <EOL> }


@ Benchmark <EOL> fun channelPipelineTwoThreadLocals ( ) : Int

= runBlocking { <EOL> run ( unconfinedTwoElements ) <EOL> }


private suspend inline fun run ( context : CoroutineContext ) : Int

{ <EOL> return Channel <EOL> . range ( <NUM_LIT:1> , <NUM_LIT> , context ) <EOL> . filter ( context ) { it % <NUM_LIT:4> == <NUM_LIT:0> } <EOL> . fold ( <NUM_LIT:0> ) { a , b -> a + b } <EOL> }


private fun Channel . Factory . range ( start : Int , count : Int , context : CoroutineContext )

= GlobalScope . produce ( context ) { <EOL> for ( i in start until ( start + count ) ) <EOL> send ( i ) <EOL> }


private fun < E > ReceiveChannel < E > . filter ( context : CoroutineContext = Dispatchers . Unconfined , predicate : suspend ( E ) -> Boolean ) : ReceiveChannel < E >

= <EOL> GlobalScope . produce ( context , onCompletion = { cancel ( ) } ) { <EOL> for ( e in this @ filter ) { <EOL> if ( predicate ( e ) ) send ( e ) <EOL> } <EOL> }


private suspend inline fun < E , R > ReceiveChannel < E > . fold ( initial : R , operation : ( acc : R , E ) -> R ) : R

{ <EOL> var accumulator = initial <EOL> consumeEach { <EOL> accumulator = operation ( accumulator , it ) <EOL> } <EOL> return accumulator <EOL> }


fun baz ( )


open fun boo ( )


external fun d ( a : Boolean , b : Any , c : SomeType )


{ <EOL> when ( x ) { <EOL> <NUM_LIT:2> + <NUM_LIT:2> -> return true <EOL> else -> return false <EOL> } <EOL> }


{ <EOL> when ( x ) { <EOL> Int . MAX_VALUE -> return true <EOL> else -> return false <EOL> } <EOL> }


{ <EOL> if ( ! foo1 ( <NUM_LIT:4> ) ) return "<STR_LIT>" <EOL> if ( foo1 ( <NUM_LIT:1> ) ) return "<STR_LIT>" <EOL> if ( ! foo2 ( Int . MAX_VALUE ) ) return "<STR_LIT>" <EOL> if ( foo2 ( <NUM_LIT:1> ) ) return "<STR_LIT>" <EOL> return "<STR_LIT:OK>" <EOL> }


override fun iterator ( ) : MutableIterator < E >


override fun applyHierarchyTemplate ( template : KotlinHierarchyTemplate )

{ <EOL> if ( ! appliedTemplatesImpl . add ( template ) ) return <EOL> applyHierarchyTemplateToAllCompilations ( template ) <EOL> }


override fun applyHierarchyTemplate ( template : KotlinHierarchyBuilder . Root . ( ) -> Unit )

{ <EOL> applyHierarchyTemplate ( KotlinHierarchyTemplate ( template ) ) <EOL> }


override fun applyHierarchyTemplate ( template : KotlinHierarchyTemplate , extension : KotlinHierarchyBuilder . Root . ( ) -> Unit )

{ <EOL> applyHierarchyTemplate ( template . extend ( extension ) ) <EOL> }


private fun applyHierarchyTemplateToAllCompilations ( template : KotlinHierarchyTemplate )

{ <EOL> targets . matching { target -> target . platformType != KotlinPlatformType . common } . all { target -> <EOL> target . compilations . all { compilation -> <EOL> target . project . kotlinPluginLifecycle . launch { <EOL> withRestrictedStages ( KotlinPluginLifecycle . Stage . upTo ( FinaliseRefinesEdges ) ) { <EOL> val hierarchy = template . buildHierarchy ( compilation ) ? : return@withRestrictedStages <EOL> applyKotlinHierarchy ( hierarchy , compilation ) <EOL> } <EOL> } <EOL> } <EOL> } <EOL> }


private suspend fun applyKotlinHierarchy ( hierarchy : KotlinHierarchy , compilation : KotlinCompilation < * > ) : KotlinSourceSet ?

{ <EOL> val sharedSourceSet = createSharedSourceSetOrNull ( hierarchy . node , compilation ) <EOL> val childSourceSets = <EOL> hierarchy . children . mapNotNull { childHierarchy -> applyKotlinHierarchy ( childHierarchy , compilation ) } <EOL> if ( sharedSourceSet == null ) return null <EOL> if ( hierarchy . children . isNotEmpty ( ) ) { <EOL> childSourceSets . forEach { childSourceSet -> <EOL> redundantDependsOnEdgesTracker . addDependsOnEdgeFromTemplate ( childSourceSet , sharedSourceSet ) <EOL> } <EOL> } else { <EOL> compilation . internal . kotlinSourceSets . forAll { compilationSourceSet -> <EOL> redundantDependsOnEdgesTracker . addDependsOnEdgeFromTemplate ( compilationSourceSet , sharedSourceSet ) <EOL> } <EOL> } <EOL> return sharedSourceSet <EOL> }


private suspend fun createSharedSourceSetOrNull ( node : KotlinHierarchy . Node , compilation : KotlinCompilation < * > , ) : KotlinSourceSet ?

{ <EOL> val sharedSourceSetName = node . sharedSourceSetName ( compilation ) ? : return null <EOL> return sourceSets . maybeCreate ( sharedSourceSetName ) <EOL> }


{ <EOL> val b = B < Any > ( ) <EOL> assertEquals ( b , b ) <EOL> return "<STR_LIT:OK>" <EOL> }


{ <EOL> val dClass = DClass ( dri = DRI ( ) , name = "<STR_LIT>" , constructors = emptyList ( ) , classlikes = emptyList ( ) , companion = null , documentation = emptyMap ( ) , expectPresentInSet = null , extra = PropertyContainer . empty ( ) , visibility = emptyMap ( ) , generics = emptyList ( ) , modifier = emptyMap ( ) , properties = emptyList ( ) , sources = emptyMap ( ) , sourceSets = emptySet ( ) , supertypes = emptyMap ( ) , isExpectActual = false , functions = listOf ( DFunction ( dri = DRI ( ) , name = "<STR_LIT>" , documentation = emptyMap ( ) , expectPresentInSet = null , extra = PropertyContainer . empty ( ) , visibility = emptyMap ( ) , generics = emptyList ( ) , modifier = emptyMap ( ) , sources = emptyMap ( ) , sourceSets = emptySet ( ) , type = Void , receiver = null , isConstructor = false , isExpectActual = false , parameters = listOf ( DParameter ( dri = DRI ( ) , name = "<STR_LIT>" , documentation = emptyMap ( ) , expectPresentInSet = null , extra = PropertyContainer . empty ( ) , sourceSets = emptySet ( ) , type = Void ) , DParameter ( dri = DRI ( ) , name = "<STR_LIT>" , documentation = emptyMap ( ) , expectPresentInSet = null , extra = PropertyContainer . empty ( ) , sourceSets = emptySet ( ) , type = Void ) ) ) , DFunction ( dri = DRI ( ) , name = "<STR_LIT>" , documentation = emptyMap ( ) , expectPresentInSet = null , extra = PropertyContainer . empty ( ) , visibility = emptyMap ( ) , generics = emptyList ( ) , modifier = emptyMap ( ) , sources = emptyMap ( ) , sourceSets = emptySet ( ) , type = Void , receiver = null , isConstructor = false , isExpectActual = false , parameters = listOf ( DParameter ( dri = DRI ( ) , name = "<STR_LIT>" , documentation = emptyMap ( ) , expectPresentInSet = null , extra = PropertyContainer . empty ( ) , sourceSets = emptySet ( ) , type = Void ) , DParameter ( dri = DRI ( ) , name = "<STR_LIT>" , documentation = emptyMap ( ) , expectPresentInSet = null , extra = PropertyContainer . empty ( ) , sourceSets = emptySet ( ) , type = Void ) ) ) ) ) <EOL> assertEquals ( listOf ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) , dClass . withDescendants ( ) . map { it . name } . toList ( ) ) <EOL> }


override fun equals ( other : Any ? ) : Boolean

{ <EOL> if ( this === other ) return true <EOL> if ( other == null || this :: class != other :: class ) return false <EOL> other as TypesUmbrella <EOL> if ( str != other . str ) return false <EOL> if ( i != other . i ) return false <EOL> if ( nullable != other . nullable ) return false <EOL> if ( list != other . list ) return false <EOL> if ( map != other . map ) return false <EOL> if ( inner != other . inner ) return false <EOL> if ( innersList != other . innersList ) return false <EOL> if ( ! byteString . contentEquals ( other . byteString ) ) return false <EOL> if ( ! byteArray . contentEquals ( other . byteArray ) ) return false <EOL> return true <EOL> }


{ <EOL> var result = str . hashCode ( ) <EOL> result = <NUM_LIT:31> * result + i <EOL> result = <NUM_LIT:31> * result + ( nullable ? . hashCode ( ) ? : <NUM_LIT:0> ) <EOL> result = <NUM_LIT:31> * result + list . hashCode ( ) <EOL> result = <NUM_LIT:31> * result + map . hashCode ( ) <EOL> result = <NUM_LIT:31> * result + inner . hashCode ( ) <EOL> result = <NUM_LIT:31> * result + innersList . hashCode ( ) <EOL> result = <NUM_LIT:31> * result + byteString . contentHashCode ( ) <EOL> result = <NUM_LIT:31> * result + byteArray . contentHashCode ( ) <EOL> return result <EOL> }


{ <EOL> if ( this === other ) return true <EOL> if ( other == null || this :: class != other :: class ) return false <EOL> other as NullableByteString <EOL> if ( byteString != null ) { <EOL> if ( other . byteString == null ) return false <EOL> if ( ! byteString . contentEquals ( other . byteString ) ) return false <EOL> } else if ( other . byteString != null ) return false <EOL> return true <EOL> }


{ <EOL> return byteString ? . contentHashCode ( ) ? : <NUM_LIT:0> <EOL> }


override fun serialize ( encoder : Encoder , value : CustomByteString )

{ <EOL> encoder . encodeSerializableValue ( ByteArraySerializer ( ) , byteArrayOf ( value . a , value . b , value . c ) ) <EOL> }


override fun deserialize ( decoder : Decoder ) : CustomByteString

{ <EOL> val array = decoder . decodeSerializableValue ( ByteArraySerializer ( ) ) <EOL> return CustomByteString ( array [ <NUM_LIT:0> ] , array [ <NUM_LIT:1> ] , array [ <NUM_LIT:2> ] ) <EOL> }


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


= name


override fun addCommonSourceSetToPlatformSourceSet ( commonSourceSet : Named , platformProject : Project )

{ <EOL> val commonSourceSetName = commonSourceSet . name <EOL> platformProject . konanMultiplatformTasks <EOL> . filter { it . commonSourceSets . contains ( commonSourceSetName ) } <EOL> . forEach { task : KonanCompileTask -> <EOL> getKotlinSourceDirectorySetSafe ( commonSourceSet ) ! ! . srcDirs . forEach { <EOL> task . commonSrcDir ( it ) <EOL> } <EOL> } <EOL> }


override fun namedSourceSetsContainer ( project : Project ) : NamedDomainObjectContainer < * >

= <EOL> project . container ( RequestedCommonSourceSet :: class . java ) . apply { <EOL> project . konanMultiplatformTasks . forEach { task -> <EOL> task . commonSourceSets . forEach { maybeCreate ( it ) } <EOL> } <EOL> }


= "<STR_LIT:OK>"


{ <EOL> return A ( ) . p ( ) <EOL> }


override fun mergeStrategyFor ( left : InheritedMember , right : InheritedMember ) : MergeStrategy < Documentable >

= MergeStrategy . Replace ( InheritedMember ( left . inheritedFrom + right . inheritedFrom ) )


public fun isInherited ( sourceSetDependent : DokkaSourceSet ) : Boolean

= inheritedFrom [ sourceSetDependent ] != null


override fun mergeStrategyFor ( left : ImplementedInterfaces , right : ImplementedInterfaces ) : MergeStrategy < Documentable >

= <EOL> MergeStrategy . Replace ( ImplementedInterfaces ( left . interfaces + right . interfaces ) )


override fun mergeStrategyFor ( left : ExceptionInSupertypes , right : ExceptionInSupertypes ) : MergeStrategy < Documentable >

= <EOL> MergeStrategy . Replace ( ExceptionInSupertypes ( left . exceptions + right . exceptions ) )


override fun mergeStrategyFor ( left : IsAlsoParameter , right : IsAlsoParameter ) : MergeStrategy < DProperty >

= <EOL> MergeStrategy . Replace ( IsAlsoParameter ( left . inSourceSets + right . inSourceSets ) )


override fun mergeStrategyFor ( left : CheckedExceptions , right : CheckedExceptions ) : MergeStrategy < Documentable >

= <EOL> MergeStrategy . Replace ( CheckedExceptions ( left . exceptions + right . exceptions ) )


{ <EOL> val size = <NUM_LIT:5> <EOL> val descriptor = createClassDescriptor ( size ) <EOL> val reader = ElementMarker ( descriptor ) { _ , _ -> true } <EOL> for ( i in <NUM_LIT:0> until size ) { <EOL> assertEquals ( i , reader . nextUnmarkedIndex ( ) ) <EOL> } <EOL> assertEquals ( CompositeDecoder . DECODE_DONE , reader . nextUnmarkedIndex ( ) ) <EOL> }


{ <EOL> val size = <NUM_LIT:5> <EOL> val descriptor = createClassDescriptor ( size ) <EOL> val reader = ElementMarker ( descriptor ) { _ , _ -> true } <EOL> for ( i in <NUM_LIT:0> until size ) { <EOL> reader . mark ( i ) <EOL> } <EOL> assertEquals ( CompositeDecoder . DECODE_DONE , reader . nextUnmarkedIndex ( ) ) <EOL> }


{ <EOL> val size = <NUM_LIT:10> <EOL> val readIndex = <NUM_LIT:4> <EOL> val predicate : ( Any ? , Int ) -> Boolean = { _ , i -> i % <NUM_LIT:2> == <NUM_LIT:0> } <EOL> val descriptor = createClassDescriptor ( size ) <EOL> val reader = ElementMarker ( descriptor , predicate ) <EOL> reader . mark ( readIndex ) <EOL> for ( i in <NUM_LIT:0> until size ) { <EOL> if ( predicate ( descriptor , i ) && i != readIndex ) { <EOL> assertEquals ( i , reader . nextUnmarkedIndex ( ) ) <EOL> } <EOL> } <EOL> assertEquals ( CompositeDecoder . DECODE_DONE , reader . nextUnmarkedIndex ( ) ) <EOL> }


@ Test <EOL> fun testSmallPartiallyRead ( )

{ <EOL> testPartiallyRead ( Long . SIZE_BITS / <NUM_LIT:3> ) <EOL> }


@ Test <EOL> fun test64PartiallyRead ( )

{ <EOL> testPartiallyRead ( Long . SIZE_BITS ) <EOL> }


@ Test <EOL> fun test128PartiallyRead ( )

{ <EOL> testPartiallyRead ( Long . SIZE_BITS * <NUM_LIT:2> ) <EOL> }


@ Test <EOL> fun testLargePartiallyRead ( )

{ <EOL> testPartiallyRead ( Long . SIZE_BITS * <NUM_LIT:2> + Long . SIZE_BITS / <NUM_LIT:3> ) <EOL> }


private fun testPartiallyRead ( size : Int )

{ <EOL> val descriptor = createClassDescriptor ( size ) <EOL> val reader = ElementMarker ( descriptor ) { _ , _ -> true } <EOL> for ( i in <NUM_LIT:0> until size ) { <EOL> if ( i % <NUM_LIT:2> == <NUM_LIT:0> ) { <EOL> reader . mark ( i ) <EOL> } <EOL> } <EOL> for ( i in <NUM_LIT:0> until size ) { <EOL> if ( i % <NUM_LIT:2> != <NUM_LIT:0> ) { <EOL> assertEquals ( i , reader . nextUnmarkedIndex ( ) ) <EOL> } <EOL> } <EOL> assertEquals ( CompositeDecoder . DECODE_DONE , reader . nextUnmarkedIndex ( ) ) <EOL> }


private fun createClassDescriptor ( size : Int ) : SerialDescriptor

{ <EOL> return buildClassSerialDescriptor ( "<STR_LIT>" ) { <EOL> for ( i in <NUM_LIT:0> until size ) { <EOL> element ( "<STR_LIT>" , buildSerialDescriptor ( "<STR_LIT>" , PrimitiveKind . INT ) ) <EOL> } <EOL> } <EOL> }


= block ( )


inline fun < reified T : Any > className ( ) : String

= T :: class . java . getName ( )


fun f ( ) : String


fun g ( ) : String


{ <EOL> val x = foo ( ) { <EOL> className < String > ( ) <EOL> } <EOL> assertEquals ( "<STR_LIT>" , x ) <EOL> val y : A = object : A { <EOL> override fun f ( ) : String = foo { className < String > ( ) } <EOL> override fun g ( ) : String = foo { className < Int > ( ) } <EOL> } <EOL> assertEquals ( "<STR_LIT>" , y . f ( ) ) <EOL> assertEquals ( "<STR_LIT>" , y . g ( ) ) <EOL> return "<STR_LIT:OK>" <EOL> }


= "<STR_LIT>"


fun getValue ( ) : B


fun < V , R > NotMap < V > . mapValuesOriginal ( ff : ( Entry < V > ) -> R ) : NotMap < R >

= throw Exception ( )


fun < B , C > NotMap < B > . mapValuesOnly ( f : ( B ) -> C )

= mapValuesOriginal { e -> f ( e . getValue ( ) ) }


@ nativeGetter <EOL> operator fun get ( key : String ) : Any ?


@ nativeSetter <EOL> operator fun set ( key : String , value : Any )


open fun runInContext ( contextifiedSandbox : Context , options : RunningScriptOptions ? = definedExternally ) : Any


open fun runInNewContext ( sandbox : Context ? = definedExternally , options : RunningScriptOptions ? = definedExternally ) : Any


open fun runInThisContext ( options : RunningScriptOptions ? = definedExternally ) : Any


open fun createCachedData ( ) : Buffer


external fun createContext ( sandbox : Context ? = definedExternally , options : CreateContextOptions ? = definedExternally ) : Context


external fun isContext ( sandbox : Context ) : Boolean


external fun runInContext ( code : String , contextifiedSandbox : Context , options : RunningScriptOptions ? = definedExternally ) : Any


external fun runInContext ( code : String , contextifiedSandbox : Context , options : String ? = definedExternally ) : Any


external fun runInNewContext ( code : String , sandbox : Context ? = definedExternally , options : RunningScriptOptions ? = definedExternally ) : Any


external fun runInNewContext ( code : String , sandbox : Context ? = definedExternally , options : String ? = definedExternally ) : Any


external fun runInThisContext ( code : String , options : RunningScriptOptions ? = definedExternally ) : Any


external fun runInThisContext ( code : String , options : String ? = definedExternally ) : Any


external fun compileFunction ( code : String , params : Array < String > , options : CompileFunctionOptions ) : Function < * >


external fun runInContext ( code : String , contextifiedSandbox : Context ) : Any


external fun runInNewContext ( code : String ) : Any


external fun runInThisContext ( code : String ) : Any


fun appendFile ( data : Any , options : `T$38` ? = definedExternally ) : Promise < Unit >


fun appendFile ( data : Any , options : String ? = definedExternally ) : Promise < Unit >


fun appendFile ( data : Any , options : Nothing ? = definedExternally ) : Promise < Unit >


fun chown ( uid : Number , gid : Number ) : Promise < Unit >


fun chmod ( mode : String ) : Promise < Unit >


fun chmod ( mode : Number ) : Promise < Unit >


fun datasync ( ) : Promise < Unit >


fun sync ( ) : Promise < Unit >


fun < TBuffer : Uint8Array > read ( buffer : TBuffer , offset : Number ? = definedExternally , length : Number ? = definedExternally , position : Number ? = definedExternally ) : Promise < `T$39` >


fun readFile ( options : `T$40` ? = definedExternally ) : Promise < Buffer >


fun readFile ( options : Nothing ? = definedExternally ) : Promise < Buffer >


fun readFile ( options : `T$41` ) : Promise < String >


fun readFile ( options : String ) : Promise < String >


fun readFile ( options : `T$42` ? = definedExternally ) : Promise < dynamic >


fun readFile ( options : String ? = definedExternally ) : Promise < dynamic >


fun readFile ( options : Nothing ? = definedExternally ) : Promise < dynamic >


fun stat ( ) : Promise < fs . Stats >


fun truncate ( len : Number ? = definedExternally ) : Promise < Unit >


fun utimes ( atime : String , mtime : String ) : Promise < Unit >


fun utimes ( atime : String , mtime : Number ) : Promise < Unit >


fun utimes ( atime : String , mtime : Date ) : Promise < Unit >


fun utimes ( atime : Number , mtime : String ) : Promise < Unit >


fun utimes ( atime : Number , mtime : Number ) : Promise < Unit >


fun utimes ( atime : Number , mtime : Date ) : Promise < Unit >


fun utimes ( atime : Date , mtime : String ) : Promise < Unit >


fun utimes ( atime : Date , mtime : Number ) : Promise < Unit >


fun utimes ( atime : Date , mtime : Date ) : Promise < Unit >


fun < TBuffer : Uint8Array > write ( buffer : TBuffer , offset : Number ? = definedExternally , length : Number ? = definedExternally , position : Number ? = definedExternally ) : Promise < `T$43` >


fun write ( data : Any , position : Number ? = definedExternally , encoding : String ? = definedExternally ) : Promise < `T$44` >


fun writeFile ( data : Any , options : `T$38` ? = definedExternally ) : Promise < Unit >


fun writeFile ( data : Any , options : String ? = definedExternally ) : Promise < Unit >


fun writeFile ( data : Any , options : Nothing ? = definedExternally ) : Promise < Unit >


fun writev ( buffers : Array < dynamic > , position : Number ? = definedExternally ) : Promise < fs . WriteVResult >


fun close ( ) : Promise < Unit >


fun appendFile ( data : Any ) : Promise < Unit >


fun readFile ( ) : Promise < Buffer >


fun writeFile ( data : Any ) : Promise < Unit >


external fun access ( path : String , mode : Number ? = definedExternally ) : Promise < Unit >


external fun access ( path : Buffer , mode : Number ? = definedExternally ) : Promise < Unit >


external fun access ( path : URL , mode : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : String , dest : String , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : String , dest : Buffer , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : String , dest : URL , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : Buffer , dest : String , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : Buffer , dest : Buffer , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : Buffer , dest : URL , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : URL , dest : String , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : URL , dest : Buffer , flags : Number ? = definedExternally ) : Promise < Unit >


external fun copyFile ( src : URL , dest : URL , flags : Number ? = definedExternally ) : Promise < Unit >


external fun open ( path : String , flags : String , mode : String ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : String , flags : String , mode : Number ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : String , flags : Number , mode : String ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : String , flags : Number , mode : Number ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : Buffer , flags : String , mode : String ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : Buffer , flags : String , mode : Number ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : Buffer , flags : Number , mode : String ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : Buffer , flags : Number , mode : Number ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : URL , flags : String , mode : String ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : URL , flags : String , mode : Number ? = definedExternally ) : Promise < FileHandle >


external fun open ( path : URL , flags : Number , mode : String ? = definedExternally ) : Promise < FileHandle >