Skip to content

Fix #5551: Handle repl line modules in splicer #5688

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 1 commit into from
Jan 12, 2019

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

val instance = loadModule(moduleClass)
(instance, instance.getClass)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need instance in the return? Seems it is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@allanrenucci allanrenucci left a comment

Choose a reason for hiding this comment

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

Can you elaborate why there is a need to special case for the REPL? Ideally the compiler should know nothing about the REPL. It could be a separate project

@nicolasstucki
Copy link
Contributor Author

The issue is that we want to load a macro the is not on the current classpath. The REPL does some magic with the classloader to include the output classpath in the current one. Not sure what else can be done for now.

In the future, we may be able to have the output directory in the classpath to expand macros defined in the same project. But we need to perform quite a few improvements before that can be performed in a sound way. When this happens we could simply remove the special case for the REPL.

@odersky odersky merged commit 971e89f into scala:master Jan 12, 2019
@allanrenucci allanrenucci deleted the fix-#5551 branch January 12, 2019 10:25
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.

4 participants