koin-annotations icon indicating copy to clipboard operation
koin-annotations copied to clipboard

Impossible to implement sealed interface.

Open DoTheMonkeyBusiness opened this issue 3 years ago • 0 comments
trafficstars

Describe the bug Ksp generator removes sealed interface from path.

To Reproduce Steps to reproduce the behavior:

  1. Create sealed Interface:
sealed interface SealedInterface {

    interface InternalInterface : SealedInterface
}
  1. Implement it:
@Single
class SampleClass : SealedInterface.InternalInterface {
}
  1. Build project
  2. See error

Expected behavior ksp must generate fulls path to SealedInterface.InternalInterface

Actual behavior ksp removes SealedInterface from path to interface

Generated file:

val CommonModuleModule = module {
	single(qualifier=null) { com.example.koinissue.common.SampleClass() } bind(com.example.koinissue.common.InternalInterface::class)
}
val com.example.koinissue.common.koin.CommonModule.module : org.koin.core.module.Module get() = CommonModuleModule

koin-core version 3.2.0-beta-1 koin-annotations version 1.0.0-beta-2

Additional Sample code: https://github.com/DoTheMonkeyBusiness/koinAnnotationIssue/tree/Sealed_interface_issue

DoTheMonkeyBusiness avatar Apr 18 '22 14:04 DoTheMonkeyBusiness