-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make tasty inspector receive tasty files directly #10061
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
Make tasty inspector receive tasty files directly #10061
Conversation
cc6037b
to
31d5120
Compare
We add ways to load a list of tasty files and all tasty files in a jar. This change is aligned with the changes in progress on the `-from-tasty` compilation. We remove the old way to load tasty file by passing the class name. Loading by name had some unintended consecuences that made this API fragile. - Loaded Scala 2 classes by mistake (no tasty) - Loaded java classes by mistake (no tasty) - Load the wrong version of the tasty file because the classpath contains an older/newer version of that class (different tasty)
31d5120
to
06d988a
Compare
@abgruszecki this change may affect the doc tool. Not sure if you already workaround this in your driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the surface level, it seems the API is more complex to use.
I have never used this API. Maybe @abgruszecki and @bishabosha can share more ideas?
@gzoller what do you think |
I guess this now makes it more clear how to use the API in some ways, as users must identify the top level class corresponding to the target being inspected, (if they are using inspector from a class obtained from |
can this work with relative paths? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM, but I'm not sure why exactly we're making this change. Is it to avoid problems with loading .tasty files from unknown/unexpected jars on the classpath?
Yes, it is to not accidentally load the wrong version of the class if another one is in the classpath. Or load from a class that has no TASTy. |
Yes it does. The stdlib tests use relative paths. |
The TASTy inspector is designed to take as input TASTy or jar files and inspect their TASTy. What you are describing is some kind of runtime reflection mixed with the tasty inspector, not really what this is designed for. |
looks good to me - I think its good to make it clear that this API is for file inspection and not class reflection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.