Closed
Description
(the issue title is a bit of a guess, to be refined when it is clearer what is going on)
Compiler version
3.0.1-RC1 and the latest nightly (3.0.2-RC1-bin-20210712-47c949b-NIGHTLY)
Minimized code
Using java.lang.Deprecated
, which has no parameters in Java 8 but has 2 (optional) parameters from Java 10 onwards:
@Deprecated
trait Foo
scalaVersion := "3.0.2-RC1-bin-20210712-47c949b-NIGHTLY"
Compile / scalacOptions ++= Seq("-release", "8")
Output
sbt compile
is fine, but sbt doc
:
$ sbt doc
[info] welcome to sbt 1.5.5 (N/A Java 16)
[info] loading settings for project global-plugins from deptree.sbt,gpg.sbt ...
[info] loading global plugins from /home/aengelen/.sbt/1.0/plugins
[info] loading project definition from /home/aengelen/dev/scala3-deprecated/project
[info] loading settings for project scala3-deprecated from build.sbt ...
[info] set current project to scala3-deprecated (in build file:/home/aengelen/dev/scala3-deprecated/)
[info] Main Scala API documentation to /home/aengelen/dev/scala3-deprecated/target/scala-3.0.2-RC1-bin-20210712-47c949b-NIGHTLY/api...
[info] Skipping unused scalacOptions: -release
[error] -- Error: Main.scala:1:0 -------------------------------------------------------
[error] 1 |@Deprecated
[error] |^^^^^^^^^^^
[error] |wrong number of arguments at <no phase> for (since: String, forRemoval: Boolean): Deprecated: (Deprecated#<init> : (since: String, forRemoval: Boolean): Deprecated), expected: 2, found: 0
[error] one error found
[error] (Compile / doc) DottyDoc Compilation Failed
[error] Total time: 3 s, completed Jul 13, 2021, 1:12:02 PM
Handling the bootclasspath was recently improved in 7d0e477 by @pikinier20 in #11582, but even with that change the problem remains.