Skip to content

Fix #4044: Change quote pickled representation #4081

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 8 commits into from
Mar 16, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki self-assigned this Mar 7, 2018
@nicolasstucki
Copy link
Contributor Author

test performance please

@dottybot
Copy link
Member

dottybot commented Mar 7, 2018

performance test scheduled: 1 job(s) in queue, 0 running.

@nicolasstucki nicolasstucki changed the title Fix #4044: Change pickled representation Fix #4044: Change quote pickled representation Mar 7, 2018
@dottybot
Copy link
Member

dottybot commented Mar 7, 2018

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/4081/ to see the changes.

Benchmarks is based on merging with master (bdfe740)

if (inQuote) {
val (body1, quotes) = nested(isQuote = false).split(body)
makeHole(body1, quotes, splice.tpe)
private def splice(splice: Select)(implicit ctx: Context): Tree = {
Copy link
Contributor

@biboudis biboudis Mar 14, 2018

Choose a reason for hiding this comment

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

splice could handle the case of a TypeTree before. 🤔

Copy link
Contributor

@odersky odersky 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

@@ -162,7 +184,6 @@ class ReifyQuotes extends MacroTransformWithImplicits {
def tryHeal(tp: Type, pos: Position)(implicit ctx: Context): Option[String] = tp match {
case tp: TypeRef =>
if (level == 0) {
assert(ctx.owner.is(Macro))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was the assert dropped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In one case where the macro contained an anonymous function inside and the tryHeal saw that function as ctx.owner. Now the assert is

assert(ctx.owner.ownersIterator.exists(_.is(Macro)))

}
}

/** Transforms the contents of a splice nested
Copy link
Contributor

Choose a reason for hiding this comment

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

"splice nested" -> "nested splice"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Add here: Assuming

* val y = ???
* { ... '{ ... x .. y ... } ... }.unary_~
* }
*
Copy link
Contributor

Choose a reason for hiding this comment

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

Add: "Then the spliced subexpression"

@odersky odersky assigned nicolasstucki and unassigned odersky Mar 15, 2018
@nicolasstucki nicolasstucki merged commit 7221287 into scala:master Mar 16, 2018
@allanrenucci allanrenucci deleted the fix-#4044 branch March 16, 2018 07:53
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