You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The below kind of typealias usage with a generic generates invalid code in 2.5.0-beta09; not sure if it will build in prior versions:
typealias Alias<T> = Foo<Bar<T>, T> // in a separate file, not sure it matters
class SomeActivity {
@Inject
internal lateinit var alias: Alias<Boolean>
}
This generates code like below; note the raw Bar<T>:
public class SomeActivity_MembersInjector(
private val alias: Provider<@JvmSuppressWildcards Foo<Bar<T>, Boolean>>,
) : MembersInjector<SomeActivity> {
//...
}
Anvil only seems to expand generics at the top level here, not a second-level usage. A typealias like this works fine:
typealias Alias<T> = Foo<Int, T>
The text was updated successfully, but these errors were encountered:
bubenheimer
changed the title
Generics typealias build error
Generics typealias codegen error
Jul 14, 2024
The below kind of typealias usage with a generic generates invalid code in 2.5.0-beta09; not sure if it will build in prior versions:
This generates code like below; note the raw
Bar<T>
:Anvil only seems to expand generics at the top level here, not a second-level usage. A typealias like this works fine:
The text was updated successfully, but these errors were encountered: