InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
https://insert-koin.io
Apache License 2.0
8.98k stars 710 forks source link

Can't use Koin Annotations with package names that start with "it" #1904

Closed FCatinella closed 1 month ago

FCatinella commented 2 months ago

Describe the bug When a package name starts with "it" , ksp fails in generating the Koin Modules.

To Reproduce Just annotate a class inside a package which name starts with "it"

package it.fabiocati.thegamedb.di

import org.koin.core.annotation.ComponentScan
import org.koin.core.annotation.Module

@Module
@ComponentScan
class GameDBModule

While compiling it throws this error: [ksp] /Users/fabio/gameDbApp/app/build/generated/ksp/debug/kotlin/org/koin/ksp/generated/GameDBModuleGenit$fabiocati$thegamedb$di.kt: (7, 71): Function declaration must have a name

And by going inside GameDBModuleGen I could find this:

Screenshot 2024-07-03 alle 11 01 44

I suppose that the issue lies in the fact that "it" is a reserved word in Kotlin.

Expected behavior Koin should create a Koin Module.

Koin module and version: koin-annotations-bom : 1.3.1 koin-annotations : 1.3.1 koin-ksp-compiler: 1.3.1

Can you help me? Unfortunately in Italy we use the prefix "it" a lot. Thanks

arnaudgiuliani commented 2 months ago

can you reopn it in koin annotations repo? thanks