Skip to content

publishLocal error when exporting certain method signatures #14469

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
AugustNagro opened this issue Feb 13, 2022 · 1 comment
Closed

publishLocal error when exporting certain method signatures #14469

AugustNagro opened this issue Feb 13, 2022 · 1 comment

Comments

@AugustNagro
Copy link
Contributor

Compiler version

3.1.1

Minimized code

object C:

// This code errors on publishLocal
//  def retry(i: Int)(fn: => Unit): Unit =
//    for i <- 0 until i do fn

// this code errors on publishLocal
//  def asFuture[A](a: => A): Future[A] =
//    Future { a }

// this works fine
  def asFuture(a: => String): Future[String] =
    Future { a }

object B:
  export C.*

@main def test(): Unit =
  import B.*
//  retry(2)(println("abcd"))
  println(asFuture("abcd"))

Output

[info] Main Scala API documentation to /home/august/prog/test-projects/extension-bug/projectB/target/scala-3.1.1/api...
[warn] -- Warning: projectB/src/main/scala/com/example/b/B.scala:18:11 ----------------
[warn] 18 |  export C.*
[warn]    |           ^
[warn]    |java.lang.ClassCastException: class dotty.tools.dotc.ast.Trees$TypeApply cannot be cast to class dotty.tools.dotc.ast.Trees$Select (dotty.tools.dotc.ast.Trees$TypeApply and dotty.tools.dotc.ast.Trees$Select are in unnamed module of loader sbt.internal.classpath.ClassLoaderCache$Key$CachedClassLoader @6602629)
[warn]    |	at scala.quoted.runtime.impl.QuotesImpl$reflect$SelectMethods$.name(QuotesImpl.scala:496)
[warn]    |	at dotty.tools.scaladoc.tasty.ClassLikeSupport.$anonfun$10(ClassLikeSupport.scala:154)
[warn]    |	at scala.Option.fold(Option.scala:263)
[warn]    |	at dotty.tools.scaladoc.tasty.ClassLikeSupport.parseMember$$anonfun$1(ClassLikeSupport.scala:154)

Expectation

This seems like a ScalaDoc issue, but I've encountered flakiness when using these extension methods in projects depending on them, although that's hard to reproduce, so maybe I'm imagining it.

@AugustNagro AugustNagro added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 13, 2022
@dwijnand dwijnand added area:doctool and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 13, 2022
@KacperFKorban
Copy link
Member

It seems that this has already been fixed in #14125

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