Skip to content
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

Implement :require [WIP] #22343

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Implement :require [WIP] #22343

wants to merge 5 commits into from

Conversation

aherlihy
Copy link
Contributor

@aherlihy aherlihy marked this pull request as draft January 10, 2025 20:55
}
}

// TODO: no idea how to access and reload the class paths
Copy link
Member

Choose a reason for hiding this comment

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

This is pretty tricky. There is a method updateClassPath but it's not used anywhere and I'm pretty sure it never worked and was just copy-pasted from Scala 2.

ctx.platform.classPath is used from ctx.platform.rootLoader which is itself used to setup RootClass which corresponds to __root__ from which all imports start. But RootClass is a symbol created once when we initialize the initial context and never again, so updateClassPath won't actually help us import any new symbol

So I think we need to recreate a rootCtx, which is akin to what :settings seems to do:

rootCtx = setupRootCtx(tokenize(arg).toArray, rootCtx)
state.copy(context = rootCtx)
but I don't guarantee this works 😅

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