Skip to content

Add FlexibleType support for scaladoc #23320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,8 @@ object Build {

lazy val `scaladoc-testcases` = project.in(file("scaladoc-testcases")).
dependsOn(`scala3-compiler-bootstrapped`).
settings(commonBootstrappedSettings)
settings(commonBootstrappedSettings).
settings(Compile / scalacOptions ++= Seq("-Yexplicit-nulls"))


/**
Expand Down
10 changes: 10 additions & 0 deletions scaladoc-testcases/src/tests/typesTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package tests
package typesTest

import java.io.File

object TypesTest
{
val classpathSeparator
= File.pathSeparator
}
2 changes: 2 additions & 0 deletions scaladoc/src/dotty/tools/scaladoc/tasty/InkuireSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ trait InkuireSupport(using DocContext) extends Resources:
inner(tpe, vars) //TODO [Inkuire] Repeated types
case AnnotatedType(tpe, _) =>
inner(tpe, vars)
case FlexibleType(tpe) =>
inner(tpe, vars)
case tl @ TypeLambda(paramNames, _, resType) =>
Inkuire.TypeLambda(paramNames.map(Inkuire.TypeLambda.argument), inner(resType, vars)) //TODO [Inkuire] Type bounds
case pt @ PolyType(paramNames, _, resType) =>
Expand Down
2 changes: 2 additions & 0 deletions scaladoc/src/dotty/tools/scaladoc/tasty/TypesSupport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ trait TypesSupport:
inner(tpe) :+ plain("*")
case AnnotatedType(tpe, _) =>
inner(tpe)
case FlexibleType(tpe) =>
inner(tpe)
case tl @ TypeLambda(params, paramBounds, AppliedType(tpe, args))
if paramBounds.map(inner).forall(_.isEmpty) && params.zip(args.map(inner).flatten.map(_.name)).forall(_ == _) =>
inner(tpe)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,5 @@ class RefinedFunctionTypes extends SignatureTest("refinedFunctionTypes", Signatu
class RightAssocExtension extends SignatureTest("rightAssocExtension", SignatureTest.all)

class NamedTuples extends SignatureTest("namedTuples", SignatureTest.all)

class TypesTest extends SignatureTest("typesTest", SignatureTest.all)
Loading