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

Update staging.md #19374

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/_docs/reference/metaprogramming/staging.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ to get a source-like representation of the expression.
import scala.quoted.*

// make available the necessary compiler for runtime code generation
given staging.Compiler = staging.Compiler.make(getClass.getClassLoader)
given staging.Compiler = staging.Compiler.make(Predef.getClass.getClassLoader)
Copy link
Contributor

Choose a reason for hiding this comment

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

That might not be the correct classloader. The standard library might be loaded earlier with a different classloader. We need to get it from a class defined in the current project.

I am not sure what is the cleanest encantation for this one that we cannot the the classloader of the synthetic package object.


val f: Array[Int] => Int = staging.run {
val stagedSum: Expr[Array[Int] => Int] =
Expand Down
Loading