-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Issue #2929: implement inspect for modules #3532
Conversation
@Shri333 let's move the discussion for this PR here rather than the original issue I played around a bit myself and it does seem problematic to get the Scala declared methods via java reflection. Rather than using scala reflection at runtime, we can instead use scala reflection in the
It should be possible to extend that tuple to include a third list for each class: a list of method names that are directly declared by this particular This approach is a bit roundabout compared to using scala-reflect at runtime, but it should work, and help us preserve the "no scala reflect at runtime" invariant we've maintained so far |
@lihaoyi I pushed some changes (fb20fa9) to get all declared methods in |
@Shri333 when you say the You can try cherry-picking your minimal changes onto |
@lihaoyi I was able to fix the issue. Turns out I was supposed to use |
@lihaoyi if I am not mistaken, resolve itself seems to be working incorrectly (on package build
import mill._, javalib._
trait TypeA extends Module {
def foo = Task { "foo" }
}
trait TypeB extends Module {
def bar = Task { "bar" }
}
trait TypeC extends Module {
def baz = Task { "baz" }
}
trait TypeAB extends TypeA with TypeB
object typeA extends TypeA
object typeB extends TypeB
object typeC extends TypeC {
object typeA extends TypeA
}
object typeAB extends TypeAB Running
But, running
Is this expected? This was also the weird behavior I was seeing in the resolve tests. I know that |
@Shri333 that looks like it might be a bug in the |
- Name of module with file/line info - Scaladoc on module - Directly inherited modules - Module dependencies - Default task - Directly implemented tasks Pull request: #3532
@lihaoyi the PR should be ready to review (green CI) |
Thanks @Shri333 ! I'm traveling now but I will try to find time to review this PR as soon as possible |
Went through the code and tried it out locally. This looks great! ![]() Nice work @Shri333, and thanks for bearing with me and with the Mill codebase the last 2-3 weeks! Email me your bank transfer details and I will close out the bounty |
Implement inspect for modules: