Skip to content

Load .tasty files from in-memory file systems too #11308

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

Merged
merged 2 commits into from
Feb 5, 2021

Conversation

alexarchambault
Copy link
Contributor

@alexarchambault alexarchambault commented Feb 3, 2021

Related to com-lihaoyi/Ammonite#1150.

This PR allows to load *.tasty files from in-memory file systems (like dotty.tools.io.VirtualDirectory-based things) during compilation, rather than requiring them to exist on disk. This would be useful from Ammonite for example, that keeps the compiler output of previous compilation steps in memory.

Not sure if or where I should add tests for that.

Comment on lines 920 to 921
val tastyFileOrNull = classfile.container
.lookupName(classfile.name.stripSuffix(".class") + ".tasty", false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a special-case just for virtual files or could this codepath also work for plain files?

Copy link
Contributor Author

@alexarchambault alexarchambault Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work for plain files too, I think. And using it there would run that code in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants