Skip to content

More user-friendly pretty printing of types #2835

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 6, 2017

Conversation

smarter
Copy link
Member

@smarter smarter commented Jul 5, 2017

No description provided.

smarter added 4 commits July 5, 2017 15:55
Otherwise we would print Foo[([+scala$Option$$A] => Option[+A])^] which
is ugly and not even coherent
Currently, this flag only hides the "^" we display on inferred types,
but in the future we can hide more stuff that shouldn't be seen by the
user in error messages and in the IDE.
@smarter smarter requested a review from odersky July 5, 2017 13:55
@smarter smarter force-pushed the nicer-pretty-printing branch from 70cb636 to dc8c5c3 Compare July 5, 2017 14:30
Trying to print the type of `List(1,2)` in the repl launched with
`-Yplain-printer` previously resulted in an infinite recursion (stopped
by PlainPrinter#controlled) because `refinementChain(tp)` will return a
list of only one argument for a RefinedType which is also an
AppliedType.
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

LGTM. Great to have this improved!

@odersky odersky merged commit 7b39007 into scala:master Jul 6, 2017
@allanrenucci allanrenucci deleted the nicer-pretty-printing branch December 14, 2017 19:24
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