Help with dotty compiler and classloading at runtime #16080
Unanswered
rvacaru
asked this question in
Compiler internals Q&A
Replies: 1 comment
-
How to reproduce the issue
For the scala2 version of the test/code simply replace |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Dotty people! 👋
I'm Razvan a GSoC contributor at scalafix (https://summerofcode.withgoogle.com/myprojects/details/gQ08FcXb).
I implemented a compiler for custom rules by reading examples or tests in github where dotty classes . This is used by scalafix to compile external rules at runtime. I then manually invoke the
RuleCompiler
from console and it seems to be working, both when there are no compilation errors and when there are:But I'm now testing this and after compilation the test tries to load the class from the classpath, but the class isn't there. The same unit test works in scala2 with the scala2 compiler. I've debugged the code and found out where the test fails in scala3:
In the scala3 version
catch 2
is printed out, while in scala2 onlycatch 1
is being printed and then class loading succeeds.Would you know what is wrong or what to investigate further? Is there any documentation I should read on this?
What I'm also trying to do is look at the classes available in the classloader, tho I couldn't find out how to do it, would anyone know?
Beta Was this translation helpful? Give feedback.
All reactions