Skip to content

Scaladoc cannot export methods with higher-kinded type parameters #13996

Closed
@Atry

Description

@Atry

Compiler version

3.1.0

Minimized code

package exportapply

object Binding:
  opaque type BindingT[M[_], A] <: M[A] = M[A]
  object BindingT:
    def apply[M[_], A](a: A): BindingT[M, A] = ???

  export BindingT._
// build.sbt
scalaVersion := "3.1.0
$ sbt doc

Output

[info] welcome to sbt 1.5.5 (Oracle Corporation Java 10.0.1)
[info] loading settings for project global-plugins from console.sbt ...
[info] loading global plugins from /Users/atry/.sbt/1.0/plugins
[info] loading project definition from /private/tmp/export-apply/project
[info] loading settings for project export-apply from build.sbt ...
[info] set current project to export-apply (in build file:/private/tmp/export-apply/)
[info] compiling 1 Scala source to /private/tmp/export-apply/target/scala-3.1.0/classes ...
[info] Main Scala API documentation to /private/tmp/export-apply/target/scala-3.1.0/api...
[warn] -- Warning: exportapply.scala:8:18 ---------------------------------------------
[warn] 8 |  export BindingT._
[warn]   |                  ^
[warn]   |java.lang.ClassCastException: dotty.tools.dotc.ast.Trees$TypeApply cannot be cast to dotty.tools.dotc.ast.Trees$Select
[warn]   |	at scala.quoted.runtime.impl.QuotesImpl$reflect$SelectMethods$.name(QuotesImpl.scala:496)
[warn]   |	at dotty.tools.scaladoc.tasty.ClassLikeSupport.$anonfun$39(ClassLikeSupport.scala:288)
[warn]   |	at scala.Option.fold(Option.scala:263)
[warn]   |	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseMember$$anonfun$1(ClassLikeSupport.scala:288)
[warn] one warning found
[info] Main Scala API documentation successful.
[success] Total time: 4 s, completed 2021年11月23日 下午10:35:35

The apply method does not appear in target/scala-3.1.0/api/exportapply/Binding$.html

Expectation

The apply method should appear in target/scala-3.1.0/api/exportapply/Binding$.html

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions