Skip to content

Fix #7634: Use (x: C) instead of C(x) for printing singleton types #7706

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 3 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
}.close

def toTextSingleton(tp: SingletonType): Text =
toTextLocal(tp.underlying) ~ "(" ~ toTextRef(tp) ~ ")"
"(" ~ toTextRef(tp) ~ " : " ~ toTextGlobal(tp.underlying) ~ ")"

protected def paramsText(tp: LambdaType): Text = {
def paramText(name: Name, tp: Type) = toText(name) ~ toTextRHS(tp)
Expand Down
2 changes: 1 addition & 1 deletion tests/neg/cannot-reduce-inline-match.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
| cannot reduce inline match with
| scrutinee: {
| "f"
| } : String("f")
| } : ("f" : String)
| patterns : case _:Int
| This location contains code that was inlined from cannot-reduce-inline-match.scala:3
2 changes: 1 addition & 1 deletion tests/neg/exports.check
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
| ^
| Double definition:
| val bar: Bar in class Baz at line 45 and
| final def bar: => => Bar(Baz.this.bar.baz.bar)(Baz.this.bar.bar) in class Baz at line 46
| final def bar: => (Baz.this.bar.bar : => (Baz.this.bar.baz.bar : Bar)) in class Baz at line 46
2 changes: 1 addition & 1 deletion tests/neg/inline-error-pos.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
| cannot reduce inline match with
| scrutinee: {
| 2
| } : Int(2)
| } : (2 : Int)
| patterns : case 1
| This location contains code that was inlined from inline-error-pos.scala:3