-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes #3683 REPL: Incorrect pretty-printing of singleton types #4132
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
Changes from all commits
13fd0d9
0d9c324
95e7c5a
eae6dca
27780b4
f51ac6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,10 @@ class PlainPrinter(_ctx: Context) extends Printer { | |
ParamRefNameString(tp) ~ ".type" | ||
case tp: TypeParamRef => | ||
ParamRefNameString(tp) ~ lambdaHash(tp.binder) | ||
case tp: ConstantType => | ||
toTextRef(tp) | ||
case tp: TermRef => | ||
toTextPrefix(tp.prefix) ~ selectionString(tp) ~ ".type" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why special case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for scala> final val a = "foo"
val a: "foo" = foo
scala> val x: a.type = a
val x: a.type = foo a.type is made by special casing TermRef. I am sorry if that's nonsensical 😛 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes some sense, but there are other cases above for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had missed that. No, those cases (in PlainPrinter) are not applied because of the guards. |
||
case tp: SingletonType => | ||
toTextLocal(tp.underlying) ~ "(" ~ toTextRef(tp) ~ ")" | ||
case AppliedType(tycon, args) => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be: