Skip to content

Fix colons in printer #1742

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 4 commits into from
Nov 24, 2016
Merged

Conversation

felixmulder
Copy link
Contributor

This PR takes off where @rethab started and fixes defs not being properly printed when desugared to TypeExpr.

It does not fix the underlying issues with the REPL. The current strategy employed by the REPL is to gather all the types that were generated during a compilation and tie them to the correct names. This proves an issue though, because the types need to get printed using special hacks.

Ideally we would do an actual compile run and then just show the types without any distortion. But this I leave up to a later point in time when we're doing a more complete overhaul.

review: @OlivierBlanvillain

@OlivierBlanvillain
Copy link
Contributor

LGTM 👍

This is done so that we can use show for the entire method except for
the ascribed type added by the compiler on success.
@felixmulder felixmulder merged commit b26af1b into scala:master Nov 24, 2016
@felixmulder felixmulder deleted the topic/colon-in-printer branch November 24, 2016 16:25
scala> x = x + 1
x: Int = 1
scala> x *= 2
scala> x
res2: Int = 2
val res2: Int = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

I was hesitant to do this. Looks very odd to me given that we initially created x as a var.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, the REPL currently has semantics that are not well defined. There's no spec for it 😅

But, if you want to have a closer look at its semantics, by all means! We'd be happy to get something that is clearer :)

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