Skip to content

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki
Copy link
Contributor Author

This will be useful for debugging.

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 ctx: Context = initCtx.fresh
ctx.settings.optimise.update(settings.optimise)(ctx)
def run[T](expr: Expr[T], settings: Settings[Run]): T = {
val (_, ctx: Context) = setup(settings.compilerArgs.toArray :+ "dummy.scala", initCtx.fresh)
Copy link
Contributor

Choose a reason for hiding this comment

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

dummy.scala?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setup expects some input file. But it is not required here. Hence I add a dummy file name that is then ignored. It is the _ in val (_, ctx: Context) =

val ctx: Context = initCtx.fresh
ctx.settings.color.update("never")(ctx) // TODO support colored show
def withTree[T](expr: Expr[_], f: (Tree, Context) => T, settings: Settings[_]): T = {
val (_, ctx: Context) = setup(settings.compilerArgs.toArray :+ "dummy.scala", initCtx.fresh)
Copy link
Contributor

Choose a reason for hiding this comment

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

what's dummy.scala?

@nicolasstucki nicolasstucki merged commit 3b5419d into scala:master Feb 12, 2018
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