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

SI-8425 don't create double-dollar names in c.freshName #3638

Merged
merged 1 commit into from Mar 18, 2014

Conversation

xeno-by
Copy link
Member

@xeno-by xeno-by commented Mar 17, 2014

If we append a dollar to a user-provided prefix that ends in a dollar,
we create a potential for confusion for backend phases. That's why
this commit prevents such situations from happening.

If we append a dollar to a user-provided prefix that ends in a dollar,
we create a potential for confusion for backend phases. That's why
this commit prevents such situations from happening.
@xeno-by xeno-by added this to the 2.11.0-RC3 milestone Mar 17, 2014
@xeno-by
Copy link
Member Author

xeno-by commented Mar 17, 2014

review @retronym

@retronym
Copy link
Member

LGTM but let's leave the merge decision up to @adriaanm

@adriaanm adriaanm modified the milestones: 2.11.0-RC2, 2.11.0-RC3 Mar 17, 2014
@adriaanm
Copy link
Contributor

Ok, I'll include this in RC2. What could possibly go wrong :)

import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context

object Macros {
Copy link
Member

Choose a reason for hiding this comment

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

A comment not blocking this PR: I think for tests like that we should have a lightweight way of instantiating macro context and turn this test into a unit test. It already is a unit test just using framework (partest) for functional tests.

The benefit is as usual: instead of having tests that takes 5s to run we would have test that takes 50ms to run and are easier to debug in the IDE.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Macros very often require a fully-operational typechecker. Is this something that has already been attempted in unit tests?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not aware of such attempt. However, I was thinking strictly about tests that do not require type checker like the one presented here. I'm not sure what's the portion of tests that fall into the category of easily unit testable.

@xeno-by xeno-by added the tested label Mar 18, 2014
adriaanm added a commit that referenced this pull request Mar 18, 2014
SI-8425 don't create double-dollar names in c.freshName
@adriaanm adriaanm merged commit df44b27 into scala:master Mar 18, 2014
@adriaanm adriaanm modified the milestones: 2.11.0-RC3, 2.11.0-RC2 Mar 18, 2014
@xeno-by xeno-by deleted the topic/freshname-hotfix branch April 9, 2014 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants