diff --git a/kotlin-inject-compiler/core/src/main/kotlin/me/tatarka/inject/compiler/TypeResultResolver.kt b/kotlin-inject-compiler/core/src/main/kotlin/me/tatarka/inject/compiler/TypeResultResolver.kt index f5fb325f..d9a9e80a 100644 --- a/kotlin-inject-compiler/core/src/main/kotlin/me/tatarka/inject/compiler/TypeResultResolver.kt +++ b/kotlin-inject-compiler/core/src/main/kotlin/me/tatarka/inject/compiler/TypeResultResolver.kt @@ -242,15 +242,16 @@ class TypeResultResolver(private val provider: AstProvider, private val options: } val astClass = key.type.toAstClass() + + if (astClass.isObject && astClass.isInject()) { + return Object(astClass.type) + } + val injectCtor = astClass.findInjectConstructors(provider.messenger, options) if (injectCtor != null) { return constructor(key, injectCtor, astClass) } - if (astClass.isInject() && astClass.isObject) { - return Object(astClass.type) - } - if (astClass.isAssistedFactory()) { return assistedFactory(astClass, key) }