[IR] dumpKotlinLike: add testdata for FIR tests
This commit is contained in:
committed by
teamcityserver
parent
d7bd4240e1
commit
c68040753d
@@ -0,0 +1,62 @@
|
||||
interface ComponentContainer {
|
||||
|
||||
}
|
||||
|
||||
interface PlatformSpecificExtension<S : PlatformSpecificExtension<S>> {
|
||||
|
||||
}
|
||||
|
||||
interface ComponentDescriptor {
|
||||
|
||||
}
|
||||
|
||||
abstract class PlatformExtensionsClashResolver<E : PlatformSpecificExtension<E>> {
|
||||
constructor(applicableTo: Class<E>) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
val applicableTo: Class<E>
|
||||
field = applicableTo
|
||||
get
|
||||
|
||||
}
|
||||
|
||||
class ClashResolutionDescriptor<E : PlatformSpecificExtension<E>> {
|
||||
constructor(container: ComponentContainer, resolver: PlatformExtensionsClashResolver<E>, clashedComponents: List<ComponentDescriptor>) /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
private val resolver: PlatformExtensionsClashResolver<E>
|
||||
field = resolver
|
||||
private get
|
||||
|
||||
private val clashedComponents: List<ComponentDescriptor>
|
||||
field = clashedComponents
|
||||
private get
|
||||
|
||||
}
|
||||
|
||||
private val registrationMap: HashMap<Type, Any>
|
||||
field = hashMapOf<Type, Any>()
|
||||
private get
|
||||
|
||||
fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List<PlatformExtensionsClashResolver<*>>) {
|
||||
{ // BLOCK
|
||||
val <iterator>: Iterator<PlatformExtensionsClashResolver<*>> = clashResolvers.iterator()
|
||||
while (<iterator>.hasNext()) { // BLOCK
|
||||
val resolver: PlatformExtensionsClashResolver<*> = <iterator>.next()
|
||||
val clashedComponents: Collection<ComponentDescriptor> = { // BLOCK
|
||||
val <elvis>: Collection<ComponentDescriptor>? = <get-registrationMap>().get(p0 = resolver.<get-applicableTo>()) as? Collection<ComponentDescriptor>
|
||||
when {
|
||||
EQEQ(arg0 = <elvis>, arg1 = null) -> continue
|
||||
else -> <elvis> /*as Collection<ComponentDescriptor> */
|
||||
}
|
||||
}
|
||||
val substituteDescriptor: ClashResolutionDescriptor<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>> = ClashResolutionDescriptor<PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out PlatformSpecificExtension<out Any?>>>>>>(container = container, resolver = resolver, clashedComponents = clashedComponents.toList<ComponentDescriptor>())
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user