You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 4.0.0, the InstanceContext was renamed to ResolutionContext, and it gained a new member clazz :
class ResolutionContext(
val logger: Logger,
val scope: Scope,
val clazz: KClass<*>,
val qualifier: Qualifier? = null,
val parameters: ParametersHolder? = null,
)
It seems that clazz isn't actually being used (at least, when creating instances via InstanceFactory<T>::get) -- so I wonder why it's there at all? Is it supposed to be same as the T::class of InstanceFactory ?
In fact, the InstanceRegistry uses NoClass::class in its place:
private fun createEagerInstances(instances: Collection<SingleInstanceFactory<*>>) {
val defaultContext = ResolutionContext(_koin.logger, _koin.scopeRegistry.rootScope, clazz = NoClass::class)
instances.forEach { factory -> factory.get(defaultContext) }
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In 4.0.0, the
InstanceContext
was renamed toResolutionContext
, and it gained a new memberclazz
:It seems that
clazz
isn't actually being used (at least, when creating instances viaInstanceFactory<T>::get
) -- so I wonder why it's there at all? Is it supposed to be same as theT::class
of InstanceFactory ?In fact, the
InstanceRegistry
usesNoClass::class
in its place:Sooo?
Beta Was this translation helpful? Give feedback.
All reactions