Description
Using a compile-time constant string as a configuration name leads to the module being incorrectly assigned to the default configuration.
To reproduce, try this:
const val TEST_CONFIG_NAME = "test"
@Module
@Configuration(TEST_CONFIG_NAME)
class TestModule
@KoinApplication(configurations = ["test"])
object KoinApp
In debug logs you'll be able to see clearly that this module is treated as a part of the default configuration.
Also there's an error in logs (although for some reason only in some cases, haven't been able to figure out which ones):
w: [Koin-Debug-FIR] -> Unknown expression type for @Configuration: FirPropertyAccessExpressionImpl
It makes sense since FIR only works with literals and varargs of literals:
Honestly would be good to get an actual build-stopping error, it took way too much time to figure out.
Versions
Koin version: 4.2.2
Plugin version: 1.0.1
Kotlin version: 2.4.0
Description
Using a compile-time constant string as a configuration name leads to the module being incorrectly assigned to the default configuration.
To reproduce, try this:
In debug logs you'll be able to see clearly that this module is treated as a part of the default configuration.
Also there's an error in logs (although for some reason only in some cases, haven't been able to figure out which ones):
w: [Koin-Debug-FIR] -> Unknown expression type for @Configuration: FirPropertyAccessExpressionImplIt makes sense since FIR only works with literals and varargs of literals:
koin-compiler-plugin/koin-compiler-plugin/src/org/koin/compiler/plugin/fir/KoinModuleFirGenerator.kt
Line 940 in 1be529c
Honestly would be good to get an actual build-stopping error, it took way too much time to figure out.
Versions
Koin version: 4.2.2
Plugin version: 1.0.1
Kotlin version: 2.4.0