Skip to content

class literal references like AppScope::class aren't counted as references #176

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

Closed
RBusarow opened this issue Sep 30, 2021 · 0 comments · Fixed by #177
Closed

class literal references like AppScope::class aren't counted as references #176

RBusarow opened this issue Sep 30, 2021 · 0 comments · Fixed by #177
Labels
bug Something isn't working

Comments

@RBusarow
Copy link
Member

:moduleA declares absolutely nothing but:

abstract class AppScope private constructor()

:moduleB references that scope in an annotation, with a wildcard import:

import com.foo.moduleA.*

@Module
@ContributesTo(AppScope::class)
object MyModule

The type reference visitor isn't catching type references which are inside a class literal expression, so it never sees that AppScope::class. This means that it doesn't get concatenated with com.foo.moduleA. and isn't added to the list of possible references.

ModuleCheck will say that :moduleA is unused in :moduleB, and will recommend removing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant