File tree 1 file changed +4
-2
lines changed
scaladoc/src/dotty/tools/scaladoc/tasty
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -199,9 +199,11 @@ trait TypesSupport:
199
199
case Seq (rtpe) =>
200
200
plain(" ()" ).l ++ keyword(arrow).l ++ inner(rtpe)
201
201
case Seq (arg, rtpe) =>
202
+ def withParentheses (tpe : TypeRepr ) = plain(" (" ).l ++ inner(tpe) ++ plain(" )" ).l
202
203
val partOfSignature = arg match
203
- case byName : ByNameType => plain(" (" ).l ++ inner(byName) ++ plain(" )" ).l
204
- case _ => inner(arg)
204
+ case tpe @ (_:TermRef | _:TypeRef | _:ConstantType | _ : ParamRef ) => inner(arg)
205
+ case tpe : AppliedType if ! tpe.isFunctionType && ! tpe.isTupleN => inner(arg)
206
+ case _ => withParentheses(arg)
205
207
partOfSignature ++ keyword(arrow).l ++ inner(rtpe)
206
208
case args =>
207
209
plain(" (" ).l ++ commas(args.init.map(inner)) ++ plain(" )" ).l ++ keyword(arrow).l ++ inner(args.last)
You can’t perform that action at this time.
0 commit comments