typelevel / simulacrum

First class syntax support for type classes in Scala
BSD 3-Clause "New" or "Revised" License
937 stars 61 forks source link

Extension methods disappear if giving them Scaladoc #82

Open Atry opened 7 years ago

Atry commented 7 years ago
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full)

libraryDependencies += "com.github.mpilquist" %% "simulacrum" % "0.11.0"
import simulacrum.typeclass

@typeclass
trait MyTypeClass[A] {
  type Out

  /** Scaladoc for `myMethod` */
  def myMethod(byName: A): Out
}

object MyTypeClass {

  def shouldCompile(ops: MyTypeClass.Ops[Int]) = {
    ops.myMethod
  }

}
$ sbt ++2.12.2 doc
[warn] Executing in batch mode.
[warn]   For better performance, hit [ENTER] to switch to interactive mode, or
[warn]   consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading global plugins from /Users/twer/.sbt/0.13/plugins
[info] Loading project definition from /private/tmp/typeclassdoc/project
[info] Set current project to typeclassdoc (in build file:/private/tmp/typeclassdoc/)
[info] Setting version to 2.12.2
[info] Reapplying settings...
[info] Set current project to typeclassdoc (in build file:/private/tmp/typeclassdoc/)
[info] Main Scala API documentation to /private/tmp/typeclassdoc/target/scala-2.12/api...
[error] /private/tmp/typeclassdoc/MyTypeClass.scala:14: value myMethod is not a member of MyTypeClass.Ops[Int]
[error]     ops.myMethod
[error]         ^
[info] No documentation generated with unsuccessful compiler run
[error] one error found
[error] (compile:doc) Scaladoc generation failed
[error] Total time: 2 s, completed Jun 9, 2017 12:12:49 PM
$ sbt ++2.11.11 doc
[warn] Executing in batch mode.
[warn]   For better performance, hit [ENTER] to switch to interactive mode, or
[warn]   consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading global plugins from /Users/twer/.sbt/0.13/plugins
[info] Loading project definition from /private/tmp/typeclassdoc/project
[info] Set current project to typeclassdoc (in build file:/private/tmp/typeclassdoc/)
[info] Setting version to 2.11.11
[info] Reapplying settings...
[info] Set current project to typeclassdoc (in build file:/private/tmp/typeclassdoc/)
[info] Main Scala API documentation to /private/tmp/typeclassdoc/target/scala-2.11/api...
[error] /private/tmp/typeclassdoc/MyTypeClass.scala:14: value myMethod is not a member of MyTypeClass.Ops[Int]
[error]     ops.myMethod
[error]         ^
[info] No documentation generated with unsuccessful compiler run
[error] one error found
[error] (compile:doc) Scaladoc generation failed
[error] Total time: 2 s, completed Jun 9, 2017 12:13:03 PM
fosskers commented 6 years ago

This still occurs.