File tree Expand file tree Collapse file tree
main/kotlin/org/koin/example/supertype
test/kotlin/org.koin.example
projects/koin-ksp-compiler/src/jvmMain/kotlin/org/koin/compiler/scanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,3 +16,10 @@ public interface D
1616
1717@Single
1818public class C : B (),D
19+
20+
21+ class MyType {
22+
23+ @Single
24+ class MyChildType
25+ }
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import org.koin.example.supertype.A
3434import org.koin.example.supertype.B
3535import org.koin.example.supertype.C
3636import org.koin.example.supertype.D
37+ import org.koin.example.supertype.MyType
3738import org.koin.example.supertype.SuperTypesModule
3839import org.koin.ksp.generated.defaultModule
3940import org.koin.ksp.generated.module
@@ -127,6 +128,8 @@ class TestModule {
127128
128129 assertEquals(2 ,koin.get<StuffList >(named(" another-counter" )).list.size)
129130 assertEquals(" another-counter" ,koin.get<StuffCounter >().name)
131+
132+ assertNotNull(koin.getOrNull<MyType .MyChildType >())
130133 }
131134
132135
Original file line number Diff line number Diff line change @@ -27,8 +27,10 @@ class ClassComponentScanner(
2727
2828 fun createClassDefinition (element : KSAnnotated ): KoinMetaData .Definition {
2929 val ksClassDeclaration = (element as KSClassDeclaration )
30- val packageName = ksClassDeclaration.getPackageName().filterForbiddenKeywords()
30+ val parent = ksClassDeclaration.parentDeclaration?.simpleName?.asString()
31+ val packageName = (ksClassDeclaration.getPackageName() + (parent?.let { " .$it " } ? : " " )).filterForbiddenKeywords()
3132 val className = ksClassDeclaration.simpleName.asString()
33+
3234 val qualifier = ksClassDeclaration.getQualifier()
3335 val annotations = element.getKoinAnnotations()
3436 val scopeAnnotation = annotations.getScopeAnnotation()
You can’t perform that action at this time.
0 commit comments