-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Describe the bug
New koin compiler plugin Unrecognized @ScopeId,Unable to inject object.
is correct in KSP.
To Reproduce
Steps to reproduce the behavior:
None
Expected behavior
Inject object.
Koin module and version:
koin: 4.2.0-RC1
koin-plugin: 0.3.0
Snippet or Sample project to help reproduce
@Scope(MyType::class)
@Scoped
class Tnt
interface MyType
// Init Application
@KoinApplication(modules = [AppModule::class])
class MyApp
class App: Application() {
override fun onCreate() {
super.onCreate()
startKoin<MyApp> {
androidLogger()
androidContext(this@App)
}
getKoin().createScope<MyType>(scopeId = "a")
}
}
// This is Bug Class
@Factory
class Lex(
@ScopeId(name = "a") val t: Tnt // Unable to inject object.
)
// output error
println("lex: " + getKoin().get<Lex>())
Error info:
Caused by: org.koin.core.error.NoDefinitionFoundException: No definition found for type 'com.demo.Tnt' on scope '['_root_']'. Check your Modules configuration and add missing type and/or qualifier!
The error message says it is in root, but a is defined in @ScopeId
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels