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

Factory generation: incorrect import for nested classes #79

Closed
Dkhusainov opened this issue Aug 29, 2020 · 1 comment · Fixed by #93
Closed

Factory generation: incorrect import for nested classes #79

Dkhusainov opened this issue Aug 29, 2020 · 1 comment · Fixed by #93
Labels
bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true

Comments

@Dkhusainov
Copy link

Class 1:

package com.example.myapplication

import com.example.myapplication.foo.MyClassFoo
import javax.inject.Inject

class MyClass @Inject constructor(d: Dependencies) : MyClassFoo(d)

Class 2:

package com.example.myapplication.foo

import javax.inject.Inject

open class MyClassFoo(d: Dependencies) {
  class Dependencies @Inject constructor()
}

Generated MyClass_Factory references Dependencies directly, without outer class name, which resuls in compilation error. Both files are otherwise valid Kotlin.

@Dkhusainov
Copy link
Author

Simplified reproducer:

import javax.inject.Inject

class MyClass @Inject constructor(d: Dependencies) {
  class Dependencies @Inject constructor()
}

@vRallev vRallev added bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true labels Aug 30, 2020
vRallev added a commit that referenced this issue Sep 1, 2020
…type is an inner class of the class itself or are parent type.

Fixes #79.
vRallev added a commit that referenced this issue Sep 1, 2020
…type is an inner class of the class itself or are parent type.

Fixes #79.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants