Skip to content

Commit 491e5f3

Browse files
committed
Use ? instead of _ to print wildcards in types
1 parent b5842bb commit 491e5f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
103103
(refinementNameString(rt) ~ toTextRHS(rt.refinedInfo)).close
104104

105105
protected def argText(arg: Type): Text = homogenizeArg(arg) match {
106-
case arg: TypeBounds => "_" ~ toText(arg)
106+
case arg: TypeBounds => "?" ~ toText(arg)
107107
case arg => toText(arg)
108108
}
109109

@@ -505,7 +505,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
505505
def toText[T >: Untyped](tree: Tree[T]): Text = {
506506
def toTextElem(elem: Any): Text = elem match {
507507
case elem: Showable => elem.toText(this)
508-
case elem: List[_] => "List(" ~ Text(elem map toTextElem, ",") ~ ")"
508+
case elem: List[?] => "List(" ~ Text(elem map toTextElem, ",") ~ ")"
509509
case elem => elem.toString
510510
}
511511
val nodeName = tree.productPrefix

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
305305
else ""
306306

307307
def argText(arg: Tree): Text = arg match {
308-
case arg: TypeBoundsTree => "_" ~ toTextGlobal(arg)
308+
case arg: TypeBoundsTree => "?" ~ toTextGlobal(arg)
309309
case arg: TypeTree =>
310310
arg.typeOpt match {
311-
case tp: TypeBounds => "_" ~ toTextGlobal(arg)
311+
case tp: TypeBounds => "?" ~ toTextGlobal(arg)
312312
case _ => toTextGlobal(arg)
313313
}
314314
case _ => toTextGlobal(arg)

0 commit comments

Comments
 (0)