File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
scaladoc/src/dotty/tools/scaladoc/tasty Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -199,9 +199,11 @@ trait TypesSupport:
199199 case Seq (rtpe) =>
200200 plain(" ()" ).l ++ keyword(arrow).l ++ inner(rtpe)
201201 case Seq (arg, rtpe) =>
202+ def withParentheses (tpe : TypeRepr ) = plain(" (" ).l ++ inner(tpe) ++ plain(" )" ).l
202203 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)
205207 partOfSignature ++ keyword(arrow).l ++ inner(rtpe)
206208 case args =>
207209 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