From 43d9285d3293ec6e2f4ec4bd87459455e0101057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Bra=C4=8Devac?= Date: 2025年9月23日 17:56:30 +0200 Subject: [PATCH] scaladoc: Fix rendering of function-type aliases Fixes #23456 We now eagerly dealias (modulo opaque types) type aliases that are known to be concrete function types. --- scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala index 4546d05adf6d..2680285b2f56 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala @@ -276,7 +276,12 @@ trait TypesSupport: ++ inParens(inner(rhs, skipThisTypePrefix), shouldWrapInParens(rhs, t, false)) case t @ AppliedType(tpe, args) if t.isFunctionType => - functionType(tpe, args, skipThisTypePrefix) + val dealiased = t.dealiasKeepOpaques + if t == dealiased then + functionType(tpe, args, skipThisTypePrefix) + else + val AppliedType(tpe, args) = dealiased.asInstanceOf[AppliedType] + functionType(tpe, args, skipThisTypePrefix) case t @ AppliedType(tpe, typeList) => inner(tpe, skipThisTypePrefix) ++ plain("[").l ++ commas(typeList.map { t => t match

AltStyle によって変換されたページ (->オリジナル) /