Skip to content

Commit

Permalink
add parentheses to v-params if t-params present
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvgt committed Oct 30, 2023
1 parent b19cc2d commit 98e504b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object TypePrinter extends ParenPrettyPrinter {
val tps = if (tparams.isEmpty) emptyDoc else typeParams(tparams)
val ps: Doc = (vparams, bparams) match {
case (Nil, Nil) => "()"
case (List(tpe), Nil) => toDoc(tpe)
case (List(tpe), Nil) => if (tparams.isEmpty) toDoc(tpe) else parens(toDoc(tpe))
case (_, _) =>
val vps = if (vparams.isEmpty) emptyDoc else parens(hsep(vparams.map(toDoc), comma))
val bps = if (bparams.isEmpty) emptyDoc else hcat(bparams.map(toDoc).map(braces))
Expand Down

0 comments on commit 98e504b

Please sign in to comment.