-
Notifications
You must be signed in to change notification settings - Fork 21
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
REPL :javap doesn't work on JDK 16+ unless you pass extra flags #12378
Comments
Agreed! Wanted this a long time. |
I guess Scala 2 doesn't make use of the Java module system.
|
|
It seems that asm does not rely on JDK classes, So our solution to this problem is to give up |
or both. scala 2 repl has a classloader issue that requires -nobootcp, so there may be the same issue with scala 3. I like the idea of having many tools in the tool belt. |
I will refer to dotty to implement asmp for scala2. Any interested volunteers can pick it up before I submit pr. |
For reference until we have a lasting answer for the Scala 2 REPL, @retronym pointed out the escape hatch for the module access on a previous tromp down this lane, still an applicable workaround in JDK 17: scala/scala#8400 (comment)
which could be set in |
here's the Scala-CLI form of the workaround:
( |
The "workaround" for
in other words
where I don't know if there is a use case where it's not feasible to use I see that |
They don't want either of them in dotty scala/scala3#12210 Scrolling way back, I see that was linked in 2021. |
From what I understand, the complication is that we need to make javap read a class from the repl's in-memory representation / class loader.
It seems the only accessible API is
ToolProvider
which only has arun
method. I assume we cannot make it search classes in a custom class loader through this.Personally, I'd be fine throwing out
:javap
in favor of:asmp
which would be easy to implementThe text was updated successfully, but these errors were encountered: