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

Specify impl for Show[Symbol] #4490

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LeifW
Copy link

@LeifW LeifW commented Aug 2, 2023

On 2.12, Symbol.toString is e.g. 'foo. On 2.13, it's Symbol(foo).

I want to use Show to get away from the vagaries of relying on .toString - to have a reliable nailed-down String representation for types.

Want to use Show to build a pretty-printer, without having the output depend on which Scala version you're using.

I tried overriding the Show[Symbol] instance locally, but I just got an ambiguous implicit error. Don't know how to not import this instance, since it's on the companion object for Show.

On 2.12, `Symbol.toString` is e.g. `'foo`. On 2.13, it's `Symbol(foo)`.

I want to use `Show` to get away from the vagaries of relying on
`.toString` - to have a reliable nailed-down String representation for
types.

Want to use `Show` to build a pretty-printer, without having the output
depend on which Scala version you're using.

I tried overriding the `Show[Symbol]` instance locally, but I just got
an ambiguous implicit error. Don't know how to not import this instance,
since it's on the companion object for `Show`.
@armanbilge
Copy link
Member

I tried overriding the Show[Symbol] instance locally, but I just got an ambiguous implicit error. Don't know how to not import this instance, since it's on the companion object for Show.

This should be solvable, can you create a small example that demonstrates the problem?

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.

None yet

3 participants