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

Require explicit types on implicits #105

Closed
puffnfresh opened this issue Jun 30, 2014 · 7 comments
Closed

Require explicit types on implicits #105

puffnfresh opened this issue Jun 30, 2014 · 7 comments
Labels

Comments

@puffnfresh
Copy link
Collaborator

  1. Enables better reasoning of implicits (i.e. you don't have to reason about inference, which is almost impossible in Scala)
  2. Prevent things like Any or Nothing being inferred somewhere, which can really screw things up.
  3. Prevents things like the following:

https://issues.scala-lang.org/browse/SI-8697

@copumpkin
Copy link

Seems closely related to #101

@stanch
Copy link
Contributor

stanch commented Jul 4, 2014

Careful with that axe! http://scalapuzzlers.com/#pzzlr-045

@copumpkin
Copy link

Pits of failure like that are exactly why this project exists!

@stanch
Copy link
Contributor

stanch commented Jul 5, 2014

@copumpkin By “this project”, do you mean Wartremover or Scalapuzzlers? Anyway, of course such unintentionally recursive implicits can be detected by this plugin as well. My point was that these two warts should go together to prevent potentially dangerous refactoring.

@copumpkin
Copy link

wart remover 😄

well, I can't say for sure why it exists, but shit like that is why I think the project is so valuable!

@puffnfresh
Copy link
Collaborator Author

@copumpkin this might be helpful:

Implicit search will never force inference of an implicit down lower in the same file as the implicit call site. This avoids spurious cycles in inference.

https://issues.scala-lang.org/browse/SI-8697?focusedCommentId=69897&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-69897

@ClaireNeveu
Copy link
Collaborator

This was added in #176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants