Skip to content

Make -explain-types a -Y option as -Yexplain-types. #10737

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

Closed
wants to merge 2 commits into from

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Dec 10, 2020

It prints compiler implementation details about constraint solving.

@sjrd sjrd added this to the 3.0.0-M3 milestone Dec 10, 2020
@sjrd sjrd requested a review from smarter December 10, 2020 09:53
It prints compiler implementation details about constraint solving.
@sjrd sjrd force-pushed the make-explain-types-Y-setting branch from 7618778 to 38e14f7 Compare December 10, 2020 13:21
@sjrd
Copy link
Member Author

sjrd commented Dec 10, 2020

Sigh ... Apparently discipline-munit uses that flag in their build ...

We should revert this commit once the community build has caught up
with the rename.
@odersky
Copy link
Contributor

odersky commented Dec 10, 2020

I am actually not sure about that one. explainTypes gives generally applicable info why a type does not conform to another. It's useful, and we will want to keep it always accessible. So hiding it behind -Y seems to restrive. I would opt for a -X flag, or else leave it as it is.

@griggt
Copy link
Contributor

griggt commented Dec 10, 2020

I believe the usage of -explain-types in projects in the community build is via the sbt-tpolecat plugin.

https://github.com/DavidGregory084/sbt-tpolecat/blob/270b2238b97e9b5a647918753e5b6405075532c4/src/main/scala/io/github/davidgregory084/TpolecatPlugin.scala#L51

@SethTisue
Copy link
Member

Should be a -V flag, IMO.

related: scala/scala#7785

@smarter
Copy link
Member

smarter commented Dec 10, 2020

If we want it to be user-visible we need to change what it does: right now it prints the constraint set in a format which might be completely unrelated to the current subtyping check and so be confusing (especially since it's not printed in a way that is meant to be understandable for users).

@som-snytt
Copy link
Contributor

It's worth noting that in Scala 2's -V -W -X -Y scheme, there is no policy whether -V -W are "stable". They are informational only, so it's benign if -Vfoo is a no-op (but not removed, to give sbt-tpolecat a break). By contrast, -X -Y are behavioral. I find -V aids discoverability. I'm agnostic whether -V means "user-visible, so all verbose output has to be user-accessible." By agnostic I mean apostate. I actually think a user might want "more and more output" analogous to logging levels, INFO or DEBUG, which may be cryptic.

@SethTisue
Copy link
Member

Fully agree with Som here. We regard it as normal (within reason) in Scala 2 to change -V and -W around in minor releases.

@sjrd sjrd deleted the make-explain-types-Y-setting branch October 14, 2022 09:30
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.

7 participants