From 98e504b2c22d9dcbeedbc6841660affc6b422273 Mon Sep 17 00:00:00 2001 From: dvdvgt Date: Mon, 30 Oct 2023 14:58:42 +0100 Subject: [PATCH] add parentheses to v-params if t-params present --- effekt/shared/src/main/scala/effekt/symbols/TypePrinter.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/effekt/shared/src/main/scala/effekt/symbols/TypePrinter.scala b/effekt/shared/src/main/scala/effekt/symbols/TypePrinter.scala index 9e2ffe3c2..d75d953e5 100644 --- a/effekt/shared/src/main/scala/effekt/symbols/TypePrinter.scala +++ b/effekt/shared/src/main/scala/effekt/symbols/TypePrinter.scala @@ -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))