koin-annotations
koin-annotations copied to clipboard
@ComponentScan typealias annotation not working.
Describe the bug I use Hilt for Android and Koin for nonAndroid in same repository. And use typealias nonAndroidTarget,
// KFactory.kt in commonMain
public expect annotation class KFactory
// KFactory.nonAndroid.kt
public actual typealias KFactory = Factory
// KFactory.android.kt
public actual annotation class KFactory
// MemoUpsertUseCase.kt in commonMain
@KFactory
public class MemoUpsertUseCase @KInject internal constructor(
private val memoRepository: MemoRepository,
) : UseCase<Memo, Unit>() {
override suspend fun execute(params: Memo) {
if (params.title.isEmpty()) throw TitleEmptyException()
memoRepository.upsert(params)
}
}
// UseCaseModule in commonMain
@Module
@ComponentScan
public class UseCaseModule
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior I expected generated code like this.
public val com_taetae98_codelab_domain_usecase_UseCaseModule : Module = module {
factory() { com.taetae98.codelab.domain.usecase.memo.MemoUpsertUseCase(memoRepository=get()) } bind(com.taetae98.codelab.domain.usecase.core.UseCase::class)
}
public val com.taetae98.codelab.domain.usecase.UseCaseModule.module : org.koin.core.module.Module get() = com_taetae98_codelab_domain_usecase_UseCaseModule
But generated code is this.
public val com_taetae98_codelab_domain_usecase_UseCaseModule : Module = module {
}
public val com.taetae98.codelab.domain.usecase.UseCaseModule.module : org.koin.core.module.Module get() = com_taetae98_codelab_domain_usecase_UseCaseModule
Koin project used and used version (please complete the following information):
koin-bom : 3.5.1
koin-annotations-bom : 1.3.0
Additional moduleDefinition Add any other moduleDefinition about the problem here.
For now type aliases are not recognized. This is something that the compiler would try to detect aliases annotations. Why do you need to alias existing annotations?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.