Skip to content

Commit f10055a

Browse files
committed
Fix bug in printing untyped New nodes.
Printed as <notype> before.
1 parent 8585325 commit f10055a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
299299
"new " ~ {
300300
tpt match {
301301
case tpt: Template => toTextTemplate(tpt, ofNew = true)
302-
case _ => toTextLocal(tpt.typeOpt.underlyingClassRef(refinementOK = false))
302+
case _ =>
303+
if (tpt.hasType)
304+
toTextLocal(tpt.typeOpt.underlyingClassRef(refinementOK = false))
305+
else
306+
toTextLocal(tpt)
303307
}
304308
}
305309
case Pair(l, r) =>

0 commit comments

Comments
 (0)