Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support scope validation #10

Open
bitlinker opened this issue Jan 9, 2024 · 0 comments
Open

Support scope validation #10

bitlinker opened this issue Jan 9, 2024 · 0 comments

Comments

@bitlinker
Copy link

It's possible to create component which provides dependencies with wrong scopes, because there are no such checks here:

https://github.com/daugeldauge/kinzhal/blob/master/kinzhal-processor/src/jvmMain/kotlin/com/daugeldauge/kinzhal/processor/KinzhalSymbolProcessor.kt#L12

https://github.com/daugeldauge/kinzhal/blob/64f84c2dd0c251a89f3c66703858e5b627dddf9d/kinzhal-processor/src/jvmMain/kotlin/com/daugeldauge/kinzhal/processor/generation/FactoryGenerator.kt#L29C4-L29C4

Example:

// Unscoped component, or component with some another scope
interface Component(modules = [FooModule::class]) {
    ...
}

object FooModule {
    @Foo // Some scope here
    fun provideFoo() : Foo{
        ...
    }
}

This compiles fine and scope will work for Foo, however it's confusing because this scope is not attached to the current component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant