Skip to content

Commit 9ae8f20

Browse files
Skip check for empty modules or orphan definition (will be check by attached module later)
1 parent 57ec90a commit 9ae8f20

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

projects/koin-ksp-compiler/src/jvmMain/kotlin/org/koin/compiler/verify/KoinConfigChecker.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ class KoinConfigChecker(val logger: KSPLogger, val tagResolver: TagResolver) {
6060
val modules = metaModuleByValue.values.map { module ->
6161
mapToModule(module)
6262
}
63+
64+
if (modules.isEmpty()){
65+
LOGGER.warn("no module found")
66+
return
67+
}
6368

6469
// Build all module indexes for O(1) lookup
6570
modulesById = modules.associateBy { it.id }.toMutableMap()
@@ -204,7 +209,7 @@ class KoinConfigChecker(val logger: KSPLogger, val tagResolver: TagResolver) {
204209
private fun verifyDefinition(
205210
def: MetaDefinitionData
206211
) {
207-
if (def.dependencies?.isNotEmpty() == true){
212+
if (def.dependencies?.isNotEmpty() == true && def.module != null){
208213
def.dependencies.forEach { dep -> verifyDefinition( def, dep) }
209214
}
210215
}

0 commit comments

Comments
 (0)