-
Notifications
You must be signed in to change notification settings - Fork 211
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
Mark receiver parameter type as referenced. #807
Conversation
Why this is somewhat important: jdeps files are used by e.g. https://github.com/bazelbuild/intellij, which will wrongly report this code as "broken" (i.e. won't add jars providing Application and it parent classes to external libraries, consequently - won't resolve the references and will report the code as broken). |
Thanks for the PR @aeremin! Are you able to add a test case to |
@Bencodes I have added a test, but while working on it understood that my initial fix was nonviable - it will only work if receiver parameter's BTW, I've noticed that this file can benefit from some cleanups (e.g. |
This might be a test case worth adding as well if it potentially changes how jdeps are interpreted.
Absolutely! The person that was originally working on jdeps support inside of rules_kotlin isn't able to work on this anymore, so this code has largely been unmaintained since then. We'd be happy to see PRs for any other cases that aren't yet supported by jdeps as well. |
Now that I reverted the addition of
Sounds good! Let's finish with this one then and then I'll do some cleanups and try to find other cases where jdeps are currently insufficient (I can think of some potential cases, but not yet 100% sure). |
@aeremin just landed this. Thanks for the contribution! |
Thanks folks! #819 is a cleanup I promised above. |
@aryeh-looker could you file a separate ticket (with a full code snippet) and ping me there? I can take a look. |
@aryeh-looker what's the actual error being shown here when you hover over the red? Is it just complaining that the types aren't available? |
At the moment, jdeps generator will miss some dependencies for this code:
In particular,
io.ktor.server.application.Application
is not referenced anywhere directly, but we still depend on it to understand what arelog
androuting
.To do that - we need to collect types representing receiver arguments.