Skip to content

Commit 31299e2

Browse files
authored
scaladoc: Fix rendering of function-type aliases (#24042)
Fixes #23456 We now eagerly dealias (modulo opaque types) type aliases that are known to be concrete function types.
2 parents e8ae44e + 43d9285 commit 31299e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,12 @@ trait TypesSupport:
276276
++ inParens(inner(rhs, skipThisTypePrefix), shouldWrapInParens(rhs, t, false))
277277

278278
case t @ AppliedType(tpe, args) if t.isFunctionType =>
279-
functionType(tpe, args, skipThisTypePrefix)
279+
val dealiased = t.dealiasKeepOpaques
280+
if t == dealiased then
281+
functionType(tpe, args, skipThisTypePrefix)
282+
else
283+
val AppliedType(tpe, args) = dealiased.asInstanceOf[AppliedType]
284+
functionType(tpe, args, skipThisTypePrefix)
280285

281286
case t @ AppliedType(tpe, typeList) =>
282287
inner(tpe, skipThisTypePrefix) ++ plain("[").l ++ commas(typeList.map { t => t match

0 commit comments

Comments
 (0)