8000 [KSP] Doesn't work well with `kotlin.Result` · Issue #4059 · google/dagger · GitHub
[go: up one dir, main page]

Skip to content

[KSP] Doesn't work well with kotlin.Result #4059

@BraisGabin

Description

@BraisGabin

In my project I have a class like this:

class MyClass @Inject constructor(result: Result<Unit>)

When I moved from kapt to ksp the ksp task works but javac is not happy with the generated code:

/path/build/generated/ksp/release/java/thepackage/MyClass_Factory.java:21: error: type Object does not take parameters
  private final Provider<Object<Unit>> resultProvider;
                               ^
/path/build/generated/ksp/release/java/thepackage/MyClass_Factory.java:23: error: type Object does not take parameters
  public MyClass_Factory(Provider<Object<Unit>> resultProvider) {
                                        ^
/path/build/generated/ksp/release/java/thepackage/MyClass_Factory.java:32: error: type Object does not take parameters
  public static MyClass_Factory create(Provider<Object<Unit>> resultProvider) {
                                                      ^
/path/build/generated/ksp/release/java/thepackage/MyClass_Factory.java:36: error: type Object does not take parameters
  public static MyClass newInstance(Object<Unit> result) {
                                          ^

Result is a value class with @JvmInline and it has a generic type. I imagine that the combination of those two generates this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0