InsertKoinIO / koin-annotations

Koin Annotations - About Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform insert-koin.io
https://insert-koin.io
Apache License 2.0
123 stars 30 forks source link

Can't auto generate classes for Italy package (it.example.app) #110

Closed safesta closed 5 months ago

safesta commented 5 months ago

Describe the bug I'll take the @Factory annotation as an example. For any app that has a package name which starts with "it.", the @Factory annotations (and pretty much every annotation) won't work. The auto generated file Default.kt will not find the package name because "it" has the ParametersHolder type.

To Reproduce Steps to reproduce the behavior:

  1. Create a project with "it.example.app" as package name
  2. Create a class with the @Factory annotation
  3. Build

Expected behavior Build succeed

Fix Just declare a different name in the auto generated variable instead of use the default Kotlin it name.

After fix example:

public val defaultModule : Module = module {
    factory() { parametersHolder ->
        it.example.app.TestClass()
    }
}

Koin project used and used version (please complete the following information): koin version 3.5.3 koin-annotations version 1.3.0

arnaudgiuliani commented 5 months ago

ha yes ... it package name 🙄 thanks for your feedback

arnaudgiuliani commented 5 months ago

Fixed in 3f1a616