Skip to content

Refactorings on Names: forbid .name on Name and cleanups on the way #4834

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 6 commits into from
Jul 25, 2018

Conversation

Blaisorblade
Copy link
Contributor

Did you know you could call .name on a Name? No more! 😄

Extracted from #4729 after we saw more with @allanrenucci , assigned to him.

The current type is inconsistent with other uses of likeSpaced. And mentioning
`name` in a return type would prevent making it private as in next commit.
This is easy for `TermNameDecorator`, and last commit makes it easy for
`NameDecorator`.
This lets you think that `tree.name` is sensible tho it isn't, and for more than
an year (since ce333b1).
Copy link
Contributor

@allanrenucci allanrenucci 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.

Can you squash your commits into a single one?

@@ -98,7 +98,7 @@ object Names {
/** A name in the same (term or type) namespace as this name and
* with same characters as given `name`.
*/
def likeSpaced(name: Name): ThisName
def likeSpaced(name: PreName): ThisName
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, there don't seems to be usages for likeSpaced(PreName) so I would keep the API as is. If you want to share the implementation with the one in NameOps, it seems you can actually replace PreName by Name

@Blaisorblade
Copy link
Contributor Author

Can you squash your commits into a single one?

Do you mind if I do a GitHub squash merge instead (once tests pass)? These are intentionally separate.

@Blaisorblade Blaisorblade merged commit 5266af5 into scala:master Jul 25, 2018
@Blaisorblade Blaisorblade deleted the refactor-names branch July 25, 2018 11:44
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