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 21, 2024
1 parent 19cfbef commit 243b9bd
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 243b9bd

Please sign in to comment.