-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add -Vimplicits and -Vtype-diffs #127
Conversation
Hi @sideeffffect, I've previously had feedback that folks don't like |
Oh, I see. I don't think these provide much utility in CI. How about we turn these on only in local development mode? |
It's a pickle... I like them. But I don't think anything, like the output or whatever has changed since then. According to #45 (comment) it seems like they cause issues with some tools that drop the color of the font. But that seems more like an issue with Metals and/or Bloop (and should be fixed there), not with sbt-tpolecat or It would be great to get perspectives from other people and perhaps more in depth explanation why it was disliked. So far we only know that
|
@sideeffffect @DavidGregory084 I like them because when working with ZIO 1 especially when it comes to the layers, they really help in distinguishing what is missing in the type. In ZIO 2 that's not that much of an issue to be honest. |
Thanks for the feedback @mihaisoloi |
@sideeffffect perhaps we should just add these options, but not enable them by default? That would enable those who want to add these options to easily do so. |
I'm not sure how much value that has... Anybody can just add their own |
I always enable those in my code-bases. Whenever I come across an implicit error, where these flags are not enabled, the error is often impossible to fix without them. I agree that they make most sense while developing. |
My original use case for these two compiler options was when I was trying to debug shapeless derivation for a bunch of codecs. I agree that it’s not a good idea to keep them on all the time due to the problems they cause but we should allow it to be enabled as options and not as default 🙏 |
What do you folks think about adding a Then whoever wants these options enabled by default can set |
/** Print dependent missing implicits. | ||
*/ | ||
val verboseImplicits = | ||
verboseOption("implicits", _.isBetween(V2_13_0, V3_0_0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that this was added as an alias of -Xlog-implicits
for Scala 2.13.0 in #7908.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to check @sideeffffect whether there was a reason you only wanted to enable this above 2.13.6? Did the behaviour change a lot? I seem to remember -Xlog-implicits
used to produce a ton of output.
|
||
/** Explain errors in more detail. | ||
*/ | ||
val explain = ScalacOption("-explain", _ >= V3_0_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dotty source code says that -explain-types
is deprecated in favour of -explain
, which solves our explaintypes2
/explaintypes3
naming problem.
I've made this change on top of @sideeffffect's changes - does this work for everyone? Happy to merge once this goes green if so! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make it easier to have verbose errors across different Scala versions. That alone is indeed helpful.
Let's merge this.
Thanks @sideeffffect! Sorry for the long delay on this one |
fixes #62
explain types:
https://docs.scala-lang.org/overviews/compiler-options/index.html
https://docs.scala-lang.org/scala3/guides/migration/tooling-migration-mode.html
/cc @mihaisoloi @calvinlfer