Skip to content

scalac hangs in phase typer #12371

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
gdiet opened this issue Apr 12, 2021 · 1 comment
Closed

scalac hangs in phase typer #12371

gdiet opened this issue Apr 12, 2021 · 1 comment
Labels
duplicate fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

Comments

@gdiet
Copy link

gdiet commented Apr 12, 2021

Using Scala 2.13.5 (on Ubuntu Java 11.0.10 x64)

object CompileHangs {
  def read1(): LazyList[Either[(Int, Int), String]] = ???
  def read2(): Option[LazyList[Either[(Int, Int), String]]] = ???

  def read(): LazyList[Either[(Int, Int), String]] =
    read1().flatMap {
      case Right(_) => LazyList()
      case Left(value) =>
        read2().getOrElse(
          Vector(Left(value))
        )
    }
}

compiling with scalac hangs in the typer phase (as shown by scalac -Ydebug). Additional observations:

  • I would expect a type error in the line containing Vector.
  • If I replace the tuple (Int, Int) with a simple Int, the example compiles. I would have expected the type error, but maybe there is some implicit conversion at work here?
  • If I replace Vector with LazyList, everything works as expected.
@joroKr21
Copy link
Member

That looks like a duplicate of #10908

@SethTisue SethTisue added duplicate fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) labels Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
Projects
None yet
Development

No branches or pull requests

3 participants