e6f4d6e6fa
^KT-65406
63 lines
2.2 KiB
Kotlin
Vendored
63 lines
2.2 KiB
Kotlin
Vendored
private val registrationMap: HashMap<Type, Any>
|
|
field = hashMapOf<Type, Any>()
|
|
private get
|
|
|
|
class ClashResolutionDescriptor<E : PlatformSpecificExtension<E>> {
|
|
private val resolver: PlatformExtensionsClashResolver<E>
|
|
field = resolver
|
|
private get
|
|
|
|
private val clashedComponents: List<ComponentDescriptor>
|
|
field = clashedComponents
|
|
private get
|
|
|
|
constructor(container: ComponentContainer, resolver: PlatformExtensionsClashResolver<E>, clashedComponents: List<ComponentDescriptor>) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
abstract class PlatformExtensionsClashResolver<E : PlatformSpecificExtension<E>> {
|
|
val applicableTo: Class<E>
|
|
field = applicableTo
|
|
get
|
|
|
|
constructor(applicableTo: Class<E>) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
interface ComponentContainer {
|
|
}
|
|
|
|
interface ComponentDescriptor {
|
|
}
|
|
|
|
interface PlatformSpecificExtension<S : PlatformSpecificExtension<S>> {
|
|
}
|
|
|
|
fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List<PlatformExtensionsClashResolver<*>>) {
|
|
{ // BLOCK
|
|
val tmp_0: Iterator<PlatformExtensionsClashResolver<*>> = clashResolvers.iterator()
|
|
while (tmp_0.hasNext()) { // BLOCK
|
|
val resolver: PlatformExtensionsClashResolver<*> = tmp_0.next()
|
|
{ // BLOCK
|
|
val clashedComponents: Collection<ComponentDescriptor> = { // BLOCK
|
|
val tmp_1: Collection<ComponentDescriptor>? = <get-registrationMap>().get(key = resolver.<get-applicableTo>()) as? Collection<ComponentDescriptor>
|
|
when {
|
|
EQEQ(arg0 = tmp_1, arg1 = null) -> continue
|
|
else -> tmp_1
|
|
}
|
|
}
|
|
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>())
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|