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

[KSP] Type variables in throws statement causes validation exception. #4014

Open
bcorso opened this issue Aug 15, 2023 · 0 comments
Open

[KSP] Type variables in throws statement causes validation exception. #4014

bcorso opened this issue Aug 15, 2023 · 0 comments

Comments

@bcorso
Copy link

bcorso commented Aug 15, 2023

Before processing an element (e.g. an @Inject-annotated constructor), Dagger validates that all types referenced in the element are valid (i.e. they exist on the class path).

However, when processing with Dagger's KSP processor we get an unexpected error when a method has a throws type that is a type variable (compared to Javac/KAPT where there is no error). For example:

class MyClass {
  // Dagger’s KSP processor will fail due to <ERROR TYPE> for type variable T.
  <T extends Throwable> void method() throws T {}
}

Fixing this issue is currently blocked by google/ksp#1460.

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

No branches or pull requests

1 participant