Skip to content
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

Scaladoc generation fails with `-release 8` on JDK 11+ #11682

Open
SethTisue opened this issue Aug 13, 2019 · 0 comments

Comments

@SethTisue
Copy link
Member

commented Aug 13, 2019

the problem is reproducible in both Scala 2.12.8 and 2.13.0, and both JDK 11 and 12

% java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)
% echo "class C" > C.scala                                     
% /usr/local/scala/scala-2.13.0/bin/scaladoc -release 8 C.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: 
  type AnyRef in java.lang
     while compiling: C.scala
        during phase: globalPhase=terminal, enteringPhase=typer
     library version: version 2.13.0
    compiler version: version 2.13.0
  reconstructed args: -release 8

  last tree to typer: Literal(Constant(()))
       tree position: line 1 of C.scala
            tree tpe: Unit
              symbol: null
           call site: constructor C in class C in package <empty>

== Source file context for tree position ==

     1 class C
     2 
	at scala.reflect.internal.SymbolTable.throwAssertionError(SymbolTable.scala:170)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$.createTemplate(ModelFactory.scala:699)
	at scala.tools.nsc.doc.model.ModelFactory.makeMember0$1(ModelFactory.scala:794)
	at scala.tools.nsc.doc.model.ModelFactory.makeMember(ModelFactory.scala:807)
	at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.$anonfun$ownMembers$1(ModelFactory.scala:365)
	at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.<init>(ModelFactory.scala:365)
	at scala.tools.nsc.doc.model.ModelFactory$PackageImpl.<init>(ModelFactory.scala:474)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$$anon$9.<init>(ModelFactory.scala:686)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$.createTemplate(ModelFactory.scala:686)
	at scala.tools.nsc.doc.model.ModelFactory.makeMember0$1(ModelFactory.scala:794)
	at scala.tools.nsc.doc.model.ModelFactory.makeMember(ModelFactory.scala:807)
	at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.$anonfun$ownMembers$1(ModelFactory.scala:365)
	at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.<init>(ModelFactory.scala:365)
	at scala.tools.nsc.doc.model.ModelFactory$PackageImpl.<init>(ModelFactory.scala:474)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$$anon$9.<init>(ModelFactory.scala:686)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$.createTemplate(ModelFactory.scala:686)
	at scala.tools.nsc.doc.model.ModelFactory.makeMember0$1(ModelFactory.scala:794)
	at scala.tools.nsc.doc.model.ModelFactory.makeMember(ModelFactory.scala:807)
	at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.$anonfun$ownMembers$1(ModelFactory.scala:365)
	at scala.tools.nsc.doc.model.ModelFactory$DocTemplateImpl.<init>(ModelFactory.scala:365)
	at scala.tools.nsc.doc.model.ModelFactory$PackageImpl.<init>(ModelFactory.scala:474)
	at scala.tools.nsc.doc.model.ModelFactory$RootPackageImpl.<init>(ModelFactory.scala:482)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$$anon$8.<init>(ModelFactory.scala:668)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$.createTemplate(ModelFactory.scala:668)
	at scala.tools.nsc.doc.model.ModelFactory$modelCreation$.createRootPackage(ModelFactory.scala:614)
	at scala.tools.nsc.doc.model.ModelFactory$$anon$1.<init>(ModelFactory.scala:54)
	at scala.tools.nsc.doc.model.ModelFactory.makeModel(ModelFactory.scala:51)
	at scala.tools.nsc.doc.DocFactory.makeUniverse(DocFactory.scala:88)
	at scala.tools.nsc.doc.DocFactory.generate$1(DocFactory.scala:131)
	at scala.tools.nsc.doc.DocFactory.document(DocFactory.scala:138)
	at scala.tools.nsc.ScalaDoc.process(ScalaDoc.scala:47)
	at scala.tools.nsc.ScalaDoc$.main(ScalaDoc.scala:102)
	at scala.tools.nsc.ScalaDoc.main(ScalaDoc.scala)

this has come up in the community build a few times. it was also noticed by @retronym back in March 2018, akka/akka#24711 (comment)

the (obvious) workaround is to only enable -release 8 during regular compilation and not during Scaladoc generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.