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
Describe the bug
Adding @ComponentScan to an object annotated with @Module that contains annotated functions does not work. The package is not scanned for other annotated values (or if it is, they are overwritten by the ones provided in the body of the object). I did notice that if there is another module definition or a annotated class in a package external to the ComponentScan that the component scan works correctly.
To Reproduce
Steps to reproduce the behavior:
Declare module like this
@Module
@ComponentScan("com.example.somepackage")
object MyModule {
@Single
funsomeSingleton(): Some3rdPartyType=Some3rdPartyType()
operatorfuninvoke() =this//needed because of something similar to https://github.com/InsertKoinIO/koin-annotations/issues/72
}
Declare this in another file in the com.example.somepackage package
Expected behavior
Expected that component scan kicks in and picks up annotated types.
Koin project used and used version (please complete the following information):
koin-annotations & koin-ksp-compiler 1.3.0
Additional moduleDefinition
Object module declarations with declared annotated functions result in generated code that tries to call a non-existent constructor (but when it does not contain function declarations then the generated code does not try to call any constructor)
The text was updated successfully, but these errors were encountered:
I'm having this same issue. Except I have the following error when the annotated @Module in question is a class MyModule and not just an object MyModule (seems that aspect isn't relevant here)
Interesting, I had the issue with it being an object, then it was resolved when it was made into a class. I will note that I was also having issues where I'd entirely removed a module and code was still being generated for it, but I was suspecting there was just something messed up with my project setup and stuff wasn't being cleaned properly.
Describe the bug
Adding
@ComponentScan
to anobject
annotated with@Module
that contains annotated functions does not work. The package is not scanned for other annotated values (or if it is, they are overwritten by the ones provided in the body of the object). I did notice that if there is another module definition or a annotated class in a package external to the ComponentScan that the component scan works correctly.To Reproduce
Steps to reproduce the behavior:
Declare module like this
Declare this in another file in the
com.example.somepackage
packageExpected behavior
Expected that component scan kicks in and picks up annotated types.
Koin project used and used version (please complete the following information):
koin-annotations & koin-ksp-compiler 1.3.0
Additional moduleDefinition
Object module declarations with declared annotated functions result in generated code that tries to call a non-existent constructor (but when it does not contain function declarations then the generated code does not try to call any constructor)
The text was updated successfully, but these errors were encountered: