Skip to content

"sbt doc" AssertionError when extending Iterator[_] (scala3) #16290

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

Closed
nigeleke opened this issue Nov 6, 2022 · 1 comment
Closed

"sbt doc" AssertionError when extending Iterator[_] (scala3) #16290

nigeleke opened this issue Nov 6, 2022 · 1 comment

Comments

@nigeleke
Copy link

nigeleke commented Nov 6, 2022

Compiler version

3.2.0 & 3.2.1

Minimized code

object Foo extends Iterator[String]:
  override def hasNext: Boolean = ???
  override def next(): String        = ???

Output

First few lines of stack trace:

[info] welcome to sbt 1.7.1 (Oracle Corporation Java 17.0.1)
[info] loading global plugins from ...\.sbt\1.0\plugins
[info] loading project definition from ...\docfailexample\project
[info] loading settings for project root from build.sbt ...
[info] set current project to docfailexample (in build file:/.../docfailexample/)
[success] Total time: 0 s, completed 5 Nov 2022, 2:50:24 pm
[info] compiling 1 Scala source to ...\docfailexample\target\scala-3.2.0\classes ...
[info] Main Scala API documentation to ...\docfailexample\target\scala-3.2.0\api...
[info] Skipping unused scalacOptions: -Werror
Problem parsing src\main\scala\Main.scala:<0..124>, documentation may not be generated.
java.lang.AssertionError: assertion failed
  | => rat scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
        at dotty.tools.dotc.util.Spans$Span$.start$extension(Spans.scala:45)
        at dotty.tools.dotc.util.SourcePosition.start(SourcePosition.scala:52)
        at scala.quoted.runtime.impl.QuotesImpl$reflect$PositionMethods$.start(QuotesImpl.scala:2813)
        at scala.quoted.runtime.impl.QuotesImpl$reflect$PositionMethods$.start(QuotesImpl.scala:2813)
        at dotty.tools.scaladoc.tasty.ClassLikeSupport.getParentsAsTreeSymbolTuples$$anonfun$1(ClassLikeSupport.scala:260)
        at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:472)
        at scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:576)
        at scala.collection.immutable.List.prependedAll(List.scala:152)
        at scala.collection.immutable.List$.from(List.scala:684)
        at scala.collection.immutable.List$.from(List.scala:681)
        at scala.collection.IterableOps$WithFilter.map(Iterable.scala:891)

Expectation

An AssertionError is generated. The task completes with warning, but no documentation is generated. The stack trace is unexpected. I would expect documentation would be generated & no AssertionError.

Notes

sbt 1.7.1

The error only occurs with extends Iterator[String] and not other extends, e.g. extends Iterable[String].

Original reported here: sbt/sbt#7065

Error also occurs with scaladoc command.

@nigeleke nigeleke added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 6, 2022
@KacperFKorban KacperFKorban added area:doctool and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 7, 2022
@SethTisue
Copy link
Member

looks like a duplicate of #15927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants