scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Scaladoc crashes when creating page for abstract types #10381

Open Atry opened 7 years ago

Atry commented 7 years ago
package p 
private[p] trait T {
  /** @template */
  type A
}
object O extends T
$ scaladoc -version
Scaladoc version 2.12.2 -- Copyright 2002-2017, LAMP/EPFL and Lightbend, Inc.
$ scaladoc O.scala 
Exception in thread "main" java.lang.RuntimeException: 'type A' isn't a class, trait or object thus cannot be built as a member template.
    at scala.sys.package$.error(package.scala:27)
    at scala.tools.nsc.doc.model.ModelFactory$modelCreation$.createNoDocMemberTemplate$1(ModelFactory.scala:711)
    at scala.tools.nsc.doc.model.ModelFactory$modelCreation$.createLazyTemplateMember(ModelFactory.scala:727)
    at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.$anonfun$completeModel$2(ModelFactory.scala:381)
    at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.completeModel(ModelFactory.scala:381)
    at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.$anonfun$completeModel$1(ModelFactory.scala:377)
    at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.completeModel(ModelFactory.scala:375)
    at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.$anonfun$completeModel$1(ModelFactory.scala:377)
    at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.completeModel(ModelFactory.scala:375)
    at scala.tools.nsc.doc.model.ModelFactory.makeModel(ModelFactory.scala:55)
    at scala.tools.nsc.doc.DocFactory.makeUniverse(DocFactory.scala:81)
    at scala.tools.nsc.doc.DocFactory.generate$1(DocFactory.scala:124)
    at scala.tools.nsc.doc.DocFactory.document(DocFactory.scala:131)
    at scala.tools.nsc.ScalaDoc.process(ScalaDoc.scala:41)
    at scala.tools.nsc.ScalaDoc$.main(ScalaDoc.scala:92)
    at scala.tools.nsc.ScalaDoc.main(ScalaDoc.scala)
SethTisue commented 10 months ago

still reproducible in 2.13.12. Scala 3 isn't affected

Scaladoc 2 is a mode of the compiler, so this is a compiler crash

som-snytt commented 10 months ago

it's a scaladoc exception. I can't tell by looking if it is a limitation.