Avoid using TypeSystemInferenceExtensionContextDelegate in FIR
It's only needed in old FE to avoid clashes when initializing DI The main idea is gettind rid of intermediate interfaces because each of them adds another intermediate DefaultImpls call
This commit is contained in:
@@ -77,12 +77,10 @@ private fun getConstructorInfo(c: Class<*>): ConstructorInfo? {
|
||||
if (Modifier.isAbstract(c.modifiers) || c.isPrimitive)
|
||||
return null
|
||||
|
||||
val constructors = c.constructors
|
||||
val hasSinglePublicConstructor = constructors.singleOrNull()?.let { Modifier.isPublic(it.modifiers) } ?: false
|
||||
if (!hasSinglePublicConstructor)
|
||||
return null
|
||||
val publicConstructors = c.constructors.filter { Modifier.isPublic(it.modifiers) && !it.isSynthetic }
|
||||
if (publicConstructors.size != 1) return null
|
||||
|
||||
val constructor = constructors.single()
|
||||
val constructor = publicConstructors.single()
|
||||
val parameterTypes =
|
||||
if (c.declaringClass != null && !Modifier.isStatic(c.modifiers))
|
||||
listOf(c.declaringClass, *constructor.genericParameterTypes)
|
||||
@@ -126,4 +124,4 @@ private fun getRegistrations(klass: Class<*>): List<Type> {
|
||||
registrations.addAll(interfaces)
|
||||
registrations.remove(Any::class.java)
|
||||
return registrations
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user