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

Move Eq instances into scala.Eq companion object? #2698

Closed
Blaisorblade opened this issue Jun 6, 2017 · 3 comments
Closed

Move Eq instances into scala.Eq companion object? #2698

Blaisorblade opened this issue Jun 6, 2017 · 3 comments

Comments

@Blaisorblade
Copy link
Contributor

Discussion after https://www.reddit.com/r/programming/comments/6elim6/announcing_dotty_012rc1_a_major_step_towards/ points out that the extra implicit instances of Eq infect the global namespace and that's undesirable — those instances are currently available for autocompletion when typing e.

Could one move them to Eq's companion object?

That might require using a different object as default instance, and maybe patching compiler special cases—such changes are included in the scope of this issue.

@odersky
Copy link
Contributor

odersky commented Jun 7, 2017

I think we could well move them to the companion object. Who wants to try that? Happy to review a PR.

@Blaisorblade
Copy link
Contributor Author

To be sure: I can't volunteer to send PRs till I graduate.

@Blaisorblade
Copy link
Contributor Author

Blaisorblade commented Jun 7, 2017

Downside of moving the instances: they can't be disabled. eqAny was moved to Predef exactly so that it could be disabled (#1247), so it seems it should stay there (not sure about the name though, but I won't bikeshed over that).

EDIT: to be clear, I think eqAny should stay and valid, specific instances should move.

odersky added a commit that referenced this issue Jun 23, 2017
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

No branches or pull requests

2 participants