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

Improve rendering of "none of overloaded alternatives" error #15633

Closed
wants to merge 7 commits into from

Conversation

keynmol
Copy link
Contributor

@keynmol keynmol commented Jul 9, 2022

Sorry for not creating an issue for this, just this error bothered me so much..

Before

Screenshot 2022-07-09 at 14 09 03

After

Screenshot 2022-07-09 at 15 43 24

Questions I have (hence draft PR):

  1. Is there anything already that does what MarginString does?
  2. Is there anything already that handles this whole where [short type] is [full type] rendering?

TODO:

  • stare intensely at the Type hierarchy to see which additional handling logic to add (recursively naming/indexing types)
  • configurable page width? though I'm not sure what dotty's default value is

@keynmol keynmol marked this pull request as ready for review July 9, 2022 19:35
@TheElectronWill
Copy link
Contributor

configurable page width? though I'm not sure what dotty's default value is

The repl uses the JLine library, which provides a method getWidth() (it can be applied on dotty.tools.repl.JLineTerminal.terminal). It would be great to use it, so that it automatically adapts to the console size.

@SethTisue
Copy link
Member

Dale (@dwijnand) has been making improvements to the pretty-printer lately, so perhaps he's in a position to review this PR and/or offer tips?

You might try including #16277 and see if anything changes or improves

@dwijnand
Copy link
Member

1. Is there anything already that does what MarginString does?

printing.Texts.Text is the closes thing to that.

2. Is there anything already that handles this whole where [short type] is [full type] rendering?

printing.Formatting.explanations handles that

@dwijnand
Copy link
Member

@keynmol think you'll be returning to this PR?

@dwijnand dwijnand removed their assignment Jul 13, 2023
@dwijnand dwijnand closed this Jul 13, 2023
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.

4 participants