Skip to content

Commit c8a67f6

Browse files
committed
Don't print inferred types
1 parent 6e5e785 commit c8a67f6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/src/scala/tasty/reflect/Printers.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,10 @@ trait Printers
713713
if (vdef.symbol.flags.is(Flags.Mutable)) this += highlightKeyword("var ", color)
714714
else this += highlightKeyword("val ", color)
715715

716-
this += highlightValDef(name, color) += ": "
717-
printTypeTree(tpt)
716+
if (tpt.pos.exists && tpt.pos.start != tpt.pos.end) {
717+
this += highlightValDef(name, color) += ": "
718+
printTypeTree(tpt)
719+
}
718720
rhs match {
719721
case Some(tree) =>
720722
this += " = "
@@ -830,7 +832,7 @@ trait Printers
830832
// type bounds already printed in `fn`
831833
this
832834
case _ =>
833-
inSquare(printTypeOrBoundsTrees(args.filter(_.pos.exists), ", "))
835+
inSquare(printTypeOrBoundsTrees(args.filter(arg => arg.pos.exists && arg.pos.start != arg.pos.end), ", "))
834836
}
835837

836838
case Term.Super(qual, idOpt) =>

0 commit comments

Comments
 (0)