Skip to content

Commit

Permalink
KSP2 returns synthetic constructors for objects
Browse files Browse the repository at this point in the history
  • Loading branch information
eygraber committed Nov 20, 2024
1 parent 690146b commit 7779b3b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7779b3b

Please sign in to comment.