Here is the code misusing `_container`: ``` clas...
# kodein
a
Here is the code misusing `_container`:
Copy code
class KodeinValueProvider(private val kodein: Kodein, private val delegate: NamedValueProvider) : NamedValueProvider {
    override val supportsDottedNames: Boolean = delegate.supportsDottedNames

    override fun <T : Any> valueByName(name: String, targetType: Type?): T? {
        return if (delegate.existsByName(name, targetType)) {
            delegate.valueByName(name, targetType)
        } else if (targetType != null) {
            kodein._container.providerOrNull<T>(Kodein.Bind(targetType, null))?.invoke() ?: throw IllegalStateException("not found")
        } else {
            throw IllegalStateException("not found")
        }
    }

    override fun existsByName(name: String, targetType: Type?): Boolean {
        return delegate.existsByName(name, targetType) || (targetType != null && kodein._container.providerOrNull<Any>(Kodein.Bind(targetType, null)) != null)
    }
}